Skip to content

Commit

Permalink
Hide actions on all status
Browse files Browse the repository at this point in the history
  • Loading branch information
cnasikas committed Mar 2, 2021
1 parent a6c372c commit b250898
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export const getActions = ({
deleteCaseOnClick,
}: GetActions): Array<DefaultItemIconButtonAction<Case>> => {
const openCaseAction = {
available: (item: Case | SubCase) => caseStatus !== CaseStatuses.open,
enabled: (item: Case | SubCase) => isIndividual(item) && item.status !== CaseStatuses.open,
available: (item: Case | SubCase) => item.status !== CaseStatuses.open,
enabled: (item: Case | SubCase) => isIndividual(item),
description: statuses[CaseStatuses.open].actions.single.title,
icon: statuses[CaseStatuses.open].icon,
name: statuses[CaseStatuses.open].actions.single.title,
Expand All @@ -44,9 +44,8 @@ export const getActions = ({
};

const makeInProgressAction = {
available: (item: Case) => caseStatus !== CaseStatuses['in-progress'],
enabled: (item: Case | SubCase) =>
isIndividual(item) && item.status !== CaseStatuses['in-progress'],
available: (item: Case) => item.status !== CaseStatuses['in-progress'],
enabled: (item: Case | SubCase) => isIndividual(item),
description: statuses[CaseStatuses['in-progress']].actions.single.title,
icon: statuses[CaseStatuses['in-progress']].icon,
name: statuses[CaseStatuses['in-progress']].actions.single.title,
Expand All @@ -62,8 +61,8 @@ export const getActions = ({
};

const closeCaseAction = {
available: (item: Case | SubCase) => caseStatus !== CaseStatuses.closed,
enabled: (item: Case | SubCase) => isIndividual(item) && item.status !== CaseStatuses.closed,
available: (item: Case | SubCase) => item.status !== CaseStatuses.closed,
enabled: (item: Case | SubCase) => isIndividual(item),
description: statuses[CaseStatuses.closed].actions.single.title,
icon: statuses[CaseStatuses.closed].icon,
name: statuses[CaseStatuses.closed].actions.single.title,
Expand Down

0 comments on commit b250898

Please sign in to comment.