Skip to content

Commit e503d50

Browse files
authored
chore: clean up existing mosip code (#309)
1 parent 8eb84cf commit e503d50

File tree

4 files changed

+13
-75
lines changed

4 files changed

+13
-75
lines changed

src/api/certificates/source/Farajaland-birth-certificate-v2.svg

Lines changed: 1 addition & 6 deletions
Loading

src/form/birth/index.ts

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ import {
6666
informantFirstNameConditionals,
6767
informantFamilyNameConditionals,
6868
informantBirthDateConditionals,
69-
exactDateOfBirthUnknownConditional,
70-
hideIfNidIntegrationEnabled
69+
exactDateOfBirthUnknownConditional
7170
} from '../common/default-validation-conditionals'
7271
import {
7372
documentsSection,
@@ -266,12 +265,12 @@ export const birthForm: ISerializedForm = {
266265
getIDType(
267266
'birth',
268267
'informant',
269-
hideIfNidIntegrationEnabled.concat(hideIfInformantMotherOrFather),
268+
hideIfInformantMotherOrFather,
270269
true
271270
),
272271
...getIDNumberFields(
273272
'informant',
274-
hideIfNidIntegrationEnabled.concat(hideIfInformantMotherOrFather),
273+
hideIfInformantMotherOrFather,
275274
true
276275
),
277276
// ADDRESS FIELDS WILL RENDER HERE
@@ -335,17 +334,8 @@ export const birthForm: ISerializedForm = {
335334
certificateHandlebars.motherNationality,
336335
detailsExist
337336
), // Required field.
338-
getIDType(
339-
'birth',
340-
'mother',
341-
hideIfNidIntegrationEnabled.concat(detailsExist),
342-
true
343-
),
344-
...getIDNumberFields(
345-
'mother',
346-
hideIfNidIntegrationEnabled.concat(detailsExist),
347-
true
348-
),
337+
getIDType('birth', 'mother', detailsExist, true),
338+
...getIDNumberFields('mother', detailsExist, true),
349339
// ADDRESS FIELDS WILL RENDER HERE
350340
divider('mother-address-seperator', detailsExist),
351341
getMaritalStatus(certificateHandlebars.motherMaritalStatus, [
@@ -422,17 +412,8 @@ export const birthForm: ISerializedForm = {
422412
certificateHandlebars.fatherNationality,
423413
detailsExist
424414
), // Required field.
425-
getIDType(
426-
'birth',
427-
'father',
428-
hideIfNidIntegrationEnabled.concat(detailsExist),
429-
true
430-
),
431-
...getIDNumberFields(
432-
'father',
433-
hideIfNidIntegrationEnabled.concat(detailsExist),
434-
true
435-
),
415+
getIDType('birth', 'father', detailsExist, true),
416+
...getIDNumberFields('father', detailsExist, true),
436417
// ADDRESS FIELDS WILL RENDER HERE
437418
divider('father-address-seperator', detailsExist),
438419
getMaritalStatus(certificateHandlebars.fatherMaritalStatus, [

src/form/common/default-validation-conditionals.ts

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,6 @@ export const isValidChildBirthDate = [
3131
}
3232
] satisfies Validator[]
3333

34-
export const hideIfNidIntegrationDisabled = [
35-
{
36-
action: 'hide',
37-
expression: `const nationalIdSystem =
38-
offlineCountryConfig &&
39-
offlineCountryConfig.systems.find(s => s.integratingSystemType === '${IntegratingSystemType.Mosip}');
40-
!nationalIdSystem ||
41-
!nationalIdSystem.settings.openIdProviderBaseUrl ||
42-
!nationalIdSystem.settings.openIdProviderClientId ||
43-
!nationalIdSystem.settings.openIdProviderClaims;
44-
`
45-
}
46-
]
47-
4834
export const detailsExistConditional: Conditional[] = [
4935
{
5036
action: 'hide',
@@ -394,20 +380,6 @@ export function getNationalIDValidators(configCase: string): Validator[] {
394380
}
395381
}
396382

397-
export const hideIfNidIntegrationEnabled = [
398-
{
399-
action: 'hide',
400-
expression: `const nationalIdSystem =
401-
offlineCountryConfig &&
402-
offlineCountryConfig.systems.find(s => s.integratingSystemType === '${IntegratingSystemType.Mosip}');
403-
nationalIdSystem &&
404-
nationalIdSystem.settings.openIdProviderBaseUrl &&
405-
nationalIdSystem.settings.openIdProhideIfNidIntegrationDisabledviderClientId &&
406-
nationalIdSystem.settings.openIdProviderClaims;
407-
`
408-
}
409-
]
410-
411383
export const informantBirthDateConditionals = [
412384
{
413385
action: 'hide',

src/form/death/index.ts

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ import {
6161
spouseBirthDateConditionals,
6262
spouseFamilyNameConditionals,
6363
spouseFirstNameConditionals,
64-
hideIfInformantSpouse,
65-
hideIfNidIntegrationEnabled
64+
hideIfInformantSpouse
6665
} from '../common/default-validation-conditionals'
6766
import {
6867
documentsSection,
@@ -291,17 +290,8 @@ export const deathForm = {
291290
certificateHandlebars.informantNationality,
292291
hideIfInformantSpouse
293292
),
294-
getIDType(
295-
'death',
296-
'informant',
297-
hideIfNidIntegrationEnabled.concat(hideIfInformantSpouse),
298-
true
299-
),
300-
...getIDNumberFields(
301-
'informant',
302-
hideIfNidIntegrationEnabled.concat(hideIfInformantSpouse),
303-
true
304-
),
293+
getIDType('death', 'informant', hideIfInformantSpouse, true),
294+
...getIDNumberFields('informant', hideIfInformantSpouse, true),
305295
// ADDRESS FIELDS WILL RENDER HERE
306296
divider('informant-address-separator', hideIfInformantSpouse),
307297
registrationPhone,
@@ -419,7 +409,7 @@ export const deathForm = {
419409
), // Required field.
420410
getNationalID(
421411
'iD',
422-
hideIfNidIntegrationEnabled.concat(detailsExist),
412+
detailsExist,
423413
getNationalIDValidators('mother'),
424414
certificateHandlebars.motherNID
425415
),
@@ -492,7 +482,7 @@ export const deathForm = {
492482
), // Required field.
493483
getNationalID(
494484
'iD',
495-
hideIfNidIntegrationEnabled.concat(detailsExist),
485+
detailsExist,
496486
getNationalIDValidators('father'),
497487
certificateHandlebars.fatherNID
498488
),

0 commit comments

Comments
 (0)