Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buttons info for Regenerate #644

Merged
merged 1 commit into from
Jan 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions backend/organization/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,10 @@ def list_org_tasks(self, request, pk=None, *args, **kwargs):
buttons["Update"] = True
if task["status"] == "FAILED":
buttons["Info"] = True
buttons["Reopen"] = True
if task["is_active"] == False:
buttons["Reopen"] = True
else:
buttons["Regenerate"] = False
if task["status"] == "REOPEN":
buttons["Info"] = True
if task["status"] == "INPROGRESS":
Expand All @@ -433,6 +436,7 @@ def list_org_tasks(self, request, pk=None, *args, **kwargs):
buttons["Info"] = False
if task["status"] == "FAILED":
buttons["Reopen"] = False
buttons["Regenerate"] = False
if task["user"]["email"] == request.user.email:
if task["status"] not in ["COMPLETE", "POST_PROCESS", "FAILED"]:
buttons["Edit"] = True
Expand Down Expand Up @@ -529,7 +533,10 @@ def list_org_tasks(self, request, pk=None, *args, **kwargs):
buttons["Update"] = True
if task["status"] == "FAILED":
buttons["Info"] = True
buttons["Reopen"] = True
if task["is_active"] == False:
buttons["Regenerate"] = True
else:
buttons["Reopen"] = False
if task["status"] == "REOPEN":
buttons["Info"] = True
if task["status"] == "INPROGRESS":
Expand All @@ -539,6 +546,7 @@ def list_org_tasks(self, request, pk=None, *args, **kwargs):
buttons["Info"] = False
if task["status"] == "FAILED":
buttons["Reopen"] = False
buttons["Regenerate"] = False
if task["user"]["email"] == request.user.email:
if task["status"] not in ["COMPLETE", "POST_PROCESS", "FAILED"]:
buttons["Edit"] = True
Expand Down
18 changes: 7 additions & 11 deletions backend/project/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,7 @@ def list_project_tasks(self, request, pk=None, *args, **kwargs):
"Upload": False,
"Info": False,
"Reopen": False,
"Regenerate": False,
}
buttons["Update"] = True
buttons["Delete"] = True
Expand All @@ -850,7 +851,10 @@ def list_project_tasks(self, request, pk=None, *args, **kwargs):
buttons["Update"] = True
if data["status"] == "FAILED":
buttons["Info"] = True
buttons["Reopen"] = True
if data["is_active"] == False:
buttons["Regenerate"] = True
else:
buttons["Reopen"] = False
if data["status"] == "REOPEN":
buttons["Info"] = True
if data["status"] == "INPROGRESS":
Expand All @@ -860,6 +864,7 @@ def list_project_tasks(self, request, pk=None, *args, **kwargs):
buttons["Info"] = False
if data["status"] == "FAILED":
buttons["Reopen"] = False
buttons["Regenerate"] = False
if data["user"]["email"] == request.user.email:
if data["status"] not in ["COMPLETE", "POST_PROCESS", "FAILED"]:
buttons["Edit"] = True
Expand Down Expand Up @@ -903,22 +908,13 @@ def list_project_tasks(self, request, pk=None, *args, **kwargs):
buttons["Export"] = True
buttons["Preview"] = True
buttons["Update"] = False
if "TRANSLATION" in data["task_type"]:
buttons["Reopen"] = True
if data["status"] == "POST_PROCESS":
buttons["Update"] = True
if data["status"] == "FAILED":
buttons["Info"] = True
buttons["Reopen"] = True
if data["status"] == "REOPEN":
if data["status"] in ["FAILED", "REOPEN"]:
buttons["Info"] = True
if data["status"] == "INPROGRESS":
buttons["Preview"] = True
if data["task_type"] == "VOICEOVER_EDIT":
buttons["Preview"] = False
buttons["Info"] = False
if data["status"] == "FAILED":
buttons["Reopen"] = False
if data["user"]["email"] == request.user.email:
if data["status"] not in ["COMPLETE", "POST_PROCESS", "FAILED"]:
buttons["Edit"] = True
Expand Down
Loading