Skip to content

Commit

Permalink
added feature flag when on ompletedPercentage
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamsinghbundela committed Oct 30, 2023
1 parent e0778f4 commit 46c0e15
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/controllers/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const API_BASE_URL = ENV.BASE_API_URL;
export default class TasksController extends Controller {
queryParams = ['dev'];
@service toast;
@service featureFlag;
TASK_KEYS = TASK_KEYS;
taskStatusList = TASK_STATUS_LIST;
tabsTaskStatusList = TABS_TASK_STATUS_LIST;
Expand All @@ -42,6 +43,10 @@ export default class TasksController extends Controller {
@tracked showFetchButton = this.isShowFetchButton() && !this.alreadyFetched;
alreadyFetched = localStorage.getItem('already-fetched');

get isDevMode() {
return this.featureFlag.isDevMode;
}

@action toggleDropDown() {
this.showDropDown = !this.showDropDown;
}
Expand Down Expand Up @@ -93,7 +98,9 @@ export default class TasksController extends Controller {
const taskCompletionPercentage = object.percentCompleted;
if (taskCompletionPercentage) {
if (taskCompletionPercentage === TASK_PERCENTAGE.completedPercentage) {
requestBody.status = 'DONE';
this.isDevMode === true
? (requestBody.status = 'DONE')
: (requestBody.status = 'COMPLETED');
}
requestBody.percentCompleted = parseInt(taskCompletionPercentage);
}
Expand Down

0 comments on commit 46c0e15

Please sign in to comment.