Skip to content

Commit

Permalink
Merge branch 'main' into j-s/show-send-to-prison-admin-file
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Dec 13, 2024
2 parents a215505 + 2523e39 commit 855f0ae
Show file tree
Hide file tree
Showing 50 changed files with 1,853 additions and 1,188 deletions.
780 changes: 394 additions & 386 deletions .github/CODEOWNERS

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -577,12 +577,12 @@ export class CourtService {
try {
const subject = `${courtName} - ${courtCaseNumber} - upplýsingar`

const sanitizedPoliceCaseNumber = policeCaseNumber?.replace(/-/g, '')
policeCaseNumber = policeCaseNumber?.replace(/-/g, '')

const content = JSON.stringify({
receivedByCourtDate,
indictmentDate,
sanitizedPoliceCaseNumber,
policeCaseNumber,
subtypes,
defendants,
prosecutor,
Expand Down
31 changes: 23 additions & 8 deletions apps/judicial-system/web/src/routes/Shared/Cases/PrisonCases.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { useIntl } from 'react-intl'
import partition from 'lodash/partition'

import { AlertMessage, Box, Tag, Text } from '@island.is/island-ui/core'
import { capitalize } from '@island.is/judicial-system/formatters'
import {
capitalize,
districtCourtAbbreviation,
} from '@island.is/judicial-system/formatters'
import {
core,
errors,
Expand Down Expand Up @@ -166,6 +169,10 @@ export const PrisonCases: FC = () => {
thead={[
{
title: formatMessage(tables.caseNumber),
sortable: {
isSortable: true,
key: 'courtCaseNumber',
},
},
{
title: capitalize(formatMessage(core.defendant, { suffix: 'i' })),
Expand All @@ -182,13 +189,21 @@ export const PrisonCases: FC = () => {
data={cases}
columns={[
{
cell: (row) => (
<CourtCaseNumber
courtCaseNumber={row.courtCaseNumber ?? ''}
policeCaseNumbers={row.policeCaseNumbers ?? []}
appealCaseNumber={row.appealCaseNumber ?? ''}
/>
),
cell: (row) => {
const courtAbbreviation = districtCourtAbbreviation(
row.court?.name,
)

return (
<CourtCaseNumber
courtCaseNumber={`${
courtAbbreviation ? `${courtAbbreviation}: ` : ''
}${row.courtCaseNumber ?? ''}`}
policeCaseNumbers={row.policeCaseNumbers ?? []}
appealCaseNumber={row.appealCaseNumber ?? ''}
/>
)
},
},
{
cell: (row) => <DefendantInfo defendants={row.defendants} />,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ query PrisonCases {
role
active
}
court {
id
name
}
prosecutor {
id
created
Expand Down
70 changes: 68 additions & 2 deletions apps/native/app/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,73 @@ PODS:
- React-Core
- RNQuickAction (0.3.13):
- React
- RNReanimated (3.12.1):
- RNReanimated (3.16.5):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Codegen
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNReanimated/reanimated (= 3.16.5)
- RNReanimated/worklets (= 3.16.5)
- Yoga
- RNReanimated/reanimated (3.16.5):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Codegen
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- RNReanimated/reanimated/apple (= 3.16.5)
- Yoga
- RNReanimated/reanimated/apple (3.16.5):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Codegen
- React-Core
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNReanimated/worklets (3.16.5):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -2030,7 +2096,7 @@ SPEC CHECKSUMS:
RNInAppBrowser: e36d6935517101ccba0e875bac8ad7b0cb655364
RNKeychain: ff836453cba46938e0e9e4c22e43d43fa2c90333
RNQuickAction: 6d404a869dc872cde841ad3147416a670d13fa93
RNReanimated: d093daf3973a7ee9f77c10a9337e10390b2969e2
RNReanimated: 73acffa7201bc9caee34b6f26878342cc9d8ab47
RNShare: 0fad69ae2d71de9d1f7b9a43acf876886a6cb99c
RNSVG: 43b64ed39c14ce830d840903774154ca0c1f27ec
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
Expand Down
5 changes: 4 additions & 1 deletion apps/native/app/src/screens/passkey/passkey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ export const PasskeyScreen: NavigationFunctionComponent<{
<TouchableOpacity
style={{ flexWrap: 'wrap' }}
onPress={() =>
openBrowser('https://island.is/adgangslyklar', componentId)
openBrowser(
'https://island.is/innskraning-umbod-og-adgangsstyring-a-island-is#innskraning-med-adgangslykli-i-island-is-appinu',
componentId,
)
}
>
<LinkText>
Expand Down
172 changes: 170 additions & 2 deletions apps/web/components/ServiceWeb/Forms/StandardForm/StandardForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ import {
Stack,
Text,
} from '@island.is/island-ui/core'
import { InputController } from '@island.is/shared/form-fields'
import {
CheckboxController,
InputController,
} from '@island.is/shared/form-fields'
import { sortAlpha } from '@island.is/shared/utils'
import {
ContentLanguage,
Expand All @@ -42,6 +45,7 @@ import { GET_SUPPORT_SEARCH_RESULTS_QUERY } from '@island.is/web/screens/queries
import {
FiskistofaCategories,
SjukratryggingarCategories,
VinnueftirlitidCategories,
} from '@island.is/web/screens/ServiceWeb/Forms/utils'
import { getServiceWebSearchTagQuery } from '@island.is/web/screens/ServiceWeb/utils'

Expand Down Expand Up @@ -93,6 +97,14 @@ const labels: Record<string, string> = {
malsnumer_ef_til_stadar: 'Málsnúmer (ef til staðar)',
faedingardagur_eda_kennitala_malsadila: 'Fæðingardagur/Kennitala málsaðila',
skipaskrarnumer: 'Skipaskrárnúmer',
vinnuvelanumer_kaupanda: 'Vinnuvélanúmer kaupanda',
vinnuvelanumer_seljanda: 'Vinnuvélanúmer seljanda',
vinnuvelanumer_vegna_skodunar: 'Vinnuvélanúmer vegna skoðunar',
stadsetning_taekis: 'Staðsetning tækis',
stadsetning_verkstadar: 'Staðsetning verkstaðar',
nafn_fyrirtaekis: 'Nafn fyrirtækis',
starfsstod: 'Starfsstöð',
oska_eftir_vernd_uppljostrara: 'Óska eftir vernd uppljóstrara',
}

// these should be skipped in the message itself
Expand Down Expand Up @@ -154,6 +166,35 @@ const BasicInput = ({
)
}

interface BasicCheckboxProps {
name: keyof typeof labels
label: string
}

const BasicCheckbox = ({ name, label }: BasicCheckboxProps) => {
const {
formState: { errors },
register,
} = useFormContext()

return (
<CheckboxController
id={name}
name={name}
error={errors?.[name]?.message as string}
options={[
{
label,
value: 'Já', // This value only gets sent in an email so it can be in only one locale
},
]}
// The docs tell us to spread the response of the register function even though it's return type is void
// https://react-hook-form.com/api/useformcontext/
{...(register(name) as unknown as object)}
/>
)
}

const MIN_SEARCH_QUERY_LENGTH = 1

export const StandardForm = ({
Expand Down Expand Up @@ -482,6 +523,129 @@ export const StandardForm = ({
</GridColumn>
)
break
case VinnueftirlitidCategories.NAMSKEID:
case VinnueftirlitidCategories.VINNUSLYS:
case VinnueftirlitidCategories.VINNUVELARETTINDI:
case VinnueftirlitidCategories.VINNUVERND:
case VinnueftirlitidCategories.MARKADSEFTIRLIT:
case VinnueftirlitidCategories.EKKO_OG_SAMSKIPTI:
case VinnueftirlitidCategories.LOG_OG_REGLUGERDIR:
case VinnueftirlitidCategories.LEYFI_OG_UMSAGNIR:
case VinnueftirlitidCategories.ONNUR_THJONUSTA:
fields = (
<GridColumn paddingBottom={3}>
<BasicCheckbox
name="oska_eftir_vernd_uppljostrara"
label={fn(
'oska_eftir_vernd_uppljostrara',
'label',
'Óska eftir vernd uppljóstrara',
)}
/>
</GridColumn>
)
break
case VinnueftirlitidCategories.SKRANING_OG_SKODUN_VINNUVELA:
fields = (
<>
<GridColumn paddingBottom={3}>
<BasicCheckbox
name="oska_eftir_vernd_uppljostrara"
label={fn(
'oska_eftir_vernd_uppljostrara',
'label',
'Óska eftir vernd uppljóstrara',
)}
/>
</GridColumn>
<GridColumn span="12/12" paddingBottom={3}>
<BasicInput
name="vinnuvelanumer_kaupanda"
label={fn(
'vinnuvelanumer_kaupanda',
'label',
'Vinnuvélanúmer kaupanda',
)}
/>
</GridColumn>
<GridColumn span="12/12" paddingBottom={3}>
<BasicInput
name="vinnuvelanumer_seljanda"
label={fn(
'vinnuvelanumer_seljanda',
'label',
'Vinnuvélanúmer seljanda',
)}
/>
</GridColumn>
<GridColumn span="12/12" paddingBottom={3}>
<BasicInput
name="vinnuvelanumer_vegna_skodunar"
label={fn(
'vinnuvelanumer_vegna_skodunar',
'label',
'Vinnuvélanúmer vegna skoðunar',
)}
/>
</GridColumn>
<GridColumn span="12/12" paddingBottom={3}>
<BasicInput
name="stadsetning_taekis"
label={fn('stadsetning_taekis', 'label', 'Staðsetning tækis')}
/>
</GridColumn>
</>
)
break
case VinnueftirlitidCategories.MANNVIRKJAGERD:
fields = (
<>
<GridColumn paddingBottom={3}>
<BasicCheckbox
name="oska_eftir_vernd_uppljostrara"
label={fn(
'oska_eftir_vernd_uppljostrara',
'label',
'Óska eftir vernd uppljóstrara',
)}
/>
</GridColumn>
<GridColumn span="12/12" paddingBottom={3}>
<BasicInput
name="stadsetning_verkstadar"
label={fn(
'stadsetning_verkstadar',
'label',
'Staðsetning verkstaðar',
)}
/>
</GridColumn>
</>
)
break
case VinnueftirlitidCategories.VINNUADSTADA:
fields = (
<>
<GridColumn paddingBottom={3}>
<BasicInput
name="nafn_fyrirtaekis"
requiredMessage={fn(
'nafn_fyrirtaekis',
'requiredMessage',
'Nafn fyrirtækis vantar',
)}
label={fn('nafn_fyrirtaekis', 'label', 'Nafn fyrirtækis')}
/>
</GridColumn>
<GridColumn span="12/12" paddingBottom={3}>
<BasicInput
name="starfsstod"
label={fn('starfsstod', 'label', 'Starfsstöð')}
/>
</GridColumn>
</>
)
break
default:
break
}
Expand Down Expand Up @@ -571,7 +735,11 @@ export const StandardForm = ({
const label = labels[k]
const value = values[k]

if (label && value) {
if (
label &&
((Array.isArray(value) && value.length > 0) ||
(!Array.isArray(value) && Boolean(value)))
) {
message += `${label}:\n${value}\n\n`
}

Expand Down
Loading

0 comments on commit 855f0ae

Please sign in to comment.