Skip to content

Commit

Permalink
fix(regulations-admin): Update strings, fix impactname (#17041)
Browse files Browse the repository at this point in the history
* Fix strings date and impact name

* Radio buttons

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
thordurhhh and kodiakhq[bot] authored Nov 27, 2024
1 parent 9fa6dc7 commit 4b7b30e
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ export const EditChange = (props: EditChangeProp) => {
} as Regulation
}
baseName={'' as RegName}
asBase={draft.type.value === 'base'}
/>
)}
<GridContainer>
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -37,12 +46,31 @@ export const ImpactDate = (props: ImpactDateProps) => {
return (
<Box marginBottom={4} width={size}>
<Box marginBottom={3}>
<Checkbox
label={t(impactMsgs.specificDateApply)}
labelVariant="default"
checked={hasCustomDate}
onChange={() => setHasCustomDate(!hasCustomDate)}
/>
<GridRow rowGap={1}>
<GridColumn span="1/1">
<RadioButton
name={`set-no-custom-date`}
checked={!hasCustomDate}
onChange={() => {
onChange(undefined)
setHasCustomDate(false)
}}
backgroundColor="white"
label={t(impactMsgs.specificDateApplyTextDetails)}
/>
</GridColumn>
<GridColumn span="1/1">
<RadioButton
name={`select-custom-date`}
checked={hasCustomDate}
onChange={() => {
setHasCustomDate(true)
}}
backgroundColor="white"
label={t(impactMsgs.specificDateApply)}
/>
</GridColumn>
</GridRow>
</Box>
{hasCustomDate ? (
<>
Expand All @@ -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)}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Expand Down
6 changes: 6 additions & 0 deletions libs/portals/admin/regulations-admin/src/lib/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 4b7b30e

Please sign in to comment.