}
*/
- 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 084b97e009..e5fc7c3077 100644
--- a/src/views/EditFull.vue
+++ b/src/views/EditFull.vue
@@ -54,8 +54,9 @@
:isNew="isNew"
:isReadOnly="isReadOnly"
:forceThisAndAllFuture="forceThisAndAllFuture"
- @saveThisOnly="prepareAccessForAttachments(false)"
- @saveThisAndAllFuture="prepareAccessForAttachments(true)" />
+ @saveThisOnly="prepareAccessForAttachments('single')"
+ @saveThisAndAllFuture="prepareAccessForAttachments('future')"
+ @saveSeries="prepareAccessForAttachments('all')" />
@@ -64,30 +65,35 @@
{{ $t('calendar', 'Export') }}
-
+
{{ $t('calendar', 'Duplicate') }}
-
+
{{ $t('calendar', 'Delete') }}
-
+
{{ $t('calendar', 'Delete this occurrence') }}
-
-
+
- {{ $t('calendar', 'Delete this and all future') }}
+ {{ $t('calendar', 'Delete this and all future occurrences') }}
+
+
+
+
+
+ {{ $t('calendar', 'Delete all occurrences') }}
@@ -291,7 +297,7 @@
+ @click="acceptAttachmentsModal()">
{{ t('calendar', 'Invite') }}
@@ -423,7 +429,7 @@ export default {
data() {
return {
- thisAndAllFuture: false,
+ saveMode: 'single',
doNotShare: false,
showModal: false,
showModalNewAttachments: [],
@@ -687,7 +693,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
@@ -711,8 +717,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
@@ -732,14 +738,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 651a845211..31ef8d28ec 100644
--- a/src/views/EditSimple.vue
+++ b/src/views/EditSimple.vue
@@ -84,24 +84,30 @@