fix: Can close template filler modal

Signed-off-by: Elizabeth Danzberger <lizzy7128@tutanota.de>
This commit is contained in:
Elizabeth Danzberger 2024-07-24 19:28:04 -04:00 committed by Julius Härtl
parent 3390fc1b94
commit 6aea44920d
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF

View file

@ -4,7 +4,7 @@
-->
<template>
<NcModal :show="show">
<NcModal>
<div class="template-field-modal__content">
<form>
<h3>{{ t('files', 'Fill template fields') }}</h3>
@ -19,6 +19,7 @@
</div>
<div class="template-field-modal__buttons">
<NcLoadingIcon v-if="loading" :name="t('files', 'Submitting fields...')" />
<NcButton aria-label="Submit button"
type="primary"
@click="submit">
@ -30,7 +31,7 @@
<script lang="ts">
import { defineComponent } from 'vue'
import { NcModal, NcButton } from '@nextcloud/vue'
import { NcModal, NcButton, NcLoadingIcon } from '@nextcloud/vue'
import { translate as t } from '@nextcloud/l10n'
import TemplateTextField from './TemplateFiller/TemplateTextField.vue'
@ -40,6 +41,7 @@ export default defineComponent({
components: {
NcModal,
NcButton,
NcLoadingIcon,
TemplateTextField,
},
@ -57,7 +59,7 @@ export default defineComponent({
data() {
return {
localFields: {},
show: true,
loading: false,
}
},
@ -69,8 +71,11 @@ export default defineComponent({
}
},
async submit() {
this.loading = true
await this.onSubmit(this.localFields)
this.show = false
this.$emit('close')
},
},
})
@ -90,6 +95,7 @@ $modal-margin: calc(var(--default-grid-baseline) * 4);
.template-field-modal__buttons {
display: flex;
justify-content: flex-end;
gap: var(--default-grid-baseline);
margin: $modal-margin;
margin-top: 0;
}