From 886a21296684337d54d9712114b0183ab1786f84 Mon Sep 17 00:00:00 2001 From: Mikhail Iontsev Date: Fri, 21 Oct 2022 20:22:59 +0700 Subject: [PATCH 001/202] feat: added optional webapi integration --- .eslintrc | 4 +- package.json | 5 +- public/env/env.json | 4 + src/app/providers/store/index.js | 2 + src/main.js | 24 +- src/pages/info/WebApiInfo.vue | 70 ++++ .../{ => components}/DesiredDomains.vue | 16 +- .../{ => components}/DomainRequirements.vue | 6 +- .../{ => components}/FinalEstimation.vue | 18 +- .../{ => components}/Range.vue | 20 +- .../{ => components}/RequiredConcepts.vue | 359 ++++++++++-------- .../{ => components}/VisitTypes.vue | 6 +- .../NetworkDataFeasibilityReport/index.vue | 14 +- .../exploreReports/config/dataLoadConfig.js | 29 +- src/processes/exploreReports/config/routes.js | 6 + .../exploreReports/model/store/data.module.js | 79 ++-- src/shared/api/{loadFile.js => apiService.js} | 6 +- src/shared/api/environment.js | 13 + src/shared/api/webAPI/index.js | 3 + src/shared/api/webAPI/store/actions.type.js | 4 + src/shared/api/webAPI/store/mutations.type.js | 2 + src/shared/api/webAPI/store/webApi.module.js | 62 +++ .../api/webAPI/webApiServices/infoService.js | 35 ++ .../webApiServices/vocabularyService.js | 15 + src/shared/config/webApiKeyMap.js | 10 + .../lib/mixins/methods/debouncedSearch.js | 2 +- src/widgets/bottomNav/ui/BottomNav.vue | 9 + src/widgets/explorer/config/reports.js | 6 + .../explorer/model/store/explorer.module.js | 14 +- 29 files changed, 595 insertions(+), 248 deletions(-) create mode 100644 public/env/env.json create mode 100644 src/pages/info/WebApiInfo.vue rename src/pages/reports/network/NetworkDataFeasibilityReport/{ => components}/DesiredDomains.vue (93%) rename src/pages/reports/network/NetworkDataFeasibilityReport/{ => components}/DomainRequirements.vue (95%) rename src/pages/reports/network/NetworkDataFeasibilityReport/{ => components}/FinalEstimation.vue (92%) rename src/pages/reports/network/NetworkDataFeasibilityReport/{ => components}/Range.vue (94%) rename src/pages/reports/network/NetworkDataFeasibilityReport/{ => components}/RequiredConcepts.vue (51%) rename src/pages/reports/network/NetworkDataFeasibilityReport/{ => components}/VisitTypes.vue (96%) rename src/shared/api/{loadFile.js => apiService.js} (81%) create mode 100644 src/shared/api/environment.js create mode 100644 src/shared/api/webAPI/index.js create mode 100644 src/shared/api/webAPI/store/actions.type.js create mode 100644 src/shared/api/webAPI/store/mutations.type.js create mode 100644 src/shared/api/webAPI/store/webApi.module.js create mode 100644 src/shared/api/webAPI/webApiServices/infoService.js create mode 100644 src/shared/api/webAPI/webApiServices/vocabularyService.js create mode 100644 src/shared/config/webApiKeyMap.js diff --git a/.eslintrc b/.eslintrc index 26a5e121..4241ec87 100644 --- a/.eslintrc +++ b/.eslintrc @@ -6,13 +6,15 @@ "extends": [ "plugin:vue/essential", "plugin:vue/recommended", - "@vue/prettier" + "@vue/prettier", + "plugin:vuetify/base" ], "parserOptions": { "parser": "@babel/eslint-parser", "requireConfigFile": false }, "rules": { + "no-warning-comments": 0, "eqeqeq": "warn", "vue/eqeqeq": "warn", "no-shadow": "warn", diff --git a/package.json b/package.json index cb8c4ca6..896ff68a 100644 --- a/package.json +++ b/package.json @@ -29,16 +29,17 @@ "vuex": "^3.6.2" }, "devDependencies": { + "@babel/eslint-parser": "^7.19.1", "@mdi/font": "^7.0.96", "@vue/cli-plugin-babel": "^5.0.8", "@vue/cli-plugin-eslint": "^5.0.8", "@vue/cli-plugin-router": "^5.0.8", "@vue/cli-service": "^5.0.8", "@vue/eslint-config-prettier": "^7.0.0", - "@babel/eslint-parser": "^7.19.1", + "comlink-loader": "^2.0.0", "eslint": "^8.22.0", "eslint-plugin-vue": "^9.5.1", - "comlink-loader": "^2.0.0", + "eslint-plugin-vuetify": "^1.1.0", "fibers": "^5.0.0", "lint-staged": "^13.0.3", "sass": "^1.55.0", diff --git a/public/env/env.json b/public/env/env.json new file mode 100644 index 00000000..7fe0679e --- /dev/null +++ b/public/env/env.json @@ -0,0 +1,4 @@ +{ + "WEB_API_URL": "./WebAPI", + "WEB_API_ENABLED": "true" +} diff --git a/src/app/providers/store/index.js b/src/app/providers/store/index.js index 5011f6a8..8fff3e62 100644 --- a/src/app/providers/store/index.js +++ b/src/app/providers/store/index.js @@ -7,6 +7,7 @@ import { explorerStore } from "@/widgets/explorer"; import { errorStore } from "@/widgets/error"; import { reportsDataStore } from "@/processes/exploreReports"; import { settingsStore } from "@/widgets/settings"; +import { webApiStore } from "@/shared/api/webAPI"; export default new Vuex.Store({ modules: { @@ -14,5 +15,6 @@ export default new Vuex.Store({ reportsDataStore, errorStore, settingsStore, + webApiStore, }, }); diff --git a/src/main.js b/src/main.js index e8c4d169..6e2f3c0b 100644 --- a/src/main.js +++ b/src/main.js @@ -5,14 +5,18 @@ import router from "./app/providers/router"; import vuetify from "@/app/plugins/vuetify"; import sync from "./shared/lib/vuex-router-sync"; import { settingsActions } from "@/widgets/settings"; -// adds reactive router module to global state -sync(store, router); -//loads app settings from the local storage (if there are any saved) -store.dispatch(settingsActions.LOAD_SETTINGS_FROM_STORAGE); +import environment from "@/shared/api/environment"; + +environment.load().then(() => { + sync(store, router); + //loads app settings from the local storage (if there are any saved) + store.dispatch(settingsActions.LOAD_SETTINGS_FROM_STORAGE); -new Vue({ - vuetify, - router, - store, - render: (h) => h(App), -}).$mount("#app"); + new Vue({ + vuetify, + router, + store, + render: (h) => h(App), + }).$mount("#app"); +}); +// adds reactive router module to global state diff --git a/src/pages/info/WebApiInfo.vue b/src/pages/info/WebApiInfo.vue new file mode 100644 index 00000000..a0a72f0d --- /dev/null +++ b/src/pages/info/WebApiInfo.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/src/pages/reports/network/NetworkDataFeasibilityReport/DesiredDomains.vue b/src/pages/reports/network/NetworkDataFeasibilityReport/components/DesiredDomains.vue similarity index 93% rename from src/pages/reports/network/NetworkDataFeasibilityReport/DesiredDomains.vue rename to src/pages/reports/network/NetworkDataFeasibilityReport/components/DesiredDomains.vue index 97f74690..40e2a812 100644 --- a/src/pages/reports/network/NetworkDataFeasibilityReport/DesiredDomains.vue +++ b/src/pages/reports/network/NetworkDataFeasibilityReport/components/DesiredDomains.vue @@ -8,7 +8,7 @@ :headers="getDomainHeaders" :items="getDomainsData" > -