Skip to content

Commit 060393a

Browse files
committed
fixed validation errors
1 parent cb211ff commit 060393a

File tree

1 file changed

+33
-10
lines changed

1 file changed

+33
-10
lines changed

src/views/playground/WidgetConfig/Index.vue

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,14 @@ ul {
197197
<div class="">
198198
<span class="zkbadge rounded " style="cursor: grab;" @click="deleteZkProof(proof.proofType)"
199199
v-for="proof in widgetConfigTemp.zkProof.proofs" v-bind:key="proof.proofType"><b-icon
200-
style="color:green;" icon="check-circle" aria-hidden="true"></b-icon> {{ proof.proofType }}
200+
style="color:green;" icon="check-circle" aria-hidden="true"></b-icon>
201+
<span v-if="proof.proofType == SupportedZkProofTypes.PROOF_OF_AGE">
202+
{{ proof.proofType }} > {{ proof.criteria }}
203+
</span>
204+
<span v-else>
205+
{{ proof.proofType }}
206+
</span>
207+
201208
<b-icon class="trash" style="color:red" icon="trash" aria-hidden="true"></b-icon></span>
202209
</div>
203210
</div>
@@ -341,13 +348,13 @@ import { mapGetters, mapMutations } from 'vuex/dist/vuex.common.js';
341348
// import TrustedIssuer from './components/TrustedIssuer.vue';
342349
import MarketplaceList from '../../../components/MarketplaceList.vue';
343350
import HFBeta from '../../../components/element/HFBeta.vue';
344-
const SupportedZkProofTypes = Object.freeze({
345-
PROOF_OF_KYC: 'zkProofOfKYC',
346-
PROOF_OF_PERSONHOOD: 'zkProofOfPersonHood',
347-
PROOF_OF_AGE: 'zkProofOfAge',
348-
PROOF_OF_MEMBERSHIP: 'zkProofOfMembership',
349-
PROOF_OF_DOB: 'zkProofOfDOB',
350-
})
351+
// const SupportedZkProofTypes = Object.freeze({
352+
// PROOF_OF_KYC: 'zkProofOfKYC',
353+
// PROOF_OF_PERSONHOOD: 'zkProofOfPersonHood',
354+
// PROOF_OF_AGE: 'zkProofOfAge',
355+
// PROOF_OF_MEMBERSHIP: 'zkProofOfMembership',
356+
// PROOF_OF_DOB: 'zkProofOfDOB',
357+
// })
351358
352359
export default {
353360
name: "WidgetConfig",
@@ -488,6 +495,13 @@ export default {
488495
},
489496
data() {
490497
return {
498+
SupportedZkProofTypes: Object.freeze({
499+
PROOF_OF_KYC: 'zkProofOfKYC',
500+
PROOF_OF_PERSONHOOD: 'zkProofOfPersonHood',
501+
PROOF_OF_AGE: 'zkProofOfAge',
502+
PROOF_OF_MEMBERSHIP: 'zkProofOfMembership',
503+
PROOF_OF_DOB: 'zkProofOfDOB',
504+
}),
491505
widgetConfigUI: {
492506
faceRecog: {
493507
label: "Enable Facial Recoginition",
@@ -644,6 +658,15 @@ export default {
644658
}
645659
646660
}
661+
662+
if (this.widgetConfigTemp.zkProof.enabled) {
663+
if (!this.widgetConfigTemp.idOcr.enabled) {
664+
const t = this.widgetConfigTemp.zkProof.proofs.filter(x => (x.proofType != this.SupportedZkProofTypes.PROOF_OF_PERSONHOOD))
665+
if (t.length > 0) {
666+
throw new Error('You are trying to configure zk proof types which required ID Documentation verification. Please enabled ID document to proceed.')
667+
}
668+
}
669+
}
647670
},
648671
async saveConfiguration() {
649672
try {
@@ -679,7 +702,7 @@ export default {
679702
this.widgetConfigTemp.zkProof.proofs = []
680703
}
681704
682-
if (proofType == SupportedZkProofTypes.PROOF_OF_AGE) {
705+
if (proofType == this.SupportedZkProofTypes.PROOF_OF_AGE) {
683706
if (!criteria) {
684707
return this.notifyErr('Kindly specify age criteria to generate proof')
685708
}
@@ -699,7 +722,7 @@ export default {
699722
}
700723
this.slectProof = null
701724
702-
this.updateConfiguration()
725+
// this.updateConfiguration()
703726
},
704727
705728
async updateConfiguration() {

0 commit comments

Comments
 (0)