Skip to content

Commit cb211ff

Browse files
committed
fixed validation issues
1 parent 3ac20e5 commit cb211ff

File tree

1 file changed

+29
-12
lines changed

1 file changed

+29
-12
lines changed

src/views/playground/WidgetConfig/Index.vue

Lines changed: 29 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ ul {
182182
</li>
183183
<li class="list-group-item">
184184
<div class="row">
185-
<div class="col">
185+
<div class="col-md-6">
186186
<div class="row">
187187
<div class="col-md-12">
188188
<b-form-checkbox switch size="lg" v-model="widgetConfigTemp.zkProof.enabled">{{
@@ -205,7 +205,6 @@ ul {
205205

206206
<div class="col" v-if="widgetConfigTemp.zkProof.enabled">
207207
<div class="">
208-
209208
<div class="">
210209
<label for=""><strong>Select Proof Type: </strong></label>
211210
<b-form-select class="col-md-10" v-model="slectProof" :options="proofTypeOptions"
@@ -235,7 +234,7 @@ ul {
235234
</div>
236235
</li>
237236
<li class="list-group-item">
238-
<div class="row" v-if="widgetConfigTemp.zkProof.enabled">
237+
<div class="row">
239238
<div class="col">
240239
<b-form-checkbox switch size="lg" v-model="widgetConfigTemp.onChainId.enabled">{{
241240
this.widgetConfigUI.onChainId.label }} <HFBeta></HFBeta></b-form-checkbox>
@@ -361,13 +360,16 @@ export default {
361360
},
362361
// TODO : check why this is not working... we need to trigger warning that its an experimental feature once user enables zk
363362
watch: {
364-
// widgetConfigTemp: function (newValue,) {
365-
// console.log(newValue)
366-
// // if (newValue.zkProof.enabled) {
367-
// this.warnUsers('b-toaster-top-full')
368-
// console.log('warningn....')
369-
// // }
370-
// }
363+
'widgetConfigTemp.zkProof.enabled':
364+
{
365+
handler(newValue) {
366+
if (!newValue) {
367+
console.log('going to disabled onchainId')
368+
this.widgetConfigTemp.onChainId.enabled = false
369+
}
370+
},
371+
deep: true
372+
},
371373
},
372374
computed: {
373375
...mapState({
@@ -435,9 +437,12 @@ export default {
435437
436438
this.trustedIssuersList = this.getMarketPlaceApps;
437439
this.appId = this.$route.params.appId;
440+
//eslint-disable-next-line
441+
debugger;
438442
if (this.appId) {
439443
this.app = { ...this.getAppByAppId(this.appId) }
440444
if (this.app) {
445+
console.log(this.app)
441446
this.widgetConfigTemp.userConsent.domain = this.app.domain ? this.app.domain : this.widgetConfigTemp.userConsent.domain;
442447
this.widgetConfigTemp.userConsent.logoUrl = this.app.logoUrl ? this.app.logoUrl : this.widgetConfigTemp.userConsent.logoUrl;
443448
if (!this.widgetConfigTemp.issuerDID) {
@@ -447,7 +452,11 @@ export default {
447452
if (!this.getMarketPlaceApps.find(x => x.appId == this.app.appId)) {
448453
this.trustedIssuersList.push({ ...this.app })
449454
}
455+
} else {
456+
console.error("No app found");
450457
}
458+
} else {
459+
console.error("No appId found");
451460
}
452461
453462
if (this.widgetConfigTemp.issuerDID) {
@@ -610,22 +619,30 @@ export default {
610619
if (!this.widgetConfigTemp.issuerDID) {
611620
throw new Error('Issuer DID is required')
612621
}
622+
console.log(this.widgetConfigTemp.idOcr)
613623
614624
if (!this.widgetConfigTemp.idOcr?.enabled) {
615625
this.widgetConfigTemp.idOcr.documentType = null
616626
} else {
617627
if (!this.widgetConfigTemp.idOcr.documentType) {
618-
throw new Error('Kindly select a document type')
628+
this.widgetConfigTemp.idOcr.documentType = 'passport'
619629
}
620630
}
621631
622-
if (!this.widgetConfigTemp.onChainId.enabled || !this.widgetConfigTemp.zkProof.enabled) {
632+
if (!this.widgetConfigTemp.onChainId.enabled) {
623633
this.widgetConfigTemp.onChainId.selectedOnChainKYCconfiguration = null
624634
this.widgetConfigTemp.onChainId.enabled = false
625635
} else {
636+
637+
626638
if (!this.widgetConfigTemp.onChainId.selectedOnChainKYCconfiguration) {
627639
throw new Error('Kindly select a onchain configuration')
628640
}
641+
642+
if (!this.widgetConfigTemp.zkProof.enabled) {
643+
throw new Error('Enable ZK Proof to enable onchainId')
644+
}
645+
629646
}
630647
},
631648
async saveConfiguration() {

0 commit comments

Comments
 (0)