diff --git a/frontend/src/components/CreateSchema.vue b/frontend/src/components/CreateSchema.vue index c6130ad62..35871f7e9 100644 --- a/frontend/src/components/CreateSchema.vue +++ b/frontend/src/components/CreateSchema.vue @@ -10,7 +10,7 @@ Create Schema - +

@@ -108,7 +108,7 @@ - + @@ -137,6 +137,7 @@ export default { props: {}, data: () => { return { + valid: true, schemaLabel: "", schemaName: "", schemaVersion: "", @@ -198,6 +199,13 @@ export default { defaultAttributeName: defaultAttr ? defaultAttr.text : undefined, }; }, + resetForm() { + // reset validation + this.$refs.form.reset(); + // reset form data + const initialData = this.$options.data.call(this); + Object.assign(this.$data, initialData); + }, async saveSchema() { try { const schemaForm = this.getSchemaFormData(); @@ -219,6 +227,7 @@ export default { const _schema = await this.saveSchema(); if (_schema) { EventBus.$emit("success", "Schema created successfully"); + this.resetForm(); this.$emit("success"); } } catch (error) { @@ -227,6 +236,7 @@ export default { } }, cancel() { + this.resetForm(); this.$emit("cancelled"); }, }, diff --git a/frontend/src/components/SchemaList.vue b/frontend/src/components/SchemaList.vue index f7acf0de9..c17fb3977 100644 --- a/frontend/src/components/SchemaList.vue +++ b/frontend/src/components/SchemaList.vue @@ -100,6 +100,12 @@ export default { this.dialog = true; this.dirty = false; this.schema = item; + if (!this.schema.credentialDefinitions) { + this.schema.credentialDefinitions = []; + } + if (!this.schema.trustedIssuer) { + this.schema.trustedIssuer = []; + } }, onClosed() { this.dialog = false; diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index f0e015d04..da3ca9284 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -150,7 +150,7 @@ const routes = [ component: About, }, { - path: "/credentialManagement", + path: "/app/credentialManagement", name: "CredentialManagement", component: CredentialManagement, },