-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for listing dialogs as archived or in bin and move …
…dialogs to bin or archive
- Loading branch information
Showing
24 changed files
with
308 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
mutation updateSystemLabel($dialogId: UUID!, $label: SystemLabel!) { | ||
setSystemLabel(input: { dialogId: $dialogId, label: $label }) { | ||
success | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
packages/frontend/src/components/DialogToolbar/DialogToolbar.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { ArchiveIcon, InboxFillIcon, TrashIcon } from '@navikt/aksel-icons'; | ||
import { SystemLabel } from 'bff-types-generated'; | ||
import { useTranslation } from 'react-i18next'; | ||
import { ProfileButton } from '../ProfileButton'; | ||
import styles from './dialogToolbar.module.css'; | ||
|
||
interface ToolbarActionProps { | ||
onClick: () => void; | ||
isLoading: boolean; | ||
} | ||
|
||
interface DialogToolbarProps { | ||
archiveAction: ToolbarActionProps; | ||
deleteAction: ToolbarActionProps; | ||
undoAction: ToolbarActionProps; | ||
currentLabel: SystemLabel; | ||
} | ||
|
||
export const DialogToolbar = ({ archiveAction, deleteAction, undoAction, currentLabel }: DialogToolbarProps) => { | ||
const { t } = useTranslation(); | ||
return ( | ||
<section className={styles.dialogToolbar}> | ||
{[SystemLabel.Archive, SystemLabel.Bin].includes(currentLabel) && ( | ||
<ProfileButton variant="tertiary" color="neutral" onClick={undoAction.onClick} isLoading={undoAction.isLoading}> | ||
<InboxFillIcon fontSize="1.5rem" /> | ||
{t('dialog.toolbar.move_undo')} | ||
</ProfileButton> | ||
)} | ||
{currentLabel !== SystemLabel.Archive && ( | ||
<ProfileButton | ||
variant="tertiary" | ||
color="neutral" | ||
onClick={archiveAction.onClick} | ||
isLoading={archiveAction.isLoading} | ||
> | ||
<ArchiveIcon fontSize="1.5rem" /> | ||
{t('dialog.toolbar.move_to_archive')} | ||
</ProfileButton> | ||
)} | ||
{currentLabel !== SystemLabel.Bin && ( | ||
<ProfileButton | ||
variant="tertiary" | ||
color="neutral" | ||
onClick={deleteAction.onClick} | ||
isLoading={deleteAction.isLoading} | ||
> | ||
<TrashIcon fontSize="1.5rem" /> | ||
{t('dialog.toolbar.move_to_bin')} | ||
</ProfileButton> | ||
)} | ||
</section> | ||
); | ||
}; |
7 changes: 7 additions & 0 deletions
7
packages/frontend/src/components/DialogToolbar/dialogToolbar.module.css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.dialogToolbar { | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: wrap; | ||
gap: 0.5rem; | ||
padding: 0.5rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.