mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-02 17:59:14 +02:00
Merge branch '25-bug-edit-calendar-router-view' into 'main'
Resolve "bug: edit calendar router view" Closes #25 See merge request ekresse/htwkalender!10
This commit is contained in:
@@ -33,9 +33,11 @@ window.addEventListener("resize", updateMobile);
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<MenuBar />
|
<MenuBar />
|
||||||
<RouterView v-slot="{ Component }">
|
<RouterView v-slot="{ Component, route }">
|
||||||
<transition name="scale" mode="out-in">
|
<transition name="scale" mode="out-in">
|
||||||
<component :is="Component" class="origin-near-top"/>
|
<div :key="route.name ?? ''">
|
||||||
|
<component :is="Component" class="origin-near-top" />
|
||||||
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</RouterView>
|
</RouterView>
|
||||||
<!-- show CalendarPreview but only on specific router views -->
|
<!-- show CalendarPreview but only on specific router views -->
|
||||||
|
@@ -19,6 +19,23 @@ export async function createIndividualFeed(modules: Module[]): Promise<string> {
|
|||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
interface FeedResponse {
|
||||||
|
modules: FeedModule[];
|
||||||
|
collectionId: string;
|
||||||
|
collectionName: string;
|
||||||
|
id: string;
|
||||||
|
retrieved: string;
|
||||||
|
updated: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface FeedModule {
|
||||||
|
course: string;
|
||||||
|
name: string;
|
||||||
|
reminder: boolean;
|
||||||
|
userDefinedName: string;
|
||||||
|
uuid: string;
|
||||||
|
}
|
||||||
|
|
||||||
export async function saveIndividualFeed(
|
export async function saveIndividualFeed(
|
||||||
token: string,
|
token: string,
|
||||||
modules: Module[],
|
modules: Module[],
|
||||||
@@ -30,11 +47,14 @@ export async function saveIndividualFeed(
|
|||||||
},
|
},
|
||||||
body: '{"modules":' + JSON.stringify(modules) + "}",
|
body: '{"modules":' + JSON.stringify(modules) + "}",
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then(async (response) => {
|
||||||
return response.json();
|
// parse response.json to FeedResponse
|
||||||
|
const feedResponse: FeedResponse = await response.json();
|
||||||
|
return feedResponse;
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response: FeedResponse) => {
|
||||||
token = response;
|
console.debug("response", response);
|
||||||
|
token = response.id;
|
||||||
});
|
});
|
||||||
return token;
|
return token;
|
||||||
}
|
}
|
||||||
|
@@ -3,21 +3,28 @@ import moduleStore from "../store/moduleStore.ts";
|
|||||||
import { createIndividualFeed } from "../api/createFeed.ts";
|
import { createIndividualFeed } from "../api/createFeed.ts";
|
||||||
import router from "../router";
|
import router from "../router";
|
||||||
import tokenStore from "../store/tokenStore.ts";
|
import tokenStore from "../store/tokenStore.ts";
|
||||||
import { Ref, computed, inject, ref } from "vue";
|
import { Ref, computed, inject, ref, onMounted } from "vue";
|
||||||
import ModuleTemplateDialog from "./ModuleTemplateDialog.vue";
|
import ModuleTemplateDialog from "./ModuleTemplateDialog.vue";
|
||||||
import { onlyWhitespace } from "../helpers/strings.ts";
|
import { onlyWhitespace } from "../helpers/strings.ts";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
|
import { Module } from "@/model/module.ts";
|
||||||
const { t } = useI18n({ useScope: "global" });
|
const { t } = useI18n({ useScope: "global" });
|
||||||
|
|
||||||
const store = moduleStore();
|
const store = moduleStore();
|
||||||
const tableData = ref(
|
const tableData: Ref<{ Course: string; Module: Module }[]> = ref([
|
||||||
store.getAllModules().map((module) => {
|
{ Course: "", Module: {} as Module },
|
||||||
return {
|
]);
|
||||||
Course: module.course,
|
|
||||||
Module: module,
|
onMounted(
|
||||||
};
|
() =>
|
||||||
}),
|
(tableData.value = store.getAllModules().map((module) => {
|
||||||
|
return {
|
||||||
|
Course: module.course,
|
||||||
|
Module: module,
|
||||||
|
};
|
||||||
|
})),
|
||||||
);
|
);
|
||||||
|
|
||||||
const mobilePage = inject("mobilePage") as Ref<boolean>;
|
const mobilePage = inject("mobilePage") as Ref<boolean>;
|
||||||
|
|
||||||
const columns = computed(() => [
|
const columns = computed(() => [
|
||||||
@@ -70,11 +77,11 @@ async function finalStep() {
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<Column
|
<Column
|
||||||
v-for="col of columns"
|
v-for="(item, index) in columns"
|
||||||
:key="col.field"
|
:key="index"
|
||||||
:field="col.field"
|
:field="item.field"
|
||||||
:header="col.header"
|
:header="item.header"
|
||||||
:class="col.field === 'Reminder' ? 'text-center' : ''"
|
:class="item.field === 'Reminder' ? 'text-center' : ''"
|
||||||
>
|
>
|
||||||
<!-- Text Body -->
|
<!-- Text Body -->
|
||||||
<template #body="{ data, field }">
|
<template #body="{ data, field }">
|
||||||
|
@@ -24,11 +24,10 @@ const hasContent = computed(() => {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div class="flex flex-column align-items-center mt-0">
|
||||||
class="flex flex-column align-items-center mt-0"
|
<div
|
||||||
>
|
class="flex align-items-center justify-content-center gap-2 mx-2 transition-rolldown"
|
||||||
<div class="flex align-items-center justify-content-center gap-2 mx-2 transition-rolldown"
|
:class="{ 'md:mt-8': hideContent }"
|
||||||
:class="{'md:mt-8': hideContent}"
|
|
||||||
>
|
>
|
||||||
<h3 class="text-4xl">
|
<h3 class="text-4xl">
|
||||||
{{ headline }}
|
{{ headline }}
|
||||||
@@ -74,7 +73,7 @@ const hasContent = computed(() => {
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.transition-rolldown {
|
.transition-rolldown {
|
||||||
transition: margin-top 0.5s ease-in-out;
|
transition: margin-top 0.5s ease-in-out;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@@ -1,16 +1,13 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed, inject, Ref, ref } from "vue";
|
import { computed, inject, Ref, ref } from "vue";
|
||||||
import { Module } from "../../model/module.ts";
|
import { Module } from "@/model/module.ts";
|
||||||
import moduleStore from "../../store/moduleStore";
|
import moduleStore from "../../store/moduleStore";
|
||||||
import { fetchAllModules } from "../../api/fetchCourse.ts";
|
import { fetchAllModules } from "@/api/fetchCourse.ts";
|
||||||
import {
|
import { deleteIndividualFeed, saveIndividualFeed } from "@/api/createFeed.ts";
|
||||||
deleteIndividualFeed,
|
|
||||||
saveIndividualFeed,
|
|
||||||
} from "../../api/createFeed.ts";
|
|
||||||
import tokenStore from "../../store/tokenStore";
|
import tokenStore from "../../store/tokenStore";
|
||||||
import router from "../../router";
|
import router from "@/router";
|
||||||
import ModuleTemplateDialog from "../../components/ModuleTemplateDialog.vue";
|
import ModuleTemplateDialog from "../../components/ModuleTemplateDialog.vue";
|
||||||
import { onlyWhitespace } from "../../helpers/strings.ts";
|
import { onlyWhitespace } from "@/helpers/strings.ts";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { useToast } from "primevue/usetoast";
|
import { useToast } from "primevue/usetoast";
|
||||||
const { t } = useI18n({ useScope: "global" });
|
const { t } = useI18n({ useScope: "global" });
|
||||||
@@ -18,6 +15,13 @@ const { t } = useI18n({ useScope: "global" });
|
|||||||
const toast = useToast();
|
const toast = useToast();
|
||||||
const visible = ref(false);
|
const visible = ref(false);
|
||||||
|
|
||||||
|
defineProps({
|
||||||
|
class: {
|
||||||
|
type: String,
|
||||||
|
default: "",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
const store = moduleStore();
|
const store = moduleStore();
|
||||||
|
|
||||||
const tableData = computed(() =>
|
const tableData = computed(() =>
|
||||||
|
Reference in New Issue
Block a user