From 0cd31c1f0d1b982b8c3fed5a9859c20631d232fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dvar=20Oddsson?= Date: Tue, 5 Nov 2024 15:25:01 +0000 Subject: [PATCH 01/14] Checkpoint --- .../Shared/IndictmentOverview/IndictmentOverview.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx index 8f7bce9de3a6..b74fae289190 100644 --- a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx +++ b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx @@ -9,6 +9,7 @@ import { isCompletedCase, isDefenceUser, isProsecutionUser, + isSuccessfulServiceStatus, } from '@island.is/judicial-system/types' import { titles } from '@island.is/judicial-system-web/messages' import { @@ -124,6 +125,13 @@ const IndictmentOverview: FC = () => { : formatMessage(strings.inProgressTitle)} + {isDefenceUser(user) && + workingCase.defendants?.map((defendant) => + defendant.subpoenas?.map( + (subpoena) => + isSuccessfulServiceStatus(subpoena.serviceStatus) && 'sdads', + ), + )} {caseHasBeenReceivedByCourt && workingCase.court && latestDate?.date && From 96aa96fe6baf091e9ef2ecc0a70c2ae5e74c8f15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dvar=20Oddsson?= Date: Tue, 5 Nov 2024 22:49:39 +0000 Subject: [PATCH 02/14] Refactor AlertMessage --- .../web/src/components/index.ts | 1 + .../IndictmentOverview/IndictmentOverview.tsx | 66 ++++++++++++++++--- .../src/lib/AlertMessage/AlertMessage.tsx | 62 ++++++++--------- libs/island-ui/core/src/lib/Box/Box.tsx | 2 + .../core/src/lib/Box/useBoxStyles.css.ts | 40 +++++++++++ .../core/src/lib/Box/useBoxStyles.ts | 11 ++++ 6 files changed, 138 insertions(+), 44 deletions(-) diff --git a/apps/judicial-system/web/src/components/index.ts b/apps/judicial-system/web/src/components/index.ts index 85c50b4f5967..2a230dffdd67 100644 --- a/apps/judicial-system/web/src/components/index.ts +++ b/apps/judicial-system/web/src/components/index.ts @@ -63,6 +63,7 @@ export { default as RulingAccordionItem } from './AccordionItems/RulingAccordion export { default as RulingInput } from './RulingInput/RulingInput' export { default as SectionHeading } from './SectionHeading/SectionHeading' export { default as ServiceAnnouncement } from './ServiceAnnouncement/ServiceAnnouncement' +export { strings as serviceAnnouncementStrings } from './ServiceAnnouncement/ServiceAnnouncement.strings' export { default as ServiceInterruptionBanner } from './ServiceInterruptionBanner/ServiceInterruptionBanner' export { default as SignedDocument } from './SignedDocument/SignedDocument' export { default as OverviewHeader } from './OverviewHeader/OverviewHeader' diff --git a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx index b74fae289190..f71b7c779fba 100644 --- a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx +++ b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx @@ -2,7 +2,7 @@ import { FC, useCallback, useContext, useState } from 'react' import { useIntl } from 'react-intl' import { useRouter } from 'next/router' -import { Accordion, Box, Button } from '@island.is/island-ui/core' +import { Accordion, AlertMessage, Box, Button } from '@island.is/island-ui/core' import * as constants from '@island.is/judicial-system/consts' import { normalizeAndFormatNationalId } from '@island.is/judicial-system/formatters' import { @@ -28,24 +28,63 @@ import { PageTitle, useIndictmentsLawsBroken, UserContext, + serviceAnnouncementStrings, } from '@island.is/judicial-system-web/src/components' import { CaseIndictmentRulingDecision, CaseState, + Defendant, IndictmentDecision, + ServiceStatus, + Subpoena, UserRole, } from '@island.is/judicial-system-web/src/graphql/schema' import { ReviewDecision } from '../../PublicProsecutor/components/ReviewDecision/ReviewDecision' import { strings } from './IndictmentOverview.strings' +interface ServiceAnnouncementProps { + defendant: Defendant + subpoena: Subpoena +} + +const ServiceAnnouncement: FC = (props) => { + const { defendant, subpoena } = props + const { formatMessage } = useIntl() + + const getTitle = (defendantName?: string | null) => { + const successMessage = formatMessage( + serviceAnnouncementStrings.serviceStatusSuccess, + ) + + return defendantName + ? `${successMessage} - ${defendantName}` + : successMessage + } + + const getMessage = ( + servedBy?: string | null, + serviceDate?: string | null, + ) => { + return [servedBy, serviceDate].filter(Boolean).join(', ') + } + + return ( + + ) +} + const IndictmentOverview: FC = () => { - const router = useRouter() const { workingCase, isLoadingWorkingCase, caseNotFound } = useContext(FormContext) - const { user } = useContext(UserContext) + const { user } = useContext(UserContext) const { formatMessage } = useIntl() + const router = useRouter() const lawsBroken = useIndictmentsLawsBroken(workingCase) const caseHasBeenReceivedByCourt = workingCase.state === CaseState.RECEIVED const latestDate = workingCase.courtDate ?? workingCase.arraignmentDate @@ -54,10 +93,16 @@ const IndictmentOverview: FC = () => { const [modalVisible, setModalVisible] = useState(false) const [isReviewDecisionSelected, setIsReviewDecisionSelected] = useState(false) + + const hasLawsBroken = lawsBroken.size > 0 + const hasMergeCases = + workingCase.mergedCases && workingCase.mergedCases.length > 0 + const shouldDisplayReviewDecision = isCompletedCase(workingCase.state) && workingCase.indictmentReviewer?.id === user?.id && Boolean(!workingCase.indictmentReviewDecision) + const canAddFiles = !isCompletedCase(workingCase.state) && isDefenceUser(user) && @@ -70,6 +115,7 @@ const IndictmentOverview: FC = () => { ) && workingCase.indictmentDecision !== IndictmentDecision.POSTPONING_UNTIL_VERDICT + const shouldDisplayGeneratedPdfFiles = isProsecutionUser(user) || workingCase.defendants?.some( @@ -97,10 +143,6 @@ const IndictmentOverview: FC = () => { [router, workingCase.id], ) - const hasLawsBroken = lawsBroken.size > 0 - const hasMergeCases = - workingCase.mergedCases && workingCase.mergedCases.length > 0 - return ( { workingCase.defendants?.map((defendant) => defendant.subpoenas?.map( (subpoena) => - isSuccessfulServiceStatus(subpoena.serviceStatus) && 'sdads', + isSuccessfulServiceStatus(subpoena.serviceStatus) && ( + + + + ), ), )} {caseHasBeenReceivedByCourt && diff --git a/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx b/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx index 22d5db4d8683..85b8458f4134 100644 --- a/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx +++ b/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx @@ -1,10 +1,9 @@ -import * as React from 'react' +import { FC, PropsWithChildren, ReactNode, isValidElement } from 'react' import { Text } from '../Text/Text' import { Icon } from '../IconRC/Icon' import { Icon as IconType } from '../IconRC/iconMap' import { Colors } from '@island.is/island-ui/theme' import { Box } from '../Box/Box' -import { Stack } from '../Stack/Stack' export type AlertMessageType = | 'error' @@ -55,33 +54,30 @@ const variantStyles: VariantStyles = { }, } -export interface AlertMessageProps { +interface AlertMessageProps { type: AlertMessageType testid?: string - action?: React.ReactNode } type TitleAndOrMessage = | { title: string - message: string | React.ReactNode + message: string | ReactNode } | { title?: never - message: string | React.ReactNode + message: string | ReactNode } | { title: string message?: never } -export const AlertMessage: React.FC< - React.PropsWithChildren -> = ({ type, title, message, action, testid }) => { +export const AlertMessage: FC< + PropsWithChildren +> = ({ type, title, message, testid }) => { const variant = variantStyles[type] - const onlyMessage = !title && !!message - return ( - + {variant.icon && ( )} - - - {!!title && ( - - {title} - - )} + + {title && ( + + {title} + + )} + {message && ( - {message && - (React.isValidElement(message) ? ( - message - ) : ( - - {message} - - ))} - {action && ( - - {action} + {isValidElement(message) ? ( + message + ) : ( + + {message} )} - + )} diff --git a/libs/island-ui/core/src/lib/Box/Box.tsx b/libs/island-ui/core/src/lib/Box/Box.tsx index b141c83d6172..6612c3f96115 100644 --- a/libs/island-ui/core/src/lib/Box/Box.tsx +++ b/libs/island-ui/core/src/lib/Box/Box.tsx @@ -30,6 +30,7 @@ export const Box = forwardRef( columnGap, rowGap, alignItems, + alignSelf, justifyContent, textAlign, border, @@ -93,6 +94,7 @@ export const Box = forwardRef( columnGap, rowGap, alignItems, + alignSelf, justifyContent, textAlign, border, diff --git a/libs/island-ui/core/src/lib/Box/useBoxStyles.css.ts b/libs/island-ui/core/src/lib/Box/useBoxStyles.css.ts index 55f863041994..12039340fcce 100644 --- a/libs/island-ui/core/src/lib/Box/useBoxStyles.css.ts +++ b/libs/island-ui/core/src/lib/Box/useBoxStyles.css.ts @@ -326,6 +326,46 @@ export const alignItemsXl = styleVariants( ), ) +const alignSelfRules = { + flexStart: 'flex-start', + center: 'center', + flexEnd: 'flex-end', + baseline: 'baseline', + stretch: 'stretch', +} +export const alignSelf = styleVariants( + mapToStyleProperty(alignSelfRules, 'alignSelf'), +) + +export const alignSelfSm = styleVariants( + mapToStyleProperty(alignSelfRules, 'alignSelf', (value, propertyName) => + themeUtils.responsiveStyle({ + sm: { [propertyName]: value }, + }), + ), +) +export const alignSelfMd = styleVariants( + mapToStyleProperty(alignSelfRules, 'alignSelf', (value, propertyName) => + themeUtils.responsiveStyle({ + md: { [propertyName]: value }, + }), + ), +) +export const alignSelfLg = styleVariants( + mapToStyleProperty(alignSelfRules, 'alignSelf', (value, propertyName) => + themeUtils.responsiveStyle({ + lg: { [propertyName]: value }, + }), + ), +) +export const alignSelfXl = styleVariants( + mapToStyleProperty(alignSelfRules, 'alignSelf', (value, propertyName) => + themeUtils.responsiveStyle({ + xl: { [propertyName]: value }, + }), + ), +) + const justifyContentRules = { flexStart: 'flex-start', center: 'center', diff --git a/libs/island-ui/core/src/lib/Box/useBoxStyles.ts b/libs/island-ui/core/src/lib/Box/useBoxStyles.ts index c659d986e98f..9ac4a5e91435 100644 --- a/libs/island-ui/core/src/lib/Box/useBoxStyles.ts +++ b/libs/island-ui/core/src/lib/Box/useBoxStyles.ts @@ -35,6 +35,7 @@ export interface UseBoxStylesProps { flexShrink?: keyof typeof styleRefs.flexShrink flexGrow?: keyof typeof styleRefs.flexGrow alignItems?: ResponsiveProp + alignSelf?: ResponsiveProp justifyContent?: ResponsiveProp textAlign?: ResponsiveProp columnGap?: ResponsiveSpace @@ -98,6 +99,7 @@ export const useBoxStyles = ({ rowGap, columnGap, alignItems, + alignSelf, justifyContent, textAlign, border, @@ -346,6 +348,15 @@ export const useBoxStyles = ({ styles.alignItemsLg, styles.alignItemsXl, ), + alignSelf !== undefined && + resolveResponsiveProp( + alignSelf, + styles.alignSelf, + styles.alignSelfSm, + styles.alignSelfMd, + styles.alignSelfLg, + styles.alignSelfXl, + ), justifyContent !== undefined && resolveResponsiveProp( justifyContent, From d717322bc89475f096204e4a8ee2d6fb54efec86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dvar=20Oddsson?= Date: Wed, 6 Nov 2024 10:15:00 +0000 Subject: [PATCH 03/14] Format date --- .../Shared/IndictmentOverview/IndictmentOverview.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx index f71b7c779fba..04a0743d2e00 100644 --- a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx +++ b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx @@ -4,7 +4,10 @@ import { useRouter } from 'next/router' import { Accordion, AlertMessage, Box, Button } from '@island.is/island-ui/core' import * as constants from '@island.is/judicial-system/consts' -import { normalizeAndFormatNationalId } from '@island.is/judicial-system/formatters' +import { + formatDate, + normalizeAndFormatNationalId, +} from '@island.is/judicial-system/formatters' import { isCompletedCase, isDefenceUser, @@ -66,7 +69,7 @@ const ServiceAnnouncement: FC = (props) => { servedBy?: string | null, serviceDate?: string | null, ) => { - return [servedBy, serviceDate].filter(Boolean).join(', ') + return [servedBy, formatDate(serviceDate, 'Pp')].filter(Boolean).join(', ') } return ( From 80e2958ecc559a0b946ad3ee738d6ab559289ab1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dvar=20Oddsson?= Date: Wed, 6 Nov 2024 10:36:16 +0000 Subject: [PATCH 04/14] Cleanup --- .../routes/Shared/IndictmentOverview/IndictmentOverview.tsx | 4 ++-- libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx index 04a0743d2e00..c890e178fb81 100644 --- a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx +++ b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx @@ -55,7 +55,7 @@ const ServiceAnnouncement: FC = (props) => { const { defendant, subpoena } = props const { formatMessage } = useIntl() - const getTitle = (defendantName?: string | null) => { + const getTitle = (defendantName?: string | null): string => { const successMessage = formatMessage( serviceAnnouncementStrings.serviceStatusSuccess, ) @@ -68,7 +68,7 @@ const ServiceAnnouncement: FC = (props) => { const getMessage = ( servedBy?: string | null, serviceDate?: string | null, - ) => { + ): string => { return [servedBy, formatDate(serviceDate, 'Pp')].filter(Boolean).join(', ') } diff --git a/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx b/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx index 85b8458f4134..409937de226b 100644 --- a/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx +++ b/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx @@ -105,7 +105,7 @@ export const AlertMessage: FC< alignSelf="center" > {title && ( - + {title} )} From 4c4c23e891175e93c9574f41ee7b4d7d110eb9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dvar=20Oddsson?= Date: Wed, 6 Nov 2024 10:37:22 +0000 Subject: [PATCH 05/14] Cleanup --- .../src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx index c890e178fb81..5cb3310daa11 100644 --- a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx +++ b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx @@ -175,7 +175,7 @@ const IndictmentOverview: FC = () => { defendant.subpoenas?.map( (subpoena) => isSuccessfulServiceStatus(subpoena.serviceStatus) && ( - + Date: Thu, 7 Nov 2024 14:54:16 +0000 Subject: [PATCH 06/14] Merge --- .../routes/Shared/IndictmentOverview/IndictmentOverview.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx index 5cb3310daa11..3874902c5df6 100644 --- a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx +++ b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx @@ -29,16 +29,15 @@ import { PageHeader, PageLayout, PageTitle, + serviceAnnouncementStrings, useIndictmentsLawsBroken, UserContext, - serviceAnnouncementStrings, } from '@island.is/judicial-system-web/src/components' import { CaseIndictmentRulingDecision, CaseState, Defendant, IndictmentDecision, - ServiceStatus, Subpoena, UserRole, } from '@island.is/judicial-system-web/src/graphql/schema' From 2deeef3e2baac115a5b904b1d6575b63b7ad78d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dvar=20Oddsson?= Date: Fri, 8 Nov 2024 09:27:48 +0000 Subject: [PATCH 07/14] Add key --- .../routes/Shared/IndictmentOverview/IndictmentOverview.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx index 3874902c5df6..a721658c2961 100644 --- a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx +++ b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx @@ -174,9 +174,8 @@ const IndictmentOverview: FC = () => { defendant.subpoenas?.map( (subpoena) => isSuccessfulServiceStatus(subpoena.serviceStatus) && ( - + From a0133c19919607b8f8a720ac1084f704792c97cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dvar=20Oddsson?= Date: Fri, 8 Nov 2024 09:49:26 +0000 Subject: [PATCH 08/14] Refactor --- .../IndictmentOverview/IndictmentOverview.tsx | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx index a721658c2961..1e0fb589b153 100644 --- a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx +++ b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx @@ -145,6 +145,7 @@ const IndictmentOverview: FC = () => { [router, workingCase.id], ) + console.log('asdasd') return ( { {isDefenceUser(user) && workingCase.defendants?.map((defendant) => - defendant.subpoenas?.map( - (subpoena) => - isSuccessfulServiceStatus(subpoena.serviceStatus) && ( - - - - ), - ), + (defendant.subpoenas ?? []) + .filter((subpoena) => + isSuccessfulServiceStatus(subpoena.serviceStatus), + ) + .map((subpoena) => ( + + + + )), )} {caseHasBeenReceivedByCourt && workingCase.court && From 9079a4c905a0f1c71c24d9fe39e5cce68bdca70f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dvar=20Oddsson?= Date: Fri, 8 Nov 2024 10:00:55 +0000 Subject: [PATCH 09/14] Remove console.log --- .../src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx index 1e0fb589b153..d41198200eab 100644 --- a/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx +++ b/apps/judicial-system/web/src/routes/Shared/IndictmentOverview/IndictmentOverview.tsx @@ -145,7 +145,6 @@ const IndictmentOverview: FC = () => { [router, workingCase.id], ) - console.log('asdasd') return ( Date: Mon, 11 Nov 2024 11:15:27 +0000 Subject: [PATCH 10/14] Import React --- .../core/src/lib/AlertMessage/AlertMessage.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx b/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx index 409937de226b..c8b603ad571c 100644 --- a/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx +++ b/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx @@ -1,4 +1,4 @@ -import { FC, PropsWithChildren, ReactNode, isValidElement } from 'react' +import React, { FC, ReactNode, isValidElement } from 'react' import { Text } from '../Text/Text' import { Icon } from '../IconRC/Icon' import { Icon as IconType } from '../IconRC/iconMap' @@ -73,9 +73,12 @@ type TitleAndOrMessage = message?: never } -export const AlertMessage: FC< - PropsWithChildren -> = ({ type, title, message, testid }) => { +export const AlertMessage: FC = ({ + type, + title, + message, + testid, +}) => { const variant = variantStyles[type] return ( From 8e13b89b95d113b771168b31c86df7d3d9958783 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dvar=20Oddsson?= Date: Mon, 11 Nov 2024 13:34:10 +0000 Subject: [PATCH 11/14] Add action prop bacj --- .../web/src/routes/Shared/Cases/Cases.tsx | 6 ++++++ .../core/src/lib/AlertMessage/AlertMessage.tsx | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/apps/judicial-system/web/src/routes/Shared/Cases/Cases.tsx b/apps/judicial-system/web/src/routes/Shared/Cases/Cases.tsx index a2c1ecb6e872..57130168cd90 100644 --- a/apps/judicial-system/web/src/routes/Shared/Cases/Cases.tsx +++ b/apps/judicial-system/web/src/routes/Shared/Cases/Cases.tsx @@ -253,6 +253,12 @@ export const Cases: FC = () => { return ( <> + asdasd

} + />
diff --git a/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx b/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx index c8b603ad571c..8814dabd034f 100644 --- a/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx +++ b/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx @@ -57,6 +57,7 @@ const variantStyles: VariantStyles = { interface AlertMessageProps { type: AlertMessageType testid?: string + action?: ReactNode } type TitleAndOrMessage = @@ -78,6 +79,7 @@ export const AlertMessage: FC = ({ title, message, testid, + action, }) => { const variant = variantStyles[type] @@ -123,6 +125,16 @@ export const AlertMessage: FC = ({ )} )} + {action && ( + + {action} + + )} From 29632c701857b487cde244ae4221347aa9e51f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dvar=20Oddsson?= Date: Mon, 11 Nov 2024 13:34:46 +0000 Subject: [PATCH 12/14] Add action prop bacj --- apps/judicial-system/web/src/routes/Shared/Cases/Cases.tsx | 6 ------ 1 file changed, 6 deletions(-) diff --git a/apps/judicial-system/web/src/routes/Shared/Cases/Cases.tsx b/apps/judicial-system/web/src/routes/Shared/Cases/Cases.tsx index 57130168cd90..a2c1ecb6e872 100644 --- a/apps/judicial-system/web/src/routes/Shared/Cases/Cases.tsx +++ b/apps/judicial-system/web/src/routes/Shared/Cases/Cases.tsx @@ -253,12 +253,6 @@ export const Cases: FC = () => { return ( <> - asdasd

} - />
From b0a8bf8c34b580f7b51c7d7feb0b73515e86e926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dvar=20Oddsson?= Date: Mon, 11 Nov 2024 13:36:26 +0000 Subject: [PATCH 13/14] Add action prop bacj --- .../src/lib/AlertMessage/AlertMessage.tsx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx b/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx index 8814dabd034f..8652ed40b1e1 100644 --- a/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx +++ b/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx @@ -123,16 +123,16 @@ export const AlertMessage: FC = ({ {message} )} - - )} - {action && ( - - {action} + {action && ( + + {action} + + )} )} From b3513748bf55018ab560701f03339fe725b9ab4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=8Dvar=20Oddsson?= Date: Wed, 13 Nov 2024 08:28:22 +0000 Subject: [PATCH 14/14] Fix import --- libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx b/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx index 8652ed40b1e1..bcacc79afd0e 100644 --- a/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx +++ b/libs/island-ui/core/src/lib/AlertMessage/AlertMessage.tsx @@ -54,7 +54,7 @@ const variantStyles: VariantStyles = { }, } -interface AlertMessageProps { +export interface AlertMessageProps { type: AlertMessageType testid?: string action?: ReactNode