Skip to content

Commit

Permalink
remove feature flag (#522)
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamsinghbundela authored Nov 22, 2023
1 parent e8ad261 commit 86b2c5b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 59 deletions.
10 changes: 2 additions & 8 deletions app/components/task/holder.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,14 @@ export default class TasksHolderComponent extends Component {

get taskStatusList() {
const statusToDisplay = this.availabletaskStatusList.filter(
(taskStatus) => {
if (this.args.dev === true) {
return taskStatus.key !== 'ALL' && taskStatus.key !== 'COMPLETED';
} else {
return taskStatus.key !== 'ALL' && taskStatus.key !== 'DONE';
}
}
(taskStatus) => taskStatus.key !== 'ALL'
);
return statusToDisplay;
}

get taskStyleClass() {
const statusNotOverDueList = [
this.args.dev === true ? TASK_KEYS.DONE : TASK_KEYS.COMPLETED,
TASK_KEYS.DONE,
TASK_KEYS.VERIFIED,
TASK_KEYS.AVAILABLE,
];
Expand Down
6 changes: 0 additions & 6 deletions app/constants/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const TASK_KEYS = {
IN_PROGRESS: 'IN_PROGRESS',
BLOCKED: 'BLOCKED',
SMOKE_TESTING: 'SMOKE_TESTING',
COMPLETED: 'COMPLETED',
DONE: 'DONE',
NEEDS_REVIEW: 'NEEDS_REVIEW',
IN_REVIEW: 'IN_REVIEW',
Expand All @@ -24,7 +23,6 @@ const {
IN_PROGRESS,
BLOCKED,
SMOKE_TESTING,
COMPLETED,
DONE,
NEEDS_REVIEW,
IN_REVIEW,
Expand Down Expand Up @@ -61,10 +59,6 @@ const TASK_STATUS_LIST = [
displayLabel: 'Smoke Testing',
key: SMOKE_TESTING,
},
{
displayLabel: 'Completed',
key: COMPLETED,
},
{
displayLabel: 'Done',
key: DONE,
Expand Down
9 changes: 1 addition & 8 deletions app/controllers/tasks.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ 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 @@ -43,10 +42,6 @@ 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 @@ -98,9 +93,7 @@ export default class TasksController extends Controller {
const taskCompletionPercentage = object.percentCompleted;
if (taskCompletionPercentage) {
if (taskCompletionPercentage === TASK_PERCENTAGE.completedPercentage) {
this.isDevMode === true
? (requestBody.status = 'DONE')
: (requestBody.status = 'COMPLETED');
requestBody.status = 'DONE';
}
requestBody.percentCompleted = parseInt(taskCompletionPercentage);
}
Expand Down
37 changes: 0 additions & 37 deletions tests/integration/components/tasks/holder-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,41 +199,6 @@ module('Integration | Component | Tasks Holder', function (hooks) {
@disabled={{this.disabled}}
/>`);

assert
.dom('[data-test-task-status-select]')
.hasValue(TASK_KEYS.IN_PROGRESS);

await select('[data-test-task-status-select]', TASK_KEYS.COMPLETED);

assert
.dom('[data-test-task-status-select]')
.hasValue(TASK_KEYS.IN_PROGRESS);
});

test('Verify values of task status upon api failures under feature flag', async function (assert) {
const testTask = tasksData[3];
testTask.status = TASK_KEYS.IN_PROGRESS;

this.set('task', testTask);
this.set('mock', () => {});
this.set('onTaskUpdate', (taskId, error) => {
error();
});
this.set('isLoading', false);
this.set('disabled', false);
this.set('defaultType', DEFAULT_TASK_TYPE);
this.set('dev', true);

await render(hbs`<Task::Holder
@task={{this.task}}
@onTaskChange={{this.mock}}
@onStausChange={{this.mock}}
@onTaskUpdate={{this.onTaskUpdate}}
@userSelectedTask={{this.defaultType}}
@disabled={{this.disabled}}
@dev={{this.dev}}
/>`);

assert
.dom('[data-test-task-status-select]')
.hasValue(TASK_KEYS.IN_PROGRESS);
Expand Down Expand Up @@ -284,7 +249,6 @@ module('Integration | Component | Tasks Holder', function (hooks) {
this.set('isLoading', false);
this.set('disabled', false);
this.set('defaultType', DEFAULT_TASK_TYPE);
this.set('dev', true);

await render(hbs`<Task::Holder
@task={{this.task}}
Expand All @@ -294,7 +258,6 @@ module('Integration | Component | Tasks Holder', function (hooks) {
@isLoading={{this.isLoading}}
@userSelectedTask={{this.defaultType}}
@disabled={{this.disabled}}
@dev={{this.dev}}
/>`);

assert.dom('[data-test-task-status-select]').exists();
Expand Down

0 comments on commit 86b2c5b

Please sign in to comment.