mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-08-09 05:07:46 +02:00
fix:#30 updated files in pwa
This commit is contained in:
4219
frontend/package-lock.json
generated
4219
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -22,8 +22,7 @@ import { RouteRecordName, RouterView, useRoute, useRouter } from "vue-router";
|
||||
import { useHead, useServerHead, useServerSeoMeta } from "@unhead/vue";
|
||||
import CalendarPreview from "./components/CalendarPreview.vue";
|
||||
import moduleStore from "./store/moduleStore.ts";
|
||||
import { onMounted, provide, ref } from "vue";
|
||||
import { computed, provide, ref } from "vue";
|
||||
import { onMounted, provide, ref, computed } from "vue";
|
||||
import { VueQueryDevtools } from "@tanstack/vue-query-devtools";
|
||||
import settingsStore from "@/store/settingsStore.ts";
|
||||
import { setTheme } from "@/helpers/theme.ts";
|
||||
|
@@ -29,13 +29,13 @@ import dayGridPlugin from "@fullcalendar/daygrid";
|
||||
import interactionPlugin from "@fullcalendar/interaction";
|
||||
import timeGridPlugin from "@fullcalendar/timegrid";
|
||||
import iCalenderPlugin from "@fullcalendar/icalendar";
|
||||
import router from "@/router";
|
||||
import { formatYearMonthDay } from "@/helpers/dates.ts";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { useQuery, useQueryClient } from "@tanstack/vue-query";
|
||||
import tokenStore from "@/store/tokenStore.ts";
|
||||
import { parseICalData } from "@/helpers/ical.ts";
|
||||
import { fetchICalendarEvents } from "@/api/loadICal.ts";
|
||||
import {router} from "@/main.ts";
|
||||
|
||||
const { t } = useI18n({ useScope: "global" });
|
||||
|
||||
|
@@ -25,13 +25,15 @@ import { computed, ComputedRef, inject, ref, Ref } from "vue";
|
||||
import { CalendarOptions, DatesSetArg, EventInput } from "@fullcalendar/core";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import allLocales from "@fullcalendar/core/locales-all";
|
||||
import router from "@/router";
|
||||
import { formatYearMonthDay } from "@/helpers/dates";
|
||||
import { useQuery } from "@tanstack/vue-query";
|
||||
import { watch } from "vue";
|
||||
import { fetchRoomOccupancy } from "@/api/fetchRoomOccupancy";
|
||||
import { isValid } from "date-fns";
|
||||
import { RoomOccupancyList } from "@/model/roomOccupancyList";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const { t } = useI18n({ useScope: "global" });
|
||||
|
||||
|
@@ -8,6 +8,7 @@
|
||||
"faq": "よくある質問",
|
||||
"imprint": "インプリント",
|
||||
"privacy": "プライバシー",
|
||||
"description": "個別の時間割にはスポーツイベントや試験が含まれています。今後のイベントや学習や作業のための空き教室を見つけましょう。",
|
||||
"english": "英語",
|
||||
"german": "ドイツ語",
|
||||
"japanese": "日本語",
|
||||
|
@@ -36,7 +36,6 @@ import OverlayPanel from "primevue/overlaypanel";
|
||||
import ToggleButton from "primevue/togglebutton";
|
||||
import "primeicons/primeicons.css";
|
||||
import "primeflex/primeflex.css";
|
||||
import routes from "./router";
|
||||
import SpeedDial from "primevue/speeddial";
|
||||
import TabView from "primevue/tabview";
|
||||
import TabPanel from "primevue/tabpanel";
|
||||
@@ -60,93 +59,94 @@ import { VueQueryPlugin } from "@tanstack/vue-query";
|
||||
import { Router } from "vue-router";
|
||||
import { polyfillCountryFlagEmojis } from "country-flag-emoji-polyfill";
|
||||
import piniaPluginPersistedstate from "pinia-plugin-persistedstate";
|
||||
import routerOptions from "@/router";
|
||||
|
||||
polyfillCountryFlagEmojis();
|
||||
|
||||
var router : Router;
|
||||
let router: Router;
|
||||
|
||||
export const createApp = ViteSSG(
|
||||
App,
|
||||
{
|
||||
base: import.meta.env.BASE_URL,
|
||||
routes: routes.routes,
|
||||
routes: routerOptions.routerOptions.routes,
|
||||
},
|
||||
(ctx) => {
|
||||
const { app } = ctx;
|
||||
const pinia = createPinia();
|
||||
app.use(pinia);
|
||||
const {app} = ctx;
|
||||
const pinia = createPinia();
|
||||
app.use(pinia);
|
||||
|
||||
router = ctx.router;
|
||||
router = ctx.router;
|
||||
|
||||
router.beforeEach(async (to, from) => {
|
||||
if (import.meta.env.SSR) {
|
||||
return;
|
||||
}
|
||||
router.beforeEach(async (to, from) => {
|
||||
if (import.meta.env.SSR) {
|
||||
return;
|
||||
}
|
||||
|
||||
// External redirect
|
||||
if (to.matched.some((record) => record.meta.redirect)) {
|
||||
window.location.replace(to.meta.redirect as string);
|
||||
return;
|
||||
}
|
||||
// External redirect
|
||||
if (to.matched.some((record) => record.meta.redirect)) {
|
||||
window.location.replace(to.meta.redirect as string);
|
||||
return;
|
||||
}
|
||||
|
||||
const newLocale = to.params.locale;
|
||||
const prevLocale = from.params.locale;
|
||||
// If the locale hasn't changed, do nothing
|
||||
if (newLocale === prevLocale) {
|
||||
return;
|
||||
}
|
||||
i18n.setLocale(newLocale);
|
||||
});
|
||||
const newLocale = to.params.locale;
|
||||
const prevLocale = from.params.locale;
|
||||
// If the locale hasn't changed, do nothing
|
||||
if (newLocale === prevLocale) {
|
||||
return;
|
||||
}
|
||||
i18n.setLocale(newLocale);
|
||||
});
|
||||
|
||||
pinia.use(piniaPluginPersistedstate);
|
||||
pinia.use(piniaPluginPersistedstate);
|
||||
|
||||
app.use(VueQueryPlugin, {
|
||||
queryClientConfig: {
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
refetchOnWindowFocus: false
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
app.use(VueQueryPlugin, {
|
||||
queryClientConfig: {
|
||||
defaultOptions: {
|
||||
queries: {
|
||||
refetchOnWindowFocus: false
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
app.use(PrimeVue);
|
||||
app.use(router);
|
||||
app.use(ToastService);
|
||||
app.use(pinia);
|
||||
app.use(DialogService);
|
||||
i18n.setup();
|
||||
app.use(i18n.vueI18n);
|
||||
app.component("Avatar", Avatar);
|
||||
app.component("Badge", Badge);
|
||||
app.component("Button", Button);
|
||||
app.component("Menu", Menu);
|
||||
app.component("Menubar", Menubar);
|
||||
app.component("Dialog", Dialog);
|
||||
app.component("Dropdown", Dropdown);
|
||||
app.component("InputText", InputText);
|
||||
app.component("InputSwitch", InputSwitch);
|
||||
app.component("Card", Card);
|
||||
app.component("DataView", DataView);
|
||||
app.component("Slider", Slider);
|
||||
app.component("ToggleButton", ToggleButton);
|
||||
app.component("SpeedDial", SpeedDial);
|
||||
app.component("TabView", TabView);
|
||||
app.component("TabPanel", TabPanel);
|
||||
app.component("MultiSelect", MultiSelect);
|
||||
app.component("Tag", Tag);
|
||||
app.component("Toast", Toast);
|
||||
app.component("Accordion", Accordion);
|
||||
app.component("AccordionTab", AccordionTab);
|
||||
app.component("DataTable", DataTable);
|
||||
app.component("Column", Column);
|
||||
app.component("DynamicDialog", DynamicDialog);
|
||||
app.component("ProgressSpinner", ProgressSpinner);
|
||||
app.component("Checkbox", Checkbox);
|
||||
app.component("Skeleton", Skeleton);
|
||||
app.component("Calendar", Calendar);
|
||||
app.component("OverlayPanel", OverlayPanel);
|
||||
},
|
||||
app.use(PrimeVue);
|
||||
app.use(router);
|
||||
app.use(ToastService);
|
||||
app.use(pinia);
|
||||
app.use(DialogService);
|
||||
i18n.setup();
|
||||
app.use(i18n.vueI18n);
|
||||
app.component("Avatar", Avatar);
|
||||
app.component("Badge", Badge);
|
||||
app.component("Button", Button);
|
||||
app.component("Menu", Menu);
|
||||
app.component("Menubar", Menubar);
|
||||
app.component("Dialog", Dialog);
|
||||
app.component("Dropdown", Dropdown);
|
||||
app.component("InputText", InputText);
|
||||
app.component("InputSwitch", InputSwitch);
|
||||
app.component("Card", Card);
|
||||
app.component("DataView", DataView);
|
||||
app.component("Slider", Slider);
|
||||
app.component("ToggleButton", ToggleButton);
|
||||
app.component("SpeedDial", SpeedDial);
|
||||
app.component("TabView", TabView);
|
||||
app.component("TabPanel", TabPanel);
|
||||
app.component("MultiSelect", MultiSelect);
|
||||
app.component("Tag", Tag);
|
||||
app.component("Toast", Toast);
|
||||
app.component("Accordion", Accordion);
|
||||
app.component("AccordionTab", AccordionTab);
|
||||
app.component("DataTable", DataTable);
|
||||
app.component("Column", Column);
|
||||
app.component("DynamicDialog", DynamicDialog);
|
||||
app.component("ProgressSpinner", ProgressSpinner);
|
||||
app.component("Checkbox", Checkbox);
|
||||
app.component("Skeleton", Skeleton);
|
||||
app.component("Calendar", Calendar);
|
||||
app.component("OverlayPanel", OverlayPanel);
|
||||
},
|
||||
)
|
||||
|
||||
export {router}
|
@@ -14,20 +14,10 @@
|
||||
//You should have received a copy of the GNU Affero General Public License
|
||||
//along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
import { createMemoryHistory, RouterOptions, createWebHistory } from "vue-router";
|
||||
import {createMemoryHistory, RouterOptions, createWebHistory, createRouter} from "vue-router";
|
||||
|
||||
const Faq = () => import("../components/FaqPage.vue");
|
||||
const AdditionalModules = () => import("../view/AdditionalModules.vue");
|
||||
const CalendarLink = () => import("../components/CalendarLink.vue");
|
||||
const RenameModules = () => import("../components/RenameModules.vue");
|
||||
const RoomFinder = () => import("../view/RoomFinder.vue");
|
||||
const RoomFinderOffline = () => import("../view/RoomFinderOffline.vue");
|
||||
const EditCalendarView = () => import("../view/EditCalendarView.vue");
|
||||
const EditAdditionalModules = () =>
|
||||
import("../view/editCalendar/EditAdditionalModules.vue");
|
||||
const EditModules = () => import("../view/editCalendar/EditModules.vue");
|
||||
const CourseSelection = () => import("../view/CourseSelection.vue");
|
||||
const FreeRooms = () => import("../view/FreeRooms.vue");
|
||||
const CalenderViewer = () => import("../view/UserCalendar.vue");
|
||||
const SettingsView = () => import("../view/SettingsView.vue");
|
||||
const NotFound = () => import("../view/NotFound.vue");
|
||||
@@ -42,10 +32,7 @@ const EditAdditionalModules = () =>
|
||||
const EditModules = () => import("../view/edit/EditModules.vue");
|
||||
const FaqView = () => import("../view/FaqView.vue");
|
||||
|
||||
import i18n from "../i18n";
|
||||
import settingsStore from "@/store/settingsStore.ts";
|
||||
|
||||
const routes : RouterOptions = {
|
||||
const routerOptions : RouterOptions = {
|
||||
history: import.meta.env.SSR ? createMemoryHistory(import.meta.env.BASE_URL) : createWebHistory(import.meta.env.BASE_URL),
|
||||
routes: [
|
||||
{
|
||||
@@ -185,4 +172,4 @@ const routes : RouterOptions = {
|
||||
],
|
||||
};
|
||||
|
||||
export default routes;
|
||||
export default {routerOptions};
|
||||
|
@@ -16,7 +16,7 @@
|
||||
|
||||
import { defineStore } from "pinia";
|
||||
import { useLocalStorage } from "@vueuse/core";
|
||||
import router from "@/router";
|
||||
import {router} from "@/main.ts";
|
||||
|
||||
const settingsStore = defineStore("settingsStore", {
|
||||
state: () => {
|
||||
@@ -33,9 +33,6 @@ const settingsStore = defineStore("settingsStore", {
|
||||
setDarkMode(isDark: boolean) {
|
||||
this.isDark = isDark;
|
||||
},
|
||||
getDarkMode(): boolean {
|
||||
return this.isDark;
|
||||
},
|
||||
setDefaultPage(page: {
|
||||
label: string;
|
||||
value: string;
|
||||
@@ -51,7 +48,7 @@ const settingsStore = defineStore("settingsStore", {
|
||||
label: string;
|
||||
value: string;
|
||||
}[] = [];
|
||||
router.getRoutes().forEach((route) => {
|
||||
router.options.routes.forEach((route) => {
|
||||
if (route.name) {
|
||||
if (typeof route.name === "string") {
|
||||
options.push({
|
||||
|
@@ -22,12 +22,15 @@ import { fetchRoom } from "../api/fetchRoom.ts";
|
||||
import DynamicPage from "./DynamicPage.vue";
|
||||
import RoomOccupationOffline from "../components/RoomOccupationOffline.vue";
|
||||
import { computedAsync } from "@vueuse/core";
|
||||
import router from "@/router";
|
||||
import { useRoute, useRouter } from "vue-router";
|
||||
|
||||
type Room = {
|
||||
name: string;
|
||||
};
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const selectedRoom: Ref<Room> = ref({ name: "" });
|
||||
|
||||
// Watch for changes in URL parameter
|
||||
@@ -46,7 +49,7 @@ const rooms = computedAsync<Set<string>>(async () => {
|
||||
return rooms;
|
||||
})
|
||||
.finally(() => {
|
||||
const room = router.currentRoute.value.query.room;
|
||||
const room = route.query.room;
|
||||
if (room && typeof room === "string") {
|
||||
// check if room is available in roomsList
|
||||
setRoomFromList(room, rooms);
|
||||
|
Reference in New Issue
Block a user