Skip to content

Commit

Permalink
fix: Can close template filler modal
Browse files Browse the repository at this point in the history
Signed-off-by: Elizabeth Danzberger <[email protected]>
  • Loading branch information
elzody committed Jul 24, 2024
1 parent 87d6ba6 commit 01927ed
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions apps/files/src/components/TemplateFiller.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
-->

<template>
<NcModal :show="show">
<NcModal :show.sync="show">
<div class="template-field-modal__content">
<form>
<h3>{{ t('files', 'Fill template fields') }}</h3>
Expand All @@ -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">
Expand All @@ -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'
Expand All @@ -40,6 +41,7 @@ export default defineComponent({
components: {
NcModal,
NcButton,
NcLoadingIcon,
TemplateTextField,
},
Expand All @@ -58,6 +60,7 @@ export default defineComponent({
return {
localFields: {},
show: true,
loading: false,
}
},
Expand All @@ -69,7 +72,10 @@ export default defineComponent({
}
},
async submit() {
this.loading = true
await this.onSubmit(this.localFields)
this.show = false
},
},
Expand All @@ -90,6 +96,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;
}
Expand Down

0 comments on commit 01927ed

Please sign in to comment.