Skip to content

Commit c5fa03c

Browse files
authored
Merge pull request #317 from digital-gov-mg/develop
update from develop
2 parents 81f6a37 + 5a43ee8 commit c5fa03c

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
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
: [

src/form/common/custom-validation-conditionals/custom-validators.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export function isFatherRecognitionDocNeeded() {
157157
)
158158
const isDocProvided = $draft?.documents?.uploadDocForFather?.length
159159
const isBirthRecognition =
160-
$draft.father.fatherHasFormallyRecognisedChild == 'true'
160+
$draft?.father?.fatherHasFormallyRecognisedChild == 'true'
161161

162162
if (isBirthRecognition && !isDocProvided) {
163163
return {

0 commit comments

Comments
 (0)