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(j-s): Fix InfoCard #16830

Merged
merged 25 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
0cd31c1
Checkpoint
oddsson Nov 5, 2024
e6b57b3
Merge branch 'main' of github.com:island-is/island.is into j-s/servic…
oddsson Nov 5, 2024
96aa96f
Refactor AlertMessage
oddsson Nov 5, 2024
d717322
Format date
oddsson Nov 6, 2024
80e2958
Cleanup
oddsson Nov 6, 2024
4c4c23e
Cleanup
oddsson Nov 6, 2024
f18cda6
Merge branch 'main' of github.com:island-is/island.is into j-s/servic…
oddsson Nov 6, 2024
f657160
Merge branch 'main' of github.com:island-is/island.is into j-s/servic…
oddsson Nov 7, 2024
04020c2
Merge branch 'j-s/service-announcement-defenders' of github.com:islan…
oddsson Nov 7, 2024
d98dbd0
Merge
oddsson Nov 7, 2024
d55a4a2
Merge branch 'main' of github.com:island-is/island.is into j-s/servic…
oddsson Nov 8, 2024
2deeef3
Add key
oddsson Nov 8, 2024
a0133c1
Refactor
oddsson Nov 8, 2024
9079a4c
Remove console.log
oddsson Nov 8, 2024
db83d4b
Merge branch 'main' of github.com:island-is/island.is into j-s/servic…
oddsson Nov 8, 2024
ae44420
Merge branch 'main' into j-s/service-announcement-defenders
kodiakhq[bot] Nov 8, 2024
b329584
Merge branch 'main' into j-s/service-announcement-defenders
gudjong Nov 8, 2024
76e228d
Merge branch 'main' of github.com:island-is/island.is
oddsson Nov 12, 2024
bb10337
Refactoring
oddsson Nov 12, 2024
91b7786
Merge branch 'main' of github.com:island-is/island.is into j-s/fix-in…
oddsson Nov 13, 2024
4f283d9
Merge
oddsson Nov 13, 2024
6081f15
Show to prosecutors
oddsson Nov 13, 2024
92e8e19
Fix tests
oddsson Nov 13, 2024
7730bbe
Merge branch 'main' of github.com:island-is/island.is into j-s/fix-in…
oddsson Nov 13, 2024
efb9fea
Merge branch 'main' into j-s/fix-info-card
kodiakhq[bot] Nov 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ export const DefendantInfo: FC<DefendantInfoProps> = (props) => {
defender,
} = props
const { formatMessage } = useIntl()
const hasDefender = defendant.defenderName || defender?.name
const defenderLabel =
defender?.sessionArrangement ===
SessionArrangements.ALL_PRESENT_SPOKESPERSON
? formatMessage(strings.spokesperson)
: formatMessage(strings.defender)
const defenderName = defendant.defenderName || defender?.name
const defenderEmail = defendant.defenderEmail || defender?.email
const defenderPhoneNumber =
defendant.defenderPhoneNumber || defender?.phoneNumber

const appealExpirationInfo = getAppealExpirationInfo(
defendant.verdictAppealDeadline,
Expand Down Expand Up @@ -103,26 +113,21 @@ export const DefendantInfo: FC<DefendantInfoProps> = (props) => {
{defendant.address ? defendant.address : 'Ekki skráð'}
</Text>
</Box>
{defendant.defenderName || defender?.name ? (
<Box component="p">
<Text as="span" whiteSpace="pre" fontWeight="semiBold">
{defender?.sessionArrangement ===
SessionArrangements.ALL_PRESENT_SPOKESPERSON
? `${formatMessage(strings.spokesperson)}: `
: `${formatMessage(strings.defender)}: `}
</Text>
{RenderPersonalData(
defendant.defenderName || defender?.name,
defendant.defenderEmail || defender?.email,
defendant.defenderPhoneNumber || defender?.phoneNumber,
<Box component="p">
<Text as="span" whiteSpace="pre" fontWeight="semiBold">
{`${defenderLabel}: `}
</Text>
{hasDefender ? (
RenderPersonalData(
defenderName,
defenderEmail,
defenderPhoneNumber,
false,
)}
</Box>
) : (
<Text>{`${formatMessage(strings.defender)}: ${formatMessage(
strings.noDefender,
)}`}</Text>
)}
)
) : (
<Text as="span">{formatMessage(strings.noDefender)}</Text>
)}
</Box>
{displayAppealExpirationInfo && (
<Box>
<Text as="span">
Expand All @@ -132,7 +137,7 @@ export const DefendantInfo: FC<DefendantInfoProps> = (props) => {
</Text>
</Box>
)}
{displayVerdictViewDate && (
{displayVerdictViewDate && defendant.serviceRequirement && (
<Text marginTop={1} fontWeight="semiBold">
{getVerdictViewDateText(
formatMessage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ const Overview: FC = () => {
</Box>
)}
<Box component="section" marginBottom={5}>
<InfoCardActiveIndictment displayVerdictViewDate={true} />
<InfoCardActiveIndictment displayVerdictViewDate />
</Box>
{(hasLawsBroken || hasMergeCases) && (
<Box marginBottom={5}>
Expand Down
Loading