Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/development' into feature/PC108-…
Browse files Browse the repository at this point in the history
…73/no-customer-before-search
  • Loading branch information
Sudo-Thijn committed Jan 2, 2025
2 parents f564027 + eb6ccf7 commit df7010c
Show file tree
Hide file tree
Showing 2 changed files with 202 additions and 183 deletions.
24 changes: 18 additions & 6 deletions src/modals/contactMomenten/ContactMomentenForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ import { contactMomentStore, navigationStore, taakStore, zaakStore } from '../..
</template>
Zaak starten
</NcActionButton>
<NcActionButton v-if="isView"
<NcActionButton v-if="isView || isEdit"
:close-after-click="true"
:disabled="contactMoment.status === 'gesloten'"
@click="closeContactMoment(contactMoment.id)">
Expand Down Expand Up @@ -572,9 +572,10 @@ import { contactMomentStore, navigationStore, taakStore, zaakStore } from '../..
// Components
import { BTabs, BTab } from 'bootstrap-vue'
import { NcButton, NcActions, NcLoadingIcon, NcDialog, NcTextArea, NcNoteCard, NcListItem, NcActionButton, NcEmptyContent } from '@nextcloud/vue'
import { generateUrl } from '@nextcloud/router'
import _ from 'lodash'
import getValidISOstring from '../../services/getValidISOstring.js'
// Forms
import SearchKlantModal from '../../modals/klanten/SearchKlantModal.vue'
import EditTaak from '../../modals/taken/EditTaak.vue'
Expand All @@ -595,7 +596,6 @@ import Minus from 'vue-material-design-icons/Minus.vue'
import ProgressClose from 'vue-material-design-icons/ProgressClose.vue'
import Eye from 'vue-material-design-icons/Eye.vue'
import router from '../../router/router.ts'
import { generateUrl } from '@nextcloud/router';
export default {
name: 'ContactMomentenForm',
Expand Down Expand Up @@ -813,7 +813,7 @@ export default {
startDate: contactMomentCopy.startDate ?? new Date().toISOString(),
status: contactMomentCopy.status === 'gesloten' ? 'gesloten' : 'open',
contactmoment: contactMomentCopy.selectedKlantContactMoment,
})
}, { redirect: !this.dashboardWidget })
.then((response) => {
this.contactMoment.addedTaken.forEach(taak => {
fetch(`/index.php/apps/zaakafhandelapp/api/taken/${taak}`, {
Expand Down Expand Up @@ -947,7 +947,18 @@ export default {
},
async closeContactMoment(id) {
const { data } = await contactMomentStore.getContactMoment(id)
let data
if (this.isEdit) {
data = {
...this.contactMoment,
...this.contactMomenten[this.selectedContactMoment],
}
} else if (this.isView) {
data = (await contactMomentStore.getContactMoment(id))?.data
} else {
return
}
if (data?.status === 'gesloten') {
console.info('Contactmoment is already closed')
Expand All @@ -958,13 +969,14 @@ export default {
status: 'gesloten',
})
contactMomentStore.saveContactMoment(newContactMoment)
contactMomentStore.saveContactMoment(newContactMoment, { redirect: !this.dashboardWidget })
.then(({ response }) => {
if (response.ok) {
this.closeModal()
this.$emit('save-success')
}
})
},
async fetchKlantData(id) {
Expand Down
Loading

0 comments on commit df7010c

Please sign in to comment.