release v2.0.0 #4
34
package.json
34
package.json
|
@ -19,31 +19,31 @@
|
|||
"@flaschengeist/users": "^1.0.0-alpha.1",
|
||||
"axios": "^0.21.1",
|
||||
"cordova": "^10.0.0",
|
||||
"pinia": "2.0.0-beta.5",
|
||||
"quasar": "^2.0.3"
|
||||
"pinia": "^2.0.0-rc.6",
|
||||
"quasar": "^2.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@flaschengeist/types": "^1.0.0-alpha.2",
|
||||
"@quasar/app": "^3.0.3",
|
||||
"@quasar/extras": "^1.10.9",
|
||||
"@types/node": "^12.20.15",
|
||||
"@flaschengeist/types": "^1.0.0-alpha.4",
|
||||
"@quasar/app": "^3.1.0",
|
||||
"@quasar/extras": "^1.10.12",
|
||||
"@types/node": "^12.20.21",
|
||||
"@types/webpack": "^5.28.0",
|
||||
"@types/webpack-env": "^1.16.0",
|
||||
"@typescript-eslint/eslint-plugin": "^4.24.0",
|
||||
"@typescript-eslint/parser": "^4.24.0",
|
||||
"eslint": "^7.26.0",
|
||||
"@types/webpack-env": "^1.16.2",
|
||||
"@typescript-eslint/eslint-plugin": "^4.29.3",
|
||||
"@typescript-eslint/parser": "^4.29.3",
|
||||
"eslint": "^7.32.0",
|
||||
"eslint-config-prettier": "^8.3.0",
|
||||
"eslint-plugin-vue": "^7.9.0",
|
||||
"eslint-webpack-plugin": "^2.5.4",
|
||||
"modify-source-webpack-plugin": "^3.0.0-rc.0",
|
||||
"prettier": "^2.3.0",
|
||||
"typescript": "^4.2.4",
|
||||
"vuedraggable": "^4.0.1"
|
||||
"eslint-plugin-vue": "^7.17.0",
|
||||
"eslint-webpack-plugin": "^3.0.1",
|
||||
"modify-source-webpack-plugin": "^3.0.0",
|
||||
"prettier": "^2.3.2",
|
||||
"typescript": "~4.3.5",
|
||||
"vuedraggable": "^4.1.0"
|
||||
},
|
||||
"prettier": {
|
||||
"singleQuote": true,
|
||||
"semi": true,
|
||||
"printWidth": 120,
|
||||
"printWidth": 100,
|
||||
"arrowParens": "always"
|
||||
},
|
||||
"browserslist": [
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Notify } from 'quasar';
|
||||
import { api } from 'boot/axios';
|
||||
import { api } from 'src/boot/axios';
|
||||
import { boot } from 'quasar/wrappers';
|
||||
import routes from 'src/router/routes';
|
||||
import { AxiosResponse } from 'axios';
|
||||
|
@ -118,7 +118,11 @@ function combineMenuRoutes(
|
|||
target.children = [];
|
||||
}
|
||||
convertRoutes(sourceMainConfig.route, sourceMainConfig.children);
|
||||
if (sourceMainConfig.children && sourceMainConfig.children.length > 0 && !sourceMainConfig.route.component)
|
||||
if (
|
||||
sourceMainConfig.children &&
|
||||
sourceMainConfig.children.length > 0 &&
|
||||
!sourceMainConfig.route.component
|
||||
)
|
||||
Object.assign(sourceMainConfig.route, {
|
||||
component: () => import('src/components/navigation/EmptyParent.vue'),
|
||||
});
|
||||
|
@ -130,14 +134,20 @@ function combineMenuRoutes(
|
|||
return target;
|
||||
}
|
||||
|
||||
function combineRoutes(target: RouteRecordRaw[], source: FG_Plugin.NamedRouteRecordRaw[], mainPath: '/' | '/in') {
|
||||
function combineRoutes(
|
||||
target: RouteRecordRaw[],
|
||||
source: FG_Plugin.NamedRouteRecordRaw[],
|
||||
mainPath: '/' | '/in'
|
||||
) {
|
||||
// Search parent
|
||||
target.forEach((target) => {
|
||||
if (target.path === mainPath) {
|
||||
// Parent found = target
|
||||
source.forEach((sourceRoute) => {
|
||||
// Check if source is already in target
|
||||
const targetRoot = target.children?.find((targetRoot) => sourceRoute.path === targetRoot.path);
|
||||
const targetRoot = target.children?.find(
|
||||
(targetRoot) => sourceRoute.path === targetRoot.path
|
||||
);
|
||||
// Already in target routes, add only children
|
||||
if (targetRoot) {
|
||||
if (targetRoot.children === undefined) targetRoot.children = [];
|
||||
|
@ -145,7 +155,11 @@ function combineRoutes(target: RouteRecordRaw[], source: FG_Plugin.NamedRouteRec
|
|||
} else {
|
||||
// Append to target
|
||||
if (target.children === undefined) target.children = [];
|
||||
if (sourceRoute.children && sourceRoute.children.length > 0 && sourceRoute.component === undefined)
|
||||
if (
|
||||
sourceRoute.children &&
|
||||
sourceRoute.children.length > 0 &&
|
||||
sourceRoute.component === undefined
|
||||
)
|
||||
Object.assign(sourceRoute, {
|
||||
component: () => import('src/components/navigation/EmptyParent.vue'),
|
||||
});
|
||||
|
@ -211,7 +225,11 @@ function combineShortcuts(target: FG_Plugin.Shortcut[], source: FG_Plugin.MenuRo
|
|||
* @param plugin Plugin to load
|
||||
* @param router VueRouter instance
|
||||
*/
|
||||
function loadPlugin(loadedPlugins: FG_Plugin.Flaschengeist, plugin: FG_Plugin.Plugin, backend: Backend) {
|
||||
function loadPlugin(
|
||||
loadedPlugins: FG_Plugin.Flaschengeist,
|
||||
plugin: FG_Plugin.Plugin,
|
||||
backend: Backend
|
||||
) {
|
||||
// Check if already loaded
|
||||
if (loadedPlugins.plugins.findIndex((p) => p.name === plugin.name) !== -1) return true;
|
||||
|
||||
|
@ -220,7 +238,8 @@ function loadPlugin(loadedPlugins: FG_Plugin.Flaschengeist, plugin: FG_Plugin.Pl
|
|||
!plugin.requiredModules.every(
|
||||
(required) =>
|
||||
backend.plugins[required[0]] !== undefined &&
|
||||
(required.length == 1 || true) /* validate the version, semver440 from python is... tricky on node*/
|
||||
(required.length == 1 ||
|
||||
true) /* validate the version, semver440 from python is... tricky on node*/
|
||||
)
|
||||
) {
|
||||
console.error(`Plugin ${plugin.name}: Backend modules not satisfied`);
|
||||
|
@ -315,7 +334,9 @@ export default boot(async ({ router, app }) => {
|
|||
|
||||
// Sort widgets by priority
|
||||
/** @todo Remove priority with first beta */
|
||||
loadedPlugins.widgets.sort((a, b) => <number>(b.order || b.priority) - <number>(a.order || a.priority));
|
||||
loadedPlugins.widgets.sort(
|
||||
(a, b) => <number>(b.order || b.priority) - <number>(a.order || a.priority)
|
||||
);
|
||||
/** @todo Can be cleaned up with first beta */
|
||||
loadedPlugins.menuLinks.sort((a, b) => {
|
||||
const diff = a.order && b.order ? b.order - a.order : 0;
|
||||
|
|
|
@ -19,11 +19,7 @@
|
|||
{{ notifications.length }}
|
||||
</q-badge>
|
||||
<q-menu style="max-height: 400px; overflow: auto">
|
||||
<q-btn
|
||||
v-if="useNative && noPermission"
|
||||
label="Benachrichtigungen erlauben"
|
||||
@click="requestPermission"
|
||||
/>
|
||||
<q-btn v-if="useNative && noPermission" label="Benachrichtigungen erlauben" @click="requestPermission" />
|
||||
<template v-if="notifications.length > 0">
|
||||
<Notification
|
||||
v-for="(notification, index) in notifications"
|
||||
|
@ -44,13 +40,7 @@
|
|||
</q-toolbar>
|
||||
</q-header>
|
||||
|
||||
<q-drawer
|
||||
v-model="leftDrawer"
|
||||
side="left"
|
||||
bordered
|
||||
:mini="leftDrawerMini"
|
||||
@click.capture="openMenu"
|
||||
>
|
||||
<q-drawer v-model="leftDrawer" side="left" bordered :mini="leftDrawerMini" @click.capture="openMenu">
|
||||
<!-- Plugins -->
|
||||
<essential-expansion-link
|
||||
v-for="(entry, index) in mainLinks"
|
||||
|
@ -59,11 +49,7 @@
|
|||
@add-short-cut="addShortcut"
|
||||
/>
|
||||
<q-separator />
|
||||
<essential-link
|
||||
v-for="(entry, index) in essentials"
|
||||
:key="'essential' + index"
|
||||
:entry="entry"
|
||||
/>
|
||||
<essential-link v-for="(entry, index) in essentials" :key="'essential' + index" :entry="entry" />
|
||||
</q-drawer>
|
||||
<q-page-container>
|
||||
<router-view />
|
||||
|
@ -76,15 +62,7 @@ import EssentialExpansionLink from 'components/navigation/EssentialExpansionLink
|
|||
import EssentialLink from 'src/components/navigation/EssentialLink.vue';
|
||||
import ShortcutLink from 'src/components/navigation/ShortcutLink.vue';
|
||||
import Notification from 'src/components/Notification.vue';
|
||||
import {
|
||||
defineComponent,
|
||||
ref,
|
||||
inject,
|
||||
computed,
|
||||
onBeforeMount,
|
||||
onBeforeUnmount,
|
||||
ComponentPublicInstance,
|
||||
} from 'vue';
|
||||
import { defineComponent, ref, inject, computed, onBeforeMount, onBeforeUnmount } from 'vue';
|
||||
import { Screen } from 'quasar';
|
||||
import config from 'src/config';
|
||||
import { useRouter } from 'vue-router';
|
||||
|
@ -107,7 +85,7 @@ export default defineComponent({
|
|||
EssentialLink,
|
||||
ShortcutLink,
|
||||
Notification,
|
||||
drag: <ComponentPublicInstance>drag,
|
||||
drag,
|
||||
},
|
||||
setup() {
|
||||
const router = useRouter();
|
||||
|
@ -151,15 +129,11 @@ export default defineComponent({
|
|||
}
|
||||
|
||||
function requestPermission() {
|
||||
void window.Notification.requestPermission().then(
|
||||
(p) => (noPermission.value = p !== 'granted')
|
||||
);
|
||||
void window.Notification.requestPermission().then((p) => (noPermission.value = p !== 'granted'));
|
||||
}
|
||||
|
||||
function pollNotification() {
|
||||
void mainStore
|
||||
.loadNotifications(<FG_Plugin.Flaschengeist>flaschengeist)
|
||||
.then((notifications) => {
|
||||
void mainStore.loadNotifications(<FG_Plugin.Flaschengeist>flaschengeist).then((notifications) => {
|
||||
if (useNative && !noPermission.value)
|
||||
notifications.forEach(
|
||||
(notif) =>
|
||||
|
|
Loading…
Reference in New Issue