Skip to content

Commit

Permalink
Merge branch 'main' of github.com:island-is/island.is into j-s/comple…
Browse files Browse the repository at this point in the history
…ted-case-notifications
  • Loading branch information
oddsson committed May 21, 2024
2 parents e4591ce + 9a95a96 commit 687f7f0
Show file tree
Hide file tree
Showing 176 changed files with 3,230 additions and 1,824 deletions.
2 changes: 2 additions & 0 deletions apps/auth-admin-web/entities/dtos/base/client-base.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export abstract class ClientBaseDTO {
this.supportsProcuringHolders = false
this.supportsPersonalRepresentatives = false
this.requireApiScopes = false
this.supportedDelegationTypes = []
}

nationalId: string
Expand Down Expand Up @@ -93,4 +94,5 @@ export abstract class ClientBaseDTO {
promptDelegations!: boolean
requireApiScopes!: boolean
domainName?: string
supportedDelegationTypes: string[]
}
1 change: 1 addition & 0 deletions apps/auth-admin-web/entities/models/client.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export class Client {
requireClientSecret!: boolean
archived!: Date
contactEmail!: string
supportedDelegationTypes!: string[]
supportsCustomDelegation!: boolean
supportsLegalGuardians!: boolean
supportsPersonalRepresentatives!: boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Allow } from 'class-validator'

import { Field, InputType } from '@nestjs/graphql'
import type { Aid } from '@island.is/financial-aid/shared/lib'
import type { Aid, ChildrenAid } from '@island.is/financial-aid/shared/lib'
import { AidInput } from '../../aid'

@InputType()
Expand Down Expand Up @@ -42,6 +42,10 @@ export class UpdateMunicipalityInput {
@Field({ nullable: true })
readonly navPassword?: string

@Allow()
@Field(() => String, { nullable: true })
readonly childrenAid?: ChildrenAid

@Allow()
@Field()
readonly municipalityId!: string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Field, ObjectType, ID } from '@nestjs/graphql'

import { Municipality } from '@island.is/financial-aid/shared/lib'
import { ChildrenAid, Municipality } from '@island.is/financial-aid/shared/lib'

import { AidModel } from '../../aid'
import { StaffModel } from '../../staff/models'
Expand Down Expand Up @@ -54,4 +54,7 @@ export class MunicipalityModel implements Municipality {

@Field({ nullable: true })
readonly navPassword?: string

@Field(() => String)
readonly childrenAid!: ChildrenAid
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict'

module.exports = {
up: (queryInterface, Sequelize) => {
return queryInterface.sequelize.transaction((t) =>
Promise.all([
queryInterface.addColumn(
'municipality',
'children_aid',
{
type: Sequelize.ENUM('NotDefined', 'Institution', 'Applicant'),
allowNull: false,
defaultValue: 'NotDefined',
},
{ transaction: t },
),
]),
)
},

down: (queryInterface, Sequelize) => {
return queryInterface.sequelize.transaction((t) =>
Promise.all([
queryInterface.removeColumn('municipality', 'children_aid', {
transaction: t,
}),
]),
)
},
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IsBoolean, IsObject, IsOptional, IsString } from 'class-validator'

import { ApiProperty } from '@nestjs/swagger'
import type { Aid } from '@island.is/financial-aid/shared/lib'
import type { Aid, ChildrenAid } from '@island.is/financial-aid/shared/lib'

export class UpdateMunicipalityDto {
@IsOptional()
Expand Down Expand Up @@ -49,6 +49,11 @@ export class UpdateMunicipalityDto {
@ApiProperty()
navPassword?: string

@IsOptional()
@IsString()
@ApiProperty()
childrenAid?: ChildrenAid

@IsString()
@ApiProperty()
readonly municipalityId: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {

import { ApiProperty } from '@nestjs/swagger'

import { Municipality } from '@island.is/financial-aid/shared/lib'
import { ChildrenAid, Municipality } from '@island.is/financial-aid/shared/lib'

import { AidModel } from '../../aid/models'
@Table({
Expand Down Expand Up @@ -132,4 +132,12 @@ export class MunicipalityModel extends Model<Municipality> {
})
@ApiProperty()
navPassword?: string

@Column({
type: DataType.ENUM,
allowNull: false,
values: Object.values(ChildrenAid),
})
@ApiProperty({ enum: ChildrenAid })
childrenAid: ChildrenAid
}
1 change: 1 addition & 0 deletions apps/financial-aid/web-veita/graphql/sharedGql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ export const UpdateMunicipalityMutation = gql`
navUrl
navUsername
navPassword
childrenAid
individualAid {
ownPlace
registeredRenting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import {
Button,
ToastContainer,
Checkbox,
RadioButton,
} from '@island.is/island-ui/core'

import {
Aid,
AidName,
ApiKeysForMunicipality,
ChildrenAid,
Municipality,
scrollToId,
} from '@island.is/financial-aid/shared/lib'
Expand Down Expand Up @@ -379,6 +381,50 @@ const MunicipalityAdminSettings = ({ currentMunicipality }: Props) => {
)
})}

<Box marginBottom={[2, 2, 7]} id="childrenAid" className={`contentUp`}>
<Text as="h3" variant="h3" marginBottom={[2, 2, 3]} color="dark300">
Börn
</Text>
<Box
display="flex"
alignItems="center"
width="full"
columnGap={3}
rowGap={3}
flexWrap={'wrap'}
>
<Box flexGrow={1}>
<RadioButton
name="children-aid-institution"
label="Styrkur greiddur til stofnunar"
value={ChildrenAid.INSTITUTION}
checked={state.childrenAid === ChildrenAid.INSTITUTION}
onChange={() => {
setState({ ...state, childrenAid: ChildrenAid.INSTITUTION })
}}
backgroundColor="blue"
large
/>
</Box>
<Box flexGrow={1}>
<RadioButton
name="children-aid-applicant"
label="Styrkur greiddur til umsækjanda"
value={ChildrenAid.APPLICANT}
checked={state.childrenAid === ChildrenAid.APPLICANT}
onChange={() => {
setState({
...state,
childrenAid: ChildrenAid.APPLICANT,
})
}}
backgroundColor="blue"
large
/>
</Box>
</Box>
</Box>

<Box display="flex" justifyContent="flexEnd">
<Button loading={loading} onClick={submit} icon="checkmark">
Vista stillingar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const useCurrentMunicipalityState = ({ municipality }: Props) => {
: state.navUrl,
navUsername: state.navUsername,
navPassword: state.navPassword,
childrenAid: state.childrenAid,
},
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const MunicipalityQuery = gql`
navUrl
navUsername
navPassword
childrenAid
individualAid {
ownPlace
registeredRenting
Expand Down
18 changes: 16 additions & 2 deletions apps/judicial-system/backend/src/app/messages/notifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -585,13 +585,27 @@ export const notifications = {
description:
'Notaður sem texti í tölvupósti vegna breytingar á lengd gæslu/farbanns/vistunar þar sem ekki var úrskurðað í einangrun.',
},
htmlDefender: {
id: 'judicial.system.backend:notifications.modified.html_defender',
defaultMessage:
'{actorInstitution}, {actorName} {actorTitle}, hefur uppfært lengd {caseType, select, ADMISSION_TO_FACILITY {vistunar} TRAVEL_BAN {farbanns} other {gæsluvarðhalds}} í máli {courtCaseNumber}. <br /><br />{defenderHasAccessToRvg, select, true {Sjá nánar á {linkStart}yfirlitssíðu málsins í Réttarvörslugátt{linkEnd}} other {Þú getur nálgast gögn málsins hjá {courtName} ef þau hafa ekki þegar verið afhent}}.<br /><br />Ný lokadagsetning: {validToDate}.',
description:
'Notaður sem texti í tölvupósti til verjanda vegna breytingar á lengd gæslu/farbanns/vistunar þar sem ekki var úrskurðað í einangrun.',
},
isolationHtml: {
id: 'judicial.system.backend:notifications.modified.isolation_html',
id: 'judicial.system.backend:notifications.modified.isolation_html_v1',
defaultMessage:
'{actorInstitution}, {actorName} {actorTitle}, hefur uppfært lengd {caseType, select, ADMISSION_TO_FACILITY {vistunar} other {gæslu}}/einangrunar í máli {courtCaseNumber}. Sjá {linkStart}yfirlitssíðu málsins í Réttarvörslugátt{linkEnd}.<br /><br />Lok {caseType, select, ADMISSION_TO_FACILITY {vistunar} other {gæslu}}: {validToDate}.<br /><br />Lok einangrunar: {isolationToDate}.',
'{actorInstitution}, {actorName} {actorTitle}, hefur uppfært lengd gæsluvarðhalds/einangrunar í máli {courtCaseNumber}. Sjá nánar á {linkStart}yfirlitssíðu málsins í Réttarvörslugátt{linkEnd}.<br /><br />Lok gæsluvarðhalds: {validToDate}.<br /><br />Lok einangrunar: {isolationToDate}.',
description:
'Notaður sem texti í tölvupósti vegna breytingar á lengd gæslu/einangrunar/vistunar þar sem úrskurðað var í einangrun.',
},
isolationHtmlDefender: {
id: 'judicial.system.backend:notifications.modified.isolation_html_defender',
defaultMessage:
'{actorInstitution}, {actorName} {actorTitle}, hefur uppfært lengd gæsluvarðhalds/einangrunar í máli {courtCaseNumber}. {defenderHasAccessToRvg, select, true {Sjá nánar á {linkStart}yfirlitssíðu málsins í Réttarvörslugátt{linkEnd}} other {Þú getur nálgast gögn málsins hjá {courtName} ef þau hafa ekki þegar verið afhent}}.<br /><br />Lok gæsluvarðhalds: {validToDate}.<br /><br />Lok einangrunar: {isolationToDate}.',
description:
'Notaður sem texti í tölvupósti til verjanda vegna breytingar á lengd gæslu/einangrunar/vistunar þar sem úrskurðað var í einangrun.',
},
}),
defenderAssignedEmail: defineMessages({
subject: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,45 +21,45 @@ import {

export class CreateCaseDto {
@IsNotEmpty()
@IsString()
@IsEnum(CaseType)
@ApiProperty({ enum: CaseType })
readonly type!: CaseType

@IsOptional()
@IsObject()
@ApiPropertyOptional()
@ApiPropertyOptional({ type: Object })
readonly indictmentSubtypes?: IndictmentSubtypeMap

@IsOptional()
@IsString()
@ApiPropertyOptional()
@ApiPropertyOptional({ type: String })
readonly description?: string

@IsNotEmpty()
@IsArray()
@ArrayMinSize(1)
@IsString({ each: true })
@ApiProperty()
@ApiProperty({ type: String, isArray: true })
readonly policeCaseNumbers!: string[]

@IsOptional()
@IsString()
@ApiPropertyOptional()
@ApiPropertyOptional({ type: String })
readonly defenderName?: string

@IsOptional()
@IsString()
@ApiPropertyOptional()
@ApiPropertyOptional({ type: String })
readonly defenderNationalId?: string

@IsOptional()
@IsString()
@ApiPropertyOptional()
@ApiPropertyOptional({ type: String })
readonly defenderEmail?: string

@IsOptional()
@IsString()
@ApiPropertyOptional()
@ApiPropertyOptional({ type: String })
readonly defenderPhoneNumber?: string

@IsOptional()
Expand All @@ -69,11 +69,11 @@ export class CreateCaseDto {

@IsOptional()
@IsString()
@ApiPropertyOptional()
@ApiPropertyOptional({ type: String })
readonly leadInvestigator?: string

@IsOptional()
@IsObject()
@ApiPropertyOptional()
@ApiPropertyOptional({ type: Object })
readonly crimeScenes?: CrimeSceneMap
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
ArrayMinSize,
IsArray,
IsBoolean,
IsEnum,
IsNotEmpty,
IsOptional,
IsString,
Expand All @@ -13,54 +14,54 @@ import { CaseType, Gender } from '@island.is/judicial-system/types'

export class InternalCreateCaseDto {
@IsNotEmpty()
@IsString()
@IsEnum(CaseType)
@ApiProperty({ enum: CaseType })
readonly type!: CaseType

@IsNotEmpty()
@IsArray()
@ArrayMinSize(1)
@IsString({ each: true })
@ApiProperty()
@ApiProperty({ type: String, isArray: true })
readonly policeCaseNumbers!: string[]

@IsOptional()
@IsNotEmpty()
@IsString()
@ApiProperty()
@ApiProperty({ type: String })
readonly prosecutorNationalId!: string

@IsNotEmpty()
@IsString()
@ApiProperty()
@ApiProperty({ type: String })
readonly accusedNationalId!: string

@IsOptional()
@IsString()
@ApiPropertyOptional()
@ApiPropertyOptional({ type: String })
readonly accusedName?: string

@IsOptional()
@IsString()
@IsEnum(Gender)
@ApiPropertyOptional({ enum: Gender })
readonly accusedGender?: Gender

@IsOptional()
@IsString()
@ApiPropertyOptional()
@ApiPropertyOptional({ type: String })
readonly accusedAddress?: string

@IsOptional()
@IsString()
@ApiPropertyOptional()
@ApiPropertyOptional({ type: String })
readonly citizenship?: string

@IsOptional()
@IsString()
@ApiPropertyOptional()
@ApiPropertyOptional({ type: String })
readonly leadInvestigator?: string

@IsOptional()
@IsBoolean()
@ApiPropertyOptional()
@ApiPropertyOptional({ type: Boolean })
readonly isHeightenedSecurityLevel?: boolean
}
Loading

0 comments on commit 687f7f0

Please sign in to comment.