mirror of
https://gitlab.dit.htwk-leipzig.de/htwk-software/htwkalender.git
synced 2025-08-03 02:09:15 +02:00
48 fix missing names in calendar module editor
This commit is contained in:
@@ -5,6 +5,7 @@ import router from "../router";
|
||||
import tokenStore from "../store/tokenStore.ts";
|
||||
import { ref } from "vue";
|
||||
import ModuleTemplateDialog from "./ModuleTemplateDialog.vue";
|
||||
import { onlyWhitespace } from "../helpers/strings.ts";
|
||||
|
||||
const tableData = ref(
|
||||
moduleStore().modules.map((module) => {
|
||||
@@ -68,7 +69,11 @@ async function finalStep() {
|
||||
<!-- Text Body -->
|
||||
<template #body="{ data, field }">
|
||||
<template v-if="field === 'Module'">
|
||||
{{ data[field].userDefinedName }}
|
||||
{{
|
||||
onlyWhitespace(data[field].userDefinedName) ?
|
||||
data[field].name :
|
||||
data[field].userDefinedName
|
||||
}}
|
||||
</template>
|
||||
<template v-else-if="field === 'Reminder'">
|
||||
<Button
|
||||
|
@@ -7,6 +7,7 @@ import { saveIndividualFeed } from "../../api/createFeed";
|
||||
import tokenStore from "../../store/tokenStore";
|
||||
import router from "../../router";
|
||||
import ModuleTemplateDialog from "../ModuleTemplateDialog.vue";
|
||||
import { onlyWhitespace } from "../../helpers/strings.ts";
|
||||
|
||||
const tableData = computed(() =>
|
||||
moduleStore().modules.map((module: Module) => {
|
||||
@@ -89,7 +90,11 @@ async function finalStep() {
|
||||
<!-- Text Body -->
|
||||
<template #body="{ data, field }">
|
||||
<template v-if="field === 'Module'">
|
||||
{{ data[field].userDefinedName }}
|
||||
{{
|
||||
onlyWhitespace(data[field].userDefinedName) ?
|
||||
data[field].name :
|
||||
data[field].userDefinedName
|
||||
}}
|
||||
</template>
|
||||
<template v-else-if="field === 'Reminder'">
|
||||
<Button
|
||||
@@ -124,6 +129,9 @@ async function finalStep() {
|
||||
@click="data.Module.reminder = !data.Module.reminder"
|
||||
></Button>
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ data[field] }}
|
||||
</template>
|
||||
</template>
|
||||
</Column>
|
||||
<Column>
|
||||
|
8
frontend/src/helpers/strings.ts
Normal file
8
frontend/src/helpers/strings.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Returns false only if the input argument is a string which contains characters that are not considered a whitespace
|
||||
* @param str - The string to check for whitespace
|
||||
* @returns boolean - true if the string contains only whitespace, false otherwise
|
||||
*/
|
||||
export function onlyWhitespace(str: string): boolean {
|
||||
return !str || str.length === 0 || /^\s*$/.test(str);
|
||||
}
|
Reference in New Issue
Block a user