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): adding report date #16384

Merged
merged 15 commits into from
Oct 15, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import logo from './logo.png'
import { dark200 } from '@island.is/island-ui/theme'
import { SignatureCollectionAreaSummaryReport } from '@island.is/api/schema'
import format from 'date-fns/format'

const MyPdfDocument = ({
report,
Expand All @@ -30,6 +31,11 @@ const MyPdfDocument = ({
<Text style={styles.header}>Flokkur:</Text>
<Text style={styles.text}>{list.candidateName}</Text>

<Text style={styles.header}>Dagsetning:</Text>
<Text style={styles.text}>
{format(new Date(), 'dd.MM.yyyy HH:mm')}
</Text>

<Text style={styles.header}>Listabókstafur:</Text>
<Text style={styles.text}>{list.partyBallotLetter}</Text>

Expand Down
5 changes: 5 additions & 0 deletions libs/service-portal/core/src/lib/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,11 @@ export const m = defineMessages({
id: 'service.portal:signatureCollectionParliamentaryLists',
defaultMessage: 'Alþingiskosningar - Meðmælasöfnun',
},
signatureCollectionParliamentaryListsCompany: {
id: 'service.portal:signatureCollectionParliamentaryListsCompany',
defaultMessage:
'Alþingiskosningar - Meðmælasöfnun (Aðeins fyrir stjórnmálasamtök)',
},
signatureCollectionPresidentialLists: {
id: 'service.portal:signatureCollectionPresidentialLists',
defaultMessage: 'Forsetakosningar - Meðmælasöfnun',
Expand Down
11 changes: 9 additions & 2 deletions libs/service-portal/signature-collection/src/lib/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,9 @@ export const m = defineMessages({
description: '',
},
actorNoAccessDescription: {
id: 'sp.signatureCollection:actorNoAccessDescription',
defaultMessage: 'Þú hefur ekki réttindi til að sjá þessar upplýsingar.',
id: 'sp.signatureCollection:actorNoAccessDescription#markdown',
defaultMessage:
'Eingöngu kennitölur sem hafa skráðan listabókstaf geta stofnað meðmælendasöfnun. Ef þú átt listabókstaf geturðu stofnað meðmælendasöfnun hér.',
description: '',
},

Expand Down Expand Up @@ -354,6 +355,12 @@ export const m = defineMessages({
defaultMessage: 'Umsjónaraðilar',
description: '',
},
supervisorsInfo: {
id: 'sp.signatureCollection:supervisorsInfo',
defaultMessage:
'Umsjónaraðilar hafa aðgang að öllum upplýsingum safnananna en geta ekki eytt söfnununum. ',
description: '',
},
add: {
id: 'sp.signatureCollection:add',
defaultMessage: 'Bæta við',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export const companySignatureCollectionNavigation: PortalNavigationItem = {
icon: {
icon: 'receipt',
},
description: m.signatureCollectionParliamentaryLists,
description: m.signatureCollectionParliamentaryListsCompany,
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,13 @@ export const PaperSignees = ({
pageNumber: Number(page),
},
},
onCompleted: () => {
toast.success(formatMessage(m.paperSigneeSuccess))
refetchSignees()
onCompleted: (res) => {
if (res.success) {
toast.success(formatMessage(m.paperSigneeSuccess))
refetchSignees()
} else {
toast.error(formatMessage(m.paperSigneeError))
}
},
onError: () => {
toast.error(formatMessage(m.paperSigneeError))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const ViewList = () => {
{!!listInfo?.collectors?.length && (
<>
<Text marginTop={[2, 0]} variant="h5">
{formatMessage(m.coOwners)}
{formatMessage(m.supervisors)}
albinagu marked this conversation as resolved.
Show resolved Hide resolved
</Text>
{listInfo?.collectors?.map((collector) => (
<Box
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,11 @@ const OwnerView = ({
>
<Text variant="h4">
{formatMessage(m.supervisors) + ' '}
<Tooltip placement="right" text="info" color="blue400" />
<Tooltip
placement="right"
text={formatMessage(m.supervisorsInfo)}
color="blue400"
/>
</Text>
</Box>
<T.Table>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const SigneeView = ({
<AlertMessage
type="warning"
title={formatMessage(m.actorNoAccessTitle)}
message={m.actorNoAccessDescription.defaultMessage}
message={formatMessage(m.actorNoAccessDescription)}
/>
) : (
<Skeleton />
Expand Down