@opencrvs/mosip 1.7.0-alpha.10 → 1.7.0-alpha.12
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 +6 -6
- package/build/forms.js +67 -67
- package/package.json +1 -1
- package/src/forms.ts +74 -78
- package/tsconfig.json +1 -1
package/build/forms.d.ts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* @description E-Signet REDIRECT button form definition. Calls E-Signet /authorize (this field may not be supported in the latest release of OpenCRVS yet)
|
|
14
14
|
*
|
|
15
15
|
*/
|
|
16
|
-
export declare const esignet: (
|
|
16
|
+
export declare const esignet: (esignetAuthUrl: string, openIdProviderClientId: string, openIdProviderClaims: string | undefined, fieldName: string, callbackFieldName: string) => {
|
|
17
17
|
name: string;
|
|
18
18
|
validator: never[];
|
|
19
19
|
icon: {
|
|
@@ -41,7 +41,7 @@ export declare const esignet: (event: string, sectionId: string, esignetAuthUrl:
|
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
|
-
export declare const popupButton: ({ url }: {
|
|
44
|
+
export declare const popupButton: ({ url, }: {
|
|
45
45
|
url: string;
|
|
46
46
|
}) => {
|
|
47
47
|
name: string;
|
|
@@ -50,14 +50,14 @@ export declare const popupButton: ({ url }: {
|
|
|
50
50
|
};
|
|
51
51
|
/**
|
|
52
52
|
*
|
|
53
|
-
* @description esignet callback button form definition. Calls mosip-api/esignet
|
|
53
|
+
* @description esignet callback button form definition. Calls https://mosip-api.{{hostname}}/esignet/get-oidp-user-info
|
|
54
54
|
*
|
|
55
55
|
*/
|
|
56
|
-
export declare const esignetCallback: ({ fieldName,
|
|
56
|
+
export declare const esignetCallback: ({ fieldName, mosipAPIUserInfoUrl, openIdProviderClientId, }: {
|
|
57
57
|
fieldName: string;
|
|
58
58
|
event: string;
|
|
59
59
|
sectionId: string;
|
|
60
|
-
|
|
60
|
+
mosipAPIUserInfoUrl: string;
|
|
61
61
|
openIdProviderClientId: string;
|
|
62
62
|
}) => {
|
|
63
63
|
name: string;
|
|
@@ -72,7 +72,7 @@ export declare const esignetCallback: ({ fieldName, event, sectionId, getOIDPUse
|
|
|
72
72
|
options: {
|
|
73
73
|
url: string;
|
|
74
74
|
headers: {
|
|
75
|
-
|
|
75
|
+
"Content-type": string;
|
|
76
76
|
};
|
|
77
77
|
body: {
|
|
78
78
|
clientId: string;
|
package/build/forms.js
CHANGED
|
@@ -17,89 +17,89 @@ exports.idVerificationFields = exports.idPendingVerificationBanner = exports.ver
|
|
|
17
17
|
* @description E-Signet REDIRECT button form definition. Calls E-Signet /authorize (this field may not be supported in the latest release of OpenCRVS yet)
|
|
18
18
|
*
|
|
19
19
|
*/
|
|
20
|
-
const esignet = (
|
|
20
|
+
const esignet = (esignetAuthUrl, openIdProviderClientId, openIdProviderClaims = "name,family_name,given_name,middle_name,birthdate,address", fieldName, callbackFieldName) => {
|
|
21
21
|
const url = new URL(esignetAuthUrl);
|
|
22
|
-
url.searchParams.append(
|
|
23
|
-
url.searchParams.append(
|
|
24
|
-
url.searchParams.append(
|
|
25
|
-
url.searchParams.append(
|
|
26
|
-
url.searchParams.append(
|
|
27
|
-
url.searchParams.append(
|
|
28
|
-
url.searchParams.append(
|
|
22
|
+
url.searchParams.append("client_id", openIdProviderClientId || "mock-client_id");
|
|
23
|
+
url.searchParams.append("response_type", "code");
|
|
24
|
+
url.searchParams.append("scope", "openid profile");
|
|
25
|
+
url.searchParams.append("acr_values", "mosip:idp:acr:static-code");
|
|
26
|
+
url.searchParams.append("claims", openIdProviderClaims);
|
|
27
|
+
url.searchParams.append("state", "fetch-on-mount");
|
|
28
|
+
url.searchParams.append("redirect_uri", '${window.location.href}');
|
|
29
29
|
return {
|
|
30
30
|
name: fieldName,
|
|
31
31
|
validator: [],
|
|
32
32
|
icon: {
|
|
33
|
-
desktop:
|
|
34
|
-
mobile:
|
|
33
|
+
desktop: "Globe",
|
|
34
|
+
mobile: "Fingerprint",
|
|
35
35
|
},
|
|
36
|
-
type:
|
|
36
|
+
type: "LINK_BUTTON",
|
|
37
37
|
custom: true,
|
|
38
38
|
label: {
|
|
39
|
-
id:
|
|
40
|
-
defaultMessage:
|
|
39
|
+
id: "views.idReader.label.eSignet",
|
|
40
|
+
defaultMessage: "E-signet",
|
|
41
41
|
},
|
|
42
42
|
hideInPreview: true,
|
|
43
43
|
conditionals: [
|
|
44
44
|
{
|
|
45
|
-
action:
|
|
46
|
-
expression:
|
|
47
|
-
}
|
|
45
|
+
action: "disable",
|
|
46
|
+
expression: "!!$form.redirectCallbackFetch",
|
|
47
|
+
},
|
|
48
48
|
],
|
|
49
49
|
options: {
|
|
50
50
|
url: url.toString(),
|
|
51
51
|
callback: {
|
|
52
52
|
params: {
|
|
53
|
-
state:
|
|
53
|
+
state: "fetch-on-mount",
|
|
54
54
|
},
|
|
55
|
-
trigger: callbackFieldName
|
|
56
|
-
}
|
|
57
|
-
}
|
|
55
|
+
trigger: callbackFieldName,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
58
|
};
|
|
59
59
|
};
|
|
60
60
|
exports.esignet = esignet;
|
|
61
61
|
const popupButton = ({
|
|
62
62
|
/** URL to OpenCRVS-MOSIP gateway (e.g. https://opencrvs-mosip-gateway.farajaland.opencrvs.org) */
|
|
63
|
-
url }) => {
|
|
63
|
+
url, }) => {
|
|
64
64
|
return {
|
|
65
|
-
name:
|
|
66
|
-
type:
|
|
67
|
-
url
|
|
65
|
+
name: "INFORMANT_AUTHENTICATION_POPUP_BUTTON",
|
|
66
|
+
type: "POPUP_BUTTON",
|
|
67
|
+
url,
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
70
|
exports.popupButton = popupButton;
|
|
71
71
|
/**
|
|
72
72
|
*
|
|
73
|
-
* @description esignet callback button form definition. Calls mosip-api/esignet
|
|
73
|
+
* @description esignet callback button form definition. Calls https://mosip-api.{{hostname}}/esignet/get-oidp-user-info
|
|
74
74
|
*
|
|
75
75
|
*/
|
|
76
|
-
const esignetCallback = ({ fieldName,
|
|
76
|
+
const esignetCallback = ({ fieldName, mosipAPIUserInfoUrl, openIdProviderClientId, }) => ({
|
|
77
77
|
name: fieldName,
|
|
78
|
-
type:
|
|
78
|
+
type: "HTTP",
|
|
79
79
|
custom: true,
|
|
80
80
|
label: {
|
|
81
|
-
id:
|
|
82
|
-
defaultMessage:
|
|
81
|
+
id: "form.field.label.empty",
|
|
82
|
+
defaultMessage: "",
|
|
83
83
|
},
|
|
84
84
|
validator: [],
|
|
85
85
|
hideInPreview: true,
|
|
86
86
|
options: {
|
|
87
|
-
url:
|
|
87
|
+
url: mosipAPIUserInfoUrl,
|
|
88
88
|
headers: {
|
|
89
|
-
|
|
89
|
+
"Content-type": "application/json",
|
|
90
90
|
},
|
|
91
91
|
body: {
|
|
92
92
|
clientId: openIdProviderClientId,
|
|
93
|
-
redirectUri: '${window.location.
|
|
93
|
+
redirectUri: '${window.location.href}',
|
|
94
94
|
},
|
|
95
|
-
method:
|
|
96
|
-
}
|
|
95
|
+
method: "POST",
|
|
96
|
+
},
|
|
97
97
|
});
|
|
98
98
|
exports.esignetCallback = esignetCallback;
|
|
99
99
|
const esignetHidden = () => {
|
|
100
100
|
return {
|
|
101
|
-
name:
|
|
102
|
-
type:
|
|
101
|
+
name: "INFORMANT_PSUT_TOKEN",
|
|
102
|
+
type: "HIDDEN",
|
|
103
103
|
};
|
|
104
104
|
};
|
|
105
105
|
exports.esignetHidden = esignetHidden;
|
|
@@ -109,88 +109,88 @@ exports.esignetHidden = esignetHidden;
|
|
|
109
109
|
*
|
|
110
110
|
*/
|
|
111
111
|
const idReader = (event, sectionId, conditionals, readers) => {
|
|
112
|
-
const fieldName =
|
|
112
|
+
const fieldName = "idReader";
|
|
113
113
|
const fieldId = `${event}.${sectionId}.${sectionId}-view-group.${fieldName}`;
|
|
114
114
|
return {
|
|
115
115
|
name: fieldName,
|
|
116
116
|
customQuestionMappingId: fieldId,
|
|
117
117
|
custom: true,
|
|
118
118
|
required: false,
|
|
119
|
-
type:
|
|
119
|
+
type: "ID_READER",
|
|
120
120
|
label: {
|
|
121
|
-
id:
|
|
122
|
-
defaultMessage:
|
|
121
|
+
id: "form.field.label.empty",
|
|
122
|
+
defaultMessage: "",
|
|
123
123
|
},
|
|
124
124
|
hideInPreview: true,
|
|
125
|
-
initialValue:
|
|
125
|
+
initialValue: "",
|
|
126
126
|
validator: [],
|
|
127
127
|
conditionals,
|
|
128
128
|
dividerLabel: {
|
|
129
|
-
id:
|
|
130
|
-
defaultMessage:
|
|
129
|
+
id: "views.idReader.label.or",
|
|
130
|
+
defaultMessage: "Or",
|
|
131
131
|
},
|
|
132
132
|
manualInputInstructionLabel: {
|
|
133
|
-
id:
|
|
134
|
-
defaultMessage:
|
|
133
|
+
id: "views.idReader.label.manualInput",
|
|
134
|
+
defaultMessage: "Complete fields below",
|
|
135
135
|
},
|
|
136
|
-
readers
|
|
136
|
+
readers,
|
|
137
137
|
};
|
|
138
138
|
};
|
|
139
139
|
exports.idReader = idReader;
|
|
140
140
|
const qr = () => ({
|
|
141
|
-
type:
|
|
141
|
+
type: "QR",
|
|
142
142
|
});
|
|
143
143
|
exports.qr = qr;
|
|
144
144
|
const verified = (event, sectionId) => {
|
|
145
|
-
const fieldName =
|
|
145
|
+
const fieldName = "verified";
|
|
146
146
|
const fieldId = `${event}.${sectionId}.${sectionId}-view-group.${fieldName}`;
|
|
147
147
|
return {
|
|
148
|
-
name:
|
|
148
|
+
name: "verified",
|
|
149
149
|
fieldId,
|
|
150
150
|
customQuestionMappingId: fieldId,
|
|
151
|
-
type:
|
|
151
|
+
type: "HIDDEN",
|
|
152
152
|
custom: true,
|
|
153
153
|
label: {
|
|
154
|
-
id:
|
|
155
|
-
defaultMessage:
|
|
154
|
+
id: "form.field.label.empty",
|
|
155
|
+
defaultMessage: "",
|
|
156
156
|
},
|
|
157
157
|
initialValue: {
|
|
158
|
-
dependsOn: [
|
|
159
|
-
expression: 'Boolean($form?.idReader)? "pending":""'
|
|
158
|
+
dependsOn: ["idReader"],
|
|
159
|
+
expression: 'Boolean($form?.idReader)? "pending":""',
|
|
160
160
|
},
|
|
161
|
-
validator: []
|
|
161
|
+
validator: [],
|
|
162
162
|
};
|
|
163
163
|
};
|
|
164
164
|
exports.verified = verified;
|
|
165
165
|
const idPendingVerificationBanner = (event, sectionId) => {
|
|
166
|
-
const fieldName =
|
|
166
|
+
const fieldName = "verified";
|
|
167
167
|
const fieldId = `${event}.${sectionId}.${sectionId}-view-group.${fieldName}`;
|
|
168
168
|
return {
|
|
169
|
-
name:
|
|
170
|
-
type:
|
|
169
|
+
name: "idPending",
|
|
170
|
+
type: "ID_VERIFICATION_BANNER",
|
|
171
171
|
fieldId,
|
|
172
172
|
hideInPreview: true,
|
|
173
173
|
custom: true,
|
|
174
|
-
bannerType:
|
|
175
|
-
idFieldName:
|
|
174
|
+
bannerType: "pending",
|
|
175
|
+
idFieldName: "idReader",
|
|
176
176
|
label: {
|
|
177
|
-
id:
|
|
178
|
-
defaultMessage:
|
|
177
|
+
id: "form.field.label.empty",
|
|
178
|
+
defaultMessage: "",
|
|
179
179
|
},
|
|
180
180
|
validator: [],
|
|
181
181
|
conditionals: [
|
|
182
182
|
{
|
|
183
|
-
action:
|
|
184
|
-
expression: '$form?.verified !== "pending"'
|
|
185
|
-
}
|
|
186
|
-
]
|
|
183
|
+
action: "hide",
|
|
184
|
+
expression: '$form?.verified !== "pending"',
|
|
185
|
+
},
|
|
186
|
+
],
|
|
187
187
|
};
|
|
188
188
|
};
|
|
189
189
|
exports.idPendingVerificationBanner = idPendingVerificationBanner;
|
|
190
190
|
const idVerificationFields = (event, sectionId) => {
|
|
191
191
|
return [
|
|
192
192
|
(0, exports.verified)(event, sectionId),
|
|
193
|
-
(0, exports.idPendingVerificationBanner)(event, sectionId)
|
|
193
|
+
(0, exports.idPendingVerificationBanner)(event, sectionId),
|
|
194
194
|
];
|
|
195
195
|
};
|
|
196
196
|
exports.idVerificationFields = idVerificationFields;
|
package/package.json
CHANGED
package/src/forms.ts
CHANGED
|
@@ -17,122 +17,118 @@
|
|
|
17
17
|
*
|
|
18
18
|
*/
|
|
19
19
|
export const esignet = (
|
|
20
|
-
event: string,
|
|
21
|
-
sectionId: string,
|
|
22
20
|
esignetAuthUrl: string,
|
|
23
21
|
openIdProviderClientId: string,
|
|
24
|
-
openIdProviderClaims: string =
|
|
22
|
+
openIdProviderClaims: string = "name,family_name,given_name,middle_name,birthdate,address",
|
|
25
23
|
fieldName: string,
|
|
26
|
-
callbackFieldName: string
|
|
24
|
+
callbackFieldName: string,
|
|
27
25
|
) => {
|
|
28
26
|
const url = new URL(esignetAuthUrl);
|
|
29
27
|
|
|
30
28
|
url.searchParams.append(
|
|
31
|
-
|
|
32
|
-
openIdProviderClientId ||
|
|
29
|
+
"client_id",
|
|
30
|
+
openIdProviderClientId || "mock-client_id",
|
|
33
31
|
);
|
|
34
|
-
url.searchParams.append(
|
|
35
|
-
url.searchParams.append(
|
|
36
|
-
url.searchParams.append(
|
|
37
|
-
url.searchParams.append(
|
|
38
|
-
url.searchParams.append(
|
|
32
|
+
url.searchParams.append("response_type", "code");
|
|
33
|
+
url.searchParams.append("scope", "openid profile");
|
|
34
|
+
url.searchParams.append("acr_values", "mosip:idp:acr:static-code");
|
|
35
|
+
url.searchParams.append("claims", openIdProviderClaims);
|
|
36
|
+
url.searchParams.append("state", "fetch-on-mount");
|
|
39
37
|
url.searchParams.append(
|
|
40
|
-
|
|
41
|
-
'${window.location.
|
|
38
|
+
"redirect_uri",
|
|
39
|
+
'${window.location.href}',
|
|
42
40
|
);
|
|
43
41
|
|
|
44
42
|
return {
|
|
45
43
|
name: fieldName,
|
|
46
44
|
validator: [],
|
|
47
45
|
icon: {
|
|
48
|
-
desktop:
|
|
49
|
-
mobile:
|
|
46
|
+
desktop: "Globe",
|
|
47
|
+
mobile: "Fingerprint",
|
|
50
48
|
},
|
|
51
|
-
type:
|
|
49
|
+
type: "LINK_BUTTON",
|
|
52
50
|
custom: true,
|
|
53
51
|
label: {
|
|
54
|
-
id:
|
|
55
|
-
defaultMessage:
|
|
52
|
+
id: "views.idReader.label.eSignet",
|
|
53
|
+
defaultMessage: "E-signet",
|
|
56
54
|
},
|
|
57
55
|
hideInPreview: true,
|
|
58
56
|
conditionals: [
|
|
59
57
|
{
|
|
60
|
-
action:
|
|
61
|
-
expression:
|
|
62
|
-
}
|
|
58
|
+
action: "disable",
|
|
59
|
+
expression: "!!$form.redirectCallbackFetch",
|
|
60
|
+
},
|
|
63
61
|
],
|
|
64
62
|
options: {
|
|
65
63
|
url: url.toString(),
|
|
66
64
|
callback: {
|
|
67
65
|
params: {
|
|
68
|
-
state:
|
|
66
|
+
state: "fetch-on-mount",
|
|
69
67
|
},
|
|
70
|
-
trigger: callbackFieldName
|
|
71
|
-
}
|
|
72
|
-
}
|
|
68
|
+
trigger: callbackFieldName,
|
|
69
|
+
},
|
|
70
|
+
},
|
|
73
71
|
};
|
|
74
72
|
};
|
|
75
73
|
|
|
76
74
|
export const popupButton = ({
|
|
77
75
|
/** URL to OpenCRVS-MOSIP gateway (e.g. https://opencrvs-mosip-gateway.farajaland.opencrvs.org) */
|
|
78
|
-
url
|
|
76
|
+
url,
|
|
79
77
|
}: {
|
|
80
78
|
url: string;
|
|
81
79
|
}) => {
|
|
82
80
|
return {
|
|
83
|
-
name:
|
|
84
|
-
type:
|
|
85
|
-
url
|
|
81
|
+
name: "INFORMANT_AUTHENTICATION_POPUP_BUTTON",
|
|
82
|
+
type: "POPUP_BUTTON",
|
|
83
|
+
url,
|
|
86
84
|
};
|
|
87
85
|
};
|
|
88
86
|
|
|
89
87
|
/**
|
|
90
88
|
*
|
|
91
|
-
* @description esignet callback button form definition. Calls mosip-api/esignet
|
|
89
|
+
* @description esignet callback button form definition. Calls https://mosip-api.{{hostname}}/esignet/get-oidp-user-info
|
|
92
90
|
*
|
|
93
91
|
*/
|
|
94
92
|
|
|
95
93
|
export const esignetCallback = ({
|
|
96
94
|
fieldName,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
getOIDPUserInfoUrl,
|
|
100
|
-
openIdProviderClientId
|
|
95
|
+
mosipAPIUserInfoUrl,
|
|
96
|
+
openIdProviderClientId,
|
|
101
97
|
}: {
|
|
102
98
|
fieldName: string;
|
|
103
99
|
event: string;
|
|
104
100
|
sectionId: string;
|
|
105
|
-
|
|
101
|
+
mosipAPIUserInfoUrl: string;
|
|
106
102
|
openIdProviderClientId: string;
|
|
107
103
|
}) => ({
|
|
108
104
|
name: fieldName,
|
|
109
|
-
type:
|
|
105
|
+
type: "HTTP",
|
|
110
106
|
custom: true,
|
|
111
107
|
label: {
|
|
112
|
-
id:
|
|
113
|
-
defaultMessage:
|
|
108
|
+
id: "form.field.label.empty",
|
|
109
|
+
defaultMessage: "",
|
|
114
110
|
},
|
|
115
111
|
validator: [],
|
|
116
112
|
hideInPreview: true,
|
|
117
113
|
options: {
|
|
118
|
-
url:
|
|
114
|
+
url: mosipAPIUserInfoUrl,
|
|
119
115
|
headers: {
|
|
120
|
-
|
|
116
|
+
"Content-type": "application/json",
|
|
121
117
|
},
|
|
122
118
|
body: {
|
|
123
119
|
clientId: openIdProviderClientId,
|
|
124
120
|
redirectUri:
|
|
125
|
-
'${window.location.
|
|
121
|
+
'${window.location.href}',
|
|
126
122
|
},
|
|
127
123
|
|
|
128
|
-
method:
|
|
129
|
-
}
|
|
124
|
+
method: "POST",
|
|
125
|
+
},
|
|
130
126
|
});
|
|
131
127
|
|
|
132
128
|
export const esignetHidden = () => {
|
|
133
129
|
return {
|
|
134
|
-
name:
|
|
135
|
-
type:
|
|
130
|
+
name: "INFORMANT_PSUT_TOKEN",
|
|
131
|
+
type: "HIDDEN",
|
|
136
132
|
};
|
|
137
133
|
};
|
|
138
134
|
|
|
@@ -146,92 +142,92 @@ export const idReader = (
|
|
|
146
142
|
event: string,
|
|
147
143
|
sectionId: string,
|
|
148
144
|
conditionals: any[],
|
|
149
|
-
readers: any[]
|
|
145
|
+
readers: any[],
|
|
150
146
|
) => {
|
|
151
|
-
const fieldName: string =
|
|
147
|
+
const fieldName: string = "idReader";
|
|
152
148
|
const fieldId: string = `${event}.${sectionId}.${sectionId}-view-group.${fieldName}`;
|
|
153
149
|
return {
|
|
154
150
|
name: fieldName,
|
|
155
151
|
customQuestionMappingId: fieldId,
|
|
156
152
|
custom: true,
|
|
157
153
|
required: false,
|
|
158
|
-
type:
|
|
154
|
+
type: "ID_READER",
|
|
159
155
|
label: {
|
|
160
|
-
id:
|
|
161
|
-
defaultMessage:
|
|
156
|
+
id: "form.field.label.empty",
|
|
157
|
+
defaultMessage: "",
|
|
162
158
|
},
|
|
163
159
|
hideInPreview: true,
|
|
164
|
-
initialValue:
|
|
160
|
+
initialValue: "",
|
|
165
161
|
validator: [],
|
|
166
162
|
conditionals,
|
|
167
163
|
dividerLabel: {
|
|
168
|
-
id:
|
|
169
|
-
defaultMessage:
|
|
164
|
+
id: "views.idReader.label.or",
|
|
165
|
+
defaultMessage: "Or",
|
|
170
166
|
},
|
|
171
167
|
manualInputInstructionLabel: {
|
|
172
|
-
id:
|
|
173
|
-
defaultMessage:
|
|
168
|
+
id: "views.idReader.label.manualInput",
|
|
169
|
+
defaultMessage: "Complete fields below",
|
|
174
170
|
},
|
|
175
|
-
readers
|
|
171
|
+
readers,
|
|
176
172
|
};
|
|
177
173
|
};
|
|
178
174
|
|
|
179
175
|
export const qr = () => ({
|
|
180
|
-
type:
|
|
176
|
+
type: "QR",
|
|
181
177
|
});
|
|
182
178
|
|
|
183
179
|
export const verified = (event: string, sectionId: string) => {
|
|
184
|
-
const fieldName =
|
|
180
|
+
const fieldName = "verified";
|
|
185
181
|
const fieldId = `${event}.${sectionId}.${sectionId}-view-group.${fieldName}`;
|
|
186
182
|
return {
|
|
187
|
-
name:
|
|
183
|
+
name: "verified",
|
|
188
184
|
fieldId,
|
|
189
185
|
customQuestionMappingId: fieldId,
|
|
190
|
-
type:
|
|
186
|
+
type: "HIDDEN",
|
|
191
187
|
custom: true,
|
|
192
188
|
label: {
|
|
193
|
-
id:
|
|
194
|
-
defaultMessage:
|
|
189
|
+
id: "form.field.label.empty",
|
|
190
|
+
defaultMessage: "",
|
|
195
191
|
},
|
|
196
192
|
initialValue: {
|
|
197
|
-
dependsOn: [
|
|
198
|
-
expression: 'Boolean($form?.idReader)? "pending":""'
|
|
193
|
+
dependsOn: ["idReader"],
|
|
194
|
+
expression: 'Boolean($form?.idReader)? "pending":""',
|
|
199
195
|
},
|
|
200
|
-
validator: []
|
|
196
|
+
validator: [],
|
|
201
197
|
};
|
|
202
198
|
};
|
|
203
199
|
|
|
204
200
|
export const idPendingVerificationBanner = (
|
|
205
201
|
event: string,
|
|
206
|
-
sectionId: string
|
|
202
|
+
sectionId: string,
|
|
207
203
|
) => {
|
|
208
|
-
const fieldName =
|
|
204
|
+
const fieldName = "verified";
|
|
209
205
|
const fieldId = `${event}.${sectionId}.${sectionId}-view-group.${fieldName}`;
|
|
210
206
|
return {
|
|
211
|
-
name:
|
|
212
|
-
type:
|
|
207
|
+
name: "idPending",
|
|
208
|
+
type: "ID_VERIFICATION_BANNER",
|
|
213
209
|
fieldId,
|
|
214
210
|
hideInPreview: true,
|
|
215
211
|
custom: true,
|
|
216
|
-
bannerType:
|
|
217
|
-
idFieldName:
|
|
212
|
+
bannerType: "pending",
|
|
213
|
+
idFieldName: "idReader",
|
|
218
214
|
label: {
|
|
219
|
-
id:
|
|
220
|
-
defaultMessage:
|
|
215
|
+
id: "form.field.label.empty",
|
|
216
|
+
defaultMessage: "",
|
|
221
217
|
},
|
|
222
218
|
validator: [],
|
|
223
219
|
conditionals: [
|
|
224
220
|
{
|
|
225
|
-
action:
|
|
226
|
-
expression: '$form?.verified !== "pending"'
|
|
227
|
-
}
|
|
228
|
-
]
|
|
221
|
+
action: "hide",
|
|
222
|
+
expression: '$form?.verified !== "pending"',
|
|
223
|
+
},
|
|
224
|
+
],
|
|
229
225
|
};
|
|
230
226
|
};
|
|
231
227
|
|
|
232
228
|
export const idVerificationFields = (event: string, sectionId: string) => {
|
|
233
229
|
return [
|
|
234
230
|
verified(event, sectionId),
|
|
235
|
-
idPendingVerificationBanner(event, sectionId)
|
|
231
|
+
idPendingVerificationBanner(event, sectionId),
|
|
236
232
|
];
|
|
237
233
|
};
|
package/tsconfig.json
CHANGED