Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(admin): already signed message & create collection available #16537

Merged
merged 4 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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