From 059554ca54985fed7b551e99e6782bdd0d9d3d70 Mon Sep 17 00:00:00 2001 From: Tim Schlagenhaufer Date: Thu, 18 Nov 2021 14:14:40 +0100 Subject: [PATCH 01/31] Refactor data binding in profile related components Signed-off-by: Tim Schlagenhaufer --- frontend/src/components/ManageSchema.vue | 11 +++++++++-- .../src/components/OrganizationalProfile.vue | 16 ++++++++++++---- frontend/src/components/Profile.vue | 7 +++---- frontend/src/components/SchemaList.vue | 2 +- frontend/src/views/Document.vue | 2 +- frontend/src/views/PublicProfile.vue | 2 +- 6 files changed, 27 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/ManageSchema.vue b/frontend/src/components/ManageSchema.vue index fd2d69f06..37d35be00 100644 --- a/frontend/src/components/ManageSchema.vue +++ b/frontend/src/components/ManageSchema.vue @@ -111,7 +111,6 @@ export default { type: Boolean, default: () => false, }, - schema: Object, trustedIssuers: { type: Boolean, default: () => true, @@ -120,6 +119,7 @@ export default { type: Boolean, default: () => true, }, + value: {}, }, components: { VBpaButton, @@ -134,7 +134,6 @@ export default { } }, }, - created() {}, data: () => { return { tab: null, @@ -142,6 +141,14 @@ export default { }; }, computed: { + schema: { + get() { + return this.value; + }, + set(val) { + this.$emit("input", val); + }, + }, items() { const tabs = [{ title: "Schema Attributes", key: "schema-attributes" }]; if (this.credentialDefinitions) diff --git a/frontend/src/components/OrganizationalProfile.vue b/frontend/src/components/OrganizationalProfile.vue index 208b0fd6b..30e5d6eac 100644 --- a/frontend/src/components/OrganizationalProfile.vue +++ b/frontend/src/components/OrganizationalProfile.vue @@ -158,12 +158,12 @@ diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 71d2a6b43..7f252263a 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -268,6 +268,21 @@ "placeholderId": "Schema ID", "eventSuccess": "Schema added successfully" }, + "credential": { + "label": "Label (Optional)", + "issuerTitle": "Issuer", + "issuerLabel": "Issuer Decentralized Identifier (DID)", + "issuedAt": "Issued at" + }, + "credentialCard": { + "details": "Details" + }, + "credentialDefinitions": { + "label": "Tag", + "labelCheckbox": "Revocable", + "buttonAddCredDef": "Add Credential Definition", + "eventSuccess": "New credential definition added" + }, "createSchema": { "title": "Create Schema", "schemaInformation": "Schema Information", From 1e49b12b5b42e79b06338f05c50b5ae4967107ae Mon Sep 17 00:00:00 2001 From: Tim Schlagenhaufer Date: Fri, 19 Nov 2021 17:22:43 +0100 Subject: [PATCH 07/31] i18n credential exchange list Signed-off-by: Tim Schlagenhaufer --- frontend/src/components/CredExList.vue | 68 ++++++++++-------- frontend/src/components/DashboardCard.vue | 87 ++++++++++++----------- frontend/src/locales/en.json | 8 +++ frontend/src/views/partner/Partner.vue | 30 +------- 4 files changed, 93 insertions(+), 100 deletions(-) diff --git a/frontend/src/components/CredExList.vue b/frontend/src/components/CredExList.vue index 266a89e78..6b3b84a55 100644 --- a/frontend/src/components/CredExList.vue +++ b/frontend/src/components/CredExList.vue @@ -270,37 +270,6 @@ import { CredentialExchangeRoles, CredentialExchangeStates } from "@/constants"; export default { props: { items: Array, - headers: { - type: Array, - default: () => [ - { - text: "", - value: "indicator", - sortable: false, - filterable: false, - }, - { - text: "Type", - value: "displayText", - }, - { - text: "Issued to", - value: "partner.name", - }, - { - text: "Updated at", - value: "updatedAt", - }, - { - text: "State", - value: "state", - }, - { - text: "Revocation", - value: "revocable", - }, - ], - }, isActiveFn: { type: Function, default: (item) => @@ -309,6 +278,10 @@ export default { item.state === CredentialExchangeStates.DONE, }, isLoading: Boolean, + headerRole: { + type: Boolean, + default: false, + }, openItemById: String, }, created() { @@ -333,6 +306,39 @@ export default { } }, computed: { + headers() { + return [ + { + text: "", + value: "indicator", + sortable: false, + filterable: false, + }, + { + text: this.$t("component.credExList.headers.displayText"), + value: "displayText", + }, + { + text: + this.headerRole === true + ? this.$t("component.credExList.headers.role") + : this.$t("component.credExList.headers.partnerName"), + value: this.headerRole === true ? "role" : "partner.name", + }, + { + text: this.$t("component.credExList.headers.updatedAt"), + value: "updatedAt", + }, + { + text: this.$t("component.credExList.headers.state"), + value: "state", + }, + { + text: this.$t("component.credExList.headers.revocable"), + value: "revocable", + }, + ]; + }, partnerList: { get() { return this.$store.getters.getPartnerSelectList; diff --git a/frontend/src/components/DashboardCard.vue b/frontend/src/components/DashboardCard.vue index 9cbb83100..dcc722684 100644 --- a/frontend/src/components/DashboardCard.vue +++ b/frontend/src/components/DashboardCard.vue @@ -7,20 +7,26 @@ --> diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 7f252263a..952bbc500 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -349,6 +349,14 @@ } }, "credExList": { + "headers": { + "displayText": "Type", + "partnerName": "Issued to", + "role": "Role", + "updatedAt": "Updated at", + "state": "State", + "revocable": "Revocation" + }, "table": { "iconCredIssued": "Credential issued", "iconCredRevoked": "Credential revoked", diff --git a/frontend/src/views/partner/Partner.vue b/frontend/src/views/partner/Partner.vue index 886682968..03e8a344d 100644 --- a/frontend/src/views/partner/Partner.vue +++ b/frontend/src/views/partner/Partner.vue @@ -200,7 +200,7 @@ @@ -317,34 +317,6 @@ export default { required: (value) => !!value || "Can't be empty", }, PartnerStates: PartnerStates, - headersIssued: [ - { - text: "", - value: "indicator", - sortable: false, - filterable: false, - }, - { - text: "Type", - value: "displayText", - }, - { - text: "Role", - value: "role", - }, - { - text: "Updated at", - value: "updatedAt", - }, - { - text: "State", - value: "state", - }, - { - text: "Revocation", - value: "revocable", - }, - ], issueCredentialDialog: false, }; }, From fef9f02af384dc06dfcf99459569c2ee44cb4edc Mon Sep 17 00:00:00 2001 From: Tim Schlagenhaufer Date: Tue, 23 Nov 2021 14:27:22 +0100 Subject: [PATCH 08/31] i18n credential list + issue + manage schema + message icon Signed-off-by: Tim Schlagenhaufer --- frontend/src/components/IssueCredential.vue | 17 +++-- frontend/src/components/ManageSchema.vue | 45 +++++++++---- frontend/src/components/MyCredentialList.vue | 4 +- frontend/src/components/NewMessageIcon.vue | 69 +++++++++++++------- frontend/src/locales/en.json | 23 ++++++- 5 files changed, 111 insertions(+), 47 deletions(-) diff --git a/frontend/src/components/IssueCredential.vue b/frontend/src/components/IssueCredential.vue index 301d7dcb2..0adc09f50 100644 --- a/frontend/src/components/IssueCredential.vue +++ b/frontend/src/components/IssueCredential.vue @@ -115,7 +115,6 @@ :key="field.type" :label="field.label" v-model="credentialFields[field.type]" - placeholder="" outlined dense @blur="enableSubmit" @@ -145,15 +144,15 @@ - Cancel + {{ + $t("button.cancel") + }} Submit{{ $t("button.submit") }} @@ -367,13 +366,17 @@ export default { reader.onerror = (evt) => { EventBus.$emit( "error", - `Error reading file '${v.name}'. ${evt.message}` + `${this.$t( + "component.issueCredential.expertLoad.errorMessages.readFile" + )} '${v.name}'. ${evt.message}` ); }; } catch (e) { EventBus.$emit( "error", - `Error reading file '${v.name}'. ${e.message}` + `${this.$t( + "component.issueCredential.expertLoad.errorMessages.readFile" + )} '${v.name}'. ${e.message}` ); } } diff --git a/frontend/src/components/ManageSchema.vue b/frontend/src/components/ManageSchema.vue index 37d35be00..50c3fe89a 100644 --- a/frontend/src/components/ManageSchema.vue +++ b/frontend/src/components/ManageSchema.vue @@ -30,7 +30,7 @@ readonly outlined dense - label="Schema ID" + :label="$t('component.manageSchema.labelSchemaId')" :append-icon="'$vuetify.icons.copy'" @click:append="copySchemaId" > @@ -38,7 +38,7 @@ - Close + {{ + $t("button.close") + }} @@ -150,14 +152,22 @@ export default { }, }, items() { - const tabs = [{ title: "Schema Attributes", key: "schema-attributes" }]; + const tabs = [ + { + title: this.$t("component.manageSchema.tabs.schemaAttributes"), + key: "schema-attributes", + }, + ]; if (this.credentialDefinitions) tabs.push({ - title: "Credential Definitions", + title: this.$t("component.manageSchema.tabs.credentialDefinitions"), key: "credential-definitions", }); if (!this.schema.isMine && this.trustedIssuers) - tabs.push({ title: "Trusted Issuers", key: "trusted-issuers" }); + tabs.push({ + title: this.$t("component.manageSchema.tabs.trustedIssuers"), + key: "trusted-issuers", + }); return tabs; }, }, @@ -165,15 +175,21 @@ export default { copySchemaId() { let idEl = document.querySelector("#schemaId"); idEl.select(); - let successfull; + let successful; try { - successfull = document.execCommand("copy"); + successful = document.execCommand("copy"); } catch (err) { - successfull = false; + successful = false; } - successfull - ? EventBus.$emit("success", "Schema ID copied") - : EventBus.$emit("error", "Can't copy Schema ID"); + successful + ? EventBus.$emit( + "success", + this.$t("component.manageSchema.eventSuccessCopy") + ) + : EventBus.$emit( + "error", + this.$t("component.manageSchema.eventErrorCopy") + ); idEl.blur(); window.getSelection().removeAllRanges(); }, @@ -183,7 +199,10 @@ export default { .then((result) => { console.log(result); if (result.status === 200) { - EventBus.$emit("success", "Schema deleted"); + EventBus.$emit( + "success", + this.$t("component.manageSchema.eventSuccessDelete") + ); this.$emit("changed"); this.$emit("deleted"); } diff --git a/frontend/src/components/MyCredentialList.vue b/frontend/src/components/MyCredentialList.vue index dc30232c8..181348146 100644 --- a/frontend/src/components/MyCredentialList.vue +++ b/frontend/src/components/MyCredentialList.vue @@ -95,8 +95,8 @@ diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 952bbc500..3e60a1bb2 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -260,6 +260,14 @@ "labelVersion": "Version:", "labelCheckbox": "As transaction author I reviewed and accept the above Transaction Author Agreement for this session" }, + "newMessageIcon": { + "activity": "New activity", + "credential": "New activity on Credential", + "partner": "New activity related to this Partner", + "presentation": "New activity on Presentation 2", + "task": "New task requires attention", + "default": "New activity on item" + }, "addSchema": { "title": "Import Schema", "schemaName": "Schema Name:", @@ -268,6 +276,18 @@ "placeholderId": "Schema ID", "eventSuccess": "Schema added successfully" }, + "manageSchema": { + "labelSchemaId": "Schema ID", + "labelCheckbox": "My Schema", + "eventSuccessCopy": "Schema ID copied", + "eventErrorCopy": "Can't copy Schema ID", + "eventSuccessDelete": "Schema deleted", + "tabs": { + "schemaAttributes": "Schema Attributes", + "credentialDefinitions": "Credential Definitions", + "trustedIssuers": "Trusted Issuers" + } + }, "credential": { "label": "Label (Optional)", "issuerTitle": "Issuer", @@ -344,7 +364,8 @@ "csv": "Ensure that data is valid Comma Separated Value (CSV) format." }, "attributes": "Could not find any matching Credential attributes.", - "parse": "Could not parse data." + "parse": "Could not parse data.", + "readFile": "Error reading file" } } }, From 0a3ee0cd45b593e02ccaeaf18513124242708a24 Mon Sep 17 00:00:00 2001 From: Tim Schlagenhaufer Date: Wed, 24 Nov 2021 10:46:47 +0100 Subject: [PATCH 09/31] i18n multiple components Signed-off-by: Tim Schlagenhaufer --- .../src/components/OrganizationalProfile.vue | 29 +++++------ frontend/src/components/PartnerList.vue | 45 +++++++++++----- .../src/components/PartnerStateIndicator.vue | 7 +-- .../src/components/PresentationExList.vue | 52 +++++++++++-------- .../src/components/PresentationRecord.vue | 27 ++++++---- .../src/components/PresentationRecordV2.vue | 16 +++--- frontend/src/locales/en.json | 37 +++++++++++-- frontend/src/views/RequestVerification.vue | 3 +- frontend/src/views/partner/Partners.vue | 2 +- 9 files changed, 140 insertions(+), 78 deletions(-) diff --git a/frontend/src/components/OrganizationalProfile.vue b/frontend/src/components/OrganizationalProfile.vue index 30e5d6eac..137fe2475 100644 --- a/frontend/src/components/OrganizationalProfile.vue +++ b/frontend/src/components/OrganizationalProfile.vue @@ -16,8 +16,7 @@ diff --git a/frontend/src/components/PresentationExList.vue b/frontend/src/components/PresentationExList.vue index fe3947a6b..c42f2518d 100644 --- a/frontend/src/components/PresentationExList.vue +++ b/frontend/src/components/PresentationExList.vue @@ -157,7 +157,7 @@ export default { // Open Item directly. Is used for links from notifications/activity if (this.openItemById) { // FIXME: items observable is typically not resolved yet. Then items is empty - const item = this.items.find((item) => item.id === this.openItemById); + const item = this.items.find((i) => i.id === this.openItemById); if (item) { this.openItem(item); } else { @@ -179,7 +179,19 @@ export default { isLoading: false, isWaitingForMatchingCreds: false, declineReasonText: "", - headers: [ + }; + }, + computed: { + items: { + get() { + return this.value; + }, + set(val) { + this.$emit("input", val); + }, + }, + headers() { + return [ { text: "", value: "indicator", @@ -187,32 +199,22 @@ export default { filterable: false, }, { - text: "Name", + text: this.$t("component.presentationExList.table.label"), value: "label", }, { - text: "Role", + text: this.$t("component.presentationExList.table.role"), value: "role", }, { - text: "Updated at", + text: this.$t("component.presentationExList.table.updatedAt"), value: "updatedAt", }, { - text: "State", + text: this.$t("component.presentationExList.table.state"), value: "state", }, - ], - }; - }, - computed: { - items: { - get() { - return this.value; - }, - set(val) { - this.$emit("input", val); - }, + ]; }, showV2() { return ( @@ -249,7 +251,10 @@ export default { const payload = this.prepareApprovePayload(); try { await proofExService.approveProofRequest(this.record.id, payload); - EventBus.$emit("success", "Proof has been sent"); + EventBus.$emit( + "success", + this.$t("component.presentationExList.eventSuccessApprove") + ); this.closeDialog(); this.$emit("changed"); } catch (e) { @@ -262,7 +267,10 @@ export default { this.record.id, this.declineReasonText ); - EventBus.$emit("success", "Presentation request declined"); + EventBus.$emit( + "success", + this.$t("component.presentationExList.eventSuccessDecline") + ); this.closeDialog(); this.$emit("changed"); } catch (e) { @@ -310,7 +318,10 @@ export default { (item) => item.id === this.record.id ); this.items.splice(idx, 1); - EventBus.$emit("success", "Presentation record deleted"); + EventBus.$emit( + "success", + this.$t("component.presentationExList.eventSuccessDelete") + ); this.closeDialog(); } } catch (e) { @@ -419,7 +430,6 @@ export default { }); this.record.canBeFullfilled = this.canBeFullfilled(); - this.isWaitingForMatchingCreds = false; }); }, diff --git a/frontend/src/components/PresentationRecord.vue b/frontend/src/components/PresentationRecord.vue index 31da093ca..5c4493fb6 100644 --- a/frontend/src/components/PresentationRecord.vue +++ b/frontend/src/components/PresentationRecord.vue @@ -10,7 +10,7 @@ - Role + {{ $t("view.presentationRecord.role") }} {{ record.role | capitalize }} @@ -19,7 +19,7 @@ - State + {{ $t("view.presentationRecord.state") }} {{ (record.state ? record.state.replace("_", " ") : "") | capitalize }} @@ -28,7 +28,7 @@ - Request Name + {{ $t("view.presentationRecord.requestName") }} {{ record.proofRequest ? record.proofRequest.name : "" }} @@ -39,7 +39,7 @@ diff --git a/frontend/src/views/Document.vue b/frontend/src/views/Document.vue index d858909bc..507ad6ccd 100644 --- a/frontend/src/views/Document.vue +++ b/frontend/src/views/Document.vue @@ -67,14 +67,14 @@ - Document modified, please save before start verification + {{ $t("view.document.modified") }} @@ -104,9 +102,9 @@ v-model="useV2Exchange" :label="$t('button.useV2')" > - Cancel + {{ + $t("button.cancel") + }} Save & Close{{ $t("button.saveAndClose") }} @@ -127,7 +125,7 @@ Show raw data{{ $t("showRawData") }} @@ -177,10 +175,10 @@ export default { }, created() { if (this.id && !this.type) { - EventBus.$emit("title", "Edit Document"); + EventBus.$emit("title", this.$t("view.document.titleExisting")); this.getDocument(); } else { - EventBus.$emit("title", "Create new Document"); + EventBus.$emit("title", this.$t("view.document.titleNew")); this.document.type = this.type; this.document.schemaId = this.schemaId; this.document.isPublic = this.isProfile(this.document.type); @@ -230,7 +228,12 @@ export default { this.document = result.data; this.intDoc = { ...this.document }; this.isReady = true; - EventBus.$emit("title", "Edit (" + this.document.typeLabel + ")"); + EventBus.$emit( + "title", + `${this.$t("view.document.titleEdit")} (${ + this.document.typeLabel + })` + ); } }) .catch((e) => { @@ -258,7 +261,10 @@ export default { } else { this.$router.go(this.$router.currentRoute); } - EventBus.$emit("success", "Success"); + EventBus.$emit( + "success", + this.$t("view.document.eventSuccessSaveEdit") + ); }) .catch((e) => { this.isBusy = false; @@ -284,7 +290,10 @@ export default { }); this.isBusy = false; this.$router.go(-1); - EventBus.$emit("success", "Success"); + EventBus.$emit( + "success", + this.$t("view.document.eventSuccessSaveNew") + ); }) .catch((e) => { this.isBusy = false; @@ -297,7 +306,10 @@ export default { .delete(`${this.$apiBaseUrl}/wallet/document/${this.id}`) .then((result) => { if (result.status === 200) { - EventBus.$emit("success", "Document deleted"); + EventBus.$emit( + "success", + this.$t("view.document.eventSuccessDelete") + ); this.$router.go(-1); } }) diff --git a/frontend/src/views/Identity.vue b/frontend/src/views/Identity.vue index 0bcb6068a..8969a3ceb 100644 --- a/frontend/src/views/Identity.vue +++ b/frontend/src/views/Identity.vue @@ -9,7 +9,7 @@ - Identity Information + {{ $t("view.identity.titleInfo") }} @@ -18,12 +18,12 @@ diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index c9be212d8..412ed7c6d 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -1,5 +1,6 @@ { "app": { + "bpaDefaultName": "Business Partner Agent", "snackBar": { "close": "Close" }, From ad377e0738bd52aed491ca9decc4e7776d3a3a6a Mon Sep 17 00:00:00 2001 From: Tim Schlagenhaufer Date: Thu, 25 Nov 2021 17:45:36 +0100 Subject: [PATCH 17/31] Move double points outside locales Signed-off-by: Tim Schlagenhaufer --- frontend/src/components/AddSchema.vue | 4 ++-- frontend/src/components/PartnerStateIndicator.vue | 2 +- frontend/src/components/PresentationRecord.vue | 2 +- .../components/taa/TransactionAuthorAgreement.vue | 5 ++--- frontend/src/locales/en.json | 12 ++++++------ 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/frontend/src/components/AddSchema.vue b/frontend/src/components/AddSchema.vue index 8c2be6538..d71be260b 100644 --- a/frontend/src/components/AddSchema.vue +++ b/frontend/src/components/AddSchema.vue @@ -16,7 +16,7 @@ - {{ $t("component.addSchema.schemaName") }} + {{ $t("component.addSchema.schemaName") }}: - {{ $t("component.addSchema.schemaId") }} + {{ $t("component.addSchema.schemaId") }}: {{ $t("component.partnerStateIndicator.connectionState") }} + >{{ $t("component.partnerStateIndicator.connectionState") }}: {{ this.state }} diff --git a/frontend/src/components/PresentationRecord.vue b/frontend/src/components/PresentationRecord.vue index 5c4493fb6..3935ccaf4 100644 --- a/frontend/src/components/PresentationRecord.vue +++ b/frontend/src/components/PresentationRecord.vue @@ -39,7 +39,7 @@