From a79736db42aae371f89c48cfbfd0d3e44d92eb2e Mon Sep 17 00:00:00 2001 From: Remko Date: Tue, 26 Nov 2024 13:26:34 +0100 Subject: [PATCH] Added contact moment form --- .../contactMomenten/ContactMomentenForm.vue | 431 ++++++++++++++++++ src/modals/klanten/SearchKlantModal.vue | 261 +++++++++++ src/views/widgets/ContactMomentenWidget.vue | 34 +- 3 files changed, 711 insertions(+), 15 deletions(-) create mode 100644 src/modals/contactMomenten/ContactMomentenForm.vue create mode 100644 src/modals/klanten/SearchKlantModal.vue diff --git a/src/modals/contactMomenten/ContactMomentenForm.vue b/src/modals/contactMomenten/ContactMomentenForm.vue new file mode 100644 index 0000000..dfb5dec --- /dev/null +++ b/src/modals/contactMomenten/ContactMomentenForm.vue @@ -0,0 +1,431 @@ + + + + + + + + + diff --git a/src/modals/klanten/SearchKlantModal.vue b/src/modals/klanten/SearchKlantModal.vue new file mode 100644 index 0000000..d3e2a66 --- /dev/null +++ b/src/modals/klanten/SearchKlantModal.vue @@ -0,0 +1,261 @@ + + + + + + + + + diff --git a/src/views/widgets/ContactMomentenWidget.vue b/src/views/widgets/ContactMomentenWidget.vue index 037623f..2dd4457 100644 --- a/src/views/widgets/ContactMomentenWidget.vue +++ b/src/views/widgets/ContactMomentenWidget.vue @@ -1,5 +1,5 @@ @@ -37,7 +38,7 @@ import { NcDashboardWidget, NcEmptyContent, NcButton } from '@nextcloud/vue' import { getTheme } from '../../services/getTheme.js' import Plus from 'vue-material-design-icons/Plus.vue' import ChatOutline from 'vue-material-design-icons/ChatOutline.vue' -import BerichtForm from '../../modals/berichten/EditBericht.vue' +import ContactMomentenForm from '../../modals/contactMomenten/ContactMomentenForm.vue' export default { name: 'ContactMomentenWidget', @@ -47,35 +48,37 @@ export default { NcEmptyContent, NcButton, Plus, + ContactMomentenForm, }, data() { return { loading: false, isModalOpen: false, - berichtItems: [], + searchKlantModalOpen: false, + contactMomentItems: [], } }, computed: { items() { - return this.berichtItems + return this.contactMomentItems }, }, mounted() { - this.fetchBerichtItems() + this.fetchContactMomentItems() }, methods: { - fetchBerichtItems() { + fetchContactMomentItems() { this.loading = true - berichtStore.refreshBerichtenList() + contactMomentStore.refreshContactMomentenList() .then(() => { - this.berichtItems = berichtStore.berichtenList.map(bericht => ({ - id: bericht.id, - mainText: bericht.title, - subText: bericht.aanmaakDatum, + this.contactMomentItems = contactMomentStore.contactMomentenList.map(contactMoment => ({ + id: contactMoment.id, + mainText: contactMoment.titel, + subText: new Date(contactMoment.startDate).toLocaleString(), avatarUrl: this.getItemIcon(), })) @@ -95,13 +98,14 @@ export default { }, openModal() { this.isModalOpen = true - berichtStore.setBerichtItem(null) - navigationStore.setModal('editBericht') + contactMomentStore.setContactMomentItem(null) + navigationStore.setModal('contactMomentenForm') }, closeModal() { this.isModalOpen = false navigationStore.setModal(null) }, + onShow() { window.open('/apps/opencatalogi/catalogi', '_self') },