diff --git a/app/components/task-tabs.hbs b/app/components/task-tabs.hbs index eb68262d..0f8d8acc 100644 --- a/app/components/task-tabs.hbs +++ b/app/components/task-tabs.hbs @@ -3,51 +3,20 @@ class='task-tabs__dropdown-container {{if @showTasks "task-tabs__dropdown-active"}}' > - {{#each @taskStatusList as |status|}} - {{#if @dev}} - - {{#if - (and - (not-eq status.key 'VERIFIED') - (not-eq status.key 'RELEASED') - (not-eq status.key 'REGRESSION_CHECK') - (not-eq status.key 'SANITY_CHECK') - (not-eq status.key 'APPROVED') - (not-eq status.key 'SMOKE_TESTING') - (not-eq status.key 'NEEDS_REVIEW') - ) - }} - - {{/if}} - - {{else}} - - {{/if}} - + {{#each this.removedTaskTabs as |status|}} + {{/each}} {{#unless @showTasks}} diff --git a/app/components/task-tabs.js b/app/components/task-tabs.js new file mode 100644 index 00000000..7ba6c612 --- /dev/null +++ b/app/components/task-tabs.js @@ -0,0 +1,28 @@ +import Component from '@glimmer/component'; +import { TASK_KEYS } from 'website-my/constants/tasks'; + +export default class TaskTabsComponent extends Component { + TASK_KEYS = TASK_KEYS; + availabletaskTabsList = this.args.taskStatusList; + + get removedTaskTabs() { + const statusToDisplay = this.availabletaskTabsList.filter((taskStatus) => { + if (this.args.dev === true) { + if ( + taskStatus.key !== TASK_KEYS.VERIFIED && + taskStatus.key !== TASK_KEYS.RELEASED && + taskStatus.key !== TASK_KEYS.APPROVED && + taskStatus.key !== TASK_KEYS.COMPLETED && + taskStatus.key !== TASK_KEYS.NEEDS_REVIEW + ) { + return true; + } else { + return false; + } + } else { + return taskStatus; + } + }); + return statusToDisplay; + } +} diff --git a/tests/integration/components/task-tabs-test.js b/tests/integration/components/task-tabs-test.js index e6bec43c..327a5ad9 100644 --- a/tests/integration/components/task-tabs-test.js +++ b/tests/integration/components/task-tabs-test.js @@ -51,8 +51,8 @@ module('Integration | Component | task-tabs', function (hooks) { userSelectedTaskText: DEFAULT_TASK_TYPE.displayLabel, showTasks: false, toggleTasks: () => {}, + dev: true, }); - await render(hbs` `); assert @@ -77,6 +78,7 @@ module('Integration | Component | task-tabs', function (hooks) { @userSelectedTaskText={{this.userSelectedTaskText}} @showTasks={{this.showTasks}} @toggleTasks={{this.toggleTasks}} + @dev={{this.dev}} />`); assert