timeGridweek default when entering calendar if the user is not admin

This commit is contained in:
Tiavina 2025-01-09 16:11:05 +03:00
parent 6d5d5d10de
commit 860c8ec0dd
8 changed files with 40 additions and 10 deletions

View File

@ -6827,6 +6827,10 @@ __webpack_require__.r(__webpack_exports__);
type: Boolean,
default: false
},
isAdmin: {
type: Boolean,
default: true
},
/**
* Whether or not the user is authenticated
*/
@ -6862,10 +6866,14 @@ __webpack_require__.r(__webpack_exports__);
_this$$route$params$v,
_this$$route2,
_this = this;
let defaultView = 'dayGridMonth';
if (this.isAdmin === false) {
defaultView = 'timeGridWeek';
}
return {
// Initialization:
initialDate: (0,_utils_date_js__WEBPACK_IMPORTED_MODULE_16__.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'),
initialView: (_this$$route$params$v = (_this$$route2 = this.$route) === null || _this$$route2 === void 0 ? void 0 : _this$$route2.params.view) !== null && _this$$route$params$v !== void 0 ? _this$$route$params$v : 'dayGridMonth',
initialView: (_this$$route$params$v = (_this$$route2 = this.$route) === null || _this$$route2 === void 0 ? void 0 : _this$$route2.params.view) !== null && _this$$route$params$v !== void 0 ? _this$$route$params$v : defaultView,
// Data
eventSources: this.eventSources,
// Plugins
@ -21738,6 +21746,7 @@ var render = function render() {
ref: "calendarGridWidget",
attrs: {
"is-widget": _vm.isWidget,
"is-admin": _vm.isAdmin,
"is-authenticated-user": _vm.isAuthenticatedUser
}
}) : _c("EmptyCalendar"), _vm._v(" "), _vm.showWidgetEventDetails ? _c("EditSimple", {
@ -21798,6 +21807,7 @@ var render = function render() {
}
}) : _vm._e(), _vm._v(" "), _c("AppContent", [!_vm.showEmptyCalendarScreen ? _c("CalendarGrid", {
attrs: {
"is-admin": _vm.isAdmin,
"is-authenticated-user": _vm.isAuthenticatedUser
}
}) : _c("EmptyCalendar")], 1), _vm._v(" "), _c("router-view")], 1);
@ -310165,4 +310175,4 @@ appointmentsConfigsStore.addInitialConfigs((0,_nextcloud_initial_state__WEBPACK_
/******/ })()
;
//# sourceMappingURL=calendar-main.js.map?v=088a2687a9300a10e3ce
//# sourceMappingURL=calendar-main.js.map?v=5f5416c3696400f29d24

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":"3533c597c61a45709c85","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":"aa18371467d4d17269b3","vendors-node_modules_vue-material-design-icons_CalendarBlankOutline_vue-node_modules_nextclou-4adead":"e4ffc04ac1c7ab0c5950","vendors-node_modules_autosize_dist_autosize_esm_js-node_modules_html-entities_lib_index_js-no-4072c5":"60939d15b29e9da9693b","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":"0ef6bfb43d6b002c1bc6","vendors-node_modules_webdav_dist_web_index_js":"454da8f908d41b47c607","src_store_index_js":"8109663b3d3c7da4f760","vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-e0595f":"6c303f18660c1428dc28","node_modules_nextcloud_dialogs_dist_legacy_mjs":"8be838e4c6e9aae56c87","vendors-node_modules_nextcloud_dialogs_dist_chunks_FilePicker-8ibBgPg__mjs":"ea54a36450de178d1141","public-calendar-subscription-picker":"4c85129ecec907c712f8","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":"3533c597c61a45709c85","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":"aa18371467d4d17269b3","vendors-node_modules_vue-material-design-icons_CalendarBlankOutline_vue-node_modules_nextclou-4adead":"e4ffc04ac1c7ab0c5950","vendors-node_modules_autosize_dist_autosize_esm_js-node_modules_html-entities_lib_index_js-no-4072c5":"60939d15b29e9da9693b","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":"42723fe6e7179e291d92","vendors-node_modules_webdav_dist_web_index_js":"454da8f908d41b47c607","src_store_index_js":"8109663b3d3c7da4f760","vendors-node_modules_path-browserify_index_js-node_modules_nextcloud_dialogs_dist_chunks_Dial-e0595f":"6c303f18660c1428dc28","node_modules_nextcloud_dialogs_dist_legacy_mjs":"8be838e4c6e9aae56c87","vendors-node_modules_nextcloud_dialogs_dist_chunks_FilePicker-8ibBgPg__mjs":"ea54a36450de178d1141","public-calendar-subscription-picker":"4c85129ecec907c712f8","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=5a170b16d774e0018f75
//# sourceMappingURL=calendar-reference.js.map?v=6f308708078386679e7c

File diff suppressed because one or more lines are too long

View File

@ -4262,6 +4262,10 @@ __webpack_require__.r(__webpack_exports__);
type: Boolean,
default: false
},
isAdmin: {
type: Boolean,
default: true
},
/**
* Whether or not the user is authenticated
*/
@ -4297,10 +4301,14 @@ __webpack_require__.r(__webpack_exports__);
_this$$route$params$v,
_this$$route2,
_this = this;
let defaultView = 'dayGridMonth';
if (this.isAdmin === false) {
defaultView = 'timeGridWeek';
}
return {
// Initialization:
initialDate: (0,_utils_date_js__WEBPACK_IMPORTED_MODULE_16__.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'),
initialView: (_this$$route$params$v = (_this$$route2 = this.$route) === null || _this$$route2 === void 0 ? void 0 : _this$$route2.params.view) !== null && _this$$route$params$v !== void 0 ? _this$$route$params$v : 'dayGridMonth',
initialView: (_this$$route$params$v = (_this$$route2 = this.$route) === null || _this$$route2 === void 0 ? void 0 : _this$$route2.params.view) !== null && _this$$route$params$v !== void 0 ? _this$$route$params$v : defaultView,
// Data
eventSources: this.eventSources,
// Plugins
@ -14026,6 +14034,7 @@ var render = function render() {
ref: "calendarGridWidget",
attrs: {
"is-widget": _vm.isWidget,
"is-admin": _vm.isAdmin,
"is-authenticated-user": _vm.isAuthenticatedUser
}
}) : _c("EmptyCalendar"), _vm._v(" "), _vm.showWidgetEventDetails ? _c("EditSimple", {
@ -14086,6 +14095,7 @@ var render = function render() {
}
}) : _vm._e(), _vm._v(" "), _c("AppContent", [!_vm.showEmptyCalendarScreen ? _c("CalendarGrid", {
attrs: {
"is-admin": _vm.isAdmin,
"is-authenticated-user": _vm.isAuthenticatedUser
}
}) : _c("EmptyCalendar")], 1), _vm._v(" "), _c("router-view")], 1);
@ -27366,4 +27376,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=0ef6bfb43d6b002c1bc6
//# sourceMappingURL=calendar-src_views_Calendar_vue-data_image_svg_xml_3csvg_20xmlns_27http_www_w3_org_2000_svg_27_20heigh-4a4254.js.map?v=42723fe6e7179e291d92

View File

@ -77,6 +77,10 @@ export default {
type: Boolean,
default: false,
},
isAdmin: {
type: Boolean,
default: true,
},
/**
* Whether or not the user is authenticated
*/
@ -107,10 +111,14 @@ export default {
modificationCount: state => state.calendarObjects.modificationCount,
}),
options() {
let defaultView = 'dayGridMonth';
if(this.isAdmin === false){
defaultView = 'timeGridWeek'
}
return {
// Initialization:
initialDate: getYYYYMMDDFromFirstdayParam(this.$route?.params?.firstDay ?? 'now'),
initialView: this.$route?.params.view ?? 'dayGridMonth',
initialView: this.$route?.params.view ?? defaultView,
// Data
eventSources: this.eventSources,
// Plugins

View File

@ -27,6 +27,7 @@
<CalendarGrid v-if="!showEmptyCalendarScreen"
ref="calendarGridWidget"
:is-widget="isWidget"
:is-admin="isAdmin"
:is-authenticated-user="isAuthenticatedUser" />
<EmptyCalendar v-else />
@ -67,6 +68,7 @@
<EmbedTopNavigation v-if="isEmbedded" :is-admin="false" />
<AppContent>
<CalendarGrid v-if="!showEmptyCalendarScreen"
:is-admin="isAdmin"
:is-authenticated-user="isAuthenticatedUser" />
<EmptyCalendar v-else />
</AppContent>