From e564901d2e144173ae2b25afe53db2ea708dafe3 Mon Sep 17 00:00:00 2001 From: Ferdinand Thiessen Date: Tue, 30 Mar 2021 00:28:18 +0200 Subject: [PATCH] [core] Remove last vuex references * src/stores can not be used as quasar thinks it contains vuex --- src/boot/axios.ts | 2 +- src/boot/login.ts | 2 +- src/boot/plugins.ts | 5 ++ src/boot/store.ts | 2 +- src/components/Notification.vue | 32 +++++++++++-- src/layouts/MainLayout.vue | 2 +- src/pages/Login.vue | 2 +- src/pages/Reset.vue | 2 +- src/plugins.d.ts | 19 +++++++- src/plugins/balance/components/BalanceAdd.vue | 2 +- .../balance/components/BalanceHeader.vue | 2 +- .../balance/components/BalanceTransfer.vue | 2 +- .../balance/components/Transaction.vue | 2 +- src/plugins/balance/components/Widget.vue | 2 +- src/plugins/balance/pages/MainPage.vue | 2 +- src/plugins/balance/pages/Overview.vue | 2 +- src/plugins/balance/store.ts | 2 +- .../pricelist/components/CalculationTable.vue | 2 +- .../components/overview/slots/JobSlot.vue | 2 +- src/plugins/user/components/UpdateUser.vue | 2 +- src/plugins/user/components/Widget.vue | 2 +- .../components/settings/MainUserSettings.vue | 2 +- .../user/components/settings/Session.vue | 2 +- src/plugins/user/pages/Settings.vue | 2 +- src/plugins/user/routes/index.ts | 2 +- src/plugins/user/store.ts | 2 +- src/{store => stores}/index.ts | 46 ++++++++----------- src/{store => stores}/store-flag.d.ts | 0 src/utils/permission.ts | 2 +- 29 files changed, 95 insertions(+), 55 deletions(-) rename src/{store => stores}/index.ts (86%) rename src/{store => stores}/store-flag.d.ts (100%) diff --git a/src/boot/axios.ts b/src/boot/axios.ts index 75ab0b7..07bf177 100644 --- a/src/boot/axios.ts +++ b/src/boot/axios.ts @@ -2,7 +2,7 @@ import config from 'src/config'; import { boot } from 'quasar/wrappers'; import { LocalStorage, Notify } from 'quasar'; import axios, { AxiosError } from 'axios'; -import { useMainStore } from 'src/store'; +import { useMainStore } from 'src/stores'; const api = axios.create(); diff --git a/src/boot/login.ts b/src/boot/login.ts index 61e1d45..c1dfca5 100644 --- a/src/boot/login.ts +++ b/src/boot/login.ts @@ -1,5 +1,5 @@ import { boot } from 'quasar/wrappers'; -import { useMainStore } from 'src/store'; +import { useMainStore } from 'src/stores'; import { hasPermissions } from 'src/utils/permission'; import { RouteRecord } from 'vue-router'; diff --git a/src/boot/plugins.ts b/src/boot/plugins.ts index a6515b9..771d1f2 100644 --- a/src/boot/plugins.ts +++ b/src/boot/plugins.ts @@ -5,6 +5,7 @@ import { api } from 'boot/axios'; import { AxiosResponse } from 'axios'; import { RouteRecordRaw } from 'vue-router'; import { Notify } from 'quasar'; +import { notEmpty } from 'src/utils/validators'; const config: { [key: string]: Array } = { // Do not change required Modules !! @@ -56,6 +57,9 @@ interface Backend { } export { Backend }; +// Handle Notifications +export const translateNotification = (note: FG.Notification): FG_Plugin.Notification => note; + // Combine routes, shortcuts and widgets from plugins /** @@ -288,6 +292,7 @@ function loadPlugin( loadedPlugins.plugins.push({ name: plugin.name, version: plugin.version, + notification: plugin.notification?.bind({}) || translateNotification, }); return plugin; diff --git a/src/boot/store.ts b/src/boot/store.ts index 9ffce59..b68d7c4 100644 --- a/src/boot/store.ts +++ b/src/boot/store.ts @@ -1,6 +1,6 @@ import { createPinia } from 'pinia'; import { boot } from 'quasar/wrappers'; -import { useMainStore } from 'src/store'; +import { useMainStore } from 'src/stores'; export default boot(({ app }) => { app.use(createPinia()); diff --git a/src/components/Notification.vue b/src/components/Notification.vue index 74f3bd1..f8a0f1f 100644 --- a/src/components/Notification.vue +++ b/src/components/Notification.vue @@ -1,7 +1,7 @@ diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index 6d0e074..42b9bf1 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -106,7 +106,7 @@ import ShortcutLink from 'src/components/navigation/ShortcutLink.vue'; import Notification from 'src/components/Notification.vue'; import { Screen } from 'quasar'; import { defineComponent, ref, inject, computed, onBeforeMount } from 'vue'; -import { useMainStore } from 'src/store'; +import { useMainStore } from 'src/stores'; import { FG_Plugin } from 'src/plugins'; import { useRouter } from 'vue-router'; diff --git a/src/pages/Login.vue b/src/pages/Login.vue index 1b1dfc0..03b82bb 100644 --- a/src/pages/Login.vue +++ b/src/pages/Login.vue @@ -54,7 +54,7 @@