display user kinds verbatim

This commit is contained in:
Yisroel Baum 2026-08-14 09:54:43 +03:00
parent 2101ab50d2
commit 74feb38300
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
5 changed files with 28 additions and 50 deletions

View file

@ -26,12 +26,7 @@ const form = reactive({
const fieldErrors = ref<ScheduleFieldErrors>({})
const levels = computed(() =>
(layout.value?.levels ?? [])
.filter((level) => level.elementCount > 0)
.map((level) => ({
...level,
label: humanizeKind(level.kind),
})),
(layout.value?.levels ?? []).filter((level) => level.elementCount > 0),
)
const scheduleFormSchema = z
@ -111,12 +106,6 @@ async function retry(): Promise<void> {
await setLayoutStore.fetchSetLayout(currentSetId.value)
}
}
function humanizeKind(kind: string): string {
const words = kind.replaceAll(/[_-]+/g, ' ')
return words.charAt(0).toUpperCase() + words.slice(1)
}
</script>
<template>
@ -163,7 +152,7 @@ function humanizeKind(kind: string): string {
>
<option :value="null">Choose a level</option>
<option v-for="level in levels" :key="level.id" :value="level.id">
{{ level.label }} ({{ level.elementCount }})
{{ level.kind }} ({{ level.elementCount }})
</option>
</select>
<p v-if="fieldErrors.levelId" id="schedule-level-error" class="field-error">