Skip to content

Commit

Permalink
Merge pull request #50602 from nextcloud/fix/template-field-title
Browse files Browse the repository at this point in the history
fix: template field title
  • Loading branch information
elzody authored Feb 13, 2025
2 parents 4905255 + 729e278 commit 6e1d9a2
Show file tree
Hide file tree
Showing 12 changed files with 20 additions and 12 deletions.
14 changes: 11 additions & 3 deletions apps/files/src/components/TemplateFiller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -80,6 +85,9 @@ export default defineComponent({

return `Template${fieldComponentType}Field`
},
fieldHasLabel(field) {
return field.name || field.alias
},
async submit() {
this.loading = true

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
},
Expand Down
2 changes: 2 additions & 0 deletions dist/4341-4341.js

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions dist/4341-4341.js.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/4341-4341.js.map.license
2 changes: 0 additions & 2 deletions dist/465-465.js

This file was deleted.

1 change: 0 additions & 1 deletion dist/465-465.js.map

This file was deleted.

1 change: 0 additions & 1 deletion dist/465-465.js.map.license

This file was deleted.

4 changes: 2 additions & 2 deletions dist/files-init.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files-init.js.map

Large diffs are not rendered by default.

0 comments on commit 6e1d9a2

Please sign in to comment.