From 378e8a9bc31e30667fc6fd17faab510b44c8a6e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9E=C3=B3r=C3=B0ur=20H?= Date: Wed, 18 Sep 2024 10:48:25 +0000 Subject: [PATCH] feat(regulations-admin): ministry basic + bugfixes (#16042) * Add ministry to basic screen + minor bugfixes * Remove console log * Minor refactor * cleanup * cleanup --------- Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../regulation-documents.controller.ts | 1 + .../src/components/EditBasics.tsx | 55 +++++++++++++++---- .../src/components/EditSignature.tsx | 2 +- .../components/impacts/EditCancellation.tsx | 6 +- .../src/components/impacts/EditChange.tsx | 6 +- .../regulations-admin/src/lib/messages.ts | 4 ++ .../src/state/actionHandlers.ts | 4 ++ .../regulations-admin/src/state/types.ts | 4 ++ .../src/state/useDraftingState.ts | 6 +- libs/regulations/src/lib/types-admin.ts | 1 + 10 files changed, 75 insertions(+), 14 deletions(-) diff --git a/apps/download-service/src/app/modules/regulation-documents/regulation-documents.controller.ts b/apps/download-service/src/app/modules/regulation-documents/regulation-documents.controller.ts index 9fd2e66917a3..0887c6c656ef 100644 --- a/apps/download-service/src/app/modules/regulation-documents/regulation-documents.controller.ts +++ b/apps/download-service/src/app/modules/regulation-documents/regulation-documents.controller.ts @@ -76,6 +76,7 @@ export class RegulationDocumentsController { comments: draftRegulation.comments, name: draftRegulation.name, publishedDate: draftRegulation.idealPublishDate, + ministry: draftRegulation.ministry, } const documentResponse = diff --git a/libs/portals/admin/regulations-admin/src/components/EditBasics.tsx b/libs/portals/admin/regulations-admin/src/components/EditBasics.tsx index 7b20d6e862b4..b6f79ed5fec0 100644 --- a/libs/portals/admin/regulations-admin/src/components/EditBasics.tsx +++ b/libs/portals/admin/regulations-admin/src/components/EditBasics.tsx @@ -8,9 +8,10 @@ import { Button, AlertMessage, AlertBanner, + Select, } from '@island.is/island-ui/core' import { EditorInput } from './EditorInput' -import { editorMsgs as msg, errorMsgs } from '../lib/messages' +import { editorMsgs as msg, errorMsgs, m } from '../lib/messages' import { useLocale } from '@island.is/localization' import { Appendixes } from './Appendixes' import { MagicTextarea } from './MagicTextarea' @@ -32,7 +33,7 @@ const updateText = export const EditBasics = () => { const t = useLocale().formatMessage - const { draft, actions } = useDraftingState() + const { draft, actions, ministries } = useDraftingState() const [editorKey, setEditorKey] = useState('initial') const [titleError, setTitleError] = useState(undefined) const [hasUpdated, setHasUpdated] = useState(false) @@ -162,13 +163,15 @@ export const EditBasics = () => { label={t(msg.text)} startExpanded={startTextExpanded} > - - - + {draft.type.value === RegulationDraftTypes.amending ? ( + + + + ) : undefined} { {' '} - {draft.signedDocumentUrl.value && ( + {draft.signedDocumentUrl.value ? ( { readOnly /> + ) : ( + ministries.length > 0 && + !draft.signatureText.value && ( +