Skip to content

Commit

Permalink
fix(service-portal): sp list submitted (#16383)
Browse files Browse the repository at this point in the history
* fix(service-portal): sp list submitted

* tweak

* chore: nx format:write update dirty files

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: andes-it <[email protected]>
  • Loading branch information
3 people authored and kksteini committed Oct 16, 2024
1 parent 4e4b035 commit dedc299
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 51 deletions.
6 changes: 6 additions & 0 deletions libs/portals/admin/signature-collection/src/lib/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,12 @@ export const m = defineMessages({
defaultMessage: 'Læsa söfnun',
description: '',
},
lockListDescription: {
id: 'admin-portal.signature-collection:lockListDescription',
defaultMessage:
'Ýtið hér ef framboð hefur skilað inn framboðsgögnum fyrir lok framboðsfrest',
description: '',
},
lockListSuccess: {
id: 'admin-portal.signature-collection:lockListSuccess',
defaultMessage: 'Tókst að læsa söfnun',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const ActionLockList = ({
closeButtonLabel={''}
>
<Box marginTop={5}>
<Text>{formatMessage(m.lockList)}</Text>
<Text>{formatMessage(m.lockListDescription)}</Text>
<Box display="flex" justifyContent="flexEnd" marginTop={5}>
<Button
iconType="outline"
Expand Down
5 changes: 5 additions & 0 deletions libs/service-portal/signature-collection/src/lib/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ export const m = defineMessages({
defaultMessage: 'Ógilt meðmæli',
description: '',
},
listSubmitted: {
id: 'sp.signatureCollection:listSubmitted',
defaultMessage: 'Lista skilað',
description: '',
},

/* Signee View */
noCollectionIsActive: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,58 +106,73 @@ const OwnerView = ({
withLabel: true,
}}
eyebrow={list.title.split(' - ')[0]}
cta={{
label: formatMessage(m.viewList),
variant: 'text',
icon: 'arrowForward',
onClick: () => {
const path = location.pathname.includes('fyrirtaeki')
? SignatureCollectionPaths.CompanyViewParliamentaryList
: SignatureCollectionPaths.ViewParliamentaryList
navigate(path.replace(':id', list.id), {
state: {
collectionId: currentCollection?.id || '',
},
})
},
}}
tag={{
label: 'Cancel collection',
renderTag: () => (
<DialogPrompt
baseId="cancel_collection_dialog"
title={
formatMessage(m.cancelCollectionButton) +
' - ' +
list.area?.name
cta={
list.active
? {
label: formatMessage(m.viewList),
variant: 'text',
icon: 'arrowForward',
onClick: () => {
const path = location.pathname.includes('fyrirtaeki')
? SignatureCollectionPaths.CompanyViewParliamentaryList
: SignatureCollectionPaths.ViewParliamentaryList
navigate(path.replace(':id', list.id), {
state: {
collectionId: currentCollection?.id || '',
},
})
},
}
description={formatMessage(
m.cancelCollectionModalMessage,
)}
ariaLabel="delete"
disclosureElement={
<Tag outlined variant="red">
<Box display="flex" alignItems="center">
<Icon icon="trash" size="small" type="outline" />
</Box>
</Tag>
: undefined
}
tag={
list.active
? {
label: 'Cancel collection',
renderTag: () => (
<DialogPrompt
baseId="cancel_collection_dialog"
title={
formatMessage(m.cancelCollectionButton) +
' - ' +
list.area?.name
}
description={formatMessage(
m.cancelCollectionModalMessage,
)}
ariaLabel="delete"
disclosureElement={
<Tag outlined variant="red">
<Box display="flex" alignItems="center">
<Icon
icon="trash"
size="small"
type="outline"
/>
</Box>
</Tag>
}
onConfirm={() => {
onCancelCollection(list.id)
}}
buttonTextConfirm={formatMessage(
m.cancelCollectionModalConfirmButton,
)}
buttonPropsConfirm={{
variant: 'primary',
colorScheme: 'destructive',
}}
buttonTextCancel={formatMessage(
m.cancelCollectionModalCancelButton,
)}
/>
),
}
onConfirm={() => {
onCancelCollection(list.id)
}}
buttonTextConfirm={formatMessage(
m.cancelCollectionModalConfirmButton,
)}
buttonPropsConfirm={{
variant: 'primary',
colorScheme: 'destructive',
}}
buttonTextCancel={formatMessage(
m.cancelCollectionModalCancelButton,
)}
/>
),
}}
: {
label: formatMessage(m.listSubmitted),
variant: 'blueberry',
}
}
/>
</Box>
))
Expand Down

0 comments on commit dedc299

Please sign in to comment.