refactor: update save method to save pending calendar events

This commit is contained in:
Narindra ezway 2025-03-11 13:58:13 +03:00
parent 13279e86db
commit 448b7e501a
15 changed files with 45 additions and 35 deletions

View File

@ -1322,7 +1322,7 @@ function b(n) {
/******/ // This function allow to reference async chunks
/******/ __webpack_require__.u = (chunkId) => {
/******/ // return url for filenames based on template
/******/ return "calendar-" + chunkId + ".js?v=" + {"vendors-node_modules_nextcloud_capabilities_dist_index_js-node_modules_nextcloud_vue-select_d-877981":"3a2ab5c12f0771c82ad1","vendors-node_modules_vue_dist_vue_runtime_esm_js":"7e3171593bdc0f62040b","vendors-node_modules_nextcloud_cdav-library_dist_dist_js-node_modules_nextcloud_logger_dist_i-36c16b":"c3b3db23da041c717fc1","vendors-node_modules_webdav_dist_web_index_js":"454da8f908d41b47c607","vendors-node_modules_axios_index_js-node_modules_vue-material-design-icons_CalendarBlankOutli-1d3065":"88354dc01b19c1f3f2fe","vendors-node_modules_nextcloud_vue-dashboard_dist_vue-dashboard_js-node_modules_css-loader_di-9e6f3d":"94406568c4140a6ddece","src_models_rfcProps_js-src_services_caldavService_js-src_services_talkService_js-src_services-8a2790":"7cf71b4f92d5bbc180b4","src_store_index_js":"c76e0bb3f18bedbee8e9","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"7910aecb675dcdfa620c","dashboard-lazy":"41ca77d834f6e319b2e6","vendors-node_modules_vue-material-design-icons_CalendarBlank_vue-node_modules_vue-material-de-e2c1f8":"b90524c103590fa7a133","vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-e0595f":"214ba50739254b654bf4","node_modules_nextcloud_dialogs_dist_legacy_mjs":"8be838e4c6e9aae56c87","vendors-node_modules_nextcloud_dialogs_dist_chunks_FilePicker-8ibBgPg__mjs":"ea54a36450de178d1141","vendors-node_modules_moment_locale_af_js-node_modules_moment_locale_ar-dz_js-node_modules_mom-582c96":"ce1bed825f57dd1d117a","node_modules_moment_locale_sync_recursive_":"4bc2c39c5e0ff182c2e3"}[chunkId] + "";
/******/ return "calendar-" + chunkId + ".js?v=" + {"vendors-node_modules_nextcloud_capabilities_dist_index_js-node_modules_nextcloud_vue-select_d-877981":"3a2ab5c12f0771c82ad1","vendors-node_modules_vue_dist_vue_runtime_esm_js":"7e3171593bdc0f62040b","vendors-node_modules_nextcloud_cdav-library_dist_dist_js-node_modules_nextcloud_logger_dist_i-36c16b":"c3b3db23da041c717fc1","vendors-node_modules_webdav_dist_web_index_js":"454da8f908d41b47c607","vendors-node_modules_axios_index_js-node_modules_vue-material-design-icons_CalendarBlankOutli-1d3065":"88354dc01b19c1f3f2fe","vendors-node_modules_nextcloud_vue-dashboard_dist_vue-dashboard_js-node_modules_css-loader_di-9e6f3d":"94406568c4140a6ddece","src_models_rfcProps_js-src_services_caldavService_js-src_services_talkService_js-src_services-8a2790":"7cf71b4f92d5bbc180b4","src_store_index_js":"9676b305963c286b748b","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"7910aecb675dcdfa620c","dashboard-lazy":"41ca77d834f6e319b2e6","vendors-node_modules_vue-material-design-icons_CalendarBlank_vue-node_modules_vue-material-de-e2c1f8":"b90524c103590fa7a133","vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-e0595f":"214ba50739254b654bf4","node_modules_nextcloud_dialogs_dist_legacy_mjs":"8be838e4c6e9aae56c87","vendors-node_modules_nextcloud_dialogs_dist_chunks_FilePicker-8ibBgPg__mjs":"ea54a36450de178d1141","vendors-node_modules_moment_locale_af_js-node_modules_moment_locale_ar-dz_js-node_modules_mom-582c96":"ce1bed825f57dd1d117a","node_modules_moment_locale_sync_recursive_":"4bc2c39c5e0ff182c2e3"}[chunkId] + "";
/******/ };
/******/ })();
/******/
@ -1580,4 +1580,4 @@ document.addEventListener('DOMContentLoaded', function () {
/******/ })()
;
//# sourceMappingURL=calendar-dashboard.js.map?v=2420fbe1a3aaf3cde750
//# sourceMappingURL=calendar-dashboard.js.map?v=349d50a5c0e81d351e0d

File diff suppressed because one or more lines are too long

View File

@ -9360,11 +9360,7 @@ __webpack_require__.r(__webpack_exports__);
// Rendering
dayHeaderDidMount: _fullcalendar_rendering_dayHeaderDidMount_js__WEBPACK_IMPORTED_MODULE_11__["default"],
eventDidMount: info => {
if (info.event.extendedProps.isCalendarPending) {
info.el.classList.add('pending-event');
info.el.style.backgroundColor = info.event.backgroundColor;
info.el.style.color = info.event.textColor;
}
this.addPendinEventClass(info);
},
noEventsDidMount: _fullcalendar_rendering_noEventsDidMount_js__WEBPACK_IMPORTED_MODULE_14__["default"],
eventOrder: ['start', '-duration', 'allDay', _fullcalendar_rendering_eventOrder_js__WEBPACK_IMPORTED_MODULE_13__["default"]],
@ -9510,7 +9506,14 @@ __webpack_require__.r(__webpack_exports__);
initialView
});
}
}, 5000)
}, 5000),
addPendinEventClass(info) {
if (info.event.extendedProps.isCalendarPending) {
info.el.classList.add('pending-event');
info.el.style.backgroundColor = info.event.backgroundColor;
info.el.style.color = info.event.textColor;
}
}
}
});
@ -16548,7 +16551,7 @@ __webpack_require__.r(__webpack_exports__);
}
this.isViewing = true;
try {
await this.save(false);
await this.savePendingCalendar(false);
this.requiresActionOnRouteLeave = false;
} catch (error) {
this.isViewing = false;
@ -16841,7 +16844,7 @@ __webpack_require__.r(__webpack_exports__);
}
this.isViewing = true;
try {
await this.save(false);
await this.savePendingCalendar(false);
this.requiresActionOnRouteLeave = false;
} catch (error) {
this.isViewing = false;
@ -313547,4 +313550,4 @@ appointmentsConfigsStore.addInitialConfigs((0,_nextcloud_initial_state__WEBPACK_
/******/ })()
;
//# sourceMappingURL=calendar-main.js.map?v=98b4c8819348b5baa60e
//# sourceMappingURL=calendar-main.js.map?v=a36eee205b3a9db56472

File diff suppressed because one or more lines are too long

View File

@ -8880,7 +8880,7 @@ window._registerCustomPickerElement = _;
/******/ // This function allow to reference async chunks
/******/ __webpack_require__.u = (chunkId) => {
/******/ // return url for filenames based on template
/******/ return "calendar-" + chunkId + ".js?v=" + {"vendors-node_modules_vue_dist_vue_runtime_esm_js":"7e3171593bdc0f62040b","vendors-node_modules_nextcloud_capabilities_dist_index_js-node_modules_nextcloud_vue-select_d-877981":"3a2ab5c12f0771c82ad1","vendors-node_modules_nextcloud_cdav-library_dist_dist_js-node_modules_nextcloud_logger_dist_i-36c16b":"c3b3db23da041c717fc1","vendors-node_modules_vue-material-design-icons_CalendarBlank_vue-node_modules_vue-material-de-e2c1f8":"b90524c103590fa7a133","vendors-node_modules_axios_index_js-node_modules_vue-material-design-icons_CalendarBlankOutli-1d3065":"88354dc01b19c1f3f2fe","vendors-node_modules_autosize_dist_autosize_esm_js-node_modules_html-entities_lib_index_js-no-4072c5":"1d12f5e341e36b0fcd1d","src_models_rfcProps_js-src_services_caldavService_js-src_services_talkService_js-src_services-8a2790":"7cf71b4f92d5bbc180b4","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"7910aecb675dcdfa620c","src_views_Calendar_vue-data_image_svg_xml_3csvg_20xmlns_27http_www_w3_org_2000_svg_27_20heigh-4a4254":"f57febcc535950e12864","vendors-node_modules_webdav_dist_web_index_js":"454da8f908d41b47c607","src_store_index_js":"c76e0bb3f18bedbee8e9","vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-e0595f":"214ba50739254b654bf4","node_modules_nextcloud_dialogs_dist_legacy_mjs":"8be838e4c6e9aae56c87","vendors-node_modules_nextcloud_dialogs_dist_chunks_FilePicker-8ibBgPg__mjs":"ea54a36450de178d1141","public-calendar-subscription-picker":"5cfd324844c891720a08","vendors-node_modules_moment_locale_af_js-node_modules_moment_locale_ar-dz_js-node_modules_mom-582c96":"ce1bed825f57dd1d117a","node_modules_moment_locale_sync_recursive_":"4bc2c39c5e0ff182c2e3"}[chunkId] + "";
/******/ return "calendar-" + chunkId + ".js?v=" + {"vendors-node_modules_vue_dist_vue_runtime_esm_js":"7e3171593bdc0f62040b","vendors-node_modules_nextcloud_capabilities_dist_index_js-node_modules_nextcloud_vue-select_d-877981":"3a2ab5c12f0771c82ad1","vendors-node_modules_nextcloud_cdav-library_dist_dist_js-node_modules_nextcloud_logger_dist_i-36c16b":"c3b3db23da041c717fc1","vendors-node_modules_vue-material-design-icons_CalendarBlank_vue-node_modules_vue-material-de-e2c1f8":"b90524c103590fa7a133","vendors-node_modules_axios_index_js-node_modules_vue-material-design-icons_CalendarBlankOutli-1d3065":"88354dc01b19c1f3f2fe","vendors-node_modules_autosize_dist_autosize_esm_js-node_modules_html-entities_lib_index_js-no-4072c5":"1d12f5e341e36b0fcd1d","src_models_rfcProps_js-src_services_caldavService_js-src_services_talkService_js-src_services-8a2790":"7cf71b4f92d5bbc180b4","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"7910aecb675dcdfa620c","src_views_Calendar_vue-data_image_svg_xml_3csvg_20xmlns_27http_www_w3_org_2000_svg_27_20heigh-4a4254":"8b44a8dca72f653e70b2","vendors-node_modules_webdav_dist_web_index_js":"454da8f908d41b47c607","src_store_index_js":"9676b305963c286b748b","vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-e0595f":"214ba50739254b654bf4","node_modules_nextcloud_dialogs_dist_legacy_mjs":"8be838e4c6e9aae56c87","vendors-node_modules_nextcloud_dialogs_dist_chunks_FilePicker-8ibBgPg__mjs":"ea54a36450de178d1141","public-calendar-subscription-picker":"5cfd324844c891720a08","vendors-node_modules_moment_locale_af_js-node_modules_moment_locale_ar-dz_js-node_modules_mom-582c96":"ce1bed825f57dd1d117a","node_modules_moment_locale_sync_recursive_":"4bc2c39c5e0ff182c2e3"}[chunkId] + "";
/******/ };
/******/ })();
/******/
@ -9130,4 +9130,4 @@ __webpack_require__.p = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_1__.linkTo
/******/ })()
;
//# sourceMappingURL=calendar-reference.js.map?v=c4f747bcdada7fc35f37
//# sourceMappingURL=calendar-reference.js.map?v=41137bb0b6ba342967a4

File diff suppressed because one or more lines are too long

View File

@ -8278,4 +8278,4 @@ function getLinkToConfig(key) {
/***/ })
}]);
//# sourceMappingURL=calendar-src_store_index_js.js.map?v=c76e0bb3f18bedbee8e9
//# sourceMappingURL=calendar-src_store_index_js.js.map?v=9676b305963c286b748b

File diff suppressed because one or more lines are too long

View File

@ -4332,11 +4332,7 @@ __webpack_require__.r(__webpack_exports__);
// Rendering
dayHeaderDidMount: _fullcalendar_rendering_dayHeaderDidMount_js__WEBPACK_IMPORTED_MODULE_11__["default"],
eventDidMount: info => {
if (info.event.extendedProps.isCalendarPending) {
info.el.classList.add('pending-event');
info.el.style.backgroundColor = info.event.backgroundColor;
info.el.style.color = info.event.textColor;
}
this.addPendinEventClass(info);
},
noEventsDidMount: _fullcalendar_rendering_noEventsDidMount_js__WEBPACK_IMPORTED_MODULE_14__["default"],
eventOrder: ['start', '-duration', 'allDay', _fullcalendar_rendering_eventOrder_js__WEBPACK_IMPORTED_MODULE_13__["default"]],
@ -4482,7 +4478,14 @@ __webpack_require__.r(__webpack_exports__);
initialView
});
}
}, 5000)
}, 5000),
addPendinEventClass(info) {
if (info.event.extendedProps.isCalendarPending) {
info.el.classList.add('pending-event');
info.el.style.backgroundColor = info.event.backgroundColor;
info.el.style.color = info.event.textColor;
}
}
}
});
@ -8358,7 +8361,7 @@ __webpack_require__.r(__webpack_exports__);
}
this.isViewing = true;
try {
await this.save(false);
await this.savePendingCalendar(false);
this.requiresActionOnRouteLeave = false;
} catch (error) {
this.isViewing = false;
@ -28070,4 +28073,4 @@ module.exports = "data:image/svg+xml,%3csvg%20xmlns=%27http://www.w3.org/2000/sv
/***/ })
}]);
//# sourceMappingURL=calendar-src_views_Calendar_vue-data_image_svg_xml_3csvg_20xmlns_27http_www_w3_org_2000_svg_27_20heigh-4a4254.js.map?v=f57febcc535950e12864
//# sourceMappingURL=calendar-src_views_Calendar_vue-data_image_svg_xml_3csvg_20xmlns_27http_www_w3_org_2000_svg_27_20heigh-4a4254.js.map?v=8b44a8dca72f653e70b2

View File

@ -140,11 +140,7 @@ export default {
// Rendering
dayHeaderDidMount,
eventDidMount : (info) => {
if (info.event.extendedProps.isCalendarPending) {
info.el.classList.add('pending-event');
info.el.style.backgroundColor = info.event.backgroundColor;
info.el.style.color = info.event.textColor;
}
this.addPendinEventClass(info);
},
noEventsDidMount,
eventOrder: ['start', '-duration', 'allDay', eventOrder],
@ -308,6 +304,13 @@ export default {
this.$store.dispatch('setInitialView', { initialView })
}
}, 5000),
addPendinEventClass(info){
if (info.event.extendedProps.isCalendarPending) {
info.el.classList.add('pending-event');
info.el.style.backgroundColor = info.event.backgroundColor;
info.el.style.color = info.event.textColor;
}
}
},
}
</script>

View File

@ -573,6 +573,8 @@ export default {
setPendingCalendar(isPending = true) {
this.calendarObjectInstance.eventComponent.isCalendarPending = isPending
this.calendarObjectInstance.isCalendarPending = isPending
},
async savePendingCalendar(thisAndAllFuture = false) {
if (!this.calendarObject) {

View File

@ -1744,7 +1744,6 @@ const actions = {
if (isForkedItem && eventComponent.canCreateRecurrenceExceptions()) {
[original, fork] = eventComponent.createRecurrenceException(thisAndAllFuture)
}
await dispatch('updateCalendarObject', { calendarObject })
if (original !== null && fork !== null && original.root !== fork.root) {

View File

@ -752,7 +752,7 @@ export default {
this.isViewing = true;
try {
await this.save(false);
await this.savePendingCalendar(false);
this.requiresActionOnRouteLeave = false;
} catch (error) {
this.isViewing = false;

View File

@ -540,7 +540,7 @@ export default {
this.isViewing = true;
try {
await this.save(false);
await this.savePendingCalendar(false);
this.requiresActionOnRouteLeave = false;
} catch (error) {
this.isViewing = false;