From 96a1a285e8ca58ddaaa94f77c357efd0544f1485 Mon Sep 17 00:00:00 2001 From: Remko Date: Wed, 13 Nov 2024 14:32:21 +0100 Subject: [PATCH 1/2] cleanup --- src/modals/klanten/EditKlant.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modals/klanten/EditKlant.vue b/src/modals/klanten/EditKlant.vue index e7c2cdd..8368e47 100644 --- a/src/modals/klanten/EditKlant.vue +++ b/src/modals/klanten/EditKlant.vue @@ -190,7 +190,7 @@ export default { updated() { if (navigationStore.modal === 'editKlant' && !this.hasUpdated) { - const klantType = this.typeOptions.options.find((option) => option.value === klantStore.klantItem.type) + const klantType = this.typeOptions.options.find((option) => option.value === klantStore.klantItem?.type) if (klantStore.klantItem?.id) { this.klantItem = { From a6913c6208e32fb31dff6e2fd6374f81e522b529 Mon Sep 17 00:00:00 2001 From: Thijn Date: Wed, 13 Nov 2024 15:55:49 +0100 Subject: [PATCH 2/2] finished widget make zaak modal --- src/modals/zaken/ZaakForm.vue | 17 +++++++++++++++ src/views/widgets/ZakenWidget.vue | 35 ++++++++++++++++++------------- 2 files changed, 37 insertions(+), 15 deletions(-) diff --git a/src/modals/zaken/ZaakForm.vue b/src/modals/zaken/ZaakForm.vue index 9b732db..ff73091 100644 --- a/src/modals/zaken/ZaakForm.vue +++ b/src/modals/zaken/ZaakForm.vue @@ -108,6 +108,13 @@ export default { NcSelect, NcTextArea, }, + props: { + dashboardWidget: { + type: Boolean, + default: false, + required: false, + }, + }, data() { return { zaak: { @@ -164,6 +171,7 @@ export default { methods: { closeModal() { navigationStore.setModal(null) + this?.dashboardWidget && this.$emit('close') this.success = null this.loading = false this.zaak = { @@ -228,6 +236,8 @@ export default { .then(({ response }) => { this.success = response.ok setTimeout(this.closeModal, 2500) + + this?.dashboardWidget && this.$emit('save-success') }) .catch((err) => { console.error(err) @@ -239,3 +249,10 @@ export default { }, } + + diff --git a/src/views/widgets/ZakenWidget.vue b/src/views/widgets/ZakenWidget.vue index 7f8b8bf..19df625 100644 --- a/src/views/widgets/ZakenWidget.vue +++ b/src/views/widgets/ZakenWidget.vue @@ -1,5 +1,5 @@ @@ -33,9 +38,10 @@ import { NcDashboardWidget, NcEmptyContent, NcButton } from '@nextcloud/vue' import Plus from 'vue-material-design-icons/Plus.vue' import Folder from 'vue-material-design-icons/Folder.vue' +import ZaakForm from '../../modals/zaken/ZaakForm.vue' + export default { name: 'ZakenWidget', - components: { NcDashboardWidget, NcEmptyContent, @@ -43,24 +49,21 @@ export default { Plus, Folder, }, - data() { return { loading: false, + isModalOpen: false, zaakItems: [], } }, - computed: { items() { return this.zaakItems }, }, - mounted() { this.fetchZaakItems() }, - methods: { fetchZaakItems() { this.loading = true @@ -76,6 +79,15 @@ export default { this.loading = false }) }, + openModal() { + this.isModalOpen = true + zaakStore.setZaakItem(null) + navigationStore.setModal('zaakForm') + }, + closeModal() { + this.isModalOpen = false + navigationStore.setModal(null) + }, search() { console.info('click') }, @@ -83,9 +95,9 @@ export default { window.open('/apps/opencatalogi/catalogi', '_self') }, }, - } + -