From 2d71df0edff7baabacf38c7d0d080933524de1e0 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Sun, 10 Mar 2024 22:27:28 +0000 Subject: [PATCH] update apexcharts --- package-lock.json | 8 +-- package.json | 2 +- src/boot/integrations.ts | 112 +++++++++++++++++++++++++++++++++++++-- 3 files changed, 112 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2037e8b9..40643e88 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "@quasar/extras": "1.16.9", "@vueuse/core": "10.9.0", "@vueuse/shared": "10.9.0", - "apexcharts": "3.46.0", + "apexcharts": "3.47.0", "axios": "1.6.7", "dotenv": "16.4.5", "monaco-editor": "0.47.0", @@ -1358,9 +1358,9 @@ } }, "node_modules/apexcharts": { - "version": "3.46.0", - "resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.46.0.tgz", - "integrity": "sha512-ELAY6vj8JQD7QLktKasTzwm9Wt0qxqfQSo+3QWS7G7I774iK8HCkG1toGsqJH0mkK6PtYBtnSIe66uUcwoCw1w==", + "version": "3.47.0", + "resolved": "https://registry.npmjs.org/apexcharts/-/apexcharts-3.47.0.tgz", + "integrity": "sha512-s/fgNCA69b8lJdhI3R7Z+/Df47RPplLyHwuvttecR+aaZ3/Pm6wHYPiAGjqDNbVsMGXhuA9mcOpIYU5ZWeSdeg==", "dependencies": { "@yr/monotone-cubic-spline": "^1.0.3", "svg.draggable.js": "^2.2.2", diff --git a/package.json b/package.json index 5464b002..a8930132 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "dependencies": { "@quasar/extras": "1.16.9", - "apexcharts": "3.46.0", + "apexcharts": "3.47.0", "axios": "1.6.7", "dotenv": "16.4.5", "pinia": "^2.1.7", diff --git a/src/boot/integrations.ts b/src/boot/integrations.ts index 14410aac..aff83b8f 100644 --- a/src/boot/integrations.ts +++ b/src/boot/integrations.ts @@ -1,10 +1,112 @@ +import ReportsManager from "@/ee/reporting/components/ReportsManager.vue"; +import RunReportDialog from "@/ee/reporting/components/RunReportDialog.vue"; +import { type DefineComponent } from "vue"; import { boot } from "quasar/wrappers"; -export default boot(({ app }) => { +interface FileBarIntegration { + component: DefineComponent; + name: string; + type: "dialog" | "route"; +} + +type ContextMenuType = "client" | "site" | "agent"; + +interface ContextMenuProps { + id: number; + type: ContextMenuType; +} + +interface ContextMenuIntegration { + component: DefineComponent; + name: string; + type: "dialog" | "route"; + props: (id: number, type: ContextMenuType) => ContextMenuProps; +} + +const propsFunction = (id: number, type: ContextMenuType) => ({ id, type }); +const propsFunctionDownload = (id: number, type: ContextMenuType) => ({ + id, + type, + download: true, +}); + +export default boot(({ app, router }) => { + router.addRoute("reports", { + path: "/reports/:id", + name: "Reports", + component: () => import("@/ee/reporting/views/ReportView.vue"), + props: (route) => ({ + id: parseInt(route.params.id), + format: route.query.format, + dependsOn: route.query.dependsOn + ? JSON.parse(route.query.dependsOn) + : undefined, + dependencies: route.query.dependencies + ? JSON.parse(route.query.dependencies) + : undefined, + }), + meta: { + requireAuth: true, + }, + }); + + const fileBarIntegrations = [ + { + component: ReportsManager, + name: "Reporting Manager", + type: "dialog", + }, + ] as FileBarIntegration[]; + + const clientMenuIntegrations: ContextMenuIntegration[] = [ + { + component: RunReportDialog, + name: "Run Report", + type: "dialog", + props: propsFunction, + }, + { + component: RunReportDialog, + name: "Download Report", + type: "dialog", + props: propsFunctionDownload, + }, + ]; + + const siteMenuIntegrations: ContextMenuIntegration[] = [ + { + component: RunReportDialog, + name: "Run Report", + type: "dialog", + props: propsFunction, + }, + { + component: RunReportDialog, + name: "Download Report", + type: "dialog", + props: propsFunctionDownload, + }, + ]; + + const agentMenuIntegrations: ContextMenuIntegration[] = [ + { + component: RunReportDialog, + name: "Run Report", + type: "dialog", + props: propsFunction, + }, + { + component: RunReportDialog, + name: "Download Report", + type: "dialog", + props: propsFunctionDownload, + }, + ]; + app.config.globalProperties.$integrations = { - fileBarIntegrations: [], - clientMenuIntegrations: [], - siteMenuIntegrations: [], - agentMenuIntegrations: [], + fileBarIntegrations, + clientMenuIntegrations, + siteMenuIntegrations, + agentMenuIntegrations, }; });