diff --git a/src/addons/calendar/pages/day/day.page.ts b/src/addons/calendar/pages/day/day.page.ts index b7dc95b76..16a6cab8d 100644 --- a/src/addons/calendar/pages/day/day.page.ts +++ b/src/addons/calendar/pages/day/day.page.ts @@ -36,7 +36,7 @@ import { CoreCoursesHelper } from '@features/courses/services/courses-helper'; import { AddonCalendarFilterPopoverComponent } from '../../components/filter/filter'; import moment from 'moment'; import { Network, NgZone } from '@singletons'; -import { CoreNavHelper } from '@services/nav-helper'; +import { CoreNavigator } from '@services/navigator'; import { ActivatedRoute, Params } from '@angular/router'; import { Subscription } from 'rxjs'; import { CoreUtils } from '@services/utils/utils'; @@ -529,9 +529,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { // It's an offline event, go to the edit page. this.openEdit(eventId); } else { - CoreNavHelper.instance.goInCurrentMainMenuTab('/calendar/event', { - id: eventId, - }); + CoreNavigator.instance.navigateToSitePath('/calendar/event', { params: { id: eventId } }); } } @@ -571,7 +569,7 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { params.courseId = this.filter.courseId; } - CoreNavHelper.instance.goInCurrentMainMenuTab('/calendar/edit', params); + CoreNavigator.instance.navigateToSitePath('/calendar/edit', { params }); } /** diff --git a/src/addons/calendar/pages/event/event.page.ts b/src/addons/calendar/pages/event/event.page.ts index 0aa3c6bf9..ecba77a19 100644 --- a/src/addons/calendar/pages/event/event.page.ts +++ b/src/addons/calendar/pages/event/event.page.ts @@ -40,7 +40,7 @@ import { CoreGroups } from '@services/groups'; // @todo import { CoreSplitViewComponent } from '@components/split-view/split-view'; import { Network, NgZone, Translate } from '@singletons'; import { Subscription } from 'rxjs'; -import { CoreNavHelper } from '@services/nav-helper'; +import { CoreNavigator } from '@services/navigator'; import { CoreUtils } from '@services/utils/utils'; import { AddonCalendarReminderDBRecord } from '../../services/database/calendar'; import { ActivatedRoute } from '@angular/router'; @@ -422,8 +422,8 @@ export class AddonCalendarEventPage implements OnInit, OnDestroy { */ openEdit(): void { // Decide which navCtrl to use. If this page is inside a split view, use the split view's master nav. - // const navCtrl = this.svComponent ? this.svComponent.getMasterNav() : this.navCtrl; - CoreNavHelper.instance.goInCurrentMainMenuTab('/edit', { eventId: this.eventId }); + // @todo const navCtrl = this.svComponent ? this.svComponent.getMasterNav() : this.navCtrl; + CoreNavigator.instance.navigateToSitePath('/calendar/edit', { params: { eventId: this.eventId } }); } /** diff --git a/src/addons/calendar/pages/index/index.page.ts b/src/addons/calendar/pages/index/index.page.ts index c05286225..d0bdb8a19 100644 --- a/src/addons/calendar/pages/index/index.page.ts +++ b/src/addons/calendar/pages/index/index.page.ts @@ -30,7 +30,7 @@ import { ActivatedRoute, Params } from '@angular/router'; import { AddonCalendarCalendarComponent } from '../../components/calendar/calendar'; import { AddonCalendarUpcomingEventsComponent } from '../../components/upcoming-events/upcoming-events'; import { AddonCalendarFilterPopoverComponent } from '../../components/filter/filter'; -import { CoreNavHelper } from '@services/nav-helper'; +import { CoreNavigator } from '@services/navigator'; import { CoreLocalNotifications } from '@services/local-notifications'; @@ -312,9 +312,7 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy { // It's an offline event, go to the edit page. this.openEdit(eventId); } else { - CoreNavHelper.instance.goInCurrentMainMenuTab('/calendar/event', { - id: eventId, - }); + CoreNavigator.instance.navigateToSitePath('/calendar/event', { params: { id: eventId } }); } } @@ -334,7 +332,7 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy { params[key] = this.filter[key]; }); - CoreNavHelper.instance.goInCurrentMainMenuTab('/calendar/day', params); + CoreNavigator.instance.navigateToSitePath('/calendar/day', { params }); } /** @@ -369,14 +367,14 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy { params.courseId = this.filter.courseId; } - CoreNavHelper.instance.goInCurrentMainMenuTab('/calendar/edit', params); + CoreNavigator.instance.navigateToSitePath('/calendar/edit', { params }); } /** * Open calendar events settings. */ openSettings(): void { - CoreNavHelper.instance.goInCurrentMainMenuTab('/calendar/settings'); + CoreNavigator.instance.navigateToSitePath('/calendar/settings'); } /** diff --git a/src/addons/calendar/pages/list/list.page.ts b/src/addons/calendar/pages/list/list.page.ts index 38d8a730d..5b99ee493 100644 --- a/src/addons/calendar/pages/list/list.page.ts +++ b/src/addons/calendar/pages/list/list.page.ts @@ -39,7 +39,7 @@ import { Subscription } from 'rxjs'; import { Network, NgZone } from '@singletons'; import { CoreCoursesHelper } from '@features/courses/services/courses-helper'; import { CoreUtils } from '@services/utils/utils'; -import { CoreNavHelper } from '@services/nav-helper'; +import { CoreNavigator } from '@services/navigator'; /** * Page that displays the list of calendar events. @@ -643,14 +643,14 @@ export class AddonCalendarListPage implements OnInit, OnDestroy { params.courseId = this.filter.courseId; } - // CoreNavHelper.instance.push('/calendar/edit', params, this.splitviewCtrl); + CoreNavigator.instance.navigateToSitePath('/calendar/edit', { params }); // @todo , this.splitviewCtrl); } /** * Open calendar events settings. */ openSettings(): void { - CoreNavHelper.instance.goInCurrentMainMenuTab('/calendar/settings'); + CoreNavigator.instance.navigateToSitePath('/calendar/settings'); } /** diff --git a/src/addons/calendar/services/calendar.ts b/src/addons/calendar/services/calendar.ts index 12a47a1b5..4644dded1 100644 --- a/src/addons/calendar/services/calendar.ts +++ b/src/addons/calendar/services/calendar.ts @@ -36,7 +36,7 @@ import { ApplicationInit, makeSingleton, Translate, Platform } from '@singletons import { AddonCalendarOfflineEventDBRecord } from './database/calendar-offline'; import { AddonCalendarMainMenuHandlerService } from './handlers/mainmenu'; import { SafeUrl } from '@angular/platform-browser'; -import { CoreNavHelper } from '@services/nav-helper'; +import { CoreNavigator } from '@services/navigator'; const ROOT_CACHE_KEY = 'mmaCalendar:'; @@ -350,7 +350,10 @@ export class AddonCalendarProvider { const site = await CoreSites.instance.getSite(notification.siteId); const pageName = this.getMainCalendarPagePath(site); - CoreNavHelper.instance.openInSiteMainMenu(pageName, { eventId: notification.eventId }, notification.siteId); + CoreNavigator.instance.navigateToSitePath( + pageName, + { params: { eventId: notification.eventId }, siteId: notification.siteId }, + ); } }, ); diff --git a/src/addons/calendar/services/handlers/view-link.ts b/src/addons/calendar/services/handlers/view-link.ts index 8df7419d2..1aa0bb8bd 100644 --- a/src/addons/calendar/services/handlers/view-link.ts +++ b/src/addons/calendar/services/handlers/view-link.ts @@ -16,7 +16,7 @@ import { Injectable } from '@angular/core'; import { Params } from '@angular/router'; import { CoreContentLinksHandlerBase } from '@features/contentlinks/classes/base-handler'; import { CoreContentLinksAction } from '@features/contentlinks/services/contentlinks-delegate'; -import { CoreNavHelper } from '@services/nav-helper'; +import { CoreNavigator } from '@services/navigator'; import { makeSingleton } from '@singletons'; import { AddonCalendar } from '../calendar'; @@ -54,7 +54,7 @@ export class AddonCalendarViewLinkHandlerService extends CoreContentLinksHandler stateParams.month = date.getMonth() + 1; // @todo: Add checkMenu param. - CoreNavHelper.instance.goInSite('/calendar/index', stateParams, siteId, true); + CoreNavigator.instance.navigateToSitePath('/calendar/index', { params: stateParams, siteId }); } else if (params.view == 'day') { // Daily view, open the page. @@ -68,7 +68,7 @@ export class AddonCalendarViewLinkHandlerService extends CoreContentLinksHandler stateParams.month = date.getMonth() + 1; stateParams.day = date.getDate(); - CoreNavHelper.instance.goInSite('/calendar/day', stateParams, siteId); + CoreNavigator.instance.navigateToSitePath('/calendar/day', { params: stateParams, siteId }); } else if (params.view == 'upcoming' || params.view == 'upcoming_mini') { // Upcoming view, open the calendar tab. @@ -78,7 +78,7 @@ export class AddonCalendarViewLinkHandlerService extends CoreContentLinksHandler }; // @todo: Add checkMenu param. - CoreNavHelper.instance.goInSite('/calendar/index', stateParams, siteId, true); + CoreNavigator.instance.navigateToSitePath('/calendar/index', { params: stateParams, siteId }); } },