@@ -193,9 +193,10 @@ h5 span {
193
193
@input =" OnSchemaSelectDropDownChange(selectedSchema)"
194
194
@change =" OnSchemaSelectDropDownChange(selectedSchema)" />
195
195
<datalist id =" schema" >
196
- <option v-for =" browser in selectOptions" :key =" browser.selected" :value =" browser.value"
196
+ <option v-for =" schema in schemaIdsList" :key =" schema.value"
197
+ :value =" schema.value"
197
198
class =" form-control" >
198
- {{ browser .text }}
199
+ {{ schema .text }}
199
200
</option >
200
201
</datalist >
201
202
<!-- <span
@@ -532,6 +533,7 @@ export default {
532
533
schemaConfigVisible: false ,
533
534
issuerConfigVisible: false ,
534
535
credentialDocumentToView: " " ,
536
+ schemaIdsList: [],
535
537
booleanOption: [
536
538
{ text: true , value: true },
537
539
{ text: false , value: false },
@@ -610,6 +612,26 @@ export default {
610
612
errorMessage: " " ,
611
613
selectedCredential: " "
612
614
};
615
+ },
616
+ async mounted () {
617
+ try {
618
+ const schemaIds = this .schemaList .map (schema => {
619
+ if (schema .id && schema .id !== undefined && schema .status === ' Registered' ){
620
+ return {
621
+ text: schema .schemaDocument .name + " " + ` {${ UtilsMixin .methods .truncate (schema .id , 60 )} }` ,
622
+ value: schema .id
623
+ }
624
+ }
625
+ else {
626
+ return null
627
+ }
628
+ })
629
+ this .schemaIdsList = schemaIds .filter (x => x)
630
+ this .schemaIdsList .unshift ({ value: null , text: " Please select a schema" })
631
+ return this .schemaIdsList ;
632
+ } catch (error) {
633
+ return this .notifyErr (error .message )
634
+ }
613
635
},
614
636
async created () {
615
637
try {
@@ -637,6 +659,7 @@ export default {
637
659
methods: {
638
660
... mapActions (' mainStore' , [
639
661
' fetchCredentialList' ,
662
+ ' fetchSchemaList' ,
640
663
' resolveCredential' ,
641
664
' checkBlockchainStatusOfSSI' ,
642
665
' resolveSchema' ,
@@ -726,8 +749,10 @@ export default {
726
749
this .reasonForCredentialUpdate = " " ;
727
750
this .verificationMethodId = " " ;
728
751
this .errorMessage = " " ;
752
+ this .warningMessage = " " ;
729
753
},
730
754
async handleCredentialAction (credentialId ,action ){
755
+ this .resetForm ()
731
756
this .vcId = credentialId;
732
757
this .selectedAction = action ;
733
758
this .selectedCredential = this .credentialList .find (x => x .id === credentialId)
@@ -757,13 +782,13 @@ export default {
757
782
}
758
783
let fetchedCredStatus;
759
784
const { revoked , suspended , issuer } = this .selectedCredential .credentialStatus ;
760
- if (! revoked && ! suspended ) {
761
- fetchedCredStatus= ' LIVE '
762
- } else if (! suspended) {
763
- fetchedCredStatus= " SUSPEND"
764
- } else {
765
- fetchedCredStatus= " REVOKE "
766
- }
785
+ if (revoked) {
786
+ fetchedCredStatus = " REVOKE " ;
787
+ } else if (suspended) {
788
+ fetchedCredStatus = " SUSPEND" ;
789
+ } else {
790
+ fetchedCredStatus = " LIVE " ;
791
+ }
767
792
// check for status
768
793
switch (this .selectedAction ) {
769
794
case " LIVE" :
@@ -774,7 +799,7 @@ export default {
774
799
break ;
775
800
case " SUSPEND" :
776
801
if (fetchedCredStatus === " SUSPEND" ) {
777
- this .errorMessage = " Credential is already Live ." ;
802
+ this .errorMessage = " Credential is already SUSPENDED ." ;
778
803
}
779
804
break ;
780
805
case " REVOKE" :
0 commit comments