refactor tag components and tagCreate events, change global week_start and timezone settings, fix pie charts

This commit is contained in:
Gregor Vostrak
2024-07-15 17:20:07 +02:00
parent 10d8540e6c
commit 655723db49
25 changed files with 255 additions and 133 deletions

View File

@@ -1,11 +1,12 @@
import './bootstrap';
import '../css/app.css';
import type { DefineComponent } from 'vue';
import { type DefineComponent } from 'vue';
import { createApp, h } from 'vue';
import { createInertiaApp } from '@inertiajs/vue3';
import { createInertiaApp, usePage } from '@inertiajs/vue3';
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
import { ZiggyVue } from '../../vendor/tightenco/ziggy';
import { createPinia } from 'pinia';
import type { User } from '@/types/models';
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
const pinia = createPinia();
@@ -24,6 +25,22 @@ createInertiaApp({
if (window.vueAppSetupHook) {
window.vueAppSetupHook(app);
}
window.getWeekStartSetting = function () {
const page = usePage<{
auth: {
user: User;
};
}>();
return page.props.auth.user.week_start;
};
window.getTimezoneSetting = function () {
const page = usePage<{
auth: {
user: User;
};
}>();
return page.props.auth.user.timezone;
};
app.use(plugin).use(pinia).use(ZiggyVue).mount(el);
},