add user type on calendar

This commit is contained in:
Tiavina 2025-02-24 15:36:10 +03:00
parent 5efabb3221
commit 27558cebec
10 changed files with 195 additions and 100 deletions

View File

@ -13249,18 +13249,20 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _components_CalendarGrid_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../components/CalendarGrid.vue */ "./src/components/CalendarGrid.vue");
/* harmony import */ var _components_AppNavigation_EditCalendarModal_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../components/AppNavigation/EditCalendarModal.vue */ "./src/components/AppNavigation/EditCalendarModal.vue");
/* harmony import */ var _EditSimple_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./EditSimple.vue */ "./src/views/EditSimple.vue");
/* harmony import */ var _services_caldavService_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../services/caldavService.js */ "./src/services/caldavService.js");
/* harmony import */ var _utils_color_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/color.js */ "./src/utils/color.js");
/* harmony import */ var _utils_date_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/date.js */ "./src/utils/date.js");
/* harmony import */ var _services_timezoneDataProviderService_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../services/timezoneDataProviderService.js */ "./src/services/timezoneDataProviderService.js");
/* harmony import */ var _utils_logger_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../utils/logger.js */ "./src/utils/logger.js");
/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! vuex */ "./node_modules/vuex/dist/vuex.esm.js");
/* harmony import */ var _utils_moment_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../utils/moment.js */ "./src/utils/moment.js");
/* harmony import */ var _nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @nextcloud/initial-state */ "./node_modules/@nextcloud/initial-state/dist/index.es.mjs");
/* harmony import */ var _nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @nextcloud/dialogs */ "./node_modules/@nextcloud/dialogs/dist/index.mjs");
/* harmony import */ var _nextcloud_dialogs_dist_index_css__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @nextcloud/dialogs/dist/index.css */ "./node_modules/@nextcloud/dialogs/dist/style.css");
/* harmony import */ var _components_AppNavigation_CalendarList_Trashbin_vue__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../components/AppNavigation/CalendarList/Trashbin.vue */ "./src/components/AppNavigation/CalendarList/Trashbin.vue");
/* harmony import */ var _components_AppNavigation_AppointmentConfigList_vue__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../components/AppNavigation/AppointmentConfigList.vue */ "./src/components/AppNavigation/AppointmentConfigList.vue");
/* harmony import */ var _nextcloud_axios__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @nextcloud/axios */ "./node_modules/@nextcloud/axios/dist/index.es.mjs");
/* harmony import */ var _services_caldavService_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../services/caldavService.js */ "./src/services/caldavService.js");
/* harmony import */ var _utils_color_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/color.js */ "./src/utils/color.js");
/* harmony import */ var _utils_date_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utils/date.js */ "./src/utils/date.js");
/* harmony import */ var _services_timezoneDataProviderService_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../services/timezoneDataProviderService.js */ "./src/services/timezoneDataProviderService.js");
/* harmony import */ var _utils_logger_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../utils/logger.js */ "./src/utils/logger.js");
/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! vuex */ "./node_modules/vuex/dist/vuex.esm.js");
/* harmony import */ var _utils_moment_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../utils/moment.js */ "./src/utils/moment.js");
/* harmony import */ var _nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @nextcloud/initial-state */ "./node_modules/@nextcloud/initial-state/dist/index.es.mjs");
/* harmony import */ var _nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @nextcloud/dialogs */ "./node_modules/@nextcloud/dialogs/dist/index.mjs");
/* harmony import */ var _nextcloud_dialogs_dist_index_css__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @nextcloud/dialogs/dist/index.css */ "./node_modules/@nextcloud/dialogs/dist/style.css");
/* harmony import */ var _components_AppNavigation_CalendarList_Trashbin_vue__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../components/AppNavigation/CalendarList/Trashbin.vue */ "./src/components/AppNavigation/CalendarList/Trashbin.vue");
/* harmony import */ var _components_AppNavigation_AppointmentConfigList_vue__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../components/AppNavigation/AppointmentConfigList.vue */ "./src/components/AppNavigation/AppointmentConfigList.vue");
/* harmony import */ var _nextcloud_router__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @nextcloud/router */ "./node_modules/@nextcloud/router/dist/index.mjs");
// Import vue components
@ -13273,6 +13275,7 @@ __webpack_require__.r(__webpack_exports__);
// Import CalDAV related methods
@ -13288,10 +13291,11 @@ __webpack_require__.r(__webpack_exports__);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
name: 'Calendar',
components: {
AppointmentConfigList: _components_AppNavigation_AppointmentConfigList_vue__WEBPACK_IMPORTED_MODULE_20__["default"],
AppointmentConfigList: _components_AppNavigation_AppointmentConfigList_vue__WEBPACK_IMPORTED_MODULE_21__["default"],
CalendarGrid: _components_CalendarGrid_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
EmptyCalendar: _components_EmptyCalendar_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
EmbedTopNavigation: _components_AppNavigation_EmbedTopNavigation_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
@ -13303,7 +13307,7 @@ __webpack_require__.r(__webpack_exports__);
AppNavigation: _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__.NcAppNavigation,
AppNavigationSpacer: _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__.NcAppNavigationSpacer,
CalendarListNew: _components_AppNavigation_CalendarList_CalendarListNew_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
Trashbin: _components_AppNavigation_CalendarList_Trashbin_vue__WEBPACK_IMPORTED_MODULE_19__["default"],
Trashbin: _components_AppNavigation_CalendarList_Trashbin_vue__WEBPACK_IMPORTED_MODULE_20__["default"],
EditCalendarModal: _components_AppNavigation_EditCalendarModal_vue__WEBPACK_IMPORTED_MODULE_8__["default"],
EditSimple: _EditSimple_vue__WEBPACK_IMPORTED_MODULE_9__["default"]
},
@ -13325,12 +13329,12 @@ __webpack_require__.r(__webpack_exports__);
};
},
computed: {
...(0,vuex__WEBPACK_IMPORTED_MODULE_21__.mapGetters)({
...(0,vuex__WEBPACK_IMPORTED_MODULE_23__.mapGetters)({
timezoneId: 'getResolvedTimezone',
hasTrashBin: 'hasTrashBin',
currentUserPrincipal: 'getCurrentUserPrincipal'
}),
...(0,vuex__WEBPACK_IMPORTED_MODULE_21__.mapState)({
...(0,vuex__WEBPACK_IMPORTED_MODULE_23__.mapState)({
eventLimit: state => state.settings.eventLimit,
skipPopover: state => state.settings.skipPopover,
showWeekends: state => state.settings.showWeekends,
@ -13345,7 +13349,7 @@ __webpack_require__.r(__webpack_exports__);
}),
defaultDate() {
var _this$$route$params$f, _this$$route;
return (0,_utils_date_js__WEBPACK_IMPORTED_MODULE_12__.getYYYYMMDDFromFirstdayParam)((_this$$route$params$f = (_this$$route = this.$route) === null || _this$$route === void 0 || (_this$$route = _this$$route.params) === null || _this$$route === void 0 ? void 0 : _this$$route.firstDay) !== null && _this$$route$params$f !== void 0 ? _this$$route$params$f : 'now');
return (0,_utils_date_js__WEBPACK_IMPORTED_MODULE_13__.getYYYYMMDDFromFirstdayParam)((_this$$route$params$f = (_this$$route = this.$route) === null || _this$$route === void 0 || (_this$$route = _this$$route.params) === null || _this$$route === void 0 ? void 0 : _this$$route.firstDay) !== null && _this$$route$params$f !== void 0 ? _this$$route$params$f : 'now');
},
isEditable() {
var _this$$route2, _this$$route3;
@ -13388,7 +13392,7 @@ __webpack_require__.r(__webpack_exports__);
},
created() {
this.timeFrameCacheExpiryJob = setInterval(() => {
const timestamp = (0,_utils_date_js__WEBPACK_IMPORTED_MODULE_12__.getUnixTimestampFromDate)((0,_utils_date_js__WEBPACK_IMPORTED_MODULE_12__.dateFactory)()) - 60 * 10;
const timestamp = (0,_utils_date_js__WEBPACK_IMPORTED_MODULE_13__.getUnixTimestampFromDate)((0,_utils_date_js__WEBPACK_IMPORTED_MODULE_13__.dateFactory)()) - 60 * 10;
const timeRanges = this.$store.getters.getAllTimeRangesOlderThan(timestamp);
for (const timeRange of timeRanges) {
this.$store.commit('removeTimeRange', {
@ -13406,29 +13410,29 @@ __webpack_require__.r(__webpack_exports__);
async beforeMount() {
var _this$$route4, _this$$route5;
this.$store.commit('loadSettingsFromServer', {
appVersion: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'app_version'),
eventLimit: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'event_limit'),
firstRun: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'first_run'),
showWeekends: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'show_weekends'),
showWeekNumbers: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'show_week_numbers'),
skipPopover: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'skip_popover'),
slotDuration: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'slot_duration'),
defaultReminder: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'default_reminder'),
talkEnabled: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'talk_enabled'),
tasksEnabled: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'tasks_enabled'),
timezone: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'timezone'),
showTasks: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'show_tasks'),
hideEventExport: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'hide_event_export'),
forceEventAlarmType: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'force_event_alarm_type', false),
disableAppointments: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'disable_appointments', false),
canSubscribeLink: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'can_subscribe_link', false),
attachmentsFolder: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'attachments_folder', false),
showResources: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'show_resources', true),
publicCalendars: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'publicCalendars', [])
appVersion: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'app_version'),
eventLimit: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'event_limit'),
firstRun: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'first_run'),
showWeekends: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'show_weekends'),
showWeekNumbers: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'show_week_numbers'),
skipPopover: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'skip_popover'),
slotDuration: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'slot_duration'),
defaultReminder: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'default_reminder'),
talkEnabled: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'talk_enabled'),
tasksEnabled: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'tasks_enabled'),
timezone: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'timezone'),
showTasks: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'show_tasks'),
hideEventExport: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'hide_event_export'),
forceEventAlarmType: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'force_event_alarm_type', false),
disableAppointments: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'disable_appointments', false),
canSubscribeLink: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'can_subscribe_link', false),
attachmentsFolder: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'attachments_folder', false),
showResources: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'show_resources', true),
publicCalendars: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'publicCalendars', [])
});
this.$store.dispatch('initializeCalendarJsConfig');
if ((_this$$route4 = this.$route) !== null && _this$$route4 !== void 0 && _this$$route4.name.startsWith('Public') || (_this$$route5 = this.$route) !== null && _this$$route5 !== void 0 && _this$$route5.name.startsWith('Embed') || this.isWidget) {
await (0,_services_caldavService_js__WEBPACK_IMPORTED_MODULE_10__.initializeClientForPublicView)();
await (0,_services_caldavService_js__WEBPACK_IMPORTED_MODULE_11__.initializeClientForPublicView)();
const tokens = this.isWidget ? [this.referenceToken] : this.$route.params.tokens.split('-');
const calendars = await this.$store.dispatch('getPublicCalendars', {
tokens
@ -13438,13 +13442,13 @@ __webpack_require__.r(__webpack_exports__);
this.showEmptyCalendarScreen = true;
}
} else {
await (0,_services_caldavService_js__WEBPACK_IMPORTED_MODULE_10__.initializeClientForUserView)();
await (0,_services_caldavService_js__WEBPACK_IMPORTED_MODULE_11__.initializeClientForUserView)();
await this.$store.dispatch('fetchCurrentUserPrincipal');
const {
calendars,
trashBin
} = await this.$store.dispatch('loadCollections');
_utils_logger_js__WEBPACK_IMPORTED_MODULE_14__["default"].debug('calendars and trash bin loaded', {
_utils_logger_js__WEBPACK_IMPORTED_MODULE_15__["default"].debug('calendars and trash bin loaded', {
calendars,
trashBin
});
@ -13465,30 +13469,31 @@ __webpack_require__.r(__webpack_exports__);
// No writeable calendars? Create a new one!
if (writeableCalendarIndex === -1) {
_utils_logger_js__WEBPACK_IMPORTED_MODULE_14__["default"].info('User has no writable calendar, a new personal calendar will be created');
_utils_logger_js__WEBPACK_IMPORTED_MODULE_15__["default"].info('User has no writable calendar, a new personal calendar will be created');
this.loadingCalendars = true;
await this.$store.dispatch('appendCalendar', {
displayName: this.$t('calendar', 'Personal'),
color: (0,_utils_color_js__WEBPACK_IMPORTED_MODULE_11__.uidToHexColor)(this.$t('calendar', 'Personal')),
color: (0,_utils_color_js__WEBPACK_IMPORTED_MODULE_12__.uidToHexColor)(this.$t('calendar', 'Personal')),
order: 0
});
}
this.loadingCalendars = false;
await this.fetchUserTypesAndUpdateCalendars(calendars);
}
},
async mounted() {
if (this.timezone === 'automatic' && this.timezoneId === 'UTC') {
const {
toastElement
} = (0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_17__.showWarning)(this.$t('calendar', 'The automatic time zone detection determined your time zone to be UTC.\nThis is most likely the result of security measures of your web browser.\nPlease set your time zone manually in the calendar settings.'), {
} = (0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_18__.showWarning)(this.$t('calendar', 'The automatic time zone detection determined your time zone to be UTC.\nThis is most likely the result of security measures of your web browser.\nPlease set your time zone manually in the calendar settings.'), {
timeout: 60000
});
toastElement.classList.add('toast-calendar-multiline');
}
if ((0,_services_timezoneDataProviderService_js__WEBPACK_IMPORTED_MODULE_13__["default"])().getTimezoneForId(this.timezoneId) === null) {
if ((0,_services_timezoneDataProviderService_js__WEBPACK_IMPORTED_MODULE_14__["default"])().getTimezoneForId(this.timezoneId) === null) {
const {
toastElement
} = (0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_17__.showWarning)(this.$t('calendar', 'Your configured time zone ({timezoneId}) was not found. Falling back to UTC.\nPlease change your time zone in the settings and report this issue.', {
} = (0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_18__.showWarning)(this.$t('calendar', 'Your configured time zone ({timezoneId}) was not found. Falling back to UTC.\nPlease change your time zone in the settings and report this issue.', {
timezoneId: this.timezoneId
}), {
timeout: 60000
@ -13504,10 +13509,27 @@ __webpack_require__.r(__webpack_exports__);
* @return {Promise<void>}
*/
async loadMomentLocale() {
const locale = await (0,_utils_moment_js__WEBPACK_IMPORTED_MODULE_15__["default"])();
const locale = await (0,_utils_moment_js__WEBPACK_IMPORTED_MODULE_16__["default"])();
this.$store.commit('setMomentLocale', {
locale
});
},
async fetchUserTypesAndUpdateCalendars(calendars) {
for (const calendar of calendars) {
const calendarOwner = calendar.owner;
const userPrincipalId = calendarOwner.split('/').filter(Boolean).pop();
const userType = await this.fetchUserTypeForCalendar(userPrincipalId);
if (userType != "") {
calendar.displayName = "".concat(calendar.displayName, " (").concat(userType, ")");
}
}
},
async fetchUserTypeForCalendar(userPrincipalId) {
let url = '/apps/gestion/getUserTypeByUserUuid/' + userPrincipalId;
const ajaxUrl = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_22__.generateUrl)(url);
const response = await _nextcloud_axios__WEBPACK_IMPORTED_MODULE_10__["default"].get(ajaxUrl);
let responseValue = JSON.parse(response.data);
return responseValue.thanatoTypeLabel;
}
}
});
@ -310053,4 +310075,4 @@ appointmentsConfigsStore.addInitialConfigs((0,_nextcloud_initial_state__WEBPACK_
/******/ })()
;
//# sourceMappingURL=calendar-main.js.map?v=8a26d47f5b506167ce1b
//# sourceMappingURL=calendar-main.js.map?v=2990e8625cbe6e7ec5ce

File diff suppressed because one or more lines are too long

View File

@ -8865,7 +8865,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":"7bde6f386631234ba146","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":"2e0b0e8bc0e8488c397c","vendors-node_modules_vue-material-design-icons_CalendarBlankOutline_vue-node_modules_nextclou-4adead":"273df538e0dc19672feb","vendors-node_modules_autosize_dist_autosize_esm_js-node_modules_html-entities_lib_index_js-no-4072c5":"56373f2063898525e8de","src_models_rfcProps_js-src_services_caldavService_js-src_services_talkService_js-src_services-8a2790":"94fac30d128df46a89a6","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"740a2859d1f364b508c1","src_views_Calendar_vue-data_image_svg_xml_3csvg_20xmlns_27http_www_w3_org_2000_svg_27_20heigh-4a4254":"70f973572631ebf61374","vendors-node_modules_webdav_dist_web_index_js":"454da8f908d41b47c607","src_store_index_js":"8e651e1007c1cc1d62d0","vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-e0595f":"728c782d2751f8e6150a","node_modules_nextcloud_dialogs_dist_legacy_mjs":"8be838e4c6e9aae56c87","vendors-node_modules_nextcloud_dialogs_dist_chunks_FilePicker-8ibBgPg__mjs":"ea54a36450de178d1141","public-calendar-subscription-picker":"9168fca99a878d4c37e3","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":"7bde6f386631234ba146","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":"2e0b0e8bc0e8488c397c","vendors-node_modules_vue-material-design-icons_CalendarBlankOutline_vue-node_modules_nextclou-4adead":"273df538e0dc19672feb","vendors-node_modules_autosize_dist_autosize_esm_js-node_modules_html-entities_lib_index_js-no-4072c5":"56373f2063898525e8de","src_models_rfcProps_js-src_services_caldavService_js-src_services_talkService_js-src_services-8a2790":"94fac30d128df46a89a6","src_fullcalendar_eventSources_eventSourceFunction_js-src_utils_moment_js-data_image_svg_xml_3-b73258":"740a2859d1f364b508c1","src_views_Calendar_vue-data_image_svg_xml_3csvg_20xmlns_27http_www_w3_org_2000_svg_27_20heigh-4a4254":"c843b5a49512d69e485e","vendors-node_modules_webdav_dist_web_index_js":"454da8f908d41b47c607","src_store_index_js":"8e651e1007c1cc1d62d0","vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-e0595f":"728c782d2751f8e6150a","node_modules_nextcloud_dialogs_dist_legacy_mjs":"8be838e4c6e9aae56c87","vendors-node_modules_nextcloud_dialogs_dist_chunks_FilePicker-8ibBgPg__mjs":"ea54a36450de178d1141","public-calendar-subscription-picker":"9168fca99a878d4c37e3","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] + "";
/******/ };
/******/ })();
/******/
@ -9115,4 +9115,4 @@ __webpack_require__.p = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_1__.linkTo
/******/ })()
;
//# sourceMappingURL=calendar-reference.js.map?v=f0917e7f93f4ffd7ea47
//# sourceMappingURL=calendar-reference.js.map?v=3d457bacc80e2d3e209d

File diff suppressed because one or more lines are too long

View File

@ -7681,18 +7681,20 @@ __webpack_require__.r(__webpack_exports__);
/* harmony import */ var _components_CalendarGrid_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../components/CalendarGrid.vue */ "./src/components/CalendarGrid.vue");
/* harmony import */ var _components_AppNavigation_EditCalendarModal_vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../components/AppNavigation/EditCalendarModal.vue */ "./src/components/AppNavigation/EditCalendarModal.vue");
/* harmony import */ var _EditSimple_vue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./EditSimple.vue */ "./src/views/EditSimple.vue");
/* harmony import */ var _services_caldavService_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../services/caldavService.js */ "./src/services/caldavService.js");
/* harmony import */ var _utils_color_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/color.js */ "./src/utils/color.js");
/* harmony import */ var _utils_date_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/date.js */ "./src/utils/date.js");
/* harmony import */ var _services_timezoneDataProviderService_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../services/timezoneDataProviderService.js */ "./src/services/timezoneDataProviderService.js");
/* harmony import */ var _utils_logger_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../utils/logger.js */ "./src/utils/logger.js");
/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! vuex */ "./node_modules/vuex/dist/vuex.esm.js");
/* harmony import */ var _utils_moment_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../utils/moment.js */ "./src/utils/moment.js");
/* harmony import */ var _nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @nextcloud/initial-state */ "./node_modules/@nextcloud/initial-state/dist/index.es.mjs");
/* harmony import */ var _nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @nextcloud/dialogs */ "./node_modules/@nextcloud/dialogs/dist/index.mjs");
/* harmony import */ var _nextcloud_dialogs_dist_index_css__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @nextcloud/dialogs/dist/index.css */ "./node_modules/@nextcloud/dialogs/dist/style.css");
/* harmony import */ var _components_AppNavigation_CalendarList_Trashbin_vue__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../components/AppNavigation/CalendarList/Trashbin.vue */ "./src/components/AppNavigation/CalendarList/Trashbin.vue");
/* harmony import */ var _components_AppNavigation_AppointmentConfigList_vue__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../components/AppNavigation/AppointmentConfigList.vue */ "./src/components/AppNavigation/AppointmentConfigList.vue");
/* harmony import */ var _nextcloud_axios__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @nextcloud/axios */ "./node_modules/@nextcloud/axios/dist/index.es.mjs");
/* harmony import */ var _services_caldavService_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../services/caldavService.js */ "./src/services/caldavService.js");
/* harmony import */ var _utils_color_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../utils/color.js */ "./src/utils/color.js");
/* harmony import */ var _utils_date_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../utils/date.js */ "./src/utils/date.js");
/* harmony import */ var _services_timezoneDataProviderService_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../services/timezoneDataProviderService.js */ "./src/services/timezoneDataProviderService.js");
/* harmony import */ var _utils_logger_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../utils/logger.js */ "./src/utils/logger.js");
/* harmony import */ var vuex__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! vuex */ "./node_modules/vuex/dist/vuex.esm.js");
/* harmony import */ var _utils_moment_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../utils/moment.js */ "./src/utils/moment.js");
/* harmony import */ var _nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @nextcloud/initial-state */ "./node_modules/@nextcloud/initial-state/dist/index.es.mjs");
/* harmony import */ var _nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @nextcloud/dialogs */ "./node_modules/@nextcloud/dialogs/dist/index.mjs");
/* harmony import */ var _nextcloud_dialogs_dist_index_css__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @nextcloud/dialogs/dist/index.css */ "./node_modules/@nextcloud/dialogs/dist/style.css");
/* harmony import */ var _components_AppNavigation_CalendarList_Trashbin_vue__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../components/AppNavigation/CalendarList/Trashbin.vue */ "./src/components/AppNavigation/CalendarList/Trashbin.vue");
/* harmony import */ var _components_AppNavigation_AppointmentConfigList_vue__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../components/AppNavigation/AppointmentConfigList.vue */ "./src/components/AppNavigation/AppointmentConfigList.vue");
/* harmony import */ var _nextcloud_router__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @nextcloud/router */ "./node_modules/@nextcloud/router/dist/index.mjs");
// Import vue components
@ -7705,6 +7707,7 @@ __webpack_require__.r(__webpack_exports__);
// Import CalDAV related methods
@ -7720,10 +7723,11 @@ __webpack_require__.r(__webpack_exports__);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
name: 'Calendar',
components: {
AppointmentConfigList: _components_AppNavigation_AppointmentConfigList_vue__WEBPACK_IMPORTED_MODULE_20__["default"],
AppointmentConfigList: _components_AppNavigation_AppointmentConfigList_vue__WEBPACK_IMPORTED_MODULE_21__["default"],
CalendarGrid: _components_CalendarGrid_vue__WEBPACK_IMPORTED_MODULE_7__["default"],
EmptyCalendar: _components_EmptyCalendar_vue__WEBPACK_IMPORTED_MODULE_6__["default"],
EmbedTopNavigation: _components_AppNavigation_EmbedTopNavigation_vue__WEBPACK_IMPORTED_MODULE_5__["default"],
@ -7735,7 +7739,7 @@ __webpack_require__.r(__webpack_exports__);
AppNavigation: _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__.NcAppNavigation,
AppNavigationSpacer: _nextcloud_vue__WEBPACK_IMPORTED_MODULE_0__.NcAppNavigationSpacer,
CalendarListNew: _components_AppNavigation_CalendarList_CalendarListNew_vue__WEBPACK_IMPORTED_MODULE_4__["default"],
Trashbin: _components_AppNavigation_CalendarList_Trashbin_vue__WEBPACK_IMPORTED_MODULE_19__["default"],
Trashbin: _components_AppNavigation_CalendarList_Trashbin_vue__WEBPACK_IMPORTED_MODULE_20__["default"],
EditCalendarModal: _components_AppNavigation_EditCalendarModal_vue__WEBPACK_IMPORTED_MODULE_8__["default"],
EditSimple: _EditSimple_vue__WEBPACK_IMPORTED_MODULE_9__["default"]
},
@ -7757,12 +7761,12 @@ __webpack_require__.r(__webpack_exports__);
};
},
computed: {
...(0,vuex__WEBPACK_IMPORTED_MODULE_21__.mapGetters)({
...(0,vuex__WEBPACK_IMPORTED_MODULE_23__.mapGetters)({
timezoneId: 'getResolvedTimezone',
hasTrashBin: 'hasTrashBin',
currentUserPrincipal: 'getCurrentUserPrincipal'
}),
...(0,vuex__WEBPACK_IMPORTED_MODULE_21__.mapState)({
...(0,vuex__WEBPACK_IMPORTED_MODULE_23__.mapState)({
eventLimit: state => state.settings.eventLimit,
skipPopover: state => state.settings.skipPopover,
showWeekends: state => state.settings.showWeekends,
@ -7777,7 +7781,7 @@ __webpack_require__.r(__webpack_exports__);
}),
defaultDate() {
var _this$$route$params$f, _this$$route;
return (0,_utils_date_js__WEBPACK_IMPORTED_MODULE_12__.getYYYYMMDDFromFirstdayParam)((_this$$route$params$f = (_this$$route = this.$route) === null || _this$$route === void 0 || (_this$$route = _this$$route.params) === null || _this$$route === void 0 ? void 0 : _this$$route.firstDay) !== null && _this$$route$params$f !== void 0 ? _this$$route$params$f : 'now');
return (0,_utils_date_js__WEBPACK_IMPORTED_MODULE_13__.getYYYYMMDDFromFirstdayParam)((_this$$route$params$f = (_this$$route = this.$route) === null || _this$$route === void 0 || (_this$$route = _this$$route.params) === null || _this$$route === void 0 ? void 0 : _this$$route.firstDay) !== null && _this$$route$params$f !== void 0 ? _this$$route$params$f : 'now');
},
isEditable() {
var _this$$route2, _this$$route3;
@ -7820,7 +7824,7 @@ __webpack_require__.r(__webpack_exports__);
},
created() {
this.timeFrameCacheExpiryJob = setInterval(() => {
const timestamp = (0,_utils_date_js__WEBPACK_IMPORTED_MODULE_12__.getUnixTimestampFromDate)((0,_utils_date_js__WEBPACK_IMPORTED_MODULE_12__.dateFactory)()) - 60 * 10;
const timestamp = (0,_utils_date_js__WEBPACK_IMPORTED_MODULE_13__.getUnixTimestampFromDate)((0,_utils_date_js__WEBPACK_IMPORTED_MODULE_13__.dateFactory)()) - 60 * 10;
const timeRanges = this.$store.getters.getAllTimeRangesOlderThan(timestamp);
for (const timeRange of timeRanges) {
this.$store.commit('removeTimeRange', {
@ -7838,29 +7842,29 @@ __webpack_require__.r(__webpack_exports__);
async beforeMount() {
var _this$$route4, _this$$route5;
this.$store.commit('loadSettingsFromServer', {
appVersion: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'app_version'),
eventLimit: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'event_limit'),
firstRun: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'first_run'),
showWeekends: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'show_weekends'),
showWeekNumbers: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'show_week_numbers'),
skipPopover: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'skip_popover'),
slotDuration: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'slot_duration'),
defaultReminder: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'default_reminder'),
talkEnabled: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'talk_enabled'),
tasksEnabled: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'tasks_enabled'),
timezone: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'timezone'),
showTasks: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'show_tasks'),
hideEventExport: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'hide_event_export'),
forceEventAlarmType: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'force_event_alarm_type', false),
disableAppointments: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'disable_appointments', false),
canSubscribeLink: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'can_subscribe_link', false),
attachmentsFolder: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'attachments_folder', false),
showResources: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'show_resources', true),
publicCalendars: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_16__.loadState)('calendar', 'publicCalendars', [])
appVersion: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'app_version'),
eventLimit: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'event_limit'),
firstRun: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'first_run'),
showWeekends: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'show_weekends'),
showWeekNumbers: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'show_week_numbers'),
skipPopover: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'skip_popover'),
slotDuration: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'slot_duration'),
defaultReminder: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'default_reminder'),
talkEnabled: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'talk_enabled'),
tasksEnabled: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'tasks_enabled'),
timezone: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'timezone'),
showTasks: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'show_tasks'),
hideEventExport: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'hide_event_export'),
forceEventAlarmType: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'force_event_alarm_type', false),
disableAppointments: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'disable_appointments', false),
canSubscribeLink: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'can_subscribe_link', false),
attachmentsFolder: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'attachments_folder', false),
showResources: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'show_resources', true),
publicCalendars: (0,_nextcloud_initial_state__WEBPACK_IMPORTED_MODULE_17__.loadState)('calendar', 'publicCalendars', [])
});
this.$store.dispatch('initializeCalendarJsConfig');
if ((_this$$route4 = this.$route) !== null && _this$$route4 !== void 0 && _this$$route4.name.startsWith('Public') || (_this$$route5 = this.$route) !== null && _this$$route5 !== void 0 && _this$$route5.name.startsWith('Embed') || this.isWidget) {
await (0,_services_caldavService_js__WEBPACK_IMPORTED_MODULE_10__.initializeClientForPublicView)();
await (0,_services_caldavService_js__WEBPACK_IMPORTED_MODULE_11__.initializeClientForPublicView)();
const tokens = this.isWidget ? [this.referenceToken] : this.$route.params.tokens.split('-');
const calendars = await this.$store.dispatch('getPublicCalendars', {
tokens
@ -7870,13 +7874,13 @@ __webpack_require__.r(__webpack_exports__);
this.showEmptyCalendarScreen = true;
}
} else {
await (0,_services_caldavService_js__WEBPACK_IMPORTED_MODULE_10__.initializeClientForUserView)();
await (0,_services_caldavService_js__WEBPACK_IMPORTED_MODULE_11__.initializeClientForUserView)();
await this.$store.dispatch('fetchCurrentUserPrincipal');
const {
calendars,
trashBin
} = await this.$store.dispatch('loadCollections');
_utils_logger_js__WEBPACK_IMPORTED_MODULE_14__["default"].debug('calendars and trash bin loaded', {
_utils_logger_js__WEBPACK_IMPORTED_MODULE_15__["default"].debug('calendars and trash bin loaded', {
calendars,
trashBin
});
@ -7897,30 +7901,31 @@ __webpack_require__.r(__webpack_exports__);
// No writeable calendars? Create a new one!
if (writeableCalendarIndex === -1) {
_utils_logger_js__WEBPACK_IMPORTED_MODULE_14__["default"].info('User has no writable calendar, a new personal calendar will be created');
_utils_logger_js__WEBPACK_IMPORTED_MODULE_15__["default"].info('User has no writable calendar, a new personal calendar will be created');
this.loadingCalendars = true;
await this.$store.dispatch('appendCalendar', {
displayName: this.$t('calendar', 'Personal'),
color: (0,_utils_color_js__WEBPACK_IMPORTED_MODULE_11__.uidToHexColor)(this.$t('calendar', 'Personal')),
color: (0,_utils_color_js__WEBPACK_IMPORTED_MODULE_12__.uidToHexColor)(this.$t('calendar', 'Personal')),
order: 0
});
}
this.loadingCalendars = false;
await this.fetchUserTypesAndUpdateCalendars(calendars);
}
},
async mounted() {
if (this.timezone === 'automatic' && this.timezoneId === 'UTC') {
const {
toastElement
} = (0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_17__.showWarning)(this.$t('calendar', 'The automatic time zone detection determined your time zone to be UTC.\nThis is most likely the result of security measures of your web browser.\nPlease set your time zone manually in the calendar settings.'), {
} = (0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_18__.showWarning)(this.$t('calendar', 'The automatic time zone detection determined your time zone to be UTC.\nThis is most likely the result of security measures of your web browser.\nPlease set your time zone manually in the calendar settings.'), {
timeout: 60000
});
toastElement.classList.add('toast-calendar-multiline');
}
if ((0,_services_timezoneDataProviderService_js__WEBPACK_IMPORTED_MODULE_13__["default"])().getTimezoneForId(this.timezoneId) === null) {
if ((0,_services_timezoneDataProviderService_js__WEBPACK_IMPORTED_MODULE_14__["default"])().getTimezoneForId(this.timezoneId) === null) {
const {
toastElement
} = (0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_17__.showWarning)(this.$t('calendar', 'Your configured time zone ({timezoneId}) was not found. Falling back to UTC.\nPlease change your time zone in the settings and report this issue.', {
} = (0,_nextcloud_dialogs__WEBPACK_IMPORTED_MODULE_18__.showWarning)(this.$t('calendar', 'Your configured time zone ({timezoneId}) was not found. Falling back to UTC.\nPlease change your time zone in the settings and report this issue.', {
timezoneId: this.timezoneId
}), {
timeout: 60000
@ -7936,10 +7941,27 @@ __webpack_require__.r(__webpack_exports__);
* @return {Promise<void>}
*/
async loadMomentLocale() {
const locale = await (0,_utils_moment_js__WEBPACK_IMPORTED_MODULE_15__["default"])();
const locale = await (0,_utils_moment_js__WEBPACK_IMPORTED_MODULE_16__["default"])();
this.$store.commit('setMomentLocale', {
locale
});
},
async fetchUserTypesAndUpdateCalendars(calendars) {
for (const calendar of calendars) {
const calendarOwner = calendar.owner;
const userPrincipalId = calendarOwner.split('/').filter(Boolean).pop();
const userType = await this.fetchUserTypeForCalendar(userPrincipalId);
if (userType != "") {
calendar.displayName = "".concat(calendar.displayName, " (").concat(userType, ")");
}
}
},
async fetchUserTypeForCalendar(userPrincipalId) {
let url = '/apps/gestion/getUserTypeByUserUuid/' + userPrincipalId;
const ajaxUrl = (0,_nextcloud_router__WEBPACK_IMPORTED_MODULE_22__.generateUrl)(url);
const response = await _nextcloud_axios__WEBPACK_IMPORTED_MODULE_10__["default"].get(ajaxUrl);
let responseValue = JSON.parse(response.data);
return responseValue.thanatoTypeLabel;
}
}
});
@ -27321,4 +27343,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=70f973572631ebf61374
//# sourceMappingURL=calendar-src_views_Calendar_vue-data_image_svg_xml_3csvg_20xmlns_27http_www_w3_org_2000_svg_27_20heigh-4a4254.js.map?v=c843b5a49512d69e485e

View File

@ -92,6 +92,7 @@ import EmptyCalendar from '../components/EmptyCalendar.vue'
import CalendarGrid from '../components/CalendarGrid.vue'
import EditCalendarModal from '../components/AppNavigation/EditCalendarModal.vue'
import EditSimple from './EditSimple.vue'
import axios from "@nextcloud/axios";
// Import CalDAV related methods
import {
@ -121,6 +122,7 @@ import {
import '@nextcloud/dialogs/dist/index.css'
import Trashbin from '../components/AppNavigation/CalendarList/Trashbin.vue'
import AppointmentConfigList from '../components/AppNavigation/AppointmentConfigList.vue'
import { generateUrl } from '@nextcloud/router'
export default {
name: 'Calendar',
@ -308,6 +310,7 @@ export default {
}
this.loadingCalendars = false
await this.fetchUserTypesAndUpdateCalendars(calendars);
}
},
async mounted() {
@ -336,6 +339,24 @@ export default {
const locale = await loadMomentLocalization()
this.$store.commit('setMomentLocale', { locale })
},
async fetchUserTypesAndUpdateCalendars(calendars) {
for (const calendar of calendars) {
const calendarOwner = calendar.owner;
const userPrincipalId = calendarOwner.split('/').filter(Boolean).pop();
const userType = await this.fetchUserTypeForCalendar(userPrincipalId);
if(userType !=""){
calendar.displayName = `${calendar.displayName} (${userType})`;
}
}
},
async fetchUserTypeForCalendar(userPrincipalId) {
let url = '/apps/gestion/getUserTypeByUserUuid/' + userPrincipalId;
const ajaxUrl = generateUrl(url);
const response = await axios.get(ajaxUrl);
let responseValue = JSON.parse(response.data);
return responseValue.thanatoTypeLabel;
},
},
}
</script>

View File

@ -197,6 +197,8 @@ return [
['name' => 'vehicle#getVehicles','url' => '/vehicle/list', 'verb' => 'PROPFIND'],
['name' => 'vehicle#getAvailableVehicles','url' => '/vehicle/available-list', 'verb' => 'PROPFIND'],
['name' => 'vehicle#getVehiclePurchaseTypes','url' => '/vehicle/purchase-type/list', 'verb' => 'PROPFIND'],
['name' => 'vehicle#createDefaultVehicle','url' => '/vehicle/createDefaultVehicle', 'verb' => 'POST']
['name' => 'vehicle#createDefaultVehicle','url' => '/vehicle/createDefaultVehicle', 'verb' => 'POST'],
//thanatoType
['name' => 'page#getUserTypeByUserUuid', 'url' => '/getUserTypeByUserUuid/{userUuid}', 'verb' => 'GET'],
]
];

View File

@ -2901,4 +2901,16 @@ class PageController extends Controller {
public function createDefaultClientGroupFacturation(){
return $this->myDb->createDefaultGroupFacturation();
}
public function getUserTypeByUserUuid($userUuid){
try{
return json_encode(value: $this->myDb->getUserTypeByUserUuid($userUuid));
}
catch(Exception){
return json_encode([
"thanatoTypeKey" => "",
"thanatoTypeLabel" => ""
]);
}
}
}

View File

@ -1821,6 +1821,8 @@ class Bdd {
public function getThanatoByUserUuid($userUuid){
$sql = "SELECT *
FROM ".$this->tableprefix."thanato as thanato
LEFT JOIN ".$this->tableprefix."thanato_type as thanato_type
ON thanato.fk_thanato_type_key = thanato_type.thanato_type_key
WHERE thanato.fk_user_uuid = ?";
$res = $this->execSQLNoJsonReturn($sql,array($userUuid));
if($res){
@ -3165,4 +3167,18 @@ class Bdd {
return $total;
}
public function getUserTypeByUserUuid($userUuid){
$response = [
"thanatoTypeKey" => "",
"thanatoTypeLabel" => ""
];
$thanato = $this->getThanatoByUserUuid($userUuid);
if($thanato != null){
$response["thanatoTypeKey"] = $thanato["fk_thanato_type_key"] ?? "";
$response["thanatoTypeLabel"] = $thanato["thanato_type_label"] ?? "";
}
return $response;
}
}