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(portals-admin): signees filters #16211

Merged
merged 16 commits into from
Oct 4, 2024
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 21 additions & 6 deletions libs/portals/admin/signature-collection/src/lib/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export const m = defineMessages({
},
filter: {
id: 'admin-portal.signature-collection:filter',
defaultMessage: 'Opna síu',
defaultMessage: 'Sía',
description: '',
},
filterBy: {
Expand Down Expand Up @@ -110,9 +110,14 @@ export const m = defineMessages({
defaultMessage: 'Hreinsa allar síur',
description: '',
},
typeOfSignee: {
id: 'admin-portal.signature-collection:typeOfSignee',
defaultMessage: 'Tegund meðmæla',
description: '',
},
createCollection: {
id: 'admin-portal.signature-collection:createCollection',
defaultMessage: 'Stofna söfnun',
defaultMessage: 'Stofna nýja meðmælasöfnun',
description: '',
},
createCollectionSuccess: {
Expand All @@ -128,7 +133,7 @@ export const m = defineMessages({
createCollectionModalDescription: {
id: 'admin-portal.signature-collection:createCollectionModalDescription',
defaultMessage:
'Til þess að stofna meðmælasöfnun þarf að slá inn kennitölu frambjóðs.',
'Til þess að stofna meðmælasöfnun þarf að slá inn kennitölu framboðs.',
description: '',
},
candidateNationalId: {
Expand All @@ -151,6 +156,11 @@ export const m = defineMessages({
defaultMessage: 'Lokadagur',
description: '',
},
editListEndTime: {
id: 'admin-portal.signature-collection:editListEndTime',
defaultMessage: 'Breyta',
description: '',
},
collectionTitle: {
id: 'admin-portal.signature-collection:collectionTitle',
defaultMessage: 'Forsetakosningar 2024',
Expand Down Expand Up @@ -245,13 +255,13 @@ export const m = defineMessages({
singleListIntro: {
id: 'admin-portal.signature-collection:singleListIntro',
defaultMessage:
'Hér birtast nöfn meðmælenda frambjóðandans. Hægt er að framlengja tímafrest söfnunarinnar og bæta við meðmælum af blaði.',
'Hér birtast nöfn meðmælenda framboðs. Hægt er að framlengja tímafrest söfnunarinnar og bæta við meðmælum af blaði.',
description: '',
},
singleListIntroManage: {
id: 'admin-portal.signature-collection:singleListIntroManage',
defaultMessage:
'Hér birtast nöfn meðmælenda frambjóðandans. Hægt er að leita að meðmælendum eftir nafni eða kennitölu.',
'Hér birtast nöfn meðmælenda framboðs. Hægt er að leita að meðmælendum eftir nafni eða kennitölu.',
description: '',
},
collectors: {
Expand Down Expand Up @@ -300,9 +310,14 @@ export const m = defineMessages({
defaultMessage: 'Leita eftir nafni eða kennitölu',
description: '',
},
searchNationalIdPlaceholder: {
id: 'admin-portal.signature-collection:searchNationalIdPlaceholder',
defaultMessage: 'Leita eftir kennitölu',
description: '',
},
sortBy: {
id: 'admin-portal.signature-collection:sortBy',
defaultMessage: 'Raða eftir',
defaultMessage: 'Raða',
description: '',
},
sortAlphabeticallyAsc: {
Expand Down
12 changes: 11 additions & 1 deletion libs/portals/admin/signature-collection/src/lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,22 @@ export const countryAreas = [
{ value: 'Austfirðingafjórðungur', label: 'Austfirðingafjórðungur' },
]

export type Filters = {
export const signeeTypes = [
{ value: 'paper', label: 'Af blaði' },
{ value: 'digital', label: 'Rafræn' },
]

export type FiltersOverview = {
area: Array<string>
candidate: Array<string>
input: string
}
albinagu marked this conversation as resolved.
Show resolved Hide resolved

export type FiltersSigneeType = {
signeeType: Array<string>
pageNumber: Array<string>
}

export enum ListStatus {
Active = 'Active',
InReview = 'InReview',
Expand Down
24 changes: 21 additions & 3 deletions libs/portals/admin/signature-collection/src/module.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,37 @@ export const signatureCollectionModule: PortalModule = {
{
name: m.signatureListsTitle,
path: SignatureCollectionPaths.ParliamentaryRoot,
element: <ParliamentaryRoot />,
element: (
<ParliamentaryRoot
allowedToProcess={props.userInfo.scopes.some(
(scope) => scope === AdminPortalScope.signatureCollectionProcess,
)}
/>
),
loader: listsLoader(props),
},
{
name: m.signatureListsConstituencyTitle,
path: SignatureCollectionPaths.ParliamentaryConstituency,
element: <ParliamentaryConstituency />,
element: (
<ParliamentaryConstituency
allowedToProcess={props.userInfo.scopes.some(
(scope) => scope === AdminPortalScope.signatureCollectionProcess,
)}
/>
),
loader: listsLoader(props),
},
{
name: m.singleList,
path: SignatureCollectionPaths.ParliamentaryConstituencyList,
element: <ParliamentaryList />,
element: (
<ParliamentaryList
allowedToProcess={props.userInfo.scopes.some(
(scope) => scope === AdminPortalScope.signatureCollectionProcess,
)}
/>
),
loader: listLoader(props),
},

Expand Down
Loading
Loading