mirror of
https://github.com/nextcloud/server.git
synced 2026-03-21 18:11:02 -04:00
fix(template-filler): Hide template fields with unknown labels
Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
This commit is contained in:
parent
4905255936
commit
7db90efe3b
3 changed files with 13 additions and 5 deletions
|
|
@ -4,13 +4,18 @@
|
|||
-->
|
||||
|
||||
<template>
|
||||
<NcModal>
|
||||
<NcModal label-id="template-field-modal__label">
|
||||
<div class="template-field-modal__content">
|
||||
<form>
|
||||
<h3>{{ t('files', 'Fill template fields') }}</h3>
|
||||
<h3 id="template-field-modal__label">
|
||||
{{ t('files', 'Fill template fields') }}
|
||||
</h3>
|
||||
|
||||
<div v-for="field in fields" :key="field.index">
|
||||
<component :is="getFieldComponent(field.type)" :field="field" @input="trackInput" />
|
||||
<component :is="getFieldComponent(field.type)"
|
||||
v-if="fieldHasLabel(field)"
|
||||
:field="field"
|
||||
@input="trackInput" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
|
@ -80,6 +85,9 @@ export default defineComponent({
|
|||
|
||||
return `Template${fieldComponentType}Field`
|
||||
},
|
||||
fieldHasLabel(field) {
|
||||
return field.name || field.alias
|
||||
},
|
||||
async submit() {
|
||||
this.loading = true
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ export default defineComponent({
|
|||
|
||||
computed: {
|
||||
fieldLabel() {
|
||||
const label = this.field.name ?? this.field.alias ?? 'Unknown field'
|
||||
const label = this.field.name || this.field.alias
|
||||
|
||||
return label.charAt(0).toUpperCase() + label.slice(1)
|
||||
},
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ export default defineComponent({
|
|||
|
||||
computed: {
|
||||
fieldLabel() {
|
||||
const label = this.field.name ?? this.field.alias ?? 'Unknown field'
|
||||
const label = this.field.name || this.field.alias
|
||||
|
||||
return (label.charAt(0).toUpperCase() + label.slice(1))
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue