Skip to content

Commit 5a43ee8

Browse files
authored
Merge pull request #316 from digital-gov-mg/fix/remove-mpanolotra
remove mpanolotra and let empty if unknown informant type like not legal father
2 parents 5365f7e + eae8819 commit 5a43ee8

File tree

2 files changed

+18
-15
lines changed

2 files changed

+18
-15
lines changed

public/helpers.js

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -822,6 +822,11 @@ function registrationStatementSimplified(registrationStatementContext) {
822822
relationMap[
823823
(_a = informantType) === null || _a === void 0 ? void 0 : _a.toLowerCase()
824824
]
825+
const isNotInformantLegalFather = !isInformantLegalFather(
826+
informantType,
827+
motherMaritalStatus,
828+
birthFatherFatherHasFormallyRecognisedChild
829+
)
825830
return joinValuesWith(
826831
__spreadArray(
827832
__spreadArray(
@@ -843,13 +848,8 @@ function registrationStatementSimplified(registrationStatementContext) {
843848
informantFirstName
844849
]) + ',',
845850
(informantType === 'FATHER' &&
846-
!isInformantLegalFather(
847-
informantType,
848-
motherMaritalStatus,
849-
birthFatherFatherHasFormallyRecognisedChild
850-
)
851-
? 'mpanolotra'
852-
: informantTypeMapped || 'mpanolotra') + ','
851+
isNotInformantLegalFather ? ''
852+
: (informantTypeMapped ? informantTypeMapped + ',' : ''))
853853
],
854854
isInformantMotherOrFather(
855855
informantType,
@@ -934,6 +934,11 @@ function registrationStatement() {
934934
: this.registrar.date,
935935
'Africa/Nairobi'
936936
)
937+
const informantRelationMapped = relationMap[
938+
(_a = this.informantType) === null || _a === void 0
939+
? void 0
940+
: _a.toLowerCase()
941+
]
937942
return joinValuesWith(
938943
__spreadArray(
939944
__spreadArray(
@@ -950,11 +955,7 @@ function registrationStatement() {
950955
this.informantFamilyName,
951956
this.informantFirstName
952957
]) + ',',
953-
(relationMap[
954-
(_a = this.informantType) === null || _a === void 0
955-
? void 0
956-
: _a.toLowerCase()
957-
] || 'mpanolotra') + ','
958+
(informantRelationMapped ? informantRelationMapped + ',' : '')
958959
],
959960
isInformantMotherOrFather(this.informantType)
960961
? []

src/form/common/certificate/handlebars/helpers.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,9 +479,11 @@ export function registrationStatement(): Handlebars.HelperDelegate {
479479
this.informantFamilyName,
480480
this.informantFirstName
481481
]) + ',',
482-
(this.informantType === 'FATHER' && !isInformantLegalFather(this)
483-
? 'mpanolotra'
484-
: informantTypeMapped || 'mpanolotra') + ',',
482+
this.informantType === 'FATHER' && !isInformantLegalFather(this)
483+
? ''
484+
: informantTypeMapped
485+
? informantTypeMapped + ','
486+
: '',
485487
...(isInformantMotherOrFather(this)
486488
? []
487489
: [

0 commit comments

Comments
 (0)