Skip to content

Commit

Permalink
feat(j-s): Enable setting civil claimants (#15996)
Browse files Browse the repository at this point in the history
* Started working on extracting nationalId input to component

* Use InputNationalId in DefendantInfo

* Create name input

* Checkpoint

* Add AddDefender button to Claimant section

* Add defender info

* Refactor

* feat(j-s): Added controller and service for civilclaimant

* Checkpoint

* fix(j-s): Dtos

* feat(j-s): Civil claimant API layer

* Add addClaimant functionality

* fix(j-s): backend usage

* Checkpoint

* Revert framer motion update

* fix(j-s): Remove defendant and rename defender to spokesperson

* Cleanup

* feat(j-s): Connect civil claimant to case

* fix(j-s): Remove required from name

* Remove unused imports

* Layout

* feat(j-s): Add hasCivilClaims

* feat(j-s): Fix boolean

* chore(j-s): Add update civil claimant mutation to resolver

* chore(j-s): Added role guards and write guards to civil claimant controller

* chore(j-s): Added delete civil claimant to resolver

* Save hasCivilClaims choise to server

* Create new civil claimant when needd

* CRUD operations on civil claimant

* Fix lint

* chore: nx format:write update dirty files

* Create and delete civil claimant

* Create and delete civil claimant

* Lookup nationalId with national registry

* Checkpoint

* Autofill name when national id is set

* Prevent double civil claimant creation

* Implement noNationalId

* Remove redunant boolean check

* Checkpoint

* Rename defendantId to clientId in DefenderInput component to make it more generic

* Enable lawyer lookup

* Add ability to share case files with defender

* Reset lawyer when he is deleted

* Remove unused code

* Remove unused code

* Remove unused code

* Remove unused code

* Remove unused code

* Remove unused code

* Remove unused code

* Merge

* Merge

* Refactor DefenderInput

* Clear nationalId when noNationalId is selcted

* Checkpoint

* Clear nationalId

* Refactor DefenderInput

* Fix lint

* Allow clear defender

* Validation

* Remove console.log

* Reset caseFilesSharedWithSpokesperson when advocate is set

* Add tooltip

* Validate name

* Validate

* Fix input name bug

* Remove DefenderInput

* Reorder imports

* Remove commented out code

* Validate

* Fix strings

* Cleanup

* Cleanup

* Cleanup

* Cleanup

* Cleanup

* Use barrel file for import

* Fix typo

---------

Co-authored-by: unakb <[email protected]>
Co-authored-by: andes-it <[email protected]>
  • Loading branch information
3 people authored Sep 25, 2024
1 parent 23d2dbd commit 621b5bb
Show file tree
Hide file tree
Showing 17 changed files with 890 additions and 139 deletions.
18 changes: 18 additions & 0 deletions apps/judicial-system/web/messages/Core/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,36 @@ export const errors = defineMessages({
description:
'Notaður sem villuskilaboð þegar ekki gengur að uppfæra varnaraðila',
},
updateCivilClaimant: {
id: 'judicial.system.core:errors.update_civil_claimant',
defaultMessage: 'Upp kom villa við að uppfæra kröfuhafa',
description:
'Notaður sem villuskilaboð þegar ekki gengur að uppfæra kröfuhafa',
},
createDefendant: {
id: 'judicial.system.core:errors.create_defendant',
defaultMessage: 'Upp kom villa við að stofna nýjan varnaraðila',
description:
'Notaður sem villuskilaboð þegar ekki gengur að stofna varnaraðila',
},
createCivilClaimant: {
id: 'judicial.system.core:errors.create_civil_claimant',
defaultMessage: 'Upp kom villa við að stofna nýjan kröfuhafa',
description:
'Notaður sem villuskilaboð þegar ekki gengur að stofna kröfuhafa',
},
deleteDefendant: {
id: 'judicial.system.core:errors.delete_defendant',
defaultMessage: 'Upp kom villa við að eyða varnaraðila',
description:
'Notaður sem villuskilaboð þegar ekki gengur að eyða varnaraðila',
},
deleteCivilClaimant: {
id: 'judicial.system.core:errors.delete_civil_claimant',
defaultMessage: 'Upp kom villa við að eyða kröfuhafa',
description:
'Notaður sem villuskilaboð þegar ekki gengur að eyða kröfuhafa',
},
createCase: {
id: 'judicial.system.core:errors.create_case',
defaultMessage: 'Upp kom villa við að stofnun máls',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import { TempCase as Case } from '@island.is/judicial-system-web/src/types'
import { useCase } from '../../utils/hooks'
import RequiredStar from '../RequiredStar/RequiredStar'
import { UserContext } from '../UserProvider/UserProvider'
import { BlueBox, SectionHeading } from '..'
import DefenderInput from './DefenderInput'
import { BlueBox, InputAdvocate, SectionHeading } from '..'
import DefenderNotFound from './DefenderNotFound'
import { defenderInfo } from './DefenderInfo.strings'

Expand Down Expand Up @@ -94,7 +93,7 @@ const DefenderInfo: FC<Props> = ({ workingCase, setWorkingCase }) => {
/>
{defenderNotFound && <DefenderNotFound />}
<BlueBox>
<DefenderInput onDefenderNotFound={setDefenderNotFound} />
<InputAdvocate onAdvocateNotFound={setDefenderNotFound} />
{isProsecutionUser(user) && (
<>
<Text variant="h4" marginTop={2} marginBottom={2}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
import { defineMessages } from 'react-intl'

export const defenderInput = defineMessages({
export const strings = defineMessages({
nameLabel: {
id: 'judicial.system.core:defender_input.name_label',
defaultMessage:
'Nafn {sessionArrangements, select, ALL_PRESENT_SPOKESPERSON {talsmanns} other {verjanda}}',
description: 'Notaður sem titill á inputi fyrir skipaðan verjanda.',
},
spokespersonNameLabel: {
id: 'judicial.system.core:defender_input.spokesperson_name_label',
defaultMessage: 'Nafn réttargæslumanns',
description: 'Notaður sem titill á inputi fyrir skipaðan verjanda.',
},
namePlaceholder: {
id: 'judicial.system.core:defender_input.name_placeholder',
defaultMessage: 'Fult nafn',
Expand All @@ -19,6 +24,11 @@ export const defenderInput = defineMessages({
description:
'Notaður sem titill á inputi fyrir netfang skipaðans verjanda.',
},
spokespersonEmailLabel: {
id: 'judicial.system.core:defender_input.spokesperson_email_label',
defaultMessage: 'Netfang réttargæslumanns',
description: 'Notaður sem titill á inputi fyrir skipaðan verjanda.',
},
emailPlaceholder: {
id: 'judicial.system.core:defender_input.email_placeholder',
defaultMessage: 'Netfang',
Expand All @@ -32,6 +42,11 @@ export const defenderInput = defineMessages({
description:
'Notaður sem titill á inputi fyrir símanúmer skipaðans verjanda.',
},
spokespersonPhoneNumberLabel: {
id: 'judicial.system.core:defender_input.spokesperson_phone_number_label',
defaultMessage: 'Símanúmer réttargæslumanns',
description: 'Notaður sem titill á inputi fyrir skipaðan verjanda.',
},
phoneNumberPlaceholder: {
id: 'judicial.system.core:defender_input.phone_number_placeholder',
defaultMessage: 'Símanúmer',
Expand Down
Loading

0 comments on commit 621b5bb

Please sign in to comment.