Skip to content

Commit

Permalink
Merge branch 'main' into j-s/signed-court-record-police
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Dec 13, 2024
2 parents b9f7579 + 28c639f commit 50676a9
Show file tree
Hide file tree
Showing 177 changed files with 3,219 additions and 1,868 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 @@ -613,6 +613,7 @@ export class InternalCaseService {
? {
name: theCase.prosecutor.name,
nationalId: theCase.prosecutor.nationalId,
email: theCase.prosecutor.email,
}
: undefined,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ describe('InternalCaseController - Deliver indictment info to court', () => {
{ eventType: EventType.INDICTMENT_CONFIRMED, created: indictmentDate },
],
defendants: [{ name: 'Test Ákærði', nationalId: '1234567890' }],
prosecutor: { name: 'Test Sækjandi', nationalId: '0101010101' },
prosecutor: {
name: 'Test Sækjandi',
nationalId: '0101010101',
email: '[email protected]',
},
} as Case

let mockCourtService: CourtService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,9 @@ export class CourtService {
)

const isIndictment = isIndictmentCase(type)
const policeCaseNumber = policeCaseNumbers[0]
? policeCaseNumbers[0].replace(/-/g, '')
: ''

return await this.courtClientService.createCase(courtId, {
caseType: isIndictment ? 'S - Ákærumál' : 'R - Rannsóknarmál',
Expand All @@ -344,7 +347,7 @@ export class CourtService {
receivalDate: formatISO(receivalDate, { representation: 'date' }),
basedOn: isIndictment ? 'Sakamál' : 'Rannsóknarhagsmunir',
// TODO: pass in all policeCaseNumbers when CourtService supports it
sourceNumber: policeCaseNumbers[0] ? policeCaseNumbers[0] : '',
sourceNumber: policeCaseNumber,
})
} catch (reason) {
if (reason instanceof ServiceUnavailableException) {
Expand Down Expand Up @@ -569,10 +572,13 @@ export class CourtService {
policeCaseNumber?: string,
subtypes?: string[],
defendants?: { name?: string; nationalId?: string }[],
prosecutor?: { name?: string; nationalId?: string },
prosecutor?: { name?: string; nationalId?: string; email?: string },
): Promise<unknown> {
try {
const subject = `${courtName} - ${courtCaseNumber} - upplýsingar`

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

const content = JSON.stringify({
receivedByCourtDate,
indictmentDate,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('CourtService - Create court case', () => {
status: 'Skráð',
receivalDate: formatISO(receivalDate, { representation: 'date' }),
basedOn: 'Rannsóknarhagsmunir',
sourceNumber: policeCaseNumbers[0],
sourceNumber: policeCaseNumbers[0].replace(/-/g, ''),
},
)
})
Expand Down Expand Up @@ -146,7 +146,7 @@ describe('CourtService - Create court case', () => {
status: 'Skráð',
receivalDate: formatISO(receivalDate, { representation: 'date' }),
basedOn: 'Sakamál',
sourceNumber: policeCaseNumbers[0],
sourceNumber: policeCaseNumbers[0].replace(/-/g, ''),
},
)
})
Expand Down Expand Up @@ -183,7 +183,7 @@ describe('CourtService - Create court case', () => {
status: 'Skráð',
receivalDate: formatISO(receivalDate, { representation: 'date' }),
basedOn: 'Rannsóknarhagsmunir',
sourceNumber: policeCaseNumbers[0],
sourceNumber: policeCaseNumbers[0].replace(/-/g, ''),
})
})
})
Expand Down Expand Up @@ -218,7 +218,7 @@ describe('CourtService - Create court case', () => {
status: 'Skráð',
receivalDate: formatISO(receivalDate, { representation: 'date' }),
basedOn: 'Rannsóknarhagsmunir',
sourceNumber: policeCaseNumbers[0],
sourceNumber: policeCaseNumbers[0].replace(/-/g, ''),
})
})
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ const strings = defineMessages({
description:
'Notaður sem texti í valmöguleika fyrir það þegar ekki skal birta dómdfellda dóminn.',
},
serviceRequirementNotRequiredTooltip: {
id: 'judicial.system.core:court.indictments.completed.service_requirement_not_required_tooltip',
defaultMessage:
'Ekki þarf að birta dóm þar sem sektarfjárhæð er lægri en sem nemur áfrýjunarfjárhæð í einkamáli kr. 1.355.762. Gildir frá 01.01.2024',
description:
'Notað sem tooltip í valmöguleika fyrir það þegar ekki skal birta dómdfellda dóminn.',
},
serviceRequirementNotApplicable: {
id: 'judicial.system.core:court.indictments.completed.service_requirement_not_applicable',
defaultMessage: 'Dómfelldi var viðstaddur dómsuppkvaðningu',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ const Completed: FC = () => {
large
backgroundColor="white"
label={formatMessage(strings.serviceRequirementNotRequired)}
tooltip={formatMessage(
strings.serviceRequirementNotRequiredTooltip,
)}
/>
</BlueBox>
</Box>
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
6 changes: 3 additions & 3 deletions apps/native/app/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ react {
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")
reactNativeDir = file("../../../../../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
// codegenDir = file("../node_modules/@react-native/codegen")
codegenDir = file("../../../../../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")
cliFile = file("../../../../../node_modules/react-native/cli.js")

/* Variants */
// The list of variants to that are debuggable. For those we're going to
Expand Down
4 changes: 2 additions & 2 deletions apps/native/app/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ allprojects {
repositories {
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
url("$rootDir/../../../../../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
url("$rootDir/../../../../../node_modules/jsc-android/dist")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
Expand Down
5 changes: 1 addition & 4 deletions apps/native/app/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@ applyNativeModulesSettingsGradle(settings)
include ':app', ':react-native-code-push'
project(':react-native-code-push').projectDir = new File(rootProject.projectDir, '../../../../node_modules/react-native-code-push/android/app')

include ':react-native-clipboard'
project(':react-native-clipboard').projectDir = new File(rootProject.projectDir, '../../node_modules/@react-native-clipboard/clipboard/android')

include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
includeBuild('../../../../node_modules/@react-native/gradle-plugin')

apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
useExpoModules()
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
2 changes: 1 addition & 1 deletion apps/native/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"react-native-pdf": "6.7.5",
"react-native-quick-actions": "0.3.13",
"react-native-quick-base64": "2.1.2",
"react-native-reanimated": "3.12.1",
"react-native-reanimated": "3.16.5",
"react-native-share": "10.2.1",
"react-native-spotlight-search": "2.0.0",
"react-native-svg": "15.2.0",
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
5 changes: 5 additions & 0 deletions apps/services/auth/ids-api/infra/ids-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,11 @@ export const serviceSetup = (): ServiceBuilder<'services-auth-ids-api'> => {
staging: 'digitaliceland',
dev: 'digitaliceland',
},
ALSO_USE_FAKE_USER_API: {
dev: 'true',
staging: 'false',
prod: 'false',
},
})
.secrets({
ZENDESK_CONTACT_FORM_EMAIL: '/k8s/api/ZENDESK_CONTACT_FORM_EMAIL',
Expand Down
2 changes: 1 addition & 1 deletion apps/services/auth/ids-api/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { NationalRegistryV3ClientConfig } from '@island.is/clients/national-regi
import { CompanyRegistryConfig } from '@island.is/clients/rsk/company-registry'
import { SyslumennClientConfig } from '@island.is/clients/syslumenn'
import { UserProfileClientConfig } from '@island.is/clients/user-profile'
import { ZendeskServiceConfig } from '@island.is/clients/zendesk'
import { AuditModule } from '@island.is/nest/audit'
import {
ConfigModule,
Expand All @@ -35,7 +36,6 @@ import { ResourcesModule } from './resources/resources.module'
import { TranslationModule } from './translation/translation.module'
import { UserProfileModule } from './user-profile/user-profile.module'
import { UsersModule } from './users/users.module'
import { ZendeskServiceConfig } from '@island.is/clients/zendesk'

@Module({
imports: [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Inject, Injectable } from '@nestjs/common'
import { Inject, Injectable, Optional } from '@nestjs/common'
import { ConfigService } from '@nestjs/config'

import { AuthMiddleware } from '@island.is/auth-nest-tools'
import { FetchError } from '@island.is/clients/middlewares'
Expand Down Expand Up @@ -30,6 +31,7 @@ type CountryFormatter = { of: (countryCode: string) => string }

@Injectable()
export class UserProfileService {
alsoUseFakeApi: boolean
// REMOVE these ignores after upgrading to TypeScript 4.5
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
Expand All @@ -45,7 +47,12 @@ export class UserProfileService {
private companyRegistryApi: CompanyRegistryClientService,
@Inject(LOGGER_PROVIDER)
private logger: Logger,
) {}
@Optional()
readonly configService?: ConfigService,
) {
this.alsoUseFakeApi =
configService?.get<boolean>('ALSO_USE_FAKE_USER_API') ?? false
}

userProfileApiWithAuth(auth: Auth) {
return this.userProfileApi.withMiddleware(new AuthMiddleware(auth))
Expand Down Expand Up @@ -123,6 +130,7 @@ export class UserProfileService {
const individual = await this.nationalRegistryV3.getAllDataIndividual(
auth.nationalId,
false,
this.alsoUseFakeApi,
)

if (!individual) {
Expand Down
Loading

0 comments on commit 50676a9

Please sign in to comment.