From 97692747f8863598a91f89a59501faac4310dd40 Mon Sep 17 00:00:00 2001 From: Tim Smyth <33017641+pulledtim@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:10:14 +0200 Subject: [PATCH 01/21] Update README.md --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0c32e59..88cb024 100644 --- a/README.md +++ b/README.md @@ -52,3 +52,4 @@ DEBUG="portal:*" ``` +Test for Gernot From c6f0f52fbd611584ce49b74fdae0adf10c3abcd4 Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:22:23 +0200 Subject: [PATCH 02/21] Update index.pug Test run --- views/index.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/index.pug b/views/index.pug index 18e9f0e..1b0020f 100644 --- a/views/index.pug +++ b/views/index.pug @@ -7,7 +7,7 @@ block content if siop tr td - a.button(href=`/loginSiop`) Login with VC + a.button(href=`/loginSiop`) Login with VCs if siopJwtOnly tr td From 96153ac597aa5b0bd50db4a373dac75a6ef4901f Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Sun, 21 Apr 2024 20:57:52 +0200 Subject: [PATCH 03/21] Default and index first update --- views/default.pug | 13 +++-- views/index.pug | 132 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 142 insertions(+), 3 deletions(-) diff --git a/views/default.pug b/views/default.pug index 10b6da9..e6086b3 100644 --- a/views/default.pug +++ b/views/default.pug @@ -11,8 +11,15 @@ html .mdl-layout.mdl-js-layout.mdl-layout--fixed-header main block header - header.header - a.title(href='/') - h1 #{title} + // header.header + // a.title(href='/') + // h1 #{title} + p + img(src='https://thebatterypass.io/_next/static/media/logo_primary.ff8fcc3a.png' alt='enter image description here') + a.title(href='/') + h1#login-with-verifiable-credentials-vcs-demo-brpowered-by-fiware-data-space-connector--pdp-component + | Login with Verifiable Credentials (VCs) demo + br + | (powered by FIWARE Data Space Connector PDP component) block topnav block content diff --git a/views/index.pug b/views/index.pug index 1b0020f..848002d 100644 --- a/views/index.pug +++ b/views/index.pug @@ -16,3 +16,135 @@ block content tr td a.button(href=`/login?idp=` + i.id) #{i.name} + + h2#a-description-how-to-login-with-vcs-and-use-the-demobr + | a) Description how to login with VCs and use the demo + br + h3#prerequisites Prerequisites: + ul + li You need to obtain a VC before, follow info below in b) + li Tested with Chrome browser (desktop + mobile) + li Camera must be allowed on mobile phone + li Pop-up windows and Javascript must be allowed on mobile + h3#step-by-step Step-by-step: + ol + li + p + | Open this page in desktop browser + a(href='https://portal-one.batterypass.fiware.dev/') Link + li + p + | Change to mobile browser to the homepage of the demo-wallet, you should see your VC you have obtained before, something like “urn:uuid:xxxxxxx”) + li + p Change back to desktop browser and click link “Login demo with VCs” + li + p A new small window appears “Scan this QR code to authenticate with a mobile” + li + p Change to mobile browser and press “Scan QR” in Authentication card + li + p Scan QR code with mobile browser + li + p Press appearing button “Send credentials” + li + p Press button “Accept” + li + p Login done successfully + li + p After successful login: + li + p + | Enter in field Type: + br + | “Battery” + br + | and press button “Get entities” + li + p + | Enter in field Battery ID: + br + | “urn:batterypass:4a1331e8-646b-423d-b75a-cee15c486555” + br + | and press button “Get Battery” + h2#b-description-how-to-obtain-demo-vcs b) Description how to obtain demo VCs + h3#step-by-step-1 Step-by-step: + ol + li + p + | Open Keycloak IDM in desktop browser: + a(href='https://kc-two.batterypass.fiware.dev/realms/fiware-server/account/#/') Link + li + p + | Sign in into Keycloak IDM + br + | (user: battery-user password: battery-user) + li + p Click Link “Verifiable Credentials” + li + p Select option: “BatteryPassAuthCredential ldp_vc” in drob-down box + li + p + | Change to mobile phone and demo-wallet open in mobile browser: + br + a(href='https://demo-wallet.fiware.dev') https://demo-wallet.fiware.dev + br + | (You should see a blue button “Scan a QR”) + li + p Change back to Keycloak in the desktop browser + li + p + | Click blue button “Initiate Credential-Issuance(OIDC4CI)” + br + | (a QR code appears) + li + p + | Change back to wallet in mobile browser an press blue button “Scan a QR” + br + | (be quick, QR code is just valid for some seconds) + li + p Receive the VC, + li + p Press button “Save” and see the VC received + li + p Scroll down and press the button “Home” + table + thead + tr + th + th + tbody + tr + td Battery passport + td + a(href='https://thebatterypass.eu/') Project website + br + a(href='https://thebatterypass.eu/assets/images/technical-guidance/pdf/2024_BatteryPassport_Technical_Guidance.pdf') Technical Guidance document + br + a(href='https://thebatterypass.eu/assets/images/content-guidance/pdf/2023_Battery_Passport_Content_Guidance.pdf') Content Guidance document + br + a(href='https://thebatterypass.io/en/did:web:acme.battery.pass:0226151e-949c-d067-8ef3-162431e28976') Software demonstrator + br + a(href='https://thebatterypass.eu/assets/images/content-guidance/pdf/2023_Battery_Passport_Data_Attributes.xlsx') Data attribute longlist + br + a(href='https://thebatterypass.eu/assets/images/value-assessment/pdf/2024_BatteryPassport_Value_Assessment.pdf') Value assessment + tr + td Follow us + td + a(href='https://www.linkedin.com/company/batterypass/') LinkedIn + br + a(href='https://www.youtube.com/@BatteryPass') Youtube + tr + td FIWARE Data Space Connector + td + a(href='https://github.com/FIWARE/data-space-connector') Github + tr + td Contact us + td + a(href='https://thebatterypass.eu/resources/contact-us/') Contact form + tr + td + img(src='https://thebatterypass.eu/wp-content/uploads/logo_BMWK_EN.png' alt='BMWK Funding Attributions') + td + | This project receives funding from the German Federal Ministry for Economic Affairs and Climate Action by resolution of the German Bundestag under grant agreement No BZF335. + br + a(href='https://fiware-legal.readthedocs.io/en/latest/PersonalDataProtectionPolicy.html') PrivacyPolicy + a(href='https://www.fiware.org/imprint/') Imprint \ No newline at end of file From 88064ec675f08661c56df44c1bd38a75d2ef4d3f Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Sun, 21 Apr 2024 21:52:39 +0200 Subject: [PATCH 04/21] Title page 1st --- public/css/style.css | 10 ++++++++++ views/default.pug | 8 ++++---- views/index.pug | 10 +++++----- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 580b45b..7742f1e 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -55,6 +55,16 @@ body { margin-bottom: 0px; } +.header img { + image-align: center; + height: 110px; + width: 300px; +} + +.header a { + float: center; +} + .title { color: inherit; text-decoration: none; diff --git a/views/default.pug b/views/default.pug index e6086b3..93cc8b2 100644 --- a/views/default.pug +++ b/views/default.pug @@ -14,10 +14,10 @@ html // header.header // a.title(href='/') // h1 #{title} - p - img(src='https://thebatterypass.io/_next/static/media/logo_primary.ff8fcc3a.png' alt='enter image description here') - a.title(href='/') - h1#login-with-verifiable-credentials-vcs-demo-brpowered-by-fiware-data-space-connector--pdp-component + a.header(href='/') + img.header(src='https://thebatterypass.io/_next/static/media/logo_primary.ff8fcc3a.png' alt='Homepage') + a.header(href='/') + h2#login-with-verifiable-credentials-vcs-demo-brpowered-by-fiware-data-space-connector--pdp-component | Login with Verifiable Credentials (VCs) demo br | (powered by FIWARE Data Space Connector PDP component) diff --git a/views/index.pug b/views/index.pug index 848002d..3cd47de 100644 --- a/views/index.pug +++ b/views/index.pug @@ -1,13 +1,13 @@ extends default block content - div.container-login - h1 Login - table(class='table-login' border='1' frame='void' rules='rows') + div //.container-login + h1 Click link below to login + table(border='1' frame='void' rules='rows') // (class='table-login' border='1' frame='void' rules='rows') if siop tr td - a.button(href=`/loginSiop`) Login with VCs + a.button(href=`/loginSiop`) Login demo with VCs if siopJwtOnly tr td @@ -16,7 +16,7 @@ block content tr td a.button(href=`/login?idp=` + i.id) #{i.name} - + div h2#a-description-how-to-login-with-vcs-and-use-the-demobr | a) Description how to login with VCs and use the demo br From 77c050bba3fc32d3d667c82cce9e5626b6d398ea Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Sun, 21 Apr 2024 22:11:03 +0200 Subject: [PATCH 05/21] Layout corrections + CB URL hardcoded in 2 GET 1 POST --- public/css/style.css | 10 +++++++++- server.js | 6 +++--- views/default.pug | 16 +++++++++------- views/index.pug | 6 +++--- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 7742f1e..e055bf4 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -50,18 +50,26 @@ body { justify-content: center; align-items: center; height: 80px; - background-color: #525286; + background-color: #1ED760; color: #FFFFFF; margin-bottom: 0px; } .header img { image-align: center; + padding-top: 10px; + padding-bottom: 10px; height: 110px; width: 300px; } .header a { + color: #000000; + float: center; +} + +.header h2 { + color: #000000; float: center; } diff --git a/server.js b/server.js index 42923b4..a6d2889 100644 --- a/server.js +++ b/server.js @@ -179,7 +179,7 @@ async function get_delivery(delivery_id, req_session) { err: null, delivery: null } - var path = req_session.cb_endpoint + '/entities/' + delivery_id; + var path = 'https://one.batterypass.fiware.dev/orion-ld/ngsi-ld/v1' + '/entities/' + delivery_id; var url = new URL(path); url.searchParams.append('options', 'keyValues'); @@ -216,7 +216,7 @@ async function get_entities(type, req_session) { err: null, entities: null } - var path = req_session.cb_endpoint + '/entities?type='+type; + var path = 'https://one.batterypass.fiware.dev/orion-ld/ngsi-ld/v1' + '/entities?type='+type; var url = new URL(path); try { debug('Get request URL: %o', url); @@ -298,7 +298,7 @@ async function patch_delivery(id, attr, val, req_session) { err: null, status: null } - var path = req_session.cb_endpoint + '/entities/' + id + '/attrs/' + attr; + var path = 'https://one.batterypass.fiware.dev/orion-ld/ngsi-ld/v1' + '/entities/' + id + '/attrs/' + attr; var url = new URL(path); const body = { type: "Property", diff --git a/views/default.pug b/views/default.pug index 93cc8b2..7e15f0f 100644 --- a/views/default.pug +++ b/views/default.pug @@ -14,12 +14,14 @@ html // header.header // a.title(href='/') // h1 #{title} - a.header(href='/') - img.header(src='https://thebatterypass.io/_next/static/media/logo_primary.ff8fcc3a.png' alt='Homepage') - a.header(href='/') - h2#login-with-verifiable-credentials-vcs-demo-brpowered-by-fiware-data-space-connector--pdp-component - | Login with Verifiable Credentials (VCs) demo - br - | (powered by FIWARE Data Space Connector PDP component) + div + a.header(href='/') + img.header(src='https://thebatterypass.io/_next/static/media/logo_primary.ff8fcc3a.png' alt='Homepage') + div + a.header(href='/') + h2.header#login-with-verifiable-credentials-vcs-demo-brpowered-by-fiware-data-space-connector--pdp-component + | Login with Verifiable Credentials (VCs) demo + br + | (powered by FIWARE Data Space Connector PDP component) block topnav block content diff --git a/views/index.pug b/views/index.pug index 3cd47de..de7e55e 100644 --- a/views/index.pug +++ b/views/index.pug @@ -1,9 +1,9 @@ extends default block content - div //.container-login - h1 Click link below to login - table(border='1' frame='void' rules='rows') // (class='table-login' border='1' frame='void' rules='rows') + div + h2 Click link below to login + table(border='1' frame='void' rules='rows') if siop tr td From b8decae4cc863c0316f1fcf5359d668278da5650 Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Sun, 21 Apr 2024 22:49:00 +0200 Subject: [PATCH 06/21] Next updates --- public/css/style.css | 12 +++++++++++- views/default.pug | 6 ++---- views/index.pug | 4 ++-- views/portal.pug | 17 ++++------------- 4 files changed, 19 insertions(+), 20 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index e055bf4..d375d53 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -66,11 +66,16 @@ body { .header a { color: #000000; float: center; + text-align: center; + height: 130px; } .header h2 { color: #000000; float: center; + text-align: center; + vertical-align: middle; + text-decoration:none; } .title { @@ -150,6 +155,11 @@ body { padding: 0; } /* margin: 0; */ +.content div { + padding-left: 20px; +} + + .content-row { text-align: center; margin-left: auto; @@ -166,7 +176,7 @@ body { .delivery-id { margin-top: 40px; - color: #525286; + color: #000; margin-bottom: 50px; } diff --git a/views/default.pug b/views/default.pug index 7e15f0f..f9a6f70 100644 --- a/views/default.pug +++ b/views/default.pug @@ -19,9 +19,7 @@ html img.header(src='https://thebatterypass.io/_next/static/media/logo_primary.ff8fcc3a.png' alt='Homepage') div a.header(href='/') - h2.header#login-with-verifiable-credentials-vcs-demo-brpowered-by-fiware-data-space-connector--pdp-component - | Login with Verifiable Credentials (VCs) demo - br - | (powered by FIWARE Data Space Connector PDP component) + h2.header + |Demo: Login with Verifiable Credentials (VCs) block topnav block content diff --git a/views/index.pug b/views/index.pug index de7e55e..9eafa72 100644 --- a/views/index.pug +++ b/views/index.pug @@ -1,7 +1,7 @@ extends default block content - div + div.content h2 Click link below to login table(border='1' frame='void' rules='rows') if siop @@ -16,7 +16,7 @@ block content tr td a.button(href=`/login?idp=` + i.id) #{i.name} - div + div.content h2#a-description-how-to-login-with-vcs-and-use-the-demobr | a) Description how to login with VCs and use the demo br diff --git a/views/portal.pug b/views/portal.pug index 7e7c3ff..3886e8a 100644 --- a/views/portal.pug +++ b/views/portal.pug @@ -24,7 +24,7 @@ block search block entities div.content-delivery-row h2.delivery-id - #{entities} + | Battery passports available each i in entities table.table tr @@ -115,24 +115,15 @@ block sd block delivery div.content-delivery-row h2.delivery-id - | #{delivery.id} + | Data elements of output object from #{delivery.id} table.table thead tr th Attribute th Values tbody - each i in entity_attributes + each i in entity_attributes.output tr if i[0] != 'id' && i[0] != 'type' td #{i[0]} - td.highlight #{i[1]} - td - form(action='/portal', method='POST') - p.delivery-action - | - input(type='text', name='entity_change_val', id='entity_change_val', value=i[1]) - input(type='hidden', name='entity_change_attr', id='entity_change_attr', value=i[0]) - input(type='hidden', name='entity_id', id='entity_id', value=delivery.id) - input(type='submit', value='Change') - \ No newline at end of file + td.highlight #{i[1]} \ No newline at end of file From ae8ca3ed025966b65411e6dcc9ac285db684ea0c Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Sun, 21 Apr 2024 23:18:03 +0200 Subject: [PATCH 07/21] Update server.js --- public/css/style.css | 5 +++-- server.js | 2 +- views/default.pug | 5 ++--- views/portal.pug | 9 ++++----- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index d375d53..db7519d 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -72,10 +72,9 @@ body { .header h2 { color: #000000; - float: center; text-align: center; vertical-align: middle; - text-decoration:none; + text-decoration: none; } .title { @@ -168,7 +167,9 @@ body { } .content-delivery-row { + float: center; margin-top: 50px; + padding-left: 20px; text-align: center; margin-left: auto; margin-right: auto; diff --git a/server.js b/server.js index a6d2889..40c8996 100644 --- a/server.js +++ b/server.js @@ -692,7 +692,7 @@ app.post('/portal', async (req, res) => { var entity_attributes = []; if (result.delivery) { - entity = result.delivery; + entity = result.delivery.output; entity_keys = Object.keys(entity); for (var key in entity_keys) { let attribute = { diff --git a/views/default.pug b/views/default.pug index f9a6f70..761e196 100644 --- a/views/default.pug +++ b/views/default.pug @@ -18,8 +18,7 @@ html a.header(href='/') img.header(src='https://thebatterypass.io/_next/static/media/logo_primary.ff8fcc3a.png' alt='Homepage') div - a.header(href='/') - h2.header - |Demo: Login with Verifiable Credentials (VCs) + h2.header + |Demo: Login with Verifiable Credentials (VCs) block topnav block content diff --git a/views/portal.pug b/views/portal.pug index 3886e8a..4df11cf 100644 --- a/views/portal.pug +++ b/views/portal.pug @@ -3,7 +3,6 @@ extends portal-layout block user a(href=`/logout`) | Logout - p #{user} block search @@ -12,13 +11,13 @@ block search p.portal-delivery | label(for='entity_type') Type: - input(type='text', name='entity_type', id='entity_type', value=entity_type, size="50") + input(type='text', name='entity_type', id='entity_type', value="Battery", size="50") input(type='submit', value="Get entities") form(action='/portal', method='POST') p.portal-delivery | - label(for='entity_id') #{input_label}: - input(type='text', name='entity_id', id='entity_id', value=entity_id, size="50") + label(for='entity_id') Battery Passport ID: + input(type='text', name='entity_id', id='entity_id', value="urn:batterypass:4a1331e8-646b-423d-b75a-cee15c486555", size="50") input(type='submit', value=get_label) hr block entities @@ -122,7 +121,7 @@ block delivery th Attribute th Values tbody - each i in entity_attributes.output + each i in entity_attributes tr if i[0] != 'id' && i[0] != 'type' td #{i[0]} From fc672246e7159fbf2ddf4a0b27e44b22d0f8a71e Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Sun, 21 Apr 2024 23:46:14 +0200 Subject: [PATCH 08/21] Next --- public/css/style.css | 12 +++++++++--- views/index.pug | 12 +++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index db7519d..72e7f13 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -51,7 +51,7 @@ body { align-items: center; height: 80px; background-color: #1ED760; - color: #FFFFFF; + color: #000; margin-bottom: 0px; } @@ -68,13 +68,15 @@ body { float: center; text-align: center; height: 130px; + } .header h2 { - color: #000000; + color: #000; text-align: center; vertical-align: middle; text-decoration: none; + margin-top: 0px; } .title { @@ -155,9 +157,13 @@ body { } /* margin: 0; */ .content div { - padding-left: 20px; + left: 20px; + top: 20px; } +.content h2 { + margin-top: 10px; +} .content-row { text-align: center; diff --git a/views/index.pug b/views/index.pug index 9eafa72..d201062 100644 --- a/views/index.pug +++ b/views/index.pug @@ -2,7 +2,7 @@ extends default block content div.content - h2 Click link below to login + h2.content Click link below to login table(border='1' frame='void' rules='rows') if siop tr @@ -17,7 +17,7 @@ block content td a.button(href=`/login?idp=` + i.id) #{i.name} div.content - h2#a-description-how-to-login-with-vcs-and-use-the-demobr + h2.content | a) Description how to login with VCs and use the demo br h3#prerequisites Prerequisites: @@ -26,6 +26,7 @@ block content li Tested with Chrome browser (desktop + mobile) li Camera must be allowed on mobile phone li Pop-up windows and Javascript must be allowed on mobile + br h3#step-by-step Step-by-step: ol li @@ -33,8 +34,7 @@ block content | Open this page in desktop browser a(href='https://portal-one.batterypass.fiware.dev/') Link li - p - | Change to mobile browser to the homepage of the demo-wallet, you should see your VC you have obtained before, something like “urn:uuid:xxxxxxx”) + p Change to mobile browser to the homepage of the demo-wallet, you should see your VC you have obtained before, something like “urn:uuid:xxxxxxx”) li p Change back to desktop browser and click link “Login demo with VCs” li @@ -65,7 +65,9 @@ block content | “urn:batterypass:4a1331e8-646b-423d-b75a-cee15c486555” br | and press button “Get Battery” - h2#b-description-how-to-obtain-demo-vcs b) Description how to obtain demo VCs + h2.content + | b) Description how to obtain demo VCs + br h3#step-by-step-1 Step-by-step: ol li From 719d9fa27d8309214afa3a5231041bd10ed46045 Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Mon, 22 Apr 2024 00:00:51 +0200 Subject: [PATCH 09/21] Margin --- public/css/style.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 72e7f13..1c105ce 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -76,7 +76,7 @@ body { text-align: center; vertical-align: middle; text-decoration: none; - margin-top: 0px; + margin: 0px; } .title { @@ -157,8 +157,8 @@ body { } /* margin: 0; */ .content div { - left: 20px; - top: 20px; + margin-left: 20px; + margin-top: 20px; } .content h2 { From 5287ef2437deed836575bc602841187eb6c6ba9c Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Mon, 22 Apr 2024 00:16:01 +0200 Subject: [PATCH 10/21] Next --- public/css/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 1c105ce..80546a2 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -157,8 +157,8 @@ body { } /* margin: 0; */ .content div { - margin-left: 20px; - margin-top: 20px; + margin: 20; + padding: 20; } .content h2 { From 468f72ff6917a8e26996dd9555a50496bf3a6193 Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Mon, 22 Apr 2024 00:38:39 +0200 Subject: [PATCH 11/21] NextTry --- public/css/style.css | 8 ++++---- server.js | 2 +- views/default.pug | 2 +- views/index.pug | 10 +++++----- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 80546a2..c631dd2 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -71,7 +71,7 @@ body { } -.header h2 { +#my-header-h2 { color: #000; text-align: center; vertical-align: middle; @@ -156,13 +156,13 @@ body { padding: 0; } /* margin: 0; */ -.content div { +#my-divid { margin: 20; padding: 20; } -.content h2 { - margin-top: 10px; +#my-h2 { + margin-top: 10px; } .content-row { diff --git a/server.js b/server.js index 40c8996..eb93a16 100644 --- a/server.js +++ b/server.js @@ -697,7 +697,7 @@ app.post('/portal', async (req, res) => { for (var key in entity_keys) { let attribute = { attribute_name: key, - attribute_value: entity[key] + attribute_value: JSON.stringify(entity[key]) } } entity_attributes = Object.entries(entity) diff --git a/views/default.pug b/views/default.pug index 761e196..bdee4e3 100644 --- a/views/default.pug +++ b/views/default.pug @@ -18,7 +18,7 @@ html a.header(href='/') img.header(src='https://thebatterypass.io/_next/static/media/logo_primary.ff8fcc3a.png' alt='Homepage') div - h2.header + h2#my-header-h2 |Demo: Login with Verifiable Credentials (VCs) block topnav block content diff --git a/views/index.pug b/views/index.pug index d201062..01f9e36 100644 --- a/views/index.pug +++ b/views/index.pug @@ -1,8 +1,8 @@ extends default block content - div.content - h2.content Click link below to login + div#my-divid + h2#my-h2 Click link below to login table(border='1' frame='void' rules='rows') if siop tr @@ -16,8 +16,8 @@ block content tr td a.button(href=`/login?idp=` + i.id) #{i.name} - div.content - h2.content + div#my-divid + h2#my-h2 | a) Description how to login with VCs and use the demo br h3#prerequisites Prerequisites: @@ -65,7 +65,7 @@ block content | “urn:batterypass:4a1331e8-646b-423d-b75a-cee15c486555” br | and press button “Get Battery” - h2.content + h2#my-h2 | b) Description how to obtain demo VCs br h3#step-by-step-1 Step-by-step: From 408399fb419d4bc9054f2118dae395c2171a3117 Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Mon, 22 Apr 2024 01:06:18 +0200 Subject: [PATCH 12/21] NextTry --- public/css/style.css | 6 +++++- server.js | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index c631dd2..20cb3e6 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -49,7 +49,7 @@ body { display: flex; justify-content: center; align-items: center; - height: 80px; + height: 110px; background-color: #1ED760; color: #000; margin-bottom: 0px; @@ -79,6 +79,10 @@ body { margin: 0px; } +#my-header-div { + background-color: #1ED760; +} + .title { color: inherit; text-decoration: none; diff --git a/server.js b/server.js index eb93a16..ee4e592 100644 --- a/server.js +++ b/server.js @@ -697,7 +697,7 @@ app.post('/portal', async (req, res) => { for (var key in entity_keys) { let attribute = { attribute_name: key, - attribute_value: JSON.stringify(entity[key]) + attribute_value: entity[key].value } } entity_attributes = Object.entries(entity) From db645cf9f67322481234ba9edc768981d4319577 Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Mon, 22 Apr 2024 01:21:48 +0200 Subject: [PATCH 13/21] Next --- public/css/style.css | 5 +++-- server.js | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/public/css/style.css b/public/css/style.css index 20cb3e6..e263174 100644 --- a/public/css/style.css +++ b/public/css/style.css @@ -71,15 +71,16 @@ body { } -#my-header-h2 { +h2#my-header-h2 { color: #000; text-align: center; vertical-align: middle; text-decoration: none; margin: 0px; + background-color: #1ED760; } -#my-header-div { +div#my-header-div { background-color: #1ED760; } diff --git a/server.js b/server.js index ee4e592..2c727f7 100644 --- a/server.js +++ b/server.js @@ -697,7 +697,7 @@ app.post('/portal', async (req, res) => { for (var key in entity_keys) { let attribute = { attribute_name: key, - attribute_value: entity[key].value + attribute_value: toString(entity[key]) } } entity_attributes = Object.entries(entity) From 2eec93ade1fb5a8b0bc1aa8837a107af8911bcc9 Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Mon, 22 Apr 2024 01:34:27 +0200 Subject: [PATCH 14/21] Next --- server.js | 2 +- views/portal.pug | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 2c727f7..40c8996 100644 --- a/server.js +++ b/server.js @@ -697,7 +697,7 @@ app.post('/portal', async (req, res) => { for (var key in entity_keys) { let attribute = { attribute_name: key, - attribute_value: toString(entity[key]) + attribute_value: entity[key] } } entity_attributes = Object.entries(entity) diff --git a/views/portal.pug b/views/portal.pug index 4df11cf..03b6bcd 100644 --- a/views/portal.pug +++ b/views/portal.pug @@ -125,4 +125,4 @@ block delivery tr if i[0] != 'id' && i[0] != 'type' td #{i[0]} - td.highlight #{i[1]} \ No newline at end of file + td.highlight #{i[1].toString()} \ No newline at end of file From 68d565b000da7597f932d9f3e5a465463589f3e3 Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Mon, 22 Apr 2024 01:41:26 +0200 Subject: [PATCH 15/21] Next --- server.js | 2 +- views/portal.pug | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 40c8996..2fce7c0 100644 --- a/server.js +++ b/server.js @@ -697,7 +697,7 @@ app.post('/portal', async (req, res) => { for (var key in entity_keys) { let attribute = { attribute_name: key, - attribute_value: entity[key] + attribute_value: entity[key].toString() } } entity_attributes = Object.entries(entity) diff --git a/views/portal.pug b/views/portal.pug index 03b6bcd..4df11cf 100644 --- a/views/portal.pug +++ b/views/portal.pug @@ -125,4 +125,4 @@ block delivery tr if i[0] != 'id' && i[0] != 'type' td #{i[0]} - td.highlight #{i[1].toString()} \ No newline at end of file + td.highlight #{i[1]} \ No newline at end of file From 0919bf7f34ccd172e5bd92caa047f98ed8dac7fe Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Mon, 22 Apr 2024 01:51:52 +0200 Subject: [PATCH 16/21] JSONtoString --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index 2fce7c0..5bd0764 100644 --- a/server.js +++ b/server.js @@ -697,7 +697,7 @@ app.post('/portal', async (req, res) => { for (var key in entity_keys) { let attribute = { attribute_name: key, - attribute_value: entity[key].toString() + attribute_value: JSON.toString(entity[key]) } } entity_attributes = Object.entries(entity) From fe3118d636dedb2d6c0d3fbfe69c927c3e98c33d Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Mon, 22 Apr 2024 02:09:32 +0200 Subject: [PATCH 17/21] value --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index 5bd0764..ee4e592 100644 --- a/server.js +++ b/server.js @@ -697,7 +697,7 @@ app.post('/portal', async (req, res) => { for (var key in entity_keys) { let attribute = { attribute_name: key, - attribute_value: JSON.toString(entity[key]) + attribute_value: entity[key].value } } entity_attributes = Object.entries(entity) From e66618aba6ebbeedf1dd40e9902cd1efc7500a96 Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Mon, 22 Apr 2024 02:27:30 +0200 Subject: [PATCH 18/21] Brackets --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index ee4e592..f7acf49 100644 --- a/server.js +++ b/server.js @@ -694,10 +694,12 @@ app.post('/portal', async (req, res) => { if (result.delivery) { entity = result.delivery.output; entity_keys = Object.keys(entity); + for (var key in entity_keys) { + let attribute = { attribute_name: key, - attribute_value: entity[key].value + attribute_value: entity[key]["value"] } } entity_attributes = Object.entries(entity) From e07ef2e69f89d7d0445897bb05a17a287b7f0003 Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Mon, 22 Apr 2024 02:36:43 +0200 Subject: [PATCH 19/21] debug --- server.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index f7acf49..cecce0f 100644 --- a/server.js +++ b/server.js @@ -697,9 +697,11 @@ app.post('/portal', async (req, res) => { for (var key in entity_keys) { + debug('GBEntitiyKeys: %o', entity[key]); + let attribute = { attribute_name: key, - attribute_value: entity[key]["value"] + attribute_value: entity[key] } } entity_attributes = Object.entries(entity) From bc1cd8470caab1e4d6876fcf661381d363dc4e70 Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Mon, 22 Apr 2024 02:47:18 +0200 Subject: [PATCH 20/21] Check --- views/portal.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/portal.pug b/views/portal.pug index 4df11cf..edde877 100644 --- a/views/portal.pug +++ b/views/portal.pug @@ -125,4 +125,4 @@ block delivery tr if i[0] != 'id' && i[0] != 'type' td #{i[0]} - td.highlight #{i[1]} \ No newline at end of file + td.highlight #{i[1]["value"]} \ No newline at end of file From be64407995cb3ab06a5182ed1919bb2bb4e7a3ff Mon Sep 17 00:00:00 2001 From: gboege <44926950+gboege@users.noreply.github.com> Date: Mon, 22 Apr 2024 07:24:48 +0200 Subject: [PATCH 21/21] Output object --- views/portal.pug | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/portal.pug b/views/portal.pug index edde877..0ad8a4f 100644 --- a/views/portal.pug +++ b/views/portal.pug @@ -114,7 +114,7 @@ block sd block delivery div.content-delivery-row h2.delivery-id - | Data elements of output object from #{delivery.id} + | Data elements of output object table.table thead tr