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