From 46c0e15f2154be6f001f0e9cce8864594c8f5b11 Mon Sep 17 00:00:00 2001 From: shubhamsigdar1 Date: Mon, 30 Oct 2023 22:54:38 +0530 Subject: [PATCH] added feature flag when on ompletedPercentage --- app/controllers/tasks.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/tasks.js b/app/controllers/tasks.js index 94333d56..bdcfbe04 100644 --- a/app/controllers/tasks.js +++ b/app/controllers/tasks.js @@ -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; @@ -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; } @@ -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); }