From 19f936b0be6119c359b9736533775abb75d82396 Mon Sep 17 00:00:00 2001 From: Manuel Meister Date: Sun, 9 Oct 2022 00:27:21 +0200 Subject: [PATCH 01/34] Create new dashboard mockup --- frontend/src/router.js | 6 + frontend/src/views/camp/DashboardNew.vue | 374 +++++++++++++++++++++++ 2 files changed, 380 insertions(+) create mode 100644 frontend/src/views/camp/DashboardNew.vue diff --git a/frontend/src/router.js b/frontend/src/router.js index 33743ddc44..3e83b4b2fa 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -247,6 +247,12 @@ export default new Router({ name: 'camp/dashboard', component: () => import('./views/camp/Dashboard.vue'), }, + { + path: 'dashboard-new', + name: 'camp/dashboard/new', + component: () => + import(/* webpackChungName: "camp" */ './views/camp/DashboardNew.vue'), + }, { path: '', name: 'camp/home', diff --git a/frontend/src/views/camp/DashboardNew.vue b/frontend/src/views/camp/DashboardNew.vue new file mode 100644 index 0000000000..847edcd071 --- /dev/null +++ b/frontend/src/views/camp/DashboardNew.vue @@ -0,0 +1,374 @@ + + + + + + + From 50a03856be11e56a459f023375ca57041252b6cf Mon Sep 17 00:00:00 2001 From: Manuel Meister Date: Sat, 22 Oct 2022 12:42:10 +0200 Subject: [PATCH 02/34] Refine design --- frontend/src/views/camp/DashboardNew.vue | 113 ++++++++++++----------- 1 file changed, 61 insertions(+), 52 deletions(-) diff --git a/frontend/src/views/camp/DashboardNew.vue b/frontend/src/views/camp/DashboardNew.vue index 847edcd071..b4bc40e99d 100644 --- a/frontend/src/views/camp/DashboardNew.vue +++ b/frontend/src/views/camp/DashboardNew.vue @@ -4,57 +4,54 @@ Admin screen of a camp: Displays details & periods of a single camp and allows t @@ -273,7 +278,11 @@ export default { computed: { events() { return this.results - .filter((period) => period.id.includes(this.filter.period)) + .filter((period) => + Array.isArray(this.filter.period) + ? this.filter.period.some((filter) => period.id.includes(filter)) + : period.id.includes(this.filter.period) + ) .map((period) => ({ ...period, days: period.days.map(({ id, scheduleEntries }) => ({ From e69c3795c3107a5b334f06be8a5c42702c535652 Mon Sep 17 00:00:00 2001 From: Manuel Meister Date: Sat, 29 Oct 2022 22:45:42 +0200 Subject: [PATCH 03/34] Refine dashboard design --- .../src/components/dashboard/ActivityRow.vue | 76 ++++ .../components/dashboard/BaselineCenter.vue | 34 ++ .../components/dashboard/BooleanFilter.vue | 21 + .../components/dashboard/FilterDivider.vue | 16 + .../src/components/dashboard/SelectFilter.vue | 137 +++++++ frontend/src/components/user/AvatarRow.vue | 56 +++ frontend/src/router.js | 3 +- frontend/src/scss/global.scss | 4 + frontend/src/views/camp/DashboardNew.vue | 384 +++++++++--------- 9 files changed, 536 insertions(+), 195 deletions(-) create mode 100644 frontend/src/components/dashboard/ActivityRow.vue create mode 100644 frontend/src/components/dashboard/BaselineCenter.vue create mode 100644 frontend/src/components/dashboard/BooleanFilter.vue create mode 100644 frontend/src/components/dashboard/FilterDivider.vue create mode 100644 frontend/src/components/dashboard/SelectFilter.vue create mode 100644 frontend/src/components/user/AvatarRow.vue diff --git a/frontend/src/components/dashboard/ActivityRow.vue b/frontend/src/components/dashboard/ActivityRow.vue new file mode 100644 index 0000000000..82a84778d1 --- /dev/null +++ b/frontend/src/components/dashboard/ActivityRow.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/frontend/src/components/dashboard/BaselineCenter.vue b/frontend/src/components/dashboard/BaselineCenter.vue new file mode 100644 index 0000000000..06faff6446 --- /dev/null +++ b/frontend/src/components/dashboard/BaselineCenter.vue @@ -0,0 +1,34 @@ + + + + + diff --git a/frontend/src/components/dashboard/BooleanFilter.vue b/frontend/src/components/dashboard/BooleanFilter.vue new file mode 100644 index 0000000000..e21abe0592 --- /dev/null +++ b/frontend/src/components/dashboard/BooleanFilter.vue @@ -0,0 +1,21 @@ + + + + + diff --git a/frontend/src/components/dashboard/FilterDivider.vue b/frontend/src/components/dashboard/FilterDivider.vue new file mode 100644 index 0000000000..ff1d156e3a --- /dev/null +++ b/frontend/src/components/dashboard/FilterDivider.vue @@ -0,0 +1,16 @@ + + + + + diff --git a/frontend/src/components/dashboard/SelectFilter.vue b/frontend/src/components/dashboard/SelectFilter.vue new file mode 100644 index 0000000000..02b6d831f6 --- /dev/null +++ b/frontend/src/components/dashboard/SelectFilter.vue @@ -0,0 +1,137 @@ + + + + + diff --git a/frontend/src/components/user/AvatarRow.vue b/frontend/src/components/user/AvatarRow.vue new file mode 100644 index 0000000000..44adde8c0f --- /dev/null +++ b/frontend/src/components/user/AvatarRow.vue @@ -0,0 +1,56 @@ + + + + + diff --git a/frontend/src/router.js b/frontend/src/router.js index 3e83b4b2fa..0798b37dd8 100644 --- a/frontend/src/router.js +++ b/frontend/src/router.js @@ -250,8 +250,7 @@ export default new Router({ { path: 'dashboard-new', name: 'camp/dashboard/new', - component: () => - import(/* webpackChungName: "camp" */ './views/camp/DashboardNew.vue'), + component: () => import('./views/camp/DashboardNew.vue'), }, { path: '', diff --git a/frontend/src/scss/global.scss b/frontend/src/scss/global.scss index c5a29d99ab..37b11af379 100644 --- a/frontend/src/scss/global.scss +++ b/frontend/src/scss/global.scss @@ -94,3 +94,7 @@ body { .pb-safe { padding-bottom: env(safe-area-inset-bottom); } + +.d-flow-root { + display: flow-root; +} diff --git a/frontend/src/views/camp/DashboardNew.vue b/frontend/src/views/camp/DashboardNew.vue index b4bc40e99d..7ab0c73969 100644 --- a/frontend/src/views/camp/DashboardNew.vue +++ b/frontend/src/views/camp/DashboardNew.vue @@ -3,139 +3,116 @@ Admin screen of a camp: Displays details & periods of a single camp and allows t --> - - diff --git a/frontend/src/views/camp/DashboardOld.vue b/frontend/src/views/camp/DashboardOld.vue new file mode 100644 index 0000000000..f2b6af5ec2 --- /dev/null +++ b/frontend/src/views/camp/DashboardOld.vue @@ -0,0 +1,202 @@ + + + + + + + From c42bb76abe8dd1b71d6414c53769692b73062366 Mon Sep 17 00:00:00 2001 From: Carlo Beltrame Date: Tue, 8 Nov 2022 00:24:52 +0100 Subject: [PATCH 05/34] Use translations --- frontend/src/locales/de.json | 17 ++++++++++--- frontend/src/locales/en.json | 17 ++++++++++--- frontend/src/views/camp/Dashboard.vue | 36 ++++++++++++++++----------- 3 files changed, 47 insertions(+), 23 deletions(-) diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 59568220c2..e6a1768488 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -371,10 +371,19 @@ "title": "Team" }, "dashboard": { - "noActivitiesLine1": "Du bist noch für keinen Block zuständig.", - "noActivitiesLine2": "Den ganzen Picasso kannst du dir hier ansehen.", - "program": "Programm", - "viewDescription": "Du arbeitest an \"{title}\" mit. Hier siehst du alle Blöcke, für welche du zuständig bist." + "activities": "Aktivitäten", + "category": "Kategorie", + "clearFilters": "Filter entfernen", + "columns": { + "category": "Kategorie", + "number": "Nummer", + "responsible": "Verantwortlich", + "time": "Zeit", + "title": "Titel" + }, + "onlyMyActivities": "Nur meine Aktivitäten", + "period": "Lagerabschnitt", + "responsible": "Verantwortlich" }, "invitation": { "acceptCurrentAuth": "Einladung mit aktuellem Account akzeptieren", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 0be3bdf02a..13f959c992 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -368,10 +368,19 @@ "title": "Team" }, "dashboard": { - "noActivitiesLine1": "You are not yet responsible for any activity.", - "noActivitiesLine2": "You can see the whole program here.", - "program": "Program", - "viewDescription": "You work on \"{title}\". Here you can see all the activities for which you are responsible." + "activities": "Activities", + "category": "Category", + "clearFilters": "Clear filters", + "columns": { + "category": "Category", + "number": "Number", + "responsible": "Responsible", + "time": "Time", + "title": "Title" + }, + "onlyMyActivities": "Only my activities", + "period": "Period", + "responsible": "Responsible" }, "invitation": { "acceptCurrentAuth": "Accept invitation with current account", diff --git a/frontend/src/views/camp/Dashboard.vue b/frontend/src/views/camp/Dashboard.vue index fcea731756..f8c73d3ed4 100644 --- a/frontend/src/views/camp/Dashboard.vue +++ b/frontend/src/views/camp/Dashboard.vue @@ -1,13 +1,9 @@ - - From 18bb96aaed7ec1452aedfa293249fe168c398141 Mon Sep 17 00:00:00 2001 From: Carlo Beltrame Date: Wed, 9 Nov 2022 18:10:58 +0100 Subject: [PATCH 22/34] Make duration more visually distinct --- common/locales/de.json | 2 +- common/locales/en.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/common/locales/de.json b/common/locales/de.json index 3e55f08a92..a8b4dbdcb6 100644 --- a/common/locales/de.json +++ b/common/locales/de.json @@ -165,7 +165,7 @@ "dateLong": "dd L", "dateShort": "dd D.M.", "dateTimeLong": "dd L HH:mm", - "durationShort": "H:mm", + "durationShort": "H[h] m[min]", "hourLong": "HH:mm", "hourShort": "H:mm" } diff --git a/common/locales/en.json b/common/locales/en.json index 5903e22cf2..546d179ed2 100644 --- a/common/locales/en.json +++ b/common/locales/en.json @@ -172,7 +172,7 @@ "dateLong": "dd L", "dateShort": "dd M/D", "dateTimeLong": "dd L HH:mm", - "durationShort": "H:mm", + "durationShort": "H[h] m[m]", "hourLong": "HH:mm", "hourShort": "h:mm A" } From 267ea905b7ca642b663527da9b2e2ade9e41365a Mon Sep 17 00:00:00 2001 From: Carlo Beltrame Date: Wed, 9 Nov 2022 18:21:07 +0100 Subject: [PATCH 23/34] Use built-in ListFormat for formatting lists of values https://caniuse.com/?search=ListFormat --- frontend/src/components/dashboard/SelectFilter.vue | 13 ++++++++++--- frontend/src/views/camp/Dashboard.vue | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/dashboard/SelectFilter.vue b/frontend/src/components/dashboard/SelectFilter.vue index 406dcaf757..113b9fac55 100644 --- a/frontend/src/components/dashboard/SelectFilter.vue +++ b/frontend/src/components/dashboard/SelectFilter.vue @@ -46,6 +46,7 @@ export default { items: { type: Object, default: () => ({}) }, displayField: { type: [String, Function], required: true }, valueField: { type: String, default: '_meta.self' }, + andFilter: { type: Boolean, default: false }, }, computed: { active() { @@ -65,9 +66,15 @@ export default { ) }, labelValue() { - return this.multiple - ? (this.value || []).map((item) => this.processedItems[item].text).join(', ') - : this.processedItems[this.value]?.text + if (this.multiple) { + const list = (this.value || []).map((item) => this.processedItems[item].text) + const lang = document.querySelector('html').getAttribute('lang') + const listFormat = new Intl.ListFormat(lang, { + type: this.andFilter ? 'conjunction' : 'disjunction', + }) + return listFormat.format(list) + } + return this.processedItems[this.value]?.text }, }, methods: { diff --git a/frontend/src/views/camp/Dashboard.vue b/frontend/src/views/camp/Dashboard.vue index 36a20aef97..e846b27911 100644 --- a/frontend/src/views/camp/Dashboard.vue +++ b/frontend/src/views/camp/Dashboard.vue @@ -14,6 +14,7 @@ Date: Wed, 9 Nov 2022 18:28:20 +0100 Subject: [PATCH 24/34] Add an underline on hover for now --- frontend/src/components/dashboard/ActivityRow.vue | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/dashboard/ActivityRow.vue b/frontend/src/components/dashboard/ActivityRow.vue index 8225c79a7f..fb7c1bab9b 100644 --- a/frontend/src/components/dashboard/ActivityRow.vue +++ b/frontend/src/components/dashboard/ActivityRow.vue @@ -15,7 +15,10 @@ {{ duration }} - + {{ title }}
{{ location }} @@ -124,4 +127,8 @@ tr + tr :is(td, th) { vertical-align: baseline; align-items: center; } + +.text-decoration-hover-underline:hover { + text-decoration: underline !important; +} From 064ba9695ae00507ae973d1480f1049271b3dc17 Mon Sep 17 00:00:00 2001 From: Carlo Beltrame Date: Wed, 9 Nov 2022 18:51:01 +0100 Subject: [PATCH 25/34] Pass tc as argument to avoid console errors --- frontend/src/components/user/UserAvatar.vue | 2 +- frontend/src/views/camp/Dashboard.vue | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/user/UserAvatar.vue b/frontend/src/components/user/UserAvatar.vue index 5d4b30a0c1..8b2259f75d 100644 --- a/frontend/src/components/user/UserAvatar.vue +++ b/frontend/src/components/user/UserAvatar.vue @@ -49,7 +49,7 @@ export default { } return this.user ? userDisplayName(this.user) - : campCollaborationDisplayName(this.campCollaboration) + : campCollaborationDisplayName(this.campCollaboration, this.$tc.bind(this)) }, style() { return { diff --git a/frontend/src/views/camp/Dashboard.vue b/frontend/src/views/camp/Dashboard.vue index e846b27911..38a44c8526 100644 --- a/frontend/src/views/camp/Dashboard.vue +++ b/frontend/src/views/camp/Dashboard.vue @@ -268,7 +268,9 @@ export default { this.loading = false }, methods: { - campCollaborationDisplayName, + campCollaborationDisplayName(campCollaboration) { + return campCollaborationDisplayName(campCollaboration, this.$tc.bind(this)) + }, dateLong, }, } From d6738b8847f2ee143c06dfd75ec0bfffb791ab37 Mon Sep 17 00:00:00 2001 From: Carlo Beltrame Date: Wed, 9 Nov 2022 18:56:33 +0100 Subject: [PATCH 26/34] Fix various console errors due to partially loaded data --- frontend/src/views/camp/Dashboard.vue | 66 ++++++++++++++------------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/frontend/src/views/camp/Dashboard.vue b/frontend/src/views/camp/Dashboard.vue index 38a44c8526..f23cecc09d 100644 --- a/frontend/src/views/camp/Dashboard.vue +++ b/frontend/src/views/camp/Dashboard.vue @@ -98,33 +98,35 @@ - - - - {{ dateLong(days[dayUri].start) }} - - - - + @@ -243,10 +245,12 @@ export default { }, }, loggedInCampCollaboration() { - return Object.values(this.campCollaborations).find( - (collaboration) => - collaboration.user()._meta.self === this.loggedInUser._meta.self - )?._meta?.self + return Object.values(this.campCollaborations).find((collaboration) => { + if (typeof collaboration.user !== 'function') { + return false + } + return collaboration.user()?._meta?.self === this.loggedInUser._meta.self + })?._meta?.self }, multiplePeriods() { return ( From e8867365e3cf856e6d48fd68a3a665d9c8524464 Mon Sep 17 00:00:00 2001 From: Carlo Beltrame Date: Wed, 9 Nov 2022 19:04:01 +0100 Subject: [PATCH 27/34] Change label --- frontend/src/components/dashboard/SelectFilter.vue | 2 +- frontend/src/locales/de.json | 2 +- frontend/src/locales/en.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/dashboard/SelectFilter.vue b/frontend/src/components/dashboard/SelectFilter.vue index 113b9fac55..0c45f5335c 100644 --- a/frontend/src/components/dashboard/SelectFilter.vue +++ b/frontend/src/components/dashboard/SelectFilter.vue @@ -12,7 +12,7 @@ {{ - $tc('components.dashboard.selectFilter.all') + $tc('components.dashboard.selectFilter.clear') }} Date: Wed, 9 Nov 2022 19:19:24 +0100 Subject: [PATCH 28/34] Make period filter more intuitive and add fallback messages --- frontend/src/locales/de.json | 4 +++- frontend/src/locales/en.json | 4 +++- frontend/src/views/camp/Dashboard.vue | 22 ++++++++++++++++------ 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index 9945c85f63..a387a802ee 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -386,9 +386,11 @@ "time": "Zeit", "title": "Titel" }, + "noEntries": "Keine Aktivitäten gefunden. Versuche die Filter zu entfernen oder lade die Seite neu.", "onlyMyActivities": "Nur meine Aktivitäten", "period": "Lagerabschnitt", - "responsible": "Verantwortlich" + "responsible": "Verantwortlich", + "welcome": "Willkommen in deinem neuen Lager. Es sind noch keine Aktivitäten erfasst. " }, "invitation": { "acceptCurrentAuth": "Einladung mit aktuellem Account akzeptieren", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 1e02f3b78b..ea04d8f9a6 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -383,9 +383,11 @@ "time": "Time", "title": "Title" }, + "noEntries": "No activities found. Try clearing the selection filters and/or reloading the page.", "onlyMyActivities": "Only my activities", "period": "Period", - "responsible": "Responsible" + "responsible": "Responsible", + "welcome": "Welcome to your new camp. There aren't any activities defined yet." }, "invitation": { "acceptCurrentAuth": "Accept invitation with current account", diff --git a/frontend/src/views/camp/Dashboard.vue b/frontend/src/views/camp/Dashboard.vue index f23cecc09d..c80004fee9 100644 --- a/frontend/src/views/camp/Dashboard.vue +++ b/frontend/src/views/camp/Dashboard.vue @@ -128,6 +128,15 @@ +

+ {{ $tc('views.camp.dashboard.noEntries') }} +

+

+ {{ $tc('views.camp.dashboard.welcome') }} +

@@ -141,7 +150,7 @@ import BooleanFilter from '@/components/dashboard/BooleanFilter.vue' import SelectFilter from '@/components/dashboard/SelectFilter.vue' import ActivityRow from '@/components/dashboard/ActivityRow.vue' import FilterDivider from '@/components/dashboard/FilterDivider.vue' -import { keyBy, groupBy, mapValues, uniq } from 'lodash' +import { keyBy, groupBy, mapValues } from 'lodash' import campCollaborationDisplayName from '../../common/helpers/campCollaborationDisplayName.js' import { dateLong } from '../../common/helpers/dateHelperUTCFormatted.js' @@ -189,6 +198,11 @@ export default { (period) => period.scheduleEntries().items ) }, + scheduleEntriesLoading() { + return Object.values(this.periods).some( + (period) => period.scheduleEntries()._meta.loading + ) + }, days() { return keyBy( Object.values(this.periods).flatMap((period) => period.days().items), @@ -253,11 +267,7 @@ export default { })?._meta?.self }, multiplePeriods() { - return ( - uniq( - this.scheduleEntries.map((scheduleEntry) => scheduleEntry.period()._meta.self) - ).length > 1 - ) + return Object.keys(this.periods).length > 1 }, }, async mounted() { From 6bc4f1d5e16ad4b2675924068b3212274d0a9801 Mon Sep 17 00:00:00 2001 From: Carlo Beltrame Date: Wed, 9 Nov 2022 21:33:23 +0100 Subject: [PATCH 29/34] Add back a component for baseline alignment --- .../src/components/dashboard/ActivityRow.vue | 7 +++-- .../components/layout/TextAlignBaseline.vue | 28 +++++++++++++++++++ 2 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 frontend/src/components/layout/TextAlignBaseline.vue diff --git a/frontend/src/components/dashboard/ActivityRow.vue b/frontend/src/components/dashboard/ActivityRow.vue index fb7c1bab9b..223bc44231 100644 --- a/frontend/src/components/dashboard/ActivityRow.vue +++ b/frontend/src/components/dashboard/ActivityRow.vue @@ -1,8 +1,8 @@ - {{ - $tc('components.dashboard.selectFilter.clear') - }} + + {{ + $tc('components.dashboard.selectFilter.clear') + }} + mdi-close + Date: Fri, 11 Nov 2022 12:16:26 +0100 Subject: [PATCH 34/34] Make clear option have less visual weight --- frontend/src/components/dashboard/SelectFilter.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/dashboard/SelectFilter.vue b/frontend/src/components/dashboard/SelectFilter.vue index b3a2fc2a49..4728baf072 100644 --- a/frontend/src/components/dashboard/SelectFilter.vue +++ b/frontend/src/components/dashboard/SelectFilter.vue @@ -11,11 +11,11 @@ - + {{ $tc('components.dashboard.selectFilter.clear') }} - mdi-close + mdi-close