From 57413d2df462e9f639cd793eff22f25009311755 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sun, 21 May 2023 11:05:57 +0200 Subject: [PATCH] feat(view): Introduce year grid view (with FC multiMonthYear plugin) Closes #159 Signed-off-by: Thomas Citharel --- appinfo/routes.php | 6 +++--- lib/Controller/SettingsController.php | 2 +- package-lock.json | 20 +++++++++++++++++++ package.json | 1 + .../AppNavigationHeaderDatePicker.vue | 19 +++++++++++++++--- .../AppNavigationHeaderViewMenu.vue | 10 +++++++++- .../EmbedHeader/EmbedHeaderViewButtons.vue | 8 ++++++++ .../Settings/ShortcutOverview.vue | 5 ++++- src/components/CalendarGrid.vue | 2 ++ src/components/Shared/DatePicker.vue | 12 +++++++---- src/filters/dateRangeFormat.js | 3 +++ .../localization/dateFormattingConfig.js | 5 +++++ src/utils/date.js | 4 +++- 13 files changed, 83 insertions(+), 14 deletions(-) diff --git a/appinfo/routes.php b/appinfo/routes.php index 6a494159de..533b426e4c 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -31,9 +31,9 @@ ['name' => 'view#index', 'url' => '/new/{isAllDay}/{dtStart}/{dtEnd}', 'verb' => 'GET', 'postfix' => 'direct.new.timerange'], ['name' => 'view#index', 'url' => '/edit/{objectId}', 'verb' => 'GET', 'postfix' => 'direct.edit'], ['name' => 'view#index', 'url' => '/edit/{objectId}/{recurrenceId}', 'verb' => 'GET', 'postfix' => 'direct.edit.recurrenceId'], - ['name' => 'view#index', 'url' => '/{view}/{timeRange}', 'verb' => 'GET', 'requirements' => ['view' => 'timeGridDay|timeGridWeek|dayGridMonth|listMonth'], 'postfix' => 'view.timerange'], - ['name' => 'view#index', 'url' => '/{view}/{timeRange}/new/{mode}/{isAllDay}/{dtStart}/{dtEnd}', 'verb' => 'GET', 'requirements' => ['view' => 'timeGridDay|timeGridWeek|dayGridMonth|listMonth'], 'postfix' => 'view.timerange.new'], - ['name' => 'view#index', 'url' => '/{view}/{timeRange}/edit/{mode}/{objectId}/{recurrenceId}', 'verb' => 'GET', 'requirements' => ['view' => 'timeGridDay|timeGridWeek|dayGridMonth|listMonth'], 'postfix' => 'view.timerange.edit'], + ['name' => 'view#index', 'url' => '/{view}/{timeRange}', 'verb' => 'GET', 'requirements' => ['view' => 'timeGridDay|timeGridWeek|dayGridMonth|multiMonthYear|listMonth'], 'postfix' => 'view.timerange'], + ['name' => 'view#index', 'url' => '/{view}/{timeRange}/new/{mode}/{isAllDay}/{dtStart}/{dtEnd}', 'verb' => 'GET', 'requirements' => ['view' => 'timeGridDay|timeGridWeek|dayGridMonth|multiMonthYear|listMonth'], 'postfix' => 'view.timerange.new'], + ['name' => 'view#index', 'url' => '/{view}/{timeRange}/edit/{mode}/{objectId}/{recurrenceId}', 'verb' => 'GET', 'requirements' => ['view' => 'timeGridDay|timeGridWeek|dayGridMonth|multiMonthYear|listMonth'], 'postfix' => 'view.timerange.edit'], ['name' => 'view#getCalendarDotSvg', 'url' => '/public/getCalendarDotSvg/{color}.svg', 'verb' => 'GET'], // Appointments ['name' => 'appointment#index', 'url' => '/appointments/{userId}', 'verb' => 'GET'], diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 81a78b77ee..fe30d548d2 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -105,7 +105,7 @@ public function setConfig(string $key, * @return JSONResponse */ private function setView(string $view):JSONResponse { - if (!\in_array($view, ['timeGridDay', 'timeGridWeek', 'dayGridMonth', 'listMonth'])) { + if (!\in_array($view, ['timeGridDay', 'timeGridWeek', 'dayGridMonth', 'multiMonthYear', 'listMonth'])) { return new JSONResponse([], Http::STATUS_UNPROCESSABLE_ENTITY); } diff --git a/package-lock.json b/package-lock.json index 7abd67ef67..5bdc9f132e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "@fullcalendar/daygrid": "^6.1.7", "@fullcalendar/interaction": "^6.1.7", "@fullcalendar/list": "^6.1.7", + "@fullcalendar/multimonth": "^6.1.7", "@fullcalendar/resource": "^6.1.7", "@fullcalendar/resource-timeline": "^6.1.7", "@fullcalendar/timegrid": "^6.1.7", @@ -2003,6 +2004,17 @@ "@fullcalendar/core": "~6.1.7" } }, + "node_modules/@fullcalendar/multimonth": { + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/@fullcalendar/multimonth/-/multimonth-6.1.7.tgz", + "integrity": "sha512-x4Z8XjmjlXNElZsVYr+AdNYiGPrYdmG3nxDYjxIDPl1CvH/pAmZinaRlOmVP4wq7ES9RP/9xOlAhe2/RKpsh3w==", + "dependencies": { + "@fullcalendar/daygrid": "~6.1.7" + }, + "peerDependencies": { + "@fullcalendar/core": "~6.1.7" + } + }, "node_modules/@fullcalendar/premium-common": { "version": "6.1.7", "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-6.1.7.tgz", @@ -18911,6 +18923,14 @@ "integrity": "sha512-Fl6jGKylhrk+g/RCISsv66vzpzjCFhd4r3nUDeHTAAE375OYGlVPKpH67YaKxpMrofj82JLIzS3JEzyQBZo0Cg==", "requires": {} }, + "@fullcalendar/multimonth": { + "version": "6.1.7", + "resolved": "https://registry.npmjs.org/@fullcalendar/multimonth/-/multimonth-6.1.7.tgz", + "integrity": "sha512-x4Z8XjmjlXNElZsVYr+AdNYiGPrYdmG3nxDYjxIDPl1CvH/pAmZinaRlOmVP4wq7ES9RP/9xOlAhe2/RKpsh3w==", + "requires": { + "@fullcalendar/daygrid": "~6.1.7" + } + }, "@fullcalendar/premium-common": { "version": "6.1.7", "resolved": "https://registry.npmjs.org/@fullcalendar/premium-common/-/premium-common-6.1.7.tgz", diff --git a/package.json b/package.json index 3b7085a6da..379b59bec1 100644 --- a/package.json +++ b/package.json @@ -40,6 +40,7 @@ "@fullcalendar/daygrid": "^6.1.7", "@fullcalendar/interaction": "^6.1.7", "@fullcalendar/list": "^6.1.7", + "@fullcalendar/multimonth": "^6.1.7", "@fullcalendar/resource": "^6.1.7", "@fullcalendar/resource-timeline": "^6.1.7", "@fullcalendar/timegrid": "^6.1.7", diff --git a/src/components/AppNavigation/AppNavigationHeader/AppNavigationHeaderDatePicker.vue b/src/components/AppNavigation/AppNavigationHeader/AppNavigationHeaderDatePicker.vue index 195fbc8979..5cceaf6508 100644 --- a/src/components/AppNavigation/AppNavigationHeader/AppNavigationHeaderDatePicker.vue +++ b/src/components/AppNavigation/AppNavigationHeader/AppNavigationHeaderDatePicker.vue @@ -36,13 +36,14 @@ @click.stop.prevent="toggleDatepicker" @mousedown.stop.prevent="doNothing" @mouseup.stop.prevent="doNothing"> - {{ selectedDate | formatDateRage(view, locale) }} + {{ selectedDate | formatDateRange(view, locale) }}