-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(id-card): updates to application (#15870)
* new application setup * new application setup * continued work * stuff * working * State for parent B * adding overview section to review * confirmation, approved and rejected file * adding steps * AssignParentB api action * reject application email * adding submit application email * commenting out fjs code in service * adding chargefjsv2clientmodule to id card module file * adding rest of steps * merge conflicst * fixing merge issues * changes to reject conclusion screen * .. * accept reject buttons and modal * fixing conclusion screen * added disability check * dataschema update * klaraði bakendaföll eins og hægt er í bili * changes in prerequisites * changes to typeofidsubsection * chore: charts update dirty files * changes to condition description * finishing up * changing answers * small changes * stuff * payment fix * merging * finishing too many things for one commit * submit application * config update * updates * trying stuff * working on this * connection type to id call * working on this * rest of updates for applicatin * removed disability from dataprovider, not only with permission * removed space * payment codes * temp changes, todo finish * changes to condition for applying to id cards * finishind touches * small fix * typing iddocumenttype * fixing comments * fixing comments * small updates * fixes for build * fixes for build * small update to test * small update to test * small update to test * small update to test * small updates * updates to formatText, applicationCard and types * stuff * payment code changes * updates to aplication * updates to application * more updates * more updates * more updates * lokapunktar * cosnole log remove * more updates * more updates * updates after comment --------- Co-authored-by: Sigrún Tinna Gissurardóttir <[email protected]> Co-authored-by: Sigrún Tinna Gissurardóttir <[email protected]> Co-authored-by: andes-it <[email protected]> Co-authored-by: Kristofer <[email protected]> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
- Loading branch information
Showing
44 changed files
with
888 additions
and
592 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
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
121 changes: 70 additions & 51 deletions
121
libs/application/templates/id-card/src/forms/Approved.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 |
---|---|---|
@@ -1,77 +1,96 @@ | ||
import { | ||
buildForm, | ||
buildSection, | ||
buildMultiField, | ||
buildAlertMessageField, | ||
buildMessageWithLinkButtonField, | ||
buildExpandableDescriptionField, | ||
coreMessages, | ||
getValueViaPath, | ||
} from '@island.is/application/core' | ||
import { Form, FormModes } from '@island.is/application/types' | ||
// import { Logo } from '../../assets/Logo' | ||
import { buildFormConclusionSection } from '@island.is/application/ui-forms' | ||
import { reviewConfirmation } from '../lib/messages' | ||
import { getChosenApplicant, hasSecondGuardian } from '../utils' | ||
import { IdentityDocumentChild } from '@island.is/clients/passports' | ||
|
||
export const Approved: Form = buildForm({ | ||
id: 'Approved', | ||
title: '', | ||
// logo: Logo, | ||
mode: FormModes.APPROVED, | ||
children: [ | ||
buildSection({ | ||
id: 'uiForms.conclusionSection', | ||
title: reviewConfirmation.general.sectionTitle, | ||
children: [ | ||
buildMultiField({ | ||
id: 'uiForms.conclusionMultifield', | ||
title: reviewConfirmation.general.sectionTitle, | ||
children: [ | ||
buildAlertMessageField({ | ||
id: 'uiForms.conclusionAlert', | ||
title: reviewConfirmation.general.alertTitle, | ||
alertType: 'success', | ||
}), | ||
buildExpandableDescriptionField({ | ||
id: 'uiForms.conclusionExpandableDescription', | ||
title: reviewConfirmation.general.accordionTitle, | ||
introText: '', | ||
description: reviewConfirmation.general.accordionText, | ||
startExpanded: true, | ||
}), | ||
buildAlertMessageField({ | ||
id: 'uiForms.conclusionAlertInfo1', | ||
title: '', | ||
alertType: 'info', | ||
message: reviewConfirmation.general.infoMessageText2, | ||
marginBottom: 0, | ||
}), | ||
buildAlertMessageField({ | ||
id: 'uiForms.conclusionAlertInfo2', | ||
title: '', | ||
alertType: 'info', | ||
message: reviewConfirmation.general.infoMessageText2, | ||
}), | ||
buildMessageWithLinkButtonField({ | ||
id: 'uiForms.conclusionBottomLink', | ||
title: '', | ||
url: '/minarsidur/umsoknir', | ||
buttonTitle: coreMessages.openServicePortalButtonTitle, | ||
message: reviewConfirmation.general.bottomButtonMessage, | ||
marginBottom: [4, 4, 12], | ||
}), | ||
], | ||
}), | ||
], | ||
}), | ||
buildFormConclusionSection({ | ||
sectionTitle: reviewConfirmation.general.sectionTitle, | ||
multiFieldTitle: reviewConfirmation.general.sectionTitle, | ||
alertTitle: reviewConfirmation.general.alertTitle, | ||
alertMessage: '', | ||
expandableHeader: reviewConfirmation.general.accordionTitle, | ||
expandableIntro: '', | ||
expandableDescription: reviewConfirmation.general.accordionText, | ||
expandableDescription: (application) => { | ||
const applicantNationalId = getValueViaPath( | ||
application.answers, | ||
'chosenApplicants', | ||
'', | ||
) as string | ||
const chosenApplicant = getChosenApplicant( | ||
application.answers, | ||
application.externalData, | ||
applicantNationalId, | ||
) | ||
|
||
return !chosenApplicant.isApplicant | ||
? reviewConfirmation.general.accordionTextForChild | ||
: reviewConfirmation.general.accordionText | ||
}, | ||
bottomButtonMessage: reviewConfirmation.general.bottomButtonMessage, | ||
}), | ||
buildAlertMessageField({ | ||
id: 'uiForms.conclusionAlertInfo1', | ||
title: '', | ||
alertType: 'info', | ||
message: reviewConfirmation.general.infoMessageText1, | ||
marginBottom: 0, | ||
condition: (formValue, externalData) => { | ||
const applicantNationalId = getValueViaPath( | ||
formValue, | ||
'chosenApplicants', | ||
'', | ||
) as string | ||
const chosenApplicant = getChosenApplicant( | ||
formValue, | ||
externalData, | ||
applicantNationalId, | ||
) | ||
|
||
const applicantHasSecondGuardian = hasSecondGuardian( | ||
formValue, | ||
externalData, | ||
) | ||
|
||
return !chosenApplicant.isApplicant && applicantHasSecondGuardian | ||
}, | ||
}), | ||
buildAlertMessageField({ | ||
id: 'uiForms.conclusionAlertInfo2', | ||
title: '', | ||
alertType: 'info', | ||
message: reviewConfirmation.general.infoMessageText2, | ||
condition: (formValue, externalData) => { | ||
const applicantNationalId = getValueViaPath( | ||
formValue, | ||
'chosenApplicants', | ||
'', | ||
) as string | ||
const chosenApplicant = getChosenApplicant( | ||
formValue, | ||
externalData, | ||
applicantNationalId, | ||
) | ||
|
||
const applicantHasSecondGuardian = hasSecondGuardian( | ||
formValue, | ||
externalData, | ||
) | ||
|
||
return !chosenApplicant.isApplicant && applicantHasSecondGuardian | ||
}, | ||
}), | ||
], | ||
}) |
Oops, something went wrong.