Skip to content

Commit

Permalink
refactor the code
Browse files Browse the repository at this point in the history
  • Loading branch information
bhtibrewal authored Nov 20, 2023
1 parent 1679cca commit edf6b54
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions app/components/task-tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,14 @@ export default class TaskTabsComponent extends Component {
availabletaskTabsList = this.args.taskStatusList;

get taskCardStatusList() {
if (!this.args.dev) return this.availabletaskTabsList;
const statusToRemove = [TASK_KEYS.VERIFIED,

Check failure on line 10 in app/components/task-tabs.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Insert `⏎······`

Check failure on line 10 in app/components/task-tabs.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Insert `⏎······`
TASK_KEYS.RELEASED,
TASK_KEYS.APPROVED,
TASK_KEYS.COMPLETED,
TASK_KEYS.NEEDS_REVIEW]

Check failure on line 14 in app/components/task-tabs.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Replace `]` with `,⏎····];`

Check failure on line 14 in app/components/task-tabs.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Replace `]` with `,⏎····];`
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;
}
!statusToRemove.includes(taskStatus.key)

Check failure on line 16 in app/components/task-tabs.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Insert `;`

Check failure on line 16 in app/components/task-tabs.js

View workflow job for this annotation

GitHub Actions / build (16.x)

Insert `;`
});
return statusToDisplay;
}
Expand Down

0 comments on commit edf6b54

Please sign in to comment.