display user kinds verbatim
This commit is contained in:
parent
2101ab50d2
commit
74feb38300
5 changed files with 28 additions and 50 deletions
|
|
@ -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">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue