Skip to content

Commit

Permalink
fix(admin): already signed message & create collection available
Browse files Browse the repository at this point in the history
  • Loading branch information
albina committed Oct 23, 2024
1 parent d66a887 commit a4e9ed0
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 9 deletions.
10 changes: 10 additions & 0 deletions libs/portals/admin/signature-collection/src/lib/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,11 @@ export const m = defineMessages({
defaultMessage: 'Úrvinnslu lokið',
description: '',
},
toggleReviewSuccessToggleBack: {
id: 'admin-portal.signature-collection:toggleReviewSuccessToggleBack',
defaultMessage: 'Tókst að opna fyrir úrvinnslu',
description: '',
},
lockList: {
id: 'admin-portal.signature-collection:lockList',
defaultMessage: 'Læsa söfnun',
Expand Down Expand Up @@ -754,6 +759,11 @@ export const m = defineMessages({
defaultMessage: 'Ekki tókst að skrá meðmæli',
description: '',
},
paperSigneeErrorAlreadySigned: {
id: 'admin-portal.signature-collection:paperSigneeErrorAlreadySigned',
defaultMessage: 'Kennitala er þegar á lista',
description: '',
},
})

export const createCollectionErrorMessages = defineMessages({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,12 @@ export const Constituency = ({
': ' +
constituencyLists.length}
</Text>
{allowedToProcess &&
collectionStatus === CollectionStatus.InInitialReview && (
<CreateCollection
collectionId={collection?.id}
areaId={areaId}
/>
)}
{allowedToProcess && (
<CreateCollection
collectionId={collection?.id}
areaId={areaId}
/>
)}
</Box>
<Stack space={3}>
{constituencyLists.map((list) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ export const PaperSignees = ({ listId }: { listId: string }) => {
if (res.signatureCollectionAdminUploadPaperSignature?.success) {
toast.success(formatMessage(m.paperSigneeSuccess))
} else {
toast.error(formatMessage(m.paperSigneeError))
if (
res.signatureCollectionAdminUploadPaperSignature?.reasons?.includes(
'alreadySigned',
)
) {
toast.error(formatMessage(m.paperSigneeErrorAlreadySigned))
}
}
reset()
revalidate()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,11 @@ const ActionReviewComplete = ({
onCompleted: () => {
setModalSubmitReviewIsOpen(false)
revalidate()
toast.success(formatMessage(m.toggleReviewSuccess))
toast.success(
listReviewed
? formatMessage(m.toggleReviewSuccessToggleBack)
: formatMessage(m.toggleReviewSuccess),
)
},
onError: () => {
toast.error(formatMessage(m.toggleReviewError))
Expand Down

0 comments on commit a4e9ed0

Please sign in to comment.