mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-08-07 04:09:17 +02:00
added information button
This commit is contained in:
@@ -1,10 +1,13 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, Ref } from "vue";
|
import { defineAsyncComponent, ref, Ref } from "vue";
|
||||||
import { Module } from "../model/module.ts";
|
import { Module } from "../model/module.ts";
|
||||||
import { fetchAllModules } from "../api/fetchCourse.ts";
|
import { fetchAllModules } from "../api/fetchCourse.ts";
|
||||||
import moduleStore from "../store/moduleStore.ts";
|
import moduleStore from "../store/moduleStore.ts";
|
||||||
import { MultiSelectAllChangeEvent } from "primevue/multiselect";
|
import { MultiSelectAllChangeEvent } from "primevue/multiselect";
|
||||||
|
|
||||||
|
import { useDialog } from "primevue/usedialog";
|
||||||
|
const dialog = useDialog();
|
||||||
|
|
||||||
import router from "../router";
|
import router from "../router";
|
||||||
|
|
||||||
const fetchedModules = async () => {
|
const fetchedModules = async () => {
|
||||||
@@ -30,6 +33,27 @@ async function nextStep() {
|
|||||||
await router.push("/rename-modules");
|
await router.push("/rename-modules");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ModuleInformation = defineAsyncComponent(
|
||||||
|
() => import("./ModuleInformation.vue"),
|
||||||
|
);
|
||||||
|
|
||||||
|
//TODO add missing module prop informations for ModuleInformation.vue
|
||||||
|
const showInfo = () => {
|
||||||
|
dialog.open(ModuleInformation, {
|
||||||
|
props: {
|
||||||
|
header: "Product List",
|
||||||
|
style: {
|
||||||
|
width: "50vw",
|
||||||
|
},
|
||||||
|
breakpoints: {
|
||||||
|
"960px": "75vw",
|
||||||
|
"640px": "90vw",
|
||||||
|
},
|
||||||
|
modal: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const display = (module: Module) => module.name + " (" + module.course + ")";
|
const display = (module: Module) => module.name + " (" + module.course + ")";
|
||||||
|
|
||||||
const selectAll = ref(false);
|
const selectAll = ref(false);
|
||||||
@@ -69,10 +93,23 @@ function selectChange() {
|
|||||||
@selectall-change="onSelectAllChange($event)"
|
@selectall-change="onSelectAllChange($event)"
|
||||||
>
|
>
|
||||||
<template #option="slotProps">
|
<template #option="slotProps">
|
||||||
<div class="flex align-items-center">
|
<div class="flex justify-content-between w-full">
|
||||||
<p class="text-1xl white-space-normal">
|
<div class="flex align-items-center justify-content-center">
|
||||||
{{ display(slotProps.option) }}
|
<p class="text-1xl white-space-normal p-mb-0">
|
||||||
</p>
|
{{ display(slotProps.option) }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="flex align-items-center justify-content-center ml-2">
|
||||||
|
<Button
|
||||||
|
icon="pi pi-info"
|
||||||
|
severity="secondary"
|
||||||
|
rounded
|
||||||
|
outlined
|
||||||
|
aria-label="Information"
|
||||||
|
@click.stop="showInfo()"
|
||||||
|
></Button>
|
||||||
|
<DynamicDialog />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
27
frontend/src/components/ModuleInformation.vue
Normal file
27
frontend/src/components/ModuleInformation.vue
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
<script lang="ts" setup>
|
||||||
|
import { PropType } from "vue";
|
||||||
|
import { Module } from "../model/module.ts";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
module: {
|
||||||
|
type: Object as PropType<Module>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<h2>{{ props.module.name }}</h2>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td>Course:</td>
|
||||||
|
<td>{{ props.module.course }}</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>ID:</td>
|
||||||
|
<td>{{ props.module.id }}</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</template>
|
@@ -23,6 +23,8 @@ import Accordion from 'primevue/accordion';
|
|||||||
import AccordionTab from 'primevue/accordiontab';
|
import AccordionTab from 'primevue/accordiontab';
|
||||||
import DataTable from "primevue/datatable";
|
import DataTable from "primevue/datatable";
|
||||||
import Column from "primevue/column";
|
import Column from "primevue/column";
|
||||||
|
import DynamicDialog from 'primevue/dynamicdialog';
|
||||||
|
import DialogService from 'primevue/dialogservice';
|
||||||
|
|
||||||
const app = createApp(App);
|
const app = createApp(App);
|
||||||
const pinia = createPinia();
|
const pinia = createPinia();
|
||||||
@@ -31,6 +33,7 @@ app.use(PrimeVue);
|
|||||||
app.use(router);
|
app.use(router);
|
||||||
app.use(ToastService);
|
app.use(ToastService);
|
||||||
app.use(pinia);
|
app.use(pinia);
|
||||||
|
app.use(DialogService);
|
||||||
app.component("Button", Button);
|
app.component("Button", Button);
|
||||||
app.component("Menubar", Menubar);
|
app.component("Menubar", Menubar);
|
||||||
app.component("Dropdown", Dropdown);
|
app.component("Dropdown", Dropdown);
|
||||||
@@ -46,4 +49,5 @@ app.component("Accordion", Accordion);
|
|||||||
app.component("AccordionTab", AccordionTab);
|
app.component("AccordionTab", AccordionTab);
|
||||||
app.component("DataTable", DataTable);
|
app.component("DataTable", DataTable);
|
||||||
app.component("Column", Column);
|
app.component("Column", Column);
|
||||||
|
app.component("DynamicDialog", DynamicDialog);
|
||||||
app.mount("#app");
|
app.mount("#app");
|
||||||
|
Reference in New Issue
Block a user