fix(template-filler): Hide template fields with unknown labels

Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
pull/50602/head
Elizabeth Danzberger 8 months ago
parent 4905255936
commit 7db90efe3b
No known key found for this signature in database
GPG Key ID: D64CE07FD0188C79
  1. 14
      apps/files/src/components/TemplateFiller.vue
  2. 2
      apps/files/src/components/TemplateFiller/TemplateCheckboxField.vue
  3. 2
      apps/files/src/components/TemplateFiller/TemplateRichTextField.vue

@ -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…
Cancel
Save