From 26fca1bc964de10a0ef4c858a0ada2e729296b13 Mon Sep 17 00:00:00 2001 From: i348307 Date: Tue, 7 Jan 2020 22:29:13 +0200 Subject: [PATCH 01/10] Align Title And Prompts left pane + Add code linter and formatter --- frontend/package.json | 34 +- frontend/public/index.html | 2 + frontend/src/App.vue | 392 ++++++++++-------- frontend/src/assets/logo.svg | 1 + frontend/src/assets/main.styl | 1 + frontend/src/components/Header.vue | 30 +- frontend/src/components/Navigation.vue | 130 ++++-- .../src/components/QuestionTypeSelector.vue | 16 +- frontend/src/main.js | 6 +- frontend/src/plugins/vuetify.js | 7 + frontend/tests/components/Done.spec.js | 2 +- frontend/tests/components/Header.spec.js | 8 +- frontend/vue.config.js | 6 +- frontend/webpack.config.js | 23 + 14 files changed, 422 insertions(+), 236 deletions(-) create mode 100644 frontend/src/assets/logo.svg create mode 100644 frontend/src/assets/main.styl create mode 100644 frontend/src/plugins/vuetify.js create mode 100644 frontend/webpack.config.js diff --git a/frontend/package.json b/frontend/package.json index f6951770..91c1b6f7 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -11,15 +11,20 @@ "build": "vue-cli-service build", "build-dev": "vue-cli-service build --mode development", "lint": "vue-cli-service lint", - "test": "vue-cli-service test:unit" + "test": "vue-cli-service test:unit", + "precommit": "lint-staged" }, "dependencies": { "bootstrap": "^4.3.1", "bootstrap-vue": "^2.0.2", + "core-js": "2.6.6", + "jquery": "3.4.1", "lodash": "^4.17.15", "vue": "^2.6.10", - "core-js": "2.6.6", - "jquery": "3.4.1" + "file-saver": "2.0.2", + "node-sass": "4.13.0", + "vuetify": "^2.2.1", + "material-design-icons-iconfont": "^5.0.1" }, "devDependencies": { "@sap-devx/webview-rpc": "^0.2.0", @@ -31,15 +36,23 @@ "babel-eslint": "^10.0.1", "babel-jest": "^24.9.0", "canvas": "2.5.0", + "deepmerge": "^4.2.2", "eslint": "^5.16.0", "eslint-plugin-vue": "^5.0.0", + "fibers": "^4.0.2", + "flush-promises": "^1.0.2", "jest": "^24.9.0", "jest-serializer-vue": "^2.0.2", "mock-socket": "^9.0.2", + "sass": "^1.24.2", + "sass-loader": "^8.0.0", + "lint-staged": "^8.1.5", + "husky": "1.2.1", "vue-jest": "^3.0.5", "vue-template-compiler": "^2.6.10", "webpack": "^4.41.2", - "flush-promises": "^1.0.2" + "vue-cli-plugin-vuetify": "^2.0.2", + "vuetify-loader": "^1.3.0" }, "eslintConfig": { "root": true, @@ -64,5 +77,16 @@ "browserslist": [ "> 1%", "last 2 versions" - ] + ], + "lint-staged": { + "*.{js,vue}": [ + "vue-cli-service lint", + "git add" + ] + }, + "husky": { + "hooks": { + "pre-commit": "npm run precommit" + } + } } diff --git a/frontend/public/index.html b/frontend/public/index.html index 0a397a46..6c1da8fc 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -5,6 +5,8 @@ + + Yeoman User Interface diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 8953f50d..22182717 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -8,58 +8,53 @@ :stepName="prompts[promptIndex].name" :rpc="rpc" /> - - - - - - - - - - - - - - - - -
-
- -
+ + + + + + + + + + + + + + +
{{logText}}
-
-
-
+ + + diff --git a/frontend/src/assets/logo.svg b/frontend/src/assets/logo.svg new file mode 100644 index 00000000..145b6d13 --- /dev/null +++ b/frontend/src/assets/logo.svg @@ -0,0 +1 @@ +Artboard 46 diff --git a/frontend/src/assets/main.styl b/frontend/src/assets/main.styl new file mode 100644 index 00000000..a427a705 --- /dev/null +++ b/frontend/src/assets/main.styl @@ -0,0 +1 @@ +@import '~vuetify/src/stylus/main.styl' diff --git a/frontend/src/components/Header.vue b/frontend/src/components/Header.vue index bafab3cf..59d34785 100644 --- a/frontend/src/components/Header.vue +++ b/frontend/src/components/Header.vue @@ -1,15 +1,12 @@ @@ -19,16 +16,19 @@ export default { props: ["selectedGeneratorHeader", "stepName", "rpc"], methods: { collapseLog() { - this.rpc.invoke("toggleLog", [{}]) + this.rpc.invoke("toggleLog", [{}]); + this.$parent.showConsole = !this.$parent.showConsole; //TODO investigate why this.$emit is not working } } }; diff --git a/frontend/src/components/Navigation.vue b/frontend/src/components/Navigation.vue index ce835a52..5e3bedd5 100644 --- a/frontend/src/components/Navigation.vue +++ b/frontend/src/components/Navigation.vue @@ -1,49 +1,105 @@ + - diff --git a/frontend/src/components/QuestionTypeSelector.vue b/frontend/src/components/QuestionTypeSelector.vue index f776e5d7..ed33f520 100644 --- a/frontend/src/components/QuestionTypeSelector.vue +++ b/frontend/src/components/QuestionTypeSelector.vue @@ -1,12 +1,12 @@