mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender-pwa.git
synced 2025-07-16 17:48:51 +02:00
added dialog information transfer
This commit is contained in:
@ -25,7 +25,7 @@ export async function fetchModulesByCourseAndSemester(
|
|||||||
})
|
})
|
||||||
.then((modulesResponse) => {
|
.then((modulesResponse) => {
|
||||||
modulesResponse.forEach((module: Module) =>
|
modulesResponse.forEach((module: Module) =>
|
||||||
modules.push(new Module(module.id, module.name, course, module.name)),
|
modules.push(new Module(module.name, course, module.name)),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
return modules;
|
return modules;
|
||||||
@ -39,7 +39,7 @@ export async function fetchAllModules(): Promise<Module[]> {
|
|||||||
})
|
})
|
||||||
.then((responseModules: Module[]) => {
|
.then((responseModules: Module[]) => {
|
||||||
responseModules.forEach((module: Module) => {
|
responseModules.forEach((module: Module) => {
|
||||||
modules.push(new Module(module.id, module.name, module.course, module.name));
|
modules.push(new Module(module.name, module.course, module.name));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -38,10 +38,9 @@ const ModuleInformation = defineAsyncComponent(
|
|||||||
);
|
);
|
||||||
|
|
||||||
//TODO add missing module prop informations for ModuleInformation.vue
|
//TODO add missing module prop informations for ModuleInformation.vue
|
||||||
const showInfo = () => {
|
function showInfo(module : Module) {
|
||||||
dialog.open(ModuleInformation, {
|
dialog.open(ModuleInformation, {
|
||||||
props: {
|
props: {
|
||||||
header: "Product List",
|
|
||||||
style: {
|
style: {
|
||||||
width: "50vw",
|
width: "50vw",
|
||||||
},
|
},
|
||||||
@ -51,8 +50,11 @@ const showInfo = () => {
|
|||||||
},
|
},
|
||||||
modal: true,
|
modal: true,
|
||||||
},
|
},
|
||||||
|
data: {
|
||||||
|
module: module,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
};
|
}
|
||||||
|
|
||||||
const display = (module: Module) => module.name + " (" + module.course + ")";
|
const display = (module: Module) => module.name + " (" + module.course + ")";
|
||||||
|
|
||||||
@ -106,7 +108,7 @@ function selectChange() {
|
|||||||
rounded
|
rounded
|
||||||
outlined
|
outlined
|
||||||
aria-label="Information"
|
aria-label="Information"
|
||||||
@click.stop="showInfo()"
|
@click.stop="showInfo(slotProps.option)"
|
||||||
></Button>
|
></Button>
|
||||||
<DynamicDialog />
|
<DynamicDialog />
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,26 +1,24 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { PropType } from "vue";
|
import { inject } from "vue";
|
||||||
import { Module } from "../model/module.ts";
|
import { Module } from "../model/module.ts";
|
||||||
|
|
||||||
const props = defineProps({
|
const dialogRef = inject("dialogRef") as any;
|
||||||
module: {
|
const module = dialogRef.value.data.module as Module;
|
||||||
type: Object as PropType<Module>,
|
|
||||||
required: true,
|
console.debug(module);
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<h2>{{ props.module.name }}</h2>
|
<h2>{{ module.name }}</h2>
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td>Course:</td>
|
<td>Course:</td>
|
||||||
<td>{{ props.module.course }}</td>
|
<td>{{ module.course }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>ID:</td>
|
<td>Termine:</td>
|
||||||
<td>{{ props.module.id }}</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
export class Module {
|
export class Module {
|
||||||
constructor(
|
constructor(
|
||||||
public id: string,
|
|
||||||
public name: string,
|
public name: string,
|
||||||
public course: string,
|
public course: string,
|
||||||
public userDefinedName: string,
|
public userDefinedName: string,
|
||||||
|
Reference in New Issue
Block a user