From 4b7b30e9cec54ca507f29aa2cfa09feaa2911b49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9E=C3=B3r=C3=B0ur=20H?= Date: Wed, 27 Nov 2024 11:59:20 +0000 Subject: [PATCH] fix(regulations-admin): Update strings, fix impactname (#17041) * Fix strings date and impact name * Radio buttons --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../src/components/impacts/EditChange.tsx | 1 + .../src/components/impacts/ImpactDate.tsx | 47 +++++++++++++++---- .../src/components/impacts/ReferenceText.tsx | 4 +- .../regulations-admin/src/lib/messages.ts | 6 +++ 4 files changed, 48 insertions(+), 10 deletions(-) diff --git a/libs/portals/admin/regulations-admin/src/components/impacts/EditChange.tsx b/libs/portals/admin/regulations-admin/src/components/impacts/EditChange.tsx index 443c1545203b..f22aac29d562 100644 --- a/libs/portals/admin/regulations-admin/src/components/impacts/EditChange.tsx +++ b/libs/portals/admin/regulations-admin/src/components/impacts/EditChange.tsx @@ -446,6 +446,7 @@ export const EditChange = (props: EditChangeProp) => { } as Regulation } baseName={'' as RegName} + asBase={draft.type.value === 'base'} /> )} diff --git a/libs/portals/admin/regulations-admin/src/components/impacts/ImpactDate.tsx b/libs/portals/admin/regulations-admin/src/components/impacts/ImpactDate.tsx index 14560cfc7830..cbcf91d2e6ca 100644 --- a/libs/portals/admin/regulations-admin/src/components/impacts/ImpactDate.tsx +++ b/libs/portals/admin/regulations-admin/src/components/impacts/ImpactDate.tsx @@ -1,4 +1,13 @@ -import { Box, Button, DatePicker, Checkbox } from '@island.is/island-ui/core' +import { + Box, + Button, + DatePicker, + Checkbox, + Text, + RadioButton, + GridColumn, + GridRow, +} from '@island.is/island-ui/core' import { impactMsgs } from '../../lib/messages' import { DraftImpactForm } from '../../state/types' import { useLocale } from '@island.is/localization' @@ -37,12 +46,31 @@ export const ImpactDate = (props: ImpactDateProps) => { return ( - setHasCustomDate(!hasCustomDate)} - /> + + + { + onChange(undefined) + setHasCustomDate(false) + }} + backgroundColor="white" + label={t(impactMsgs.specificDateApplyTextDetails)} + /> + + + { + setHasCustomDate(true) + }} + backgroundColor="white" + label={t(impactMsgs.specificDateApply)} + /> + + {hasCustomDate ? ( <> @@ -65,7 +93,10 @@ export const ImpactDate = (props: ImpactDateProps) => { size="small" variant="text" preTextIcon="close" - onClick={() => onChange(undefined)} + onClick={() => { + onChange(undefined) + setHasCustomDate(false) + }} > {t(impactMsgs.effectiveDate_default)} diff --git a/libs/portals/admin/regulations-admin/src/components/impacts/ReferenceText.tsx b/libs/portals/admin/regulations-admin/src/components/impacts/ReferenceText.tsx index 15adaff457e9..089c705487cd 100644 --- a/libs/portals/admin/regulations-admin/src/components/impacts/ReferenceText.tsx +++ b/libs/portals/admin/regulations-admin/src/components/impacts/ReferenceText.tsx @@ -26,8 +26,8 @@ const t = getTexts({ effectiveDate: 'Tekur gildi þann', - referenceLegend: 'Texti áhrifareglugerðar {name}', - referenceBaseLegend: 'Texti grunnreglugerðarinnar {name}', + referenceLegend: 'Texti breytingareglugerðar {name}', + referenceBaseLegend: 'Texti stofnreglugerðarinnar {name}', referenceMeta: 'Útgáfudagur: {published}', referenceEditLink: 'Leiðrétta', diff --git a/libs/portals/admin/regulations-admin/src/lib/messages.ts b/libs/portals/admin/regulations-admin/src/lib/messages.ts index 1483376cd6af..b23dd85e2fa3 100644 --- a/libs/portals/admin/regulations-admin/src/lib/messages.ts +++ b/libs/portals/admin/regulations-admin/src/lib/messages.ts @@ -425,6 +425,12 @@ export const impactMsgs = defineMessages({ defaultMessage: 'Breyting tekur gildi á ákveðinni dagsetningu', }, + specificDateApplyTextDetails: { + id: 'ap.regulations-admin:change-applied-on-specific-date-text-details', + defaultMessage: + 'Breyting tekur gildi þegar í stað, daginn eftir útgáfudag.', + }, + // --------------------------------------------------------------------------- regExplainer: {