Skip to content

Commit c338fda

Browse files
author
Maikel Maas
committed
VDX-278 Fixed KVK broken pages:
- Information Manual Request (readonly fields); - Credentials Issue Request (Layout);
1 parent 536040d commit c338fda

4 files changed

Lines changed: 34 additions & 17 deletions

File tree

packages/oid4vci-demo-frontend/src/components/Form/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const evaluateDefaultValue = (field: DataFormElement, formInitData: ImmutableRec
2424
return fieldValue
2525
}
2626

27-
let defaultValue: FormFieldValue = formInitData?.[field.id] ?? field.defaultValue ?? ''
27+
let defaultValue: FormFieldValue = formInitData?.[field.key] ?? field.defaultValue ?? ''
2828
if (defaultValue === '*RANDOM8') { // TODO this is for a demo, create something more sophisticated later
2929
defaultValue = Math.floor(Math.random() * 89999999 + 10000000)
3030
} else if (defaultValue === '*RANDOM-IBAN') { // TODO this is for a demo, create something more sophisticated later
@@ -67,7 +67,7 @@ const Form: FC<Props> = (props: Props): ReactElement => {
6767
inlineStyle={style}
6868
label={field.label ? t(field.label) ?? undefined : undefined}
6969
type={field.type}
70-
readonly={field.readonly || formInitData?.[field.id] !== undefined || Boolean(field.readonlyWhenAbsentInPayload)}
70+
readonly={field.readonly || formInitData?.[field.key] !== undefined || Boolean(field.readonlyWhenAbsentInPayload)}
7171
defaultValue={defaultValue}
7272
customValidation={field.customValidation ? new RegExp(field.customValidation) : undefined}
7373
onChange={async (value: FormFieldValue): Promise<void> => onChangeValue(value, field.key)}

packages/oid4vci-demo-frontend/src/configs/kvk.json

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,11 @@
142142
"backgroundColor": "#005371"
143143
},
144144
"issueRequest": {
145-
"title": "coc_qrcode_right_pane_top_title",
145+
"title": "title_secure_your_credential",
146146
"topParagraph": "paragraph_add_credential",
147147
"bottomParagraph": "paragraph_scan_this_qr",
148148
"backgroundColor": "#005371",
149+
"rightPaneHeight": "70%",
149150
"logo": {
150151
"src": "coc/logo.svg",
151152
"alt": "chamber of commerce logo",
@@ -167,6 +168,7 @@
167168
"sharing_data_right_pane_title": "coc_sharing_data_right_pane_title",
168169
"sharing_data_right_pane_paragraph": "coc_sharing_data_right_pane_top_paragraph",
169170
"backgroundColor": "#005371",
171+
"primaryButtonResourceId": "Share",
170172
"logo": {
171173
"src": "coc/logo.svg",
172174
"alt": "chamber of commerce logo",
@@ -187,17 +189,19 @@
187189
{
188190
"id": "ssi_information_request_page_form_company_name",
189191
"key": "Bedrijfsnaam",
190-
"title": "ssi_information_request_page_form_company_name_label",
191-
"type": "string",
192+
"label": "ssi_information_request_page_form_company_name_label",
193+
"labelStyle": { "color": "#424242" },
194+
"type": "text",
192195
"required": true
193196
}
194197
],
195198
[
196199
{
197200
"id": "ssi_information_request_page_form_coc_number",
198201
"key": "KvkNummer",
199-
"title": "ssi_information_request_page_form_coc_number_label",
200-
"type": "string",
202+
"label": "ssi_information_request_page_form_coc_number_label",
203+
"labelStyle": { "color": "#424242" },
204+
"type": "text",
201205
"required": true,
202206
"defaultValue": "*RANDOM8"
203207
}
@@ -206,41 +210,46 @@
206210
{
207211
"id": "ssi_information_request_page_form_company_location",
208212
"key": "Bedrijfslocatie",
209-
"title": "ssi_information_request_page_form_company_location_label",
210-
"type": "string",
213+
"label": "ssi_information_request_page_form_company_location_label",
214+
"labelStyle": { "color": "#424242" },
215+
"type": "text",
211216
"required": true
212217
}
213218
],
214219
[
215220
{
216221
"id": "ssi_information_request_page_first_name_director",
217222
"key": "Voornaam",
218-
"title": "ssi_information_request_page_form_first_name_director_label",
219-
"type": "string",
223+
"label": "ssi_information_request_page_form_first_name_director_label",
224+
"labelStyle": { "color": "#424242" },
225+
"type": "text",
220226
"required": true
221227
},
222228
{
223229
"id": "ssi_information_request_page_form_last_name_director",
224230
"key": "Achternaam",
225-
"title": "ssi_information_request_page_form_last_name_director_label",
226-
"type": "string",
231+
"label": "ssi_information_request_page_form_last_name_director_label",
232+
"labelStyle": { "color": "#424242" },
233+
"type": "text",
227234
"required": true
228235
}
229236
],
230237
[
231238
{
232239
"id": "ssi_information_request_page_form_place_of_birth",
233240
"key": "Geboorteplaats",
234-
"title": "ssi_information_request_page_form_place_of_birth_label",
235-
"type": "string",
241+
"label": "ssi_information_request_page_form_place_of_birth_label",
242+
"labelStyle": { "color": "#424242" },
243+
"type": "text",
236244
"required": true
237245
}
238246
],
239247
[
240248
{
241249
"id": "ssi_information_request_page_form_date_of_birth",
242250
"key": "Geboortedatum",
243-
"title": "ssi_information_request_page_form_date_of_birth_label",
251+
"label": "ssi_information_request_page_form_date_of_birth_label",
252+
"labelStyle": { "color": "#424242" },
244253
"type": "date",
245254
"required": true
246255
}
@@ -275,6 +284,9 @@
275284
"id": "credentialOffer",
276285
"operation": "execute",
277286
"action": "create-credential-offer",
287+
"actionParams": {
288+
"issueCredentialType": "KvkInschrijving"
289+
},
278290
"nextId": "issueRequest"
279291
},
280292
{
@@ -313,6 +325,9 @@
313325
"styles": {
314326
"mainContainer": {
315327
"backgroundColor": "#005371"
328+
},
329+
"button": {
330+
"width": "327px"
316331
}
317332
}
318333
},

packages/oid4vci-demo-frontend/src/ecosystem/ecosystem-config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,7 @@ export interface SSICredentialIssueRequestPageConfig extends PageConfig {
216216
title?: string
217217
topParagraph?: string
218218
bottomParagraph?: string
219+
rightPaneHeight?: string | number
219220
mobile?: {
220221
logo?: ImageProperties
221222
backgroundColor?: string

packages/oid4vci-demo-frontend/src/pages/SSICredentialIssueRequestPage/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,9 @@ const SSICredentialIssueRequestPage: React.FC = () => {
134134
display: 'flex',
135135
flexDirection: 'column',
136136
justifyContent: 'space-between',
137+
...(pageConfig.rightPaneHeight && { height: pageConfig.rightPaneHeight }),
137138
...(isNarrowScreen && {height: '100%'}),
138-
alignItems: 'center'
139+
alignItems: 'center',
139140
}}>
140141
<Text
141142
style={{textAlign: 'center', ...(isNarrowScreen && {marginRight: 24, marginLeft: 24})}}

0 commit comments

Comments
 (0)