Skip to content

Commit

Permalink
update apexcharts
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Mar 10, 2024
1 parent f38ddb8 commit 2d71df0
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 10 deletions.
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
112 changes: 107 additions & 5 deletions src/boot/integrations.ts
Original file line number Diff line number Diff line change
@@ -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,
};
});

0 comments on commit 2d71df0

Please sign in to comment.