release v2.0.0 #4

Merged
crimsen merged 481 commits from develop into master 2024-01-18 15:15:08 +00:00
2 changed files with 2 additions and 20 deletions
Showing only changes of commit f18897caf4 - Show all commits

View File

@ -1,5 +1,4 @@
import { boot } from 'quasar/wrappers'; import { boot } from 'quasar/wrappers';
import { Store } from 'vuex';
import { FG_Plugin } from 'src/plugins'; import { FG_Plugin } from 'src/plugins';
import routes from 'src/router/routes'; import routes from 'src/router/routes';
import { api } from 'boot/axios'; import { api } from 'boot/axios';
@ -158,7 +157,6 @@ function loadPlugin(
modules: string[], modules: string[],
backendpromise: Promise<Backend | null>, backendpromise: Promise<Backend | null>,
plugins: FG_Plugin.Plugin[], plugins: FG_Plugin.Plugin[],
store: Store<unknown>,
router: Router router: Router
): FG_Plugin.Flaschengeist { ): FG_Plugin.Flaschengeist {
modules.forEach((requiredModule) => { modules.forEach((requiredModule) => {
@ -181,11 +179,6 @@ function loadPlugin(
plugin.widgets.forEach((widget) => (widget.name = plugin.name + '_' + widget.name)); plugin.widgets.forEach((widget) => (widget.name = plugin.name + '_' + widget.name));
Array.prototype.push.apply(loadedPlugins.widgets, plugin.widgets); Array.prototype.push.apply(loadedPlugins.widgets, plugin.widgets);
} }
if (plugin.store) {
plugin.store.forEach((store_plugin, store_namespace) => {
store.registerModule(store_namespace, store_plugin);
});
}
loadedPlugins.plugins.push({ loadedPlugins.plugins.push({
name: plugin.name, name: plugin.name,
version: plugin.version, version: plugin.version,
@ -213,7 +206,7 @@ async function getBackend(): Promise<Backend | null> {
} }
} }
export default boot(({ router, app, store }) => { export default boot(({ router, app }) => {
const plugins: FG_Plugin.Plugin[] = []; const plugins: FG_Plugin.Plugin[] = [];
const backendPromise = getBackend(); const backendPromise = getBackend();
@ -275,17 +268,9 @@ export default boot(({ router, app, store }) => {
config.requiredModules, config.requiredModules,
backendPromise, backendPromise,
plugins, plugins,
store,
router
);
loadedPlugins = loadPlugin(
loadedPlugins,
config.loadModules,
backendPromise,
plugins,
store,
router router
); );
loadedPlugins = loadPlugin(loadedPlugins, config.loadModules, backendPromise, plugins, router);
loadedPlugins.widgets.sort((a, b) => b.priority - a.priority); loadedPlugins.widgets.sort((a, b) => b.priority - a.priority);

3
src/plugins.d.ts vendored
View File

@ -1,5 +1,4 @@
import { RouteRecordRaw } from 'vue-router'; import { RouteRecordRaw } from 'vue-router';
import { Module } from 'vuex';
import { Component, ComputedRef } from 'vue'; import { Component, ComputedRef } from 'vue';
declare namespace FG_Plugin { declare namespace FG_Plugin {
@ -33,8 +32,6 @@ declare namespace FG_Plugin {
requiredBackendModules: string[]; requiredBackendModules: string[];
mainRoutes?: PluginRouteConfig[]; mainRoutes?: PluginRouteConfig[];
outRoutes?: PluginRouteConfig[]; outRoutes?: PluginRouteConfig[];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
store?: Map<string, Module<any, any>>;
} }
interface PluginMainLink extends PluginChildLink { interface PluginMainLink extends PluginChildLink {