From 64f687f8a8067b850a9a99ce99dda567a92f9049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Mon, 28 Feb 2022 15:48:58 +0100 Subject: [PATCH] MOBILE-3814 calendar: Change calendar filter to a side modal --- .../pages/issued-badge/issued-badge.html | 2 +- .../calendar/components/components.module.ts | 6 ++-- .../filter/addon-calendar-filter-popover.html | 18 ------------ .../calendar/components/filter/filter.html | 29 +++++++++++++++++++ .../{filter-popover.scss => filter.scss} | 0 .../calendar/components/filter/filter.ts | 18 ++++++++---- .../addon-calendar-upcoming-events.html | 2 +- src/addons/calendar/pages/day/day.html | 2 +- src/addons/calendar/pages/day/day.page.ts | 13 ++++----- src/addons/calendar/pages/index/index.html | 2 +- src/addons/calendar/pages/index/index.page.ts | 13 ++++----- .../pages/competency/competency.html | 2 +- .../competencysummary/competencysummary.html | 2 +- .../coursecompetencies.html | 2 +- src/addons/competency/pages/plan/plan.html | 2 +- .../index/addon-mod-assign-index.html | 2 +- .../index/addon-mod-data-index.html | 2 +- src/addons/mod/data/pages/entry/entry.html | 3 +- .../index/addon-mod-feedback-index.html | 2 +- .../index/addon-mod-resource-index.html | 2 +- .../components/index/addon-mod-url-index.html | 2 +- .../privatefiles/pages/index/index.html | 2 +- .../comments/pages/viewer/viewer.html | 2 +- .../tag-area/core-course-tag-area.html | 18 +++++++----- .../tag/components/feed/core-tag-feed.html | 24 ++++++++------- .../tag/pages/index-area/index-area.html | 2 +- .../tag-area/core-user-tag-area.html | 15 ++++++---- src/core/features/user/pages/about/about.html | 2 +- .../features/user/pages/profile/profile.html | 2 +- 29 files changed, 107 insertions(+), 86 deletions(-) delete mode 100644 src/addons/calendar/components/filter/addon-calendar-filter-popover.html create mode 100644 src/addons/calendar/components/filter/filter.html rename src/addons/calendar/components/filter/{filter-popover.scss => filter.scss} (100%) diff --git a/src/addons/badges/pages/issued-badge/issued-badge.html b/src/addons/badges/pages/issued-badge/issued-badge.html index 834845a06..fde877cb2 100644 --- a/src/addons/badges/pages/issued-badge/issued-badge.html +++ b/src/addons/badges/pages/issued-badge/issued-badge.html @@ -13,7 +13,7 @@ - + diff --git a/src/addons/calendar/components/components.module.ts b/src/addons/calendar/components/components.module.ts index 283909027..68b2bdee2 100644 --- a/src/addons/calendar/components/components.module.ts +++ b/src/addons/calendar/components/components.module.ts @@ -18,14 +18,14 @@ import { CoreSharedModule } from '@/core/shared.module'; import { AddonCalendarCalendarComponent } from './calendar/calendar'; import { AddonCalendarUpcomingEventsComponent } from './upcoming-events/upcoming-events'; -import { AddonCalendarFilterPopoverComponent } from './filter/filter'; +import { AddonCalendarFilterComponent } from './filter/filter'; import { AddonCalendarReminderTimeModalComponent } from './reminder-time-modal/reminder-time-modal'; @NgModule({ declarations: [ AddonCalendarCalendarComponent, AddonCalendarUpcomingEventsComponent, - AddonCalendarFilterPopoverComponent, + AddonCalendarFilterComponent, AddonCalendarReminderTimeModalComponent, ], imports: [ @@ -36,7 +36,7 @@ import { AddonCalendarReminderTimeModalComponent } from './reminder-time-modal/r exports: [ AddonCalendarCalendarComponent, AddonCalendarUpcomingEventsComponent, - AddonCalendarFilterPopoverComponent, + AddonCalendarFilterComponent, AddonCalendarReminderTimeModalComponent, ], }) diff --git a/src/addons/calendar/components/filter/addon-calendar-filter-popover.html b/src/addons/calendar/components/filter/addon-calendar-filter-popover.html deleted file mode 100644 index fd88358b3..000000000 --- a/src/addons/calendar/components/filter/addon-calendar-filter-popover.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - {{ 'addon.calendar.' + type + 'events' | translate}} - - - - - - - - - - - - - - diff --git a/src/addons/calendar/components/filter/filter.html b/src/addons/calendar/components/filter/filter.html new file mode 100644 index 000000000..c49826ce1 --- /dev/null +++ b/src/addons/calendar/components/filter/filter.html @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + {{ 'addon.calendar.' + type + 'events' | translate}} + + + + + + + + + + + + + + + diff --git a/src/addons/calendar/components/filter/filter-popover.scss b/src/addons/calendar/components/filter/filter.scss similarity index 100% rename from src/addons/calendar/components/filter/filter-popover.scss rename to src/addons/calendar/components/filter/filter.scss diff --git a/src/addons/calendar/components/filter/filter.ts b/src/addons/calendar/components/filter/filter.ts index 8827846c5..9d25721b2 100644 --- a/src/addons/calendar/components/filter/filter.ts +++ b/src/addons/calendar/components/filter/filter.ts @@ -15,6 +15,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { CoreEnrolledCourseData } from '@features/courses/services/courses'; import { CoreUtils } from '@services/utils/utils'; +import { ModalController } from '@singletons'; import { CoreEvents } from '@singletons/events'; import { AddonCalendarEventType, AddonCalendarProvider } from '../../services/calendar'; import { AddonCalendarFilter, AddonCalendarEventIcons } from '../../services/calendar-helper'; @@ -23,11 +24,11 @@ import { AddonCalendarFilter, AddonCalendarEventIcons } from '../../services/cal * Component to display the events filter that includes events types and a list of courses. */ @Component({ - selector: 'addon-calendar-filter-popover', - templateUrl: 'addon-calendar-filter-popover.html', - styleUrls: ['../../calendar-common.scss', 'filter-popover.scss'], + selector: 'addon-calendar-filter', + templateUrl: 'filter.html', + styleUrls: ['../../calendar-common.scss', 'filter.scss'], }) -export class AddonCalendarFilterPopoverComponent implements OnInit { +export class AddonCalendarFilterComponent implements OnInit { @Input() filter: AddonCalendarFilter = { filtered: false, @@ -56,7 +57,7 @@ export class AddonCalendarFilterPopoverComponent implements OnInit { } /** - * Init the component. + * @inheritdoc */ ngOnInit(): void { this.courseId = this.filter.courseId || -1; @@ -80,4 +81,11 @@ export class AddonCalendarFilterPopoverComponent implements OnInit { CoreEvents.trigger(AddonCalendarProvider.FILTER_CHANGED_EVENT, this.filter); } + /** + * Close modal. + */ + closeModal(): void { + ModalController.dismiss(); + } + } diff --git a/src/addons/calendar/components/upcoming-events/addon-calendar-upcoming-events.html b/src/addons/calendar/components/upcoming-events/addon-calendar-upcoming-events.html index 23283d242..e5a295569 100644 --- a/src/addons/calendar/components/upcoming-events/addon-calendar-upcoming-events.html +++ b/src/addons/calendar/components/upcoming-events/addon-calendar-upcoming-events.html @@ -6,7 +6,7 @@ + [ngClass]="['addon-calendar-eventtype-'+event.eventtype]" [detail]="false">