Skip to content

Commit

Permalink
Merge pull request #2162 from City-of-Helsinki/hl-868
Browse files Browse the repository at this point in the history
HL-868 | Hide archived / batched app's actions
  • Loading branch information
sirtawast authored Aug 11, 2023
2 parents 23bc3b6 + 5cfb28c commit 9f80c0d
Showing 1 changed file with 29 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,21 @@ const HandlingApplicationActions: React.FC<Props> = ({
}`
)}
</Button>
{(application.status === APPLICATION_STATUSES.ACCEPTED ||
application.status === APPLICATION_STATUSES.REJECTED) && (
<Button
onClick={onBackToHandling}
theme="black"
variant="secondary"
disabled={!!application.batch}
iconLeft={<IconArrowUndo />}
>
{t(`${translationsBase}.backToHandling`)}
</Button>
)}
{[
APPLICATION_STATUSES.ACCEPTED,
APPLICATION_STATUSES.REJECTED,
].includes(application.status) &&
!application.batch &&
!application.archived && (
<Button
onClick={onBackToHandling}
theme="black"
variant="secondary"
iconLeft={<IconArrowUndo />}
>
{t(`${translationsBase}.backToHandling`)}
</Button>
)}
<Button
onClick={toggleMessagesDrawerVisiblity}
theme="black"
Expand All @@ -84,18 +87,20 @@ const HandlingApplicationActions: React.FC<Props> = ({
{t(`${translationsBase}.handlingPanel`)}
</Button>
</$Column>
{application.status !== APPLICATION_STATUSES.CANCELLED && (
<$Column>
<Button
onClick={openDialog}
theme="black"
variant="supplementary"
iconLeft={<IconTrash />}
>
{t(`${translationsBase}.cancel`)}
</Button>
</$Column>
)}
{application.status !== APPLICATION_STATUSES.CANCELLED &&
!application.batch &&
!application.archived && (
<$Column>
<Button
onClick={openDialog}
theme="black"
variant="supplementary"
iconLeft={<IconTrash />}
>
{t(`${translationsBase}.cancel`)}
</Button>
</$Column>
)}

{isConfirmationModalOpen && (
<Modal
Expand Down

0 comments on commit 9f80c0d

Please sign in to comment.