From a2b2c291feed32e5dcaa11c3d4dd29fc5388ffa9 Mon Sep 17 00:00:00 2001 From: F-Node-Karlsruhe Date: Wed, 22 Feb 2023 15:43:43 +0100 Subject: [PATCH] add context info to product passport view --- CHANGELOG.md | 7 ++++++- frontend/src/components/MergedProps.vue | 16 ++++++++++++---- frontend/src/components/Passport.vue | 13 +++++++++++-- frontend/src/components/ProductPassport.vue | 20 ++++++++++++++------ frontend/src/store/index.js | 2 +- 5 files changed, 44 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7682037..27fe979 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,12 @@ VC Verifier Changelog WIP --- -- show ld context in credential details + +1.2.0 (2023-02-22) +--- + +- show JSON-LD context in credential details +- show JSON-LD context in product passport 1.1.2 (2023-02-17) diff --git a/frontend/src/components/MergedProps.vue b/frontend/src/components/MergedProps.vue index 46d3f89..10e6193 100644 --- a/frontend/src/components/MergedProps.vue +++ b/frontend/src/components/MergedProps.vue @@ -8,11 +8,18 @@
  • - {{key}} + {{ key }} + + + +
    - {{$getCredentialValue(value)}} -

    {{$getCredentialValue(value)}}

    + {{ + $getCredentialValue(value) }} +

    {{ $getCredentialValue(value) }}

  • @@ -26,10 +33,11 @@ export default { name: 'MergedProps', props: { properties: Object, + context: Map }, data() { return { - + } }, } diff --git a/frontend/src/components/Passport.vue b/frontend/src/components/Passport.vue index d0e2e3d..907c37b 100644 --- a/frontend/src/components/Passport.vue +++ b/frontend/src/components/Passport.vue @@ -1,8 +1,10 @@ @@ -43,6 +45,13 @@ export default { }, }, methods: { + getContext() { + var context = new Map(); + this.credentials.forEach((credential) => { + if (credential.context) context = new Map([...context, ...credential.context]) + }) + return context + }, isProductPassport() { if (this.credentials.length < 1) return false; return this.credentials.filter(function (credential) { diff --git a/frontend/src/components/ProductPassport.vue b/frontend/src/components/ProductPassport.vue index 58b0bcf..2ff9bed 100644 --- a/frontend/src/components/ProductPassport.vue +++ b/frontend/src/components/ProductPassport.vue @@ -6,9 +6,8 @@
    Verified Product Passport
    -