-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(j-s): Create police case files screen (#8600)
* Create police case files screen * Basic page setup * feat(j-s): rewrite useS3Upload hook * feat(j-s): use new upload hook for each loke number * feat(j-s): add retry and remove for useS3UploadV2 * feat(j-s): add error handling for upload Co-authored-by: Ívar Oddsson <[email protected]> * feat(j-s): memorize police file upload list To avoid maximum depth rendering * feat(j-s): move string to contentful * docs(j-s): add to more explaination to comment * refactor(j-s): change PageTitle to accept children * fix(j-s): fix missing defaultMessage for contentful string * fix(j-s): fix retry uploading file Adding `id` from the beginning to file to be able to refrence it when retrying. Setting precent and state to uploading for better user experince when retrying a failed upload. * feat(j-s): handle errors when delete file failes * test(j-s): fix e2e test for indictments prosecutor flow * refactor(j-s): move setting file upload state out of uploadToS3 Co-authored-by: Arnar Kári <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
1 parent
0dc1d6d
commit c66e9b6
Showing
27 changed files
with
581 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
apps/judicial-system/web-e2e/src/integration/Prosecutor/Indictments/policeCaseFiles.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { | ||
INDICTMENTS_POLICE_CASE_FILES_ROUTE, | ||
INDICTMENTS_OVERVIEW_ROUTE, | ||
} from '@island.is/judicial-system/consts' | ||
import { CaseType, UserRole } from '@island.is/judicial-system/types' | ||
|
||
import { makeCourt, mockCase, makeProsecutor, intercept } from '../../../utils' | ||
|
||
describe(`${INDICTMENTS_POLICE_CASE_FILES_ROUTE}/:id`, () => { | ||
beforeEach(() => { | ||
const caseData = mockCase(CaseType.MURDER) | ||
const caseDataAddition = { | ||
...caseData, | ||
prosecutor: makeProsecutor(), | ||
court: makeCourt(), | ||
} | ||
|
||
cy.login(UserRole.PROSECUTOR) | ||
cy.stubAPIResponses() | ||
intercept(caseDataAddition) | ||
cy.visit(`${INDICTMENTS_POLICE_CASE_FILES_ROUTE}/test_id`) | ||
}) | ||
|
||
it('should navigate to the correct page on continue', () => { | ||
cy.getByTestid('continueButton').click() | ||
cy.url().should('contain', INDICTMENTS_OVERVIEW_ROUTE) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import Defendant from '@island.is/judicial-system-web/src/routes/Prosecutor/Indictments/Defendant' | ||
import Defendant from '@island.is/judicial-system-web/src/routes/Prosecutor/Indictments/Defendant/Defendant' | ||
|
||
export default Defendant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import PoliceCaseFiles from '@island.is/judicial-system-web/src/routes/Prosecutor/Indictments/PoliceCaseFiles/PoliceCaseFilesRoute' | ||
|
||
export default PoliceCaseFiles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
import Defendant from '@island.is/judicial-system-web/src/routes/Prosecutor/Indictments/Defendant' | ||
import Defendant from '@island.is/judicial-system-web/src/routes/Prosecutor/Indictments/Defendant/Defendant' | ||
export default Defendant |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...tem/web/src/routes/Prosecutor/Indictments/PoliceCaseFiles/PoliceCaseFilesRoute.strings.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { defineMessage, defineMessages } from 'react-intl' | ||
|
||
export const policeCaseFiles = { | ||
heading: defineMessage({ | ||
id: 'judicial.system.core:police_case_files_route.heading', | ||
defaultMessage: 'Málsgögn', | ||
description: 'Notaður sem titill á Málsgögn skrefi í ákærum.', | ||
}), | ||
infoBox: defineMessage({ | ||
id: 'judicial.system.core:police_case_files_route.info_box', | ||
defaultMessage: | ||
'Gögn sem er hlaðið upp hér fyrir neðan verða sameinuð í eitt PDF skjal og efnisyfirlit sjálfkrafa búið til.', | ||
description: 'Notaður sem texti í info boxi í Málsgögn skrefi í ákærum.', | ||
}), | ||
policeCaseNumberSectionHeading: defineMessage({ | ||
id: | ||
'judicial.system.core:police_case_files_route.police_case_number_section_heading', | ||
defaultMessage: 'Gögn úr LÖKE-máli {policeCaseNumber}', | ||
description: | ||
'Notaður sem fyrirsögn fyrir hvert Löke númer á Málsgögn skrefi í ákærum.', | ||
}), | ||
inputFileUpload: defineMessages({ | ||
header: { | ||
id: | ||
'judicial.system.core:police_case_files_route.input_file_upload.header', | ||
defaultMessage: 'Dragðu skrár hingað til að hlaða upp', | ||
description: | ||
'Notaður fyrir texta í svæði sem hægt er að draga skrá á til að hlaða þeim upp.', | ||
}, | ||
buttonLabel: { | ||
id: | ||
'judicial.system.core:police_case_files_route.input_file_upload.button_label', | ||
defaultMessage: 'Velja gögn til að hlaða upp', | ||
description: | ||
'Notaður fyrir texta í takka sem hægt er að ýta á til að velja skrár til að hlaða upp.', | ||
}, | ||
}), | ||
} |
Oops, something went wrong.