@opencrvs/mosip 1.7.0-alpha.26 → 1.7.0-alpha.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/forms.d.ts +1 -6
- package/build/forms.js +9 -8
- package/package.json +1 -1
- package/src/forms.ts +20 -10
package/build/forms.d.ts
CHANGED
|
@@ -93,11 +93,6 @@ export declare const esignetHidden: () => {
|
|
|
93
93
|
name: string;
|
|
94
94
|
type: string;
|
|
95
95
|
};
|
|
96
|
-
/**
|
|
97
|
-
*
|
|
98
|
-
* @description QR reader type definition (this field may not be supported in the latest release of OpenCRVS yet)
|
|
99
|
-
*
|
|
100
|
-
*/
|
|
101
96
|
export declare const idReader: (event: string, sectionId: string, conditionals: any[], readers: any[]) => {
|
|
102
97
|
name: string;
|
|
103
98
|
customQuestionMappingId: string;
|
|
@@ -171,7 +166,7 @@ export declare const verified: (event: string, sectionId: string, mapping: any,
|
|
|
171
166
|
validator: never[];
|
|
172
167
|
mapping: any;
|
|
173
168
|
};
|
|
174
|
-
type VerificationStatus = "verified" | "failed" | "authenticated";
|
|
169
|
+
type VerificationStatus = "verified" | "failed" | "authenticated" | "failedFetchIdDetails";
|
|
175
170
|
export declare const idVerificationBanner: (event: string, sectionId: string, status: VerificationStatus, conditionals?: any[]) => {
|
|
176
171
|
name: string;
|
|
177
172
|
type: string;
|
package/build/forms.js
CHANGED
|
@@ -113,11 +113,6 @@ const esignetHidden = () => {
|
|
|
113
113
|
};
|
|
114
114
|
};
|
|
115
115
|
exports.esignetHidden = esignetHidden;
|
|
116
|
-
/**
|
|
117
|
-
*
|
|
118
|
-
* @description QR reader type definition (this field may not be supported in the latest release of OpenCRVS yet)
|
|
119
|
-
*
|
|
120
|
-
*/
|
|
121
116
|
const idReader = (event, sectionId, conditionals, readers) => {
|
|
122
117
|
const fieldName = "idReader";
|
|
123
118
|
const fieldId = `${event}.${sectionId}.${sectionId}-view-group.${fieldName}`;
|
|
@@ -173,7 +168,10 @@ const verified = (event, sectionId, mapping, esignetConfig) => {
|
|
|
173
168
|
initialValue: esignetConfig
|
|
174
169
|
? {
|
|
175
170
|
dependsOn: ["idReader", esignetConfig.callback.fieldName],
|
|
176
|
-
expression: `Boolean($form?.idReader)? "pending"
|
|
171
|
+
expression: `Boolean($form?.idReader)? "pending"
|
|
172
|
+
: Boolean($form?.${esignetConfig.callback.fieldName}?.data)? "authenticated"
|
|
173
|
+
: Boolean($form?.${esignetConfig.callback.fieldName}?.error)? "failedFetchIdDetails"
|
|
174
|
+
: ""`,
|
|
177
175
|
}
|
|
178
176
|
: {
|
|
179
177
|
dependsOn: ["idReader"],
|
|
@@ -197,7 +195,9 @@ const idVerificationBanner = (event, sectionId, status, conditionals = []) => {
|
|
|
197
195
|
hideInPreview: true,
|
|
198
196
|
custom: true,
|
|
199
197
|
bannerType: status,
|
|
200
|
-
idFieldName: status === "authenticated"
|
|
198
|
+
idFieldName: status === "authenticated" || "failedFetchIdDetails"
|
|
199
|
+
? "esignetCallback"
|
|
200
|
+
: "idReader",
|
|
201
201
|
label: {
|
|
202
202
|
id: "form.field.label.empty",
|
|
203
203
|
defaultMessage: "",
|
|
@@ -246,7 +246,7 @@ const idReaderFields = (event, section, qrConfig, esignetConfig, verifiedCustomF
|
|
|
246
246
|
const fields = [
|
|
247
247
|
(0, exports.idReader)(event, section, conditionals.concat({
|
|
248
248
|
action: "hide",
|
|
249
|
-
expression: "$form?.verified === 'verified' || $form?.verified === 'authenticated' || $form?.verified === 'failed' || !!$form?.esignetCallback?.loading",
|
|
249
|
+
expression: "$form?.verified === 'verified' || $form?.verified === 'authenticated' || $form?.verified === 'failed' || $form?.verified === 'failedFetchIdDetails' || !!$form?.esignetCallback?.loading",
|
|
250
250
|
}), readers),
|
|
251
251
|
];
|
|
252
252
|
if (esignetConfig) {
|
|
@@ -281,6 +281,7 @@ const idVerificationFields = (event, sectionId, mapping, conditionals = [], esig
|
|
|
281
281
|
(0, exports.idVerificationBanner)(event, sectionId, "verified", conditionals),
|
|
282
282
|
(0, exports.idVerificationBanner)(event, sectionId, "failed", conditionals),
|
|
283
283
|
(0, exports.idVerificationBanner)(event, sectionId, "authenticated", conditionals),
|
|
284
|
+
(0, exports.idVerificationBanner)(event, sectionId, "failedFetchIdDetails", conditionals),
|
|
284
285
|
];
|
|
285
286
|
};
|
|
286
287
|
exports.idVerificationFields = idVerificationFields;
|
package/package.json
CHANGED
package/src/forms.ts
CHANGED
|
@@ -134,12 +134,6 @@ export const esignetHidden = () => {
|
|
|
134
134
|
};
|
|
135
135
|
};
|
|
136
136
|
|
|
137
|
-
/**
|
|
138
|
-
*
|
|
139
|
-
* @description QR reader type definition (this field may not be supported in the latest release of OpenCRVS yet)
|
|
140
|
-
*
|
|
141
|
-
*/
|
|
142
|
-
|
|
143
137
|
export const idReader = (
|
|
144
138
|
event: string,
|
|
145
139
|
sectionId: string,
|
|
@@ -232,7 +226,10 @@ export const verified = (
|
|
|
232
226
|
initialValue: esignetConfig
|
|
233
227
|
? {
|
|
234
228
|
dependsOn: ["idReader", esignetConfig.callback.fieldName],
|
|
235
|
-
expression: `Boolean($form?.idReader)? "pending"
|
|
229
|
+
expression: `Boolean($form?.idReader)? "pending"
|
|
230
|
+
: Boolean($form?.${esignetConfig.callback.fieldName}?.data)? "authenticated"
|
|
231
|
+
: Boolean($form?.${esignetConfig.callback.fieldName}?.error)? "failedFetchIdDetails"
|
|
232
|
+
: ""`,
|
|
236
233
|
}
|
|
237
234
|
: {
|
|
238
235
|
dependsOn: ["idReader"],
|
|
@@ -247,7 +244,11 @@ function capitalize(str: string) {
|
|
|
247
244
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
248
245
|
}
|
|
249
246
|
|
|
250
|
-
type VerificationStatus =
|
|
247
|
+
type VerificationStatus =
|
|
248
|
+
| "verified"
|
|
249
|
+
| "failed"
|
|
250
|
+
| "authenticated"
|
|
251
|
+
| "failedFetchIdDetails";
|
|
251
252
|
|
|
252
253
|
export const idVerificationBanner = (
|
|
253
254
|
event: string,
|
|
@@ -264,7 +265,10 @@ export const idVerificationBanner = (
|
|
|
264
265
|
hideInPreview: true,
|
|
265
266
|
custom: true,
|
|
266
267
|
bannerType: status,
|
|
267
|
-
idFieldName:
|
|
268
|
+
idFieldName:
|
|
269
|
+
status === "authenticated" || "failedFetchIdDetails"
|
|
270
|
+
? "esignetCallback"
|
|
271
|
+
: "idReader",
|
|
268
272
|
label: {
|
|
269
273
|
id: "form.field.label.empty",
|
|
270
274
|
defaultMessage: "",
|
|
@@ -335,7 +339,7 @@ export const idReaderFields = (
|
|
|
335
339
|
conditionals.concat({
|
|
336
340
|
action: "hide",
|
|
337
341
|
expression:
|
|
338
|
-
"$form?.verified === 'verified' || $form?.verified === 'authenticated' || $form?.verified === 'failed' || !!$form?.esignetCallback?.loading",
|
|
342
|
+
"$form?.verified === 'verified' || $form?.verified === 'authenticated' || $form?.verified === 'failed' || $form?.verified === 'failedFetchIdDetails' || !!$form?.esignetCallback?.loading",
|
|
339
343
|
}),
|
|
340
344
|
readers,
|
|
341
345
|
),
|
|
@@ -400,5 +404,11 @@ export const idVerificationFields = (
|
|
|
400
404
|
idVerificationBanner(event, sectionId, "verified", conditionals),
|
|
401
405
|
idVerificationBanner(event, sectionId, "failed", conditionals),
|
|
402
406
|
idVerificationBanner(event, sectionId, "authenticated", conditionals),
|
|
407
|
+
idVerificationBanner(
|
|
408
|
+
event,
|
|
409
|
+
sectionId,
|
|
410
|
+
"failedFetchIdDetails",
|
|
411
|
+
conditionals,
|
|
412
|
+
),
|
|
403
413
|
];
|
|
404
414
|
};
|