From e1cc33bba274548392dad274d14e7e075e39e9db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= Date: Mon, 7 Aug 2023 15:51:23 +0000 Subject: [PATCH] refactor: rename "recurring" to "week overview" refactor: replace dashboard calendar icon resolves #128 refactor: route dashboard "next unit" to date series instead of events resolves #126 --- .changeset/fluffy-lamps-count.md | 5 ++ .changeset/pink-sheep-relax.md | 9 ++++ .changeset/tricky-garlics-hope.md | 5 ++ .../app/cypress/integration/dashboard.spec.ts | 8 ++-- .../dashboard/dashboard.component.html | 10 ++-- .../dashboard/dashboard.component.scss | 1 + .../date-series-detail-content.component.ts | 46 +++++++++++++++---- .../date-series-detail-content.html | 41 ++++++++++------- .../date-series-detail-content.scss | 6 +++ .../schedule/page/schedule-page.component.ts | 2 +- .../modules/schedule/page/schedule-page.html | 31 +++++++------ .../app/modules/schedule/schedule.module.ts | 2 +- frontend/app/src/assets/i18n/de.json | 4 +- frontend/app/src/assets/i18n/en.json | 2 +- 14 files changed, 120 insertions(+), 52 deletions(-) create mode 100644 .changeset/fluffy-lamps-count.md create mode 100644 .changeset/pink-sheep-relax.md create mode 100644 .changeset/tricky-garlics-hope.md create mode 100644 frontend/app/src/app/modules/data/types/date-series/date-series-detail-content.scss diff --git a/.changeset/fluffy-lamps-count.md b/.changeset/fluffy-lamps-count.md new file mode 100644 index 00000000..daa5c792 --- /dev/null +++ b/.changeset/fluffy-lamps-count.md @@ -0,0 +1,5 @@ +--- +'@openstapps/app': minor +--- + +Added the ability to remove and add date series from their detail page diff --git a/.changeset/pink-sheep-relax.md b/.changeset/pink-sheep-relax.md new file mode 100644 index 00000000..2ce74c86 --- /dev/null +++ b/.changeset/pink-sheep-relax.md @@ -0,0 +1,9 @@ +--- +'@openstapps/app': minor +--- + +Improved calendar descriptions + +- The dashboard quick link now has a more intuitive icon +- "Recurring" has been renamed to "Week Overview" +- Long words in calendar tabs will now break instead of overflowing diff --git a/.changeset/tricky-garlics-hope.md b/.changeset/tricky-garlics-hope.md new file mode 100644 index 00000000..8e9dcc9a --- /dev/null +++ b/.changeset/tricky-garlics-hope.md @@ -0,0 +1,5 @@ +--- +'@openstapps/app': minor +--- + +Replaced simple links with list items in date-series detail diff --git a/frontend/app/cypress/integration/dashboard.spec.ts b/frontend/app/cypress/integration/dashboard.spec.ts index 1a8868e2..0506e27c 100644 --- a/frontend/app/cypress/integration/dashboard.spec.ts +++ b/frontend/app/cypress/integration/dashboard.spec.ts @@ -20,12 +20,14 @@ describe('dashboard', async function () { describe('schedule section', function () { it('should lead to the schedule', function () { cy.visit('/overview'); - cy.get('.schedule').contains('a', 'Stundenplan').click(); - cy.url().should('include', '/schedule/recurring'); + cy.get('.schedule') + .contains('a', /Wochen.*übersicht/) + .click(); + cy.url().should('include', '/schedule/week-overview'); cy.visit('/overview'); cy.get('.schedule').contains('a', 'Kein Eintrag gefunden').click(); - cy.url().should('include', '/schedule/recurring'); + cy.url().should('include', '/schedule/calendar'); }); // TODO: Reenable and stabilize tests diff --git a/frontend/app/src/app/modules/dashboard/dashboard.component.html b/frontend/app/src/app/modules/dashboard/dashboard.component.html index 07ea8215..36a6ded3 100644 --- a/frontend/app/src/app/modules/dashboard/dashboard.component.html +++ b/frontend/app/src/app/modules/dashboard/dashboard.component.html @@ -19,19 +19,19 @@
- - - {{ 'schedule.recurring' | translate }} + + + {{ 'dashboard.schedule.title' | translate }} {{ - nextEvent?.event + nextEvent ? (nextEvent!.dates | nextDateInList | amDateFormat : 'll, HH:mm') : ('dashboard.schedule.noEvent' | translate) }} diff --git a/frontend/app/src/app/modules/dashboard/dashboard.component.scss b/frontend/app/src/app/modules/dashboard/dashboard.component.scss index d960f399..be6e9b69 100644 --- a/frontend/app/src/app/modules/dashboard/dashboard.component.scss +++ b/frontend/app/src/app/modules/dashboard/dashboard.component.scss @@ -117,6 +117,7 @@ ion-content { ion-label { font-size: var(--font-size-xxs); font-weight: var(--font-weight-semi-bold); + word-break: break-word; } &:hover ::ng-deep stapps-icon { diff --git a/frontend/app/src/app/modules/data/types/date-series/date-series-detail-content.component.ts b/frontend/app/src/app/modules/data/types/date-series/date-series-detail-content.component.ts index 4063ab87..11c2eca5 100644 --- a/frontend/app/src/app/modules/data/types/date-series/date-series-detail-content.component.ts +++ b/frontend/app/src/app/modules/data/types/date-series/date-series-detail-content.component.ts @@ -12,19 +12,49 @@ * You should have received a copy of the GNU General Public License along with * this program. If not, see . */ -import {Component, Input} from '@angular/core'; +import {Component, Input, OnInit} from '@angular/core'; import {SCDateSeries} from '@openstapps/core'; +import {ScheduleProvider, toDateSeriesRelevantData} from '../../../calendar/schedule.provider'; +import {Observable} from 'rxjs'; +import {map} from 'rxjs/operators'; +import {DataRoutingService} from '../../data-routing.service'; +import {Router} from '@angular/router'; +import {takeUntilDestroyed} from '@angular/core/rxjs-interop'; -/** - * TODO - */ @Component({ selector: 'stapps-date-series-detail-content', templateUrl: 'date-series-detail-content.html', + styleUrls: ['date-series-detail-content.scss'], }) -export class DateSeriesDetailContentComponent { - /** - * TODO - */ +export class DateSeriesDetailContentComponent implements OnInit { @Input() item: SCDateSeries; + + isInCalendar: Observable; + + constructor( + readonly scheduleProvider: ScheduleProvider, + dataRoutingService: DataRoutingService, + router: Router, + ) { + dataRoutingService + .itemSelectListener() + .pipe(takeUntilDestroyed()) + .subscribe(item => { + void router.navigate(['/data-detail', item.uid]); + }); + } + + ngOnInit() { + this.isInCalendar = this.scheduleProvider.uuids$.pipe(map(it => it.includes(this.item.uid))); + } + + addToCalendar() { + const current = this.scheduleProvider.partialEvents$.value; + this.scheduleProvider.partialEvents$.next([...current, toDateSeriesRelevantData(this.item)]); + } + + removeFromCalendar() { + const filtered = this.scheduleProvider.partialEvents$.value.filter(it => it.uid !== this.item.uid); + this.scheduleProvider.partialEvents$.next(filtered); + } } diff --git a/frontend/app/src/app/modules/data/types/date-series/date-series-detail-content.html b/frontend/app/src/app/modules/data/types/date-series/date-series-detail-content.html index b4fc33f8..4a7632ad 100644 --- a/frontend/app/src/app/modules/data/types/date-series/date-series-detail-content.html +++ b/frontend/app/src/app/modules/data/types/date-series/date-series-detail-content.html @@ -12,23 +12,18 @@ ~ You should have received a copy of the GNU General Public License along with ~ this program. If not, see . --> - - {{ 'event' | propertyNameTranslate : item | titlecase }} - - {{ 'name' | thingTranslate : item.event }} - - - - {{ 'inPlace' | propertyNameTranslate : item | titlecase }} - - - {{ 'name' | thingTranslate : item.inPlace }} - - - + + + + {{'chips.addEvent.addedToEvents' | translate}} + + + + + + {{'chips.addEvent.addEvent' | translate}} + + + + {{ 'event' | propertyNameTranslate : item | titlecase }} + + + + + + {{ 'inPlace' | propertyNameTranslate : item | titlecase }} + + + + diff --git a/frontend/app/src/app/modules/data/types/date-series/date-series-detail-content.scss b/frontend/app/src/app/modules/data/types/date-series/date-series-detail-content.scss new file mode 100644 index 00000000..5e5dd561 --- /dev/null +++ b/frontend/app/src/app/modules/data/types/date-series/date-series-detail-content.scss @@ -0,0 +1,6 @@ +ion-chip { + position: absolute; + z-index: 1; + top: 0; + right: 0; +} diff --git a/frontend/app/src/app/modules/schedule/page/schedule-page.component.ts b/frontend/app/src/app/modules/schedule/page/schedule-page.component.ts index 51c9b3cb..60121e6c 100644 --- a/frontend/app/src/app/modules/schedule/page/schedule-page.component.ts +++ b/frontend/app/src/app/modules/schedule/page/schedule-page.component.ts @@ -136,7 +136,7 @@ export class SchedulePageComponent implements OnInit, AfterViewInit { onInit() { this.tabChoreographer = new SharedAxisChoreographer(this.activatedRoute.snapshot.paramMap.get('mode'), [ 'calendar', - 'recurring', + 'week-overview', 'single', ]); } diff --git a/frontend/app/src/app/modules/schedule/page/schedule-page.html b/frontend/app/src/app/modules/schedule/page/schedule-page.html index 5bc3b9aa..ea93e7db 100644 --- a/frontend/app/src/app/modules/schedule/page/schedule-page.html +++ b/frontend/app/src/app/modules/schedule/page/schedule-page.html @@ -18,15 +18,18 @@ - {{ 'schedule.calendar' | translate | titlecase }} - {{ 'schedule.recurring' | translate | titlecase }} - {{ 'schedule.single' | translate | titlecase }} + + + @@ -36,15 +39,15 @@ - {{ 'schedule.calendar' | translate }} + - - {{ 'schedule.recurring' | translate }} + + - {{ 'schedule.single' | translate }} + @@ -59,7 +62,7 @@ > - +
diff --git a/frontend/app/src/app/modules/schedule/schedule.module.ts b/frontend/app/src/app/modules/schedule/schedule.module.ts index 4c9d2d38..23415fe3 100644 --- a/frontend/app/src/app/modules/schedule/schedule.module.ts +++ b/frontend/app/src/app/modules/schedule/schedule.module.ts @@ -41,7 +41,7 @@ import {ChooseEventsPageComponent} from './page/choose-events-page.component'; const settingsRoutes: Routes = [ {path: 'schedule', redirectTo: 'schedule/calendar/now'}, {path: 'schedule/calendar', redirectTo: 'schedule/calendar/now'}, - {path: 'schedule/recurring', redirectTo: 'schedule/recurring/now'}, + {path: 'schedule/week-overview', redirectTo: 'schedule/week-overview/now'}, {path: 'schedule/single', redirectTo: 'schedule/single/now'}, // calendar | recurring | single {path: 'schedule/:mode/:date', component: SchedulePageComponent}, diff --git a/frontend/app/src/assets/i18n/de.json b/frontend/app/src/assets/i18n/de.json index 6239b168..60831ff6 100644 --- a/frontend/app/src/assets/i18n/de.json +++ b/frontend/app/src/assets/i18n/de.json @@ -459,9 +459,9 @@ "view": { "today": "Heute" }, - "recurring": "Stundenplan", + "recurring": "Wochen­übersicht", "calendar": "Kalender", - "single": "Einzeltermine", + "single": "Einzel­termine", "addEventPage": { "TITLE": "Termine Hinzufügen", "PLACEHOLDER": "Termine", diff --git a/frontend/app/src/assets/i18n/en.json b/frontend/app/src/assets/i18n/en.json index d48527dc..0d765a26 100644 --- a/frontend/app/src/assets/i18n/en.json +++ b/frontend/app/src/assets/i18n/en.json @@ -459,7 +459,7 @@ "view": { "today": "Today" }, - "recurring": "Recurring", + "recurring": "Week Overview", "calendar": "Calendar", "single": "Single Events", "addEventPage": {