}
*/
- async deleteCalendarObjectInstance({ thisAndAllFuture }) {
+ async deleteCalendarObjectInstance({ mode }) {
const calendarObjectsStore = useCalendarObjectsStore()
-
const eventComponent = this.calendarObjectInstance.eventComponent
- const isRecurrenceSetEmpty = eventComponent.removeThisOccurrence(thisAndAllFuture)
- const calendarObject = this.calendarObject
+ // Singleton event or deleting all occurrences - delete the whole calendar-object
+ if (!eventComponent.isRecurring() || mode === 'all') {
+ await calendarObjectsStore.deleteCalendarObject({ calendarObject: this.calendarObject })
+ return
+ }
+
+ // Recurring event - remove this occurrence or this and all future
+ const isRecurrenceSetEmpty = eventComponent.removeThisOccurrence(mode === 'future')
if (isRecurrenceSetEmpty) {
- await calendarObjectsStore.deleteCalendarObject({ calendarObject })
+ await calendarObjectsStore.deleteCalendarObject({ calendarObject: this.calendarObject })
} else {
- await calendarObjectsStore.updateCalendarObject({ calendarObject })
+ await calendarObjectsStore.updateCalendarObject({ calendarObject: this.calendarObject })
}
},
diff --git a/src/views/EditFull.vue b/src/views/EditFull.vue
index 75524358f2..197a9f8967 100644
--- a/src/views/EditFull.vue
+++ b/src/views/EditFull.vue
@@ -54,8 +54,10 @@
:is-new="isNew"
:is-read-only="isReadOnly"
:force-this-and-all-future="forceThisAndAllFuture"
- @save-this-only="prepareAccessForAttachments(false)"
- @save-this-and-all-future="prepareAccessForAttachments(true)" />
+ @save-this-only="prepareAccessForAttachments('single')"
+ @save-this-and-all-future="prepareAccessForAttachments('future')"
+ @save-series="prepareAccessForAttachments('all')"
+ />
@@ -70,23 +72,29 @@
{{ $t('calendar', 'Duplicate') }}
-
+
{{ $t('calendar', 'Delete') }}
-
+
{{ $t('calendar', 'Delete this occurrence') }}
-
+
- {{ $t('calendar', 'Delete this and all future') }}
+ {{ $t('calendar', 'Delete this and future occurrences') }}
+
+
+
+
+
+ {{ $t('calendar', 'Delete this and future occurrences') }}
@@ -291,7 +299,7 @@
+ @click="acceptAttachmentsModal()">
{{ t('calendar', 'Invite') }}
@@ -421,7 +429,7 @@ export default {
data() {
return {
- thisAndAllFuture: false,
+ saveMode: 'single',
doNotShare: false,
showModal: false,
showModalNewAttachments: [],
@@ -707,7 +715,7 @@ export default {
this.showModal = false
this.showModalNewAttachments = []
this.showModalUsers = []
- this.saveEvent(this.thisAndAllFuture)
+ this.saveEvent(this.saveMode)
}, 500)
// trigger save event after make each attachment access
// 1) if !isPrivate get attachments NOT SHARED and SharedType is empry -> API ADD SHARE
@@ -731,8 +739,8 @@ export default {
return name.split('/').pop()
},
- prepareAccessForAttachments(thisAndAllFuture = false) {
- this.thisAndAllFuture = thisAndAllFuture
+ prepareAccessForAttachments(mode = false) {
+ this.saveMode = mode
const newAttachments = this.calendarObjectInstance.attachments.filter((attachment) => {
// get only new attachments
// TODO get NOT only new attachments =) Maybe we should filter all attachments without share-type, 'cause event can be private and AFTER save owner could add new participant
@@ -752,14 +760,14 @@ export default {
return false
})
} else {
- this.saveEvent(thisAndAllFuture)
+ this.saveEvent(this.saveMode)
}
},
- saveEvent(thisAndAllFuture = false) {
+ saveEvent(mode = 'single') {
// if there is new attachments and !private, then make modal with users and files/
// maybe check shared access before add file
- this.saveAndLeave(thisAndAllFuture)
+ this.saveAndLeave(mode)
this.calendarObjectInstance.attachments = this.calendarObjectInstance.attachments.map((attachment) => {
if (attachment.isNew) {
delete attachment.isNew
diff --git a/src/views/EditSimple.vue b/src/views/EditSimple.vue
index 7f5e175e3c..e3153a10e9 100644
--- a/src/views/EditSimple.vue
+++ b/src/views/EditSimple.vue
@@ -84,23 +84,29 @@
{{ $t('calendar', 'Duplicate') }}
-
+
{{ $t('calendar', 'Delete') }}
-
+
{{ $t('calendar', 'Delete this occurrence') }}
-
+
- {{ $t('calendar', 'Delete this and all future') }}
+ {{ $t('calendar', 'Delete this and future occurrences') }}
+
+
+
+
+
+ {{ $t('calendar', 'Delete all occurrences') }}
@@ -199,8 +205,9 @@
:show-more-button="true"
:more-button-type="isViewing ? 'tertiary' : undefined"
:disabled="isSaving"
- @save-this-only="saveAndView(false)"
- @save-this-and-all-future="saveAndView(true)"
+ @save-this-only="saveAndView('single')"
+ @save-this-and-all-future="saveAndView('future')"
+ @save-series="saveAndView('all')"
@show-more="showMore">
}
*/
- async saveAndView(thisAndAllFuture) {
+ async saveAndView(mode) {
// Transitioning from new to edit routes is not implemented for now
if (this.isNew) {
- await this.saveAndLeave(thisAndAllFuture)
+ await this.saveAndLeave(mode)
return
}