diff --git a/frontend/.dockerignore b/frontend/.dockerignore index 4ecd8c2b7..9fd5bc54a 100644 --- a/frontend/.dockerignore +++ b/frontend/.dockerignore @@ -1,3 +1,8 @@ +# Copyright (c) 2020-2021 - for information on the respective copyright owner +# see the NOTICE file and/or the repository at +# https://github.com/hyperledger-labs/business-partner-agent +# +# SPDX-License-Identifier: Apache-2.0 node_modules dist diff --git a/frontend/.env b/frontend/.env index b85781abb..19bce0934 100644 --- a/frontend/.env +++ b/frontend/.env @@ -1,3 +1,9 @@ +# Copyright (c) 2020-2021 - for information on the respective copyright owner +# see the NOTICE file and/or the repository at +# https://github.com/hyperledger-labs/business-partner-agent +# +# SPDX-License-Identifier: Apache-2.0 + VUE_APP_TITLE=Business Partner Agent VUE_APP_API_BASE_URL=/api #VUE_APP_EVENTS_HOST=localhost:8000 diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index 4a9eeebbf..9a7bad3de 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2020-2021 - for information on the respective copyright owner + * see the NOTICE file and/or the repository at + * https://github.com/hyperledger-labs/business-partner-agent + * + * SPDX-License-Identifier: Apache-2.0 + */ module.exports = { root: true, env: { @@ -10,5 +17,8 @@ module.exports = { rules: { "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", + "vue/multi-word-component-names": "off", + "vue/no-mutating-props": "warn", + "vue/valid-v-slot": "warn", }, -}; \ No newline at end of file +}; diff --git a/frontend/babel.config.js b/frontend/babel.config.js index 162a3ea97..a09a8b475 100644 --- a/frontend/babel.config.js +++ b/frontend/babel.config.js @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2020-2021 - for information on the respective copyright owner + * see the NOTICE file and/or the repository at + * https://github.com/hyperledger-labs/business-partner-agent + * + * SPDX-License-Identifier: Apache-2.0 + */ module.exports = { presets: ["@vue/cli-plugin-babel/preset"], }; diff --git a/frontend/jest.config.js b/frontend/jest.config.js index 2c1e1b75e..84cf2dc58 100644 --- a/frontend/jest.config.js +++ b/frontend/jest.config.js @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2020-2021 - for information on the respective copyright owner + * see the NOTICE file and/or the repository at + * https://github.com/hyperledger-labs/business-partner-agent + * + * SPDX-License-Identifier: Apache-2.0 + */ module.exports = { preset: "@vue/cli-plugin-unit-jest", verbose: true, diff --git a/frontend/package.json b/frontend/package.json index d8df3e43a..26d91c10e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,13 +1,14 @@ { - "name": "company-agent-frontend", + "name": "business-partner-agent-frontend", "version": "0.1.0", "private": true, "scripts": { "serve": "vue-cli-service serve", "test:unit": "vue-cli-service test:unit", "build": "vue-cli-service build", - "lint": "vue-cli-service lint", - "license-check": "license-checker --production --json --onlyAllow 'MIT;Python-2.0;Apache-2.0;BSD-2-Clause;BSD-3-Clause' --excludePackages 'company-agent-frontend@0.1.0'", + "lint": "vue-cli-service lint && npm run license-file-headers-add", + "license-file-headers-add": "license-check-and-add add -f licenses/config.json -r 2021", + "license-check": "license-checker --production --json --onlyAllow 'MIT;Python-2.0;Apache-2.0;BSD-2-Clause;BSD-3-Clause' --excludePackages 'business-partner-agent-frontend@0.1.0'", "license": "generate-attribution -o ./licenses", "i18n:report": "vue-cli-service i18n:report --src './src/**/*.?(js|vue)' --locales './src/locales/**/*.json'" }, @@ -44,10 +45,11 @@ "@vue/eslint-config-prettier": "^6.0.0", "@vue/test-utils": "^1.1.1", "babel-eslint": "^10.1.0", - "eslint": "^6.7.2", + "eslint": "^6.8.0", "eslint-plugin-prettier": "^3.1.4", - "eslint-plugin-vue": "^6.2.2", + "eslint-plugin-vue": "^8.1.0", "husky": "^4.3.0", + "license-check-and-add": "^4.0.3", "license-checker": "25.0.1", "lint-staged": "^10.4.2", "node-sass": "^5.0.0", @@ -68,6 +70,7 @@ } }, "lint-staged": { - "**/*.{js,vue}": "prettier --write" + "**/*.{html,xml,ts,css,scss,env,dockerignore,sh}": "license-check-and-add add -f licenses/config.json -r 2021", + "**/*.{js,vue}": ["license-check-and-add add -f licenses/config.json -r 2021", "prettier --write"] } } diff --git a/frontend/public/index.html b/frontend/public/index.html index 1b87b2a63..ddcd31f8e 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -1,3 +1,10 @@ + diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 67eecf7bf..1405e3c73 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -1,7 +1,7 @@ @@ -17,28 +17,32 @@ > - - - {{ getNavDisplayName }} + > + {{ + getNavDisplayName + }} @@ -140,10 +144,10 @@ diff --git a/frontend/src/views/Credential.vue b/frontend/src/views/Credential.vue index 94721c672..bd4a3c1f7 100644 --- a/frontend/src/views/Credential.vue +++ b/frontend/src/views/Credential.vue @@ -1,7 +1,7 @@ @@ -9,12 +9,7 @@ - + $vuetify.icons.prev
@@ -54,14 +49,14 @@ - Cancel + {{ + $t("button.cancel") + }} Save{{ $t("button.save") }} @@ -69,7 +64,7 @@ Show raw data{{ $t("showRawData") }} @@ -81,9 +76,9 @@ diff --git a/frontend/src/views/Document.vue b/frontend/src/views/Document.vue index f8450ff61..411447b15 100644 --- a/frontend/src/views/Document.vue +++ b/frontend/src/views/Document.vue @@ -1,7 +1,7 @@ @@ -28,7 +28,7 @@ - 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..87d64c66e 100644 --- a/frontend/src/views/Identity.vue +++ b/frontend/src/views/Identity.vue @@ -1,7 +1,7 @@ @@ -9,7 +9,7 @@ - Identity Information + {{ $t("view.identity.titleInfo") }} @@ -18,12 +18,12 @@ diff --git a/frontend/src/views/settings/SchemaSettings.vue b/frontend/src/views/settings/SchemaSettings.vue index 05baa1f5f..b93cb23a2 100644 --- a/frontend/src/views/settings/SchemaSettings.vue +++ b/frontend/src/views/settings/SchemaSettings.vue @@ -1,7 +1,7 @@ @@ -12,7 +12,7 @@ $vuetify.icons.prev - Schemas + {{ $t("view.schemaSettings.title") }} { return { @@ -76,7 +75,6 @@ export default { createSchemaDialog: false, }; }, - computed: {}, methods: { onSchemaAdded() { store.dispatch("loadSchemas"); diff --git a/frontend/src/views/settings/Settings.vue b/frontend/src/views/settings/Settings.vue index 7bfcaa200..c297d0fdc 100644 --- a/frontend/src/views/settings/Settings.vue +++ b/frontend/src/views/settings/Settings.vue @@ -1,14 +1,28 @@