Skip to content

Commit

Permalink
Merge branch 'main' of github.com:island-is/island.is into j-s/limite…
Browse files Browse the repository at this point in the history
…d-access-files
  • Loading branch information
oddsson committed Sep 5, 2024
2 parents 76a8684 + e0f0050 commit 3a3eb31
Show file tree
Hide file tree
Showing 31 changed files with 510 additions and 309 deletions.
4 changes: 2 additions & 2 deletions apps/application-system/api/infra/application-system-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,12 +221,12 @@ export const serviceSetup = (services: {
),
XROAD_COURT_BANKRUPTCY_CERT_PATH: {
dev: 'IS-DEV/GOV/10019/Domstolasyslan/JusticePortal-v1',
staging: 'IS-DEV/GOV/10019/Domstolasyslan/JusticePortal-v1',
staging: 'IS-TEST/GOV/10019/Domstolasyslan/JusticePortal-v1',
prod: 'IS/GOV/4707171140/Domstolasyslan/JusticePortal-v1',
},
XROAD_ALTHINGI_OMBUDSMAN_SERVICE_PATH: {
dev: 'IS-DEV/GOV/10047/UA-Protected/kvortun-v1/',
staging: 'IS-DEV/GOV/10047/UA-Protected/kvortun-v1/',
staging: 'IS-TEST/GOV/10047/UA-Protected/kvortun-v1/',
prod: 'IS/GOV/5605882089/UA-Protected/kvortun-v1',
},
NOVA_ACCEPT_UNAUTHORIZED: {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
'use strict'

module.exports = {
up: async (queryInterface, Sequelize) => {
await queryInterface.addColumn('institution', 'address', {
type: Sequelize.STRING,
allowNull: true,
})

const institutionsToUpdate = [
{
name: 'Héraðsdómur Reykjavíkur',
address: 'Dómhúsið við Lækjartorg, Reykjavík',
},
{ name: 'Héraðsdómur Reykjaness', address: 'Fjarðargata 9, Hafnarfirði' },
{
name: 'Héraðsdómur Vesturlands',
address: 'Bjarnarbraut 8, Borgarnesi',
},
{ name: 'Héraðsdómur Vestfjarða', address: 'Hafnarstræti 9, Ísafirði' },
{
name: 'Héraðsdómur Norðurlands vestra',
address: 'Skagfirðingabraut 21, Sauðárkróki',
},
{
name: 'Héraðsdómur Norðurlands eystra',
address: 'Hafnarstræti 107, 4. hæð, Akureyri',
},
{ name: 'Héraðsdómur Austurlands', address: 'Lyngás 15, Egilsstöðum' },
{ name: 'Héraðsdómur Suðurlands', address: 'Austurvegur 4, Selfossi' },
]

await queryInterface.sequelize.transaction(async (transaction) => {
for (const institution of institutionsToUpdate) {
await queryInterface.bulkUpdate(
'institution',
{ address: institution.address },
{ name: institution.name },
{ transaction },
)
}
})
},

down: async (queryInterface) => {
await queryInterface.removeColumn('institution', 'address')
},
}
24 changes: 1 addition & 23 deletions apps/judicial-system/backend/src/app/formatters/subpoenaPdf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,28 +22,6 @@ import {
setTitle,
} from './pdfHelpers'

type DistrictCourts =
| 'Héraðsdómur Reykjavíkur'
| 'Héraðsdómur Reykjaness'
| 'Héraðsdómur Vesturlands'
| 'Héraðsdómur Vestfjarða'
| 'Héraðsdómur Norðurlands vestra'
| 'Héraðsdómur Norðurlands eystra'
| 'Héraðsdómur Austurlands'
| 'Héraðsdómur Suðurlands'

// TODO: Move to databas
const DistrictCourtLocation: Record<DistrictCourts, string> = {
'Héraðsdómur Reykjavíkur': 'Dómhúsið við Lækjartorg, Reykjavík',
'Héraðsdómur Reykjaness': 'Fjarðargata 9, Hafnarfirði',
'Héraðsdómur Vesturlands': 'Bjarnarbraut 8, Borgarnesi',
'Héraðsdómur Vestfjarða': 'Hafnarstræti 9, Ísafirði',
'Héraðsdómur Norðurlands vestra': 'Skagfirðingabraut 21, Sauðárkróki',
'Héraðsdómur Norðurlands eystra': 'Hafnarstræti 107, 4. hæð, Akureyri',
'Héraðsdómur Austurlands': 'Lyngás 15, Egilsstöðum',
'Héraðsdómur Suðurlands': 'Austurvegur 4, Selfossi',
}

export const createSubpoena = (
theCase: Case,
defendant: Defendant,
Expand Down Expand Up @@ -86,7 +64,7 @@ export const createSubpoena = (
if (theCase.court?.name) {
addNormalText(
doc,
DistrictCourtLocation[theCase.court.name as DistrictCourts],
theCase.court.address || 'Ekki skráð', // the latter shouldn't happen, if it does we have an problem with the court data
'Times-Roman',
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,8 @@ export class Institution extends Model {
@Column({ type: DataType.STRING, allowNull: true })
@ApiPropertyOptional({ type: String })
nationalId?: string

@Column({ type: DataType.STRING, allowNull: true })
@ApiPropertyOptional({ type: String })
address?: string
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ class IndictmentCaseData {
@ApiProperty({ type: String })
caseNumber!: string

@ApiProperty({ type: Boolean })
acknowledged?: boolean

@ApiProperty({ type: [Groups] })
groups!: Groups[]
}
Expand All @@ -37,6 +40,7 @@ export class CaseResponse {
caseId: res.id,
data: {
caseNumber: `${t.caseNumber} ${res.courtCaseNumber}`,
acknowledged: false, // TODO: Connect to real data
groups: [
{
label: t.defendant,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class SubpoenaData {
@ApiProperty({ type: () => String })
title!: string

@ApiProperty({ type: Boolean })
acknowledged?: boolean

@ApiProperty({ type: () => [Groups] })
groups!: Groups[]
}
Expand Down Expand Up @@ -60,12 +63,13 @@ export class SubpoenaResponse {
(dateLog) => dateLog.dateType === DateType.ARRAIGNMENT_DATE,
)
const arraignmentDate = subpoenaDateLog?.date ?? ''
const subpoenaCreatedDate = subpoenaDateLog?.created ?? ''
const subpoenaCreatedDate = subpoenaDateLog?.created ?? '' //TODO: Change to subpoena created in RLS

return {
caseId: internalCase.id,
data: {
title: t.subpoena,
acknowledged: false, // TODO: Connect to real data
groups: [
{
label: `${t.caseNumber} ${internalCase.courtCaseNumber}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,24 @@ const Overview: FC = () => {
const latestDate = workingCase.courtDate ?? workingCase.arraignmentDate

const isIndictmentNew = workingCase.state === CaseState.DRAFT
const isIndictmentWaitingForConfirmation =
workingCase.state === CaseState.WAITING_FOR_CONFIRMATION
const isIndictmentSubmitted = workingCase.state === CaseState.SUBMITTED
const isIndictmentWaitingForCancellation =
workingCase.state === CaseState.WAITING_FOR_CANCELLATION
const isIndictmentReceived = workingCase.state === CaseState.RECEIVED

const userCanSendIndictmentToCourt =
Boolean(user?.canConfirmIndictment) &&
workingCase.state === CaseState.WAITING_FOR_CONFIRMATION
Boolean(user?.canConfirmIndictment) && isIndictmentWaitingForConfirmation
const userCanCancelIndictment =
(workingCase.state === CaseState.SUBMITTED ||
workingCase.state === CaseState.RECEIVED) &&
(isIndictmentSubmitted || isIndictmentReceived) &&
!workingCase.indictmentDecision
const userCanAddDocuments =
isIndictmentSubmitted ||
(isIndictmentReceived &&
workingCase.indictmentDecision !==
IndictmentDecision.POSTPONING_UNTIL_VERDICT &&
workingCase.indictmentDecision !== IndictmentDecision.COMPLETING)

const handleTransition = async (transitionType: CaseTransition) => {
const caseTransitioned = await transitionCase(
Expand Down Expand Up @@ -215,8 +221,7 @@ const Overview: FC = () => {
>
<IndictmentCaseFilesList workingCase={workingCase} />
</Box>
{workingCase.indictmentDecision !==
IndictmentDecision.POSTPONING_UNTIL_VERDICT ? (
{userCanAddDocuments && (
<Box
display="flex"
justifyContent="flexEnd"
Expand All @@ -234,7 +239,7 @@ const Overview: FC = () => {
{formatMessage(strings.addDocumentsButtonText)}
</Button>
</Box>
) : null}
)}
{userCanSendIndictmentToCourt && (
<Box marginBottom={10}>
<SectionHeading
Expand Down
1 change: 1 addition & 0 deletions apps/services/regulations-admin-backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ bootstrap({
appModule: AppModule,
name: 'regulations-admin-backend',
openApi,
jsonBodyLimit: '300kb',
})
2 changes: 1 addition & 1 deletion charts/identity-server/values.staging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ services-auth-ids-api:
LOG_LEVEL: 'info'
NATIONAL_REGISTRY_B2C_CLIENT_ID: '6cf94113-d326-4e4d-b97c-1fea12d2f5e1'
NATIONAL_REGISTRY_B2C_ENDPOINT: 'https://skraidentitydev.b2clogin.com/skraidentitydev.onmicrosoft.com/b2c_1_midlun_flow/oauth2/v2.0/token'
NATIONAL_REGISTRY_B2C_PATH: 'IS-DEV/GOV/10001/SKRA-Cloud-Protected/Midlun-v1'
NATIONAL_REGISTRY_B2C_PATH: 'IS-TEST/GOV/10001/SKRA-Cloud-Protected/Midlun-v1'
NATIONAL_REGISTRY_B2C_SCOPE: 'https://skraidentitydev.onmicrosoft.com/midlun/.default'
NODE_OPTIONS: '--max-old-space-size=691 -r dd-trace/init'
NOVA_ACCEPT_UNAUTHORIZED: 'false'
Expand Down
Loading

0 comments on commit 3a3eb31

Please sign in to comment.