Skip to content

Commit

Permalink
merge master to develop (#858)
Browse files Browse the repository at this point in the history
  • Loading branch information
rikukissa authored Jan 23, 2024
1 parent 7544122 commit a12502b
Show file tree
Hide file tree
Showing 10 changed files with 86 additions and 48 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/deploy-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:
core-image-tag:
description: Core DockerHub image tag
required: true
default: 'v1.3.1'
default: 'v1.3.2'
countryconfig-image-tag:
description: Your Country Config DockerHub image tag
required: true
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Wait for images to be available
run: |
while true; do
Expand All @@ -83,7 +83,6 @@ jobs:
fi
sleep 10
done
- name: Deploy to ${{ github.event.inputs.environment }}
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
core-image-tag:
description: Core DockerHub image tag
required: true
default: 'v1.3.1'
default: 'v1.3.2'
countryconfig-image-tag:
description: Your Country Config DockerHub image tag
required: true
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Wait for images to be available
run: |
while true; do
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@opencrvs/countryconfig",
"version": "1.3.1",
"version": "1.3.2",
"description": "OpenCRVS country configuration for reference data",
"license": "MPL-2.0",
"husky": {
Expand Down
1 change: 1 addition & 0 deletions src/api/content/client/descriptions.json
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,7 @@
"misc.title.declarationStatus": "Title for review action component",
"review.actions.description.confirmComplete": "Description for review action component when complete declaration",
"review.actions.description.confirmInComplete": "Description for review action component when incomplete declaration",
"review.actions.description.hasError": "Description for review action component when declaration has errors on fields",
"review.actions.title.declarationStatus": "Title for review action component",
"review.form.section.review.name": "Form section name for Review",
"review.form.section.review.title": "Form section title for Review",
Expand Down
4 changes: 2 additions & 2 deletions src/data-seeding/certificates/source/MarriageCertificate.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 13 additions & 4 deletions src/form/birth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ import {
fatherFirstNameConditionals,
fatherFamilyNameConditionals,
informantNotMotherOrFather,
detailsExistConditional
detailsExistConditional,
ageOfIndividualConditionals,
ageOfParentsConditionals
} from '../common/default-validation-conditionals'
import {
getNationalIDValidators,
Expand Down Expand Up @@ -248,7 +250,8 @@ export const birthForm: ISerializedForm = {
formMessageDescriptors.ageOfInformant,
exactDateOfBirthUnknownConditional.concat(
hideIfInformantMotherOrFather
)
),
ageOfIndividualConditionals
),
getNationality(
certificateHandlebars.informantNationality,
Expand Down Expand Up @@ -319,7 +322,10 @@ export const birthForm: ISerializedForm = {
exactDateOfBirthUnknown(detailsExistConditional),
getAgeOfIndividualInYears(
formMessageDescriptors.ageOfMother,
exactDateOfBirthUnknownConditional.concat(detailsExistConditional)
exactDateOfBirthUnknownConditional.concat(
detailsExistConditional
),
ageOfParentsConditionals
),
getNationality(
certificateHandlebars.motherNationality,
Expand Down Expand Up @@ -395,7 +401,10 @@ export const birthForm: ISerializedForm = {
exactDateOfBirthUnknown(detailsExistConditional),
getAgeOfIndividualInYears(
formMessageDescriptors.ageOfFather,
exactDateOfBirthUnknownConditional.concat(detailsExistConditional)
exactDateOfBirthUnknownConditional.concat(
detailsExistConditional
),
ageOfParentsConditionals
),
getNationality(
certificateHandlebars.fatherNationality,
Expand Down
19 changes: 4 additions & 15 deletions src/form/common/common-optional-fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
} from './select-options'
import { certificateHandlebars } from '../birth/certificate-handlebars'
import { getFieldMapping } from '@countryconfig/utils/mapping/field-mapping-utils'
import { Validator } from '../types/validators'

const exactDobConditional: Conditional[] = [
{
Expand Down Expand Up @@ -53,27 +54,15 @@ export const exactDateOfBirthUnknown = (

export const getAgeOfIndividualInYears = (
label: MessageDescriptor,
conditionals: Conditional[]
conditionals: Conditional[],
validators: Validator[]
): SerializedFormField => ({
name: 'ageOfIndividualInYears',
type: 'NUMBER',
label,
required: true,
initialValue: '',
validator: [
{
operation: 'range',
parameters: [12, 120]
},
{
operation: 'maxLength',
parameters: [3]
},
{
operation: 'isValidParentsBirthDate',
parameters: [10, true]
}
],
validator: validators,
conditionals,
postfix: 'years',
inputFieldWidth: '78px'
Expand Down
49 changes: 41 additions & 8 deletions src/form/common/default-validation-conditionals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,47 @@ export const brideOrGroomBirthDateValidators = (spouseType: string) => [
}
]

export const brideOrGroomAgeValidators = [
{
operation: 'range',
parameters: [18, 120]
},
{
operation: 'maxLength',
parameters: [3]
}
] satisfies Validator[]

export const ageOfIndividualConditionals: Validator[] = [
{
operation: 'range',
parameters: [12, 120]
},
{
operation: 'maxLength',
parameters: [3]
}
]

export const ageOfParentsConditionals = [
...ageOfIndividualConditionals,
{
operation: 'isValidParentsBirthDate',
parameters: [10, true]
}
] satisfies Validator[]

export const ageOfDeceasedConditionals = [
{
operation: 'range',
parameters: [0, 120]
},
{
operation: 'maxLength',
parameters: [3]
}
] satisfies Validator[]

export const exactDateOfBirthUnknownConditional = [
{
action: 'hide',
Expand Down Expand Up @@ -286,10 +327,6 @@ export function getNationalIDValidators(configCase: string): Validator[] {
{
operation: 'duplicateIDNumber',
parameters: ['bride.iD']
},
{
operation: 'duplicateIDNumber',
parameters: ['informant.informantID']
}
]
} else if (configCase === 'bride') {
Expand All @@ -301,10 +338,6 @@ export function getNationalIDValidators(configCase: string): Validator[] {
{
operation: 'duplicateIDNumber',
parameters: ['groom.iD']
},
{
operation: 'duplicateIDNumber',
parameters: ['informant.informantID']
}
]
} else {
Expand Down
14 changes: 9 additions & 5 deletions src/form/death/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import {
getMaritalStatus,
registrationEmail,
registrationPhone,
divider,
getOccupation
divider
// getOccupation
} from '../common/common-optional-fields'
import {
getGender,
Expand Down Expand Up @@ -44,6 +44,8 @@ import {
hideIfNidIntegrationEnabled,
informantBirthDateConditionals,
informantFamilyNameConditionals,
ageOfIndividualConditionals,
ageOfDeceasedConditionals,
informantFirstNameConditionals,
exactDateOfBirthUnknownConditional,
isValidBirthDate /*,
Expand Down Expand Up @@ -192,8 +194,9 @@ export const deathForm = {
), // Required field.,
exactDateOfBirthUnknown([]),
getAgeOfIndividualInYears(
formMessageDescriptors.ageOfInformant,
exactDateOfBirthUnknownConditional
formMessageDescriptors.ageOfDeceased,
exactDateOfBirthUnknownConditional,
ageOfDeceasedConditionals
),
getNationality(certificateHandlebars.deceasedNationality, []),
getNationalID(
Expand Down Expand Up @@ -274,7 +277,8 @@ export const deathForm = {
exactDateOfBirthUnknown([]),
getAgeOfIndividualInYears(
formMessageDescriptors.ageOfInformant,
exactDateOfBirthUnknownConditional
exactDateOfBirthUnknownConditional,
ageOfIndividualConditionals
),
getNationality(certificateHandlebars.informantNationality, []),
getNationalID(
Expand Down
19 changes: 11 additions & 8 deletions src/form/marriage/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ import {
} from './required-fields'
import { Event, ISerializedForm } from '../types/types'
import {
ageOfIndividualConditionals,
brideOrGroomAgeValidators,
exactDateOfBirthUnknownConditional,
getNationalIDValidators
} from '../common/default-validation-conditionals'
Expand Down Expand Up @@ -128,7 +130,8 @@ export const marriageForm: ISerializedForm = {
formMessageDescriptors.ageOfInformant,
exactDateOfBirthUnknownConditional.concat(
hideIfInformantBrideOrGroom
)
),
ageOfIndividualConditionals
),
getNationality(
certificateHandlebars.informantNationality,
Expand Down Expand Up @@ -183,7 +186,8 @@ export const marriageForm: ISerializedForm = {
exactDateOfBirthUnknown([]),
getAgeOfIndividualInYears(
formMessageDescriptors.ageOfGroom,
exactDateOfBirthUnknownConditional
exactDateOfBirthUnknownConditional,
brideOrGroomAgeValidators
),
getNationality(certificateHandlebars.groomNationality, []), // Required field
getNationalID(
Expand Down Expand Up @@ -230,12 +234,11 @@ export const marriageForm: ISerializedForm = {
certificateHandlebars.brideBirthDate
), // Required field
exactDateOfBirthUnknown([]),
getAgeOfIndividualInYears(formMessageDescriptors.ageOfBride, [
{
action: 'hide',
expression: '!values.exactDateOfBirthUnknown'
}
]),
getAgeOfIndividualInYears(
formMessageDescriptors.ageOfBride,
exactDateOfBirthUnknownConditional,
brideOrGroomAgeValidators
),
getNationality(certificateHandlebars.brideNationality, []), // Required field
getNationalID(
'iD',
Expand Down

0 comments on commit a12502b

Please sign in to comment.