From 41ca26a4c6b718d51d984de59ea91ffda53cbc43 Mon Sep 17 00:00:00 2001 From: Andreas Date: Wed, 29 May 2024 23:15:33 +0200 Subject: [PATCH] Restructure calendar components and fix remote tentative event styles (#437) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ❌ Remove deprecated calendar components Reduce calendar month to mini version only * ➕ Split calendar event into 4 classes * ➕ Move calendar event classes into corresponding components * 🔨 Fix tentative remote events styles * 🔨 Fix all day events styles --- frontend/src/components/CalendarDay.vue | 281 ------------------ ...alendarMonth.vue => CalendarMiniMonth.vue} | 11 +- frontend/src/components/CalendarQalendar.vue | 6 +- frontend/src/components/CalendarWeek.vue | 270 ----------------- frontend/src/elements/CalendarEvent.vue | 129 -------- frontend/src/elements/CalendarMonthDay.vue | 136 --------- frontend/src/elements/CalendarPageHeading.vue | 65 ---- .../src/elements/calendar/CalendarEvent.vue | 107 +++++++ .../calendar/CalendarEventPlaceholder.vue | 42 +++ .../calendar/CalendarEventPreview.vue | 30 ++ .../elements/calendar/CalendarEventRemote.vue | 70 +++++ .../calendar/CalendarEventScheduled.vue | 31 ++ .../calendar/CalendarMiniMonthDay.vue | 45 +++ frontend/src/utils.js | 10 +- frontend/src/views/AppointmentsView.vue | 5 +- frontend/src/views/CalendarView.vue | 5 +- 16 files changed, 336 insertions(+), 907 deletions(-) delete mode 100644 frontend/src/components/CalendarDay.vue rename frontend/src/components/{CalendarMonth.vue => CalendarMiniMonth.vue} (96%) delete mode 100644 frontend/src/components/CalendarWeek.vue delete mode 100644 frontend/src/elements/CalendarEvent.vue delete mode 100644 frontend/src/elements/CalendarMonthDay.vue delete mode 100644 frontend/src/elements/CalendarPageHeading.vue create mode 100644 frontend/src/elements/calendar/CalendarEvent.vue create mode 100644 frontend/src/elements/calendar/CalendarEventPlaceholder.vue create mode 100644 frontend/src/elements/calendar/CalendarEventPreview.vue create mode 100644 frontend/src/elements/calendar/CalendarEventRemote.vue create mode 100644 frontend/src/elements/calendar/CalendarEventScheduled.vue create mode 100644 frontend/src/elements/calendar/CalendarMiniMonthDay.vue diff --git a/frontend/src/components/CalendarDay.vue b/frontend/src/components/CalendarDay.vue deleted file mode 100644 index 386c6f7c8..000000000 --- a/frontend/src/components/CalendarDay.vue +++ /dev/null @@ -1,281 +0,0 @@ - - - diff --git a/frontend/src/components/CalendarMonth.vue b/frontend/src/components/CalendarMiniMonth.vue similarity index 96% rename from frontend/src/components/CalendarMonth.vue rename to frontend/src/components/CalendarMiniMonth.vue index 1ab69a0c4..4fc6d534d 100644 --- a/frontend/src/components/CalendarMonth.vue +++ b/frontend/src/components/CalendarMiniMonth.vue @@ -19,18 +19,16 @@ v-for="h in isoWeekdays" :key="h" class="bg-gray-100 py-2 text-center text-gray-500 dark:bg-gray-600 dark:text-gray-300" - :class="{ 'font-bold': !mini}" > {{ h.min }} - diff --git a/frontend/src/elements/CalendarEvent.vue b/frontend/src/elements/CalendarEvent.vue deleted file mode 100644 index 8f0ec8309..000000000 --- a/frontend/src/elements/CalendarEvent.vue +++ /dev/null @@ -1,129 +0,0 @@ - - - diff --git a/frontend/src/elements/CalendarMonthDay.vue b/frontend/src/elements/CalendarMonthDay.vue deleted file mode 100644 index 579564603..000000000 --- a/frontend/src/elements/CalendarMonthDay.vue +++ /dev/null @@ -1,136 +0,0 @@ - - - diff --git a/frontend/src/elements/CalendarPageHeading.vue b/frontend/src/elements/CalendarPageHeading.vue deleted file mode 100644 index bda1fa44f..000000000 --- a/frontend/src/elements/CalendarPageHeading.vue +++ /dev/null @@ -1,65 +0,0 @@ - - - diff --git a/frontend/src/elements/calendar/CalendarEvent.vue b/frontend/src/elements/calendar/CalendarEvent.vue new file mode 100644 index 000000000..ef52f853d --- /dev/null +++ b/frontend/src/elements/calendar/CalendarEvent.vue @@ -0,0 +1,107 @@ + + + diff --git a/frontend/src/elements/calendar/CalendarEventPlaceholder.vue b/frontend/src/elements/calendar/CalendarEventPlaceholder.vue new file mode 100644 index 000000000..7c590eafa --- /dev/null +++ b/frontend/src/elements/calendar/CalendarEventPlaceholder.vue @@ -0,0 +1,42 @@ + + + diff --git a/frontend/src/elements/calendar/CalendarEventPreview.vue b/frontend/src/elements/calendar/CalendarEventPreview.vue new file mode 100644 index 000000000..c3d09bef7 --- /dev/null +++ b/frontend/src/elements/calendar/CalendarEventPreview.vue @@ -0,0 +1,30 @@ + + diff --git a/frontend/src/elements/calendar/CalendarEventRemote.vue b/frontend/src/elements/calendar/CalendarEventRemote.vue new file mode 100644 index 000000000..5bb47c7a9 --- /dev/null +++ b/frontend/src/elements/calendar/CalendarEventRemote.vue @@ -0,0 +1,70 @@ + + + diff --git a/frontend/src/elements/calendar/CalendarEventScheduled.vue b/frontend/src/elements/calendar/CalendarEventScheduled.vue new file mode 100644 index 000000000..7ba08d874 --- /dev/null +++ b/frontend/src/elements/calendar/CalendarEventScheduled.vue @@ -0,0 +1,31 @@ + + + diff --git a/frontend/src/elements/calendar/CalendarMiniMonthDay.vue b/frontend/src/elements/calendar/CalendarMiniMonthDay.vue new file mode 100644 index 000000000..71d3c1912 --- /dev/null +++ b/frontend/src/elements/calendar/CalendarMiniMonthDay.vue @@ -0,0 +1,45 @@ + + + diff --git a/frontend/src/utils.js b/frontend/src/utils.js index f79231d2a..104f6d967 100644 --- a/frontend/src/utils.js +++ b/frontend/src/utils.js @@ -10,19 +10,15 @@ export const eventColor = (event, placeholder) => { background: null, }; // color appointment slots - if (!placeholder && !event.remote) { + if (!placeholder) { color.border = event.calendar_color; color.background = event.calendar_color; // keep solid background only for slots with attendee - if (!event.attendee) { + if (!event.attendee && !event.remote) { color.background += '22'; } } - // color remote tentative events - if (event.remote && event.tentative) { - color.border = `${event.calendar_color}bb`; - color.background = 'transparent'; - } + return color; }; diff --git a/frontend/src/views/AppointmentsView.vue b/frontend/src/views/AppointmentsView.vue index 212b40ad5..c43268bec 100644 --- a/frontend/src/views/AppointmentsView.vue +++ b/frontend/src/views/AppointmentsView.vue @@ -174,9 +174,8 @@
-
-