diff --git a/libs/portals/admin/signature-collection/src/lib/messages.ts b/libs/portals/admin/signature-collection/src/lib/messages.ts index a90cbdaccbb1..04147e17217e 100644 --- a/libs/portals/admin/signature-collection/src/lib/messages.ts +++ b/libs/portals/admin/signature-collection/src/lib/messages.ts @@ -442,6 +442,27 @@ export const m = defineMessages({ defaultMessage: 'Opna fyrir úrvinnslu', description: '', }, + collectionReviewedTitle: { + id: 'admin-portal.signature-collection:collectionReviewedTitle', + defaultMessage: 'Meðmælasöfnun vegna framboðs til Alþingis lokið', + description: '', + }, + collectionReviewedMessage: { + id: 'admin-portal.signature-collection:collectionReviewedMessage', + defaultMessage: + 'Nú hefur úrvinnslu verið lokið á öllum listum í öllum kjördæmum.', + description: '', + }, + collectionProcessedTitle: { + id: 'admin-portal.signature-collection:collectionProcessedTitle', + defaultMessage: 'Úrvinnsla meðmælasöfnunar lokið', + description: '', + }, + collectionProcessedMessage: { + id: 'admin-portal.signature-collection:collectionReviewedTitle', + defaultMessage: 'Nú er hægt að framlengja stökum listum.', + description: '', + }, listReviewedModalDescription: { id: 'admin-portal.signature-collection:listReviewedModalDescription#markdown', defaultMessage: diff --git a/libs/portals/admin/signature-collection/src/screens-parliamentary/Constituency/index.tsx b/libs/portals/admin/signature-collection/src/screens-parliamentary/Constituency/index.tsx index 15582fc57fbb..c0ddcfdf8772 100644 --- a/libs/portals/admin/signature-collection/src/screens-parliamentary/Constituency/index.tsx +++ b/libs/portals/admin/signature-collection/src/screens-parliamentary/Constituency/index.tsx @@ -131,14 +131,12 @@ export const Constituency = ({ ': ' + constituencyLists.length} - {constituencyLists?.length > 0 && - allowedToProcess && - collectionStatus === CollectionStatus.InInitialReview && ( - - )} + {allowedToProcess && ( + + )} {constituencyLists.map((list) => ( @@ -164,7 +162,9 @@ export const Constituency = ({ }, }} tag={ - allowedToProcess && list.active + allowedToProcess && + list.active && + collectionStatus === CollectionStatus.InitialActive ? { label: 'Cancel collection', renderTag: () => ( diff --git a/libs/portals/admin/signature-collection/src/screens-parliamentary/List/index.tsx b/libs/portals/admin/signature-collection/src/screens-parliamentary/List/index.tsx index 4dc51fd43cd9..49581f3a8171 100644 --- a/libs/portals/admin/signature-collection/src/screens-parliamentary/List/index.tsx +++ b/libs/portals/admin/signature-collection/src/screens-parliamentary/List/index.tsx @@ -106,7 +106,9 @@ const List = ({ allowedToProcess }: { allowedToProcess: boolean }) => { )} {allowedToProcess && ( - {!list.active && } + {!list.active && !list.reviewed && ( + + )} )} diff --git a/libs/portals/admin/signature-collection/src/screens-parliamentary/List/paperSignees/index.tsx b/libs/portals/admin/signature-collection/src/screens-parliamentary/List/paperSignees/index.tsx index a156005bd07e..38d624aeec34 100644 --- a/libs/portals/admin/signature-collection/src/screens-parliamentary/List/paperSignees/index.tsx +++ b/libs/portals/admin/signature-collection/src/screens-parliamentary/List/paperSignees/index.tsx @@ -20,10 +20,12 @@ import { useIdentityQuery, } from './identityAndCanSignLookup.generated' import { useSignatureCollectionAdminUploadPaperSignatureMutation } from './uploadPaperSignee.generated' +import { useRevalidator } from 'react-router-dom' export const PaperSignees = ({ listId }: { listId: string }) => { useNamespaces('sp.signatureCollection') const { formatMessage } = useLocale() + const { revalidate } = useRevalidator() const { control, reset } = useForm() const [nationalIdInput, setNationalIdInput] = useState('') @@ -76,6 +78,7 @@ export const PaperSignees = ({ listId }: { listId: string }) => { toast.error(formatMessage(m.paperSigneeError)) } reset() + revalidate() setNationalIdTypo(false) setName('') }, diff --git a/libs/portals/admin/signature-collection/src/screens-parliamentary/index.tsx b/libs/portals/admin/signature-collection/src/screens-parliamentary/index.tsx index 0b7f2197ab34..8f5e994adfe2 100644 --- a/libs/portals/admin/signature-collection/src/screens-parliamentary/index.tsx +++ b/libs/portals/admin/signature-collection/src/screens-parliamentary/index.tsx @@ -9,6 +9,7 @@ import { Breadcrumbs, Table as T, Text, + AlertMessage, } from '@island.is/island-ui/core' import { useLocale } from '@island.is/localization' import { IntroHeader, PortalNavigation } from '@island.is/portals/core' @@ -220,9 +221,37 @@ const ParliamentaryRoot = ({ ) })} - {allowedToProcess && } - {collectionStatus === CollectionStatus.InInitialReview && ( - + {allowedToProcess && ( + + {collectionStatus !== CollectionStatus.InReview && ( + + )} + {(collectionStatus === CollectionStatus.InitialActive || + collectionStatus === CollectionStatus.InInitialReview) && ( + l.reviewed === true)} + /> + )} + + )} + {collectionStatus === CollectionStatus.Processed && ( + + + + )} + {collectionStatus === CollectionStatus.InReview && ( + + + )} diff --git a/libs/portals/admin/signature-collection/src/shared-components/completeCollectionProcessing/index.tsx b/libs/portals/admin/signature-collection/src/shared-components/completeCollectionProcessing/index.tsx index 6a6290e0f44b..4b281f23ac1c 100644 --- a/libs/portals/admin/signature-collection/src/shared-components/completeCollectionProcessing/index.tsx +++ b/libs/portals/admin/signature-collection/src/shared-components/completeCollectionProcessing/index.tsx @@ -8,8 +8,10 @@ import { useProcessCollectionMutation } from './finishCollectionProcess.generate const ActionCompleteCollectionProcessing = ({ collectionId, + canProcess, }: { collectionId: string + canProcess?: boolean }) => { const { formatMessage } = useLocale() const [modalSubmitReviewIsOpen, setModalSubmitReviewIsOpen] = useState(false) @@ -45,6 +47,7 @@ const ActionCompleteCollectionProcessing = ({ colorScheme="destructive" variant="text" onClick={() => setModalSubmitReviewIsOpen(true)} + disabled={!canProcess} > {formatMessage(m.completeCollectionProcessing)}