From 2078c12571591e3a4acd7f9740d617870d698bbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 12 Mar 2024 15:37:00 +0100 Subject: [PATCH 1/4] MOBILE-3947 chore: Decouple constants from Addons used in core folder --- .../searchforums/services/block-handler.ts | 4 ++-- src/addons/blog/blog-lazy.module.ts | 4 ++-- src/addons/blog/blog.module.ts | 5 +++-- src/addons/blog/constants.ts | 15 ++++++++++++++ .../blog/services/handlers/course-option.ts | 4 ++-- src/addons/blog/services/handlers/mainmenu.ts | 5 ++--- src/addons/calendar/constants.ts | 15 ++++++++++++++ .../calendar/pages/edit-event/edit-event.ts | 7 ++++--- .../calendar/services/calendar-helper.ts | 3 ++- src/addons/calendar/services/calendar-sync.ts | 4 ++-- src/addons/calendar/services/calendar.ts | 20 +++++++++---------- .../mod/forum/components/index/index.ts | 5 ++--- src/addons/mod/forum/constants.ts | 15 ++++++++++++++ src/addons/mod/forum/forum.module.ts | 5 ++--- .../module-summary/module-summary.ts | 4 ++-- .../mainmenu/mainmenu-home-lazy.module.ts | 5 +---- .../reminders/services/database/reminders.ts | 4 ++-- src/core/features/sitehome/sitehome.module.ts | 1 - 18 files changed, 83 insertions(+), 42 deletions(-) create mode 100644 src/addons/blog/constants.ts create mode 100644 src/addons/calendar/constants.ts create mode 100644 src/addons/mod/forum/constants.ts diff --git a/src/addons/block/searchforums/services/block-handler.ts b/src/addons/block/searchforums/services/block-handler.ts index 58c27d0e1..b1425a34d 100644 --- a/src/addons/block/searchforums/services/block-handler.ts +++ b/src/addons/block/searchforums/services/block-handler.ts @@ -17,7 +17,7 @@ import { CoreBlockHandlerData } from '@features/block/services/block-delegate'; import { CoreBlockOnlyTitleComponent } from '@features/block/components/only-title-block/only-title-block'; import { CoreBlockBaseHandler } from '@features/block/classes/base-block-handler'; import { makeSingleton } from '@singletons'; -import { FORUM_SEARCH_PAGE_NAME } from '@addons/mod/forum/forum.module'; +import { ADDON_MOD_FORUM_SEARCH_PAGE_NAME } from '@addons/mod/forum/constants'; import { CoreCourseBlock } from '@features/course/services/course'; import { CoreSearchGlobalSearch } from '@features/search/services/global-search'; @@ -60,7 +60,7 @@ export class AddonBlockSearchForumsHandlerService extends CoreBlockBaseHandler { title: 'addon.block_searchforums.pluginname', class: 'addon-block-search-forums', component: CoreBlockOnlyTitleComponent, - link: FORUM_SEARCH_PAGE_NAME, + link: ADDON_MOD_FORUM_SEARCH_PAGE_NAME, linkParams: { courseId: instanceId }, }; } diff --git a/src/addons/blog/blog-lazy.module.ts b/src/addons/blog/blog-lazy.module.ts index 5eea47053..4ee04963b 100644 --- a/src/addons/blog/blog-lazy.module.ts +++ b/src/addons/blog/blog-lazy.module.ts @@ -21,7 +21,7 @@ import { CoreCommentsComponentsModule } from '@features/comments/components/comp import { CoreTagComponentsModule } from '@features/tag/components/components.module'; import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module'; -import { AddonBlogMainMenuHandlerService } from './services/handlers/mainmenu'; +import { ADDON_BLOG_MAINMENU_PAGE_NAME } from './constants'; import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module'; /** @@ -34,7 +34,7 @@ function buildRoutes(injector: Injector): Routes { return [ ...buildTabMainRoutes(injector, { data: { - mainMenuTabRoot: AddonBlogMainMenuHandlerService.PAGE_NAME, + mainMenuTabRoot: ADDON_BLOG_MAINMENU_PAGE_NAME, }, component: AddonBlogEntriesPage, }), diff --git a/src/addons/blog/blog.module.ts b/src/addons/blog/blog.module.ts index fca1d2bb5..b2dbfdde1 100644 --- a/src/addons/blog/blog.module.ts +++ b/src/addons/blog/blog.module.ts @@ -24,13 +24,14 @@ import { CoreTagAreaDelegate } from '@features/tag/services/tag-area-delegate'; import { CoreUserDelegate } from '@features/user/services/user-delegate'; import { AddonBlogCourseOptionHandler } from './services/handlers/course-option'; import { AddonBlogIndexLinkHandler } from './services/handlers/index-link'; -import { AddonBlogMainMenuHandler, AddonBlogMainMenuHandlerService } from './services/handlers/mainmenu'; +import { AddonBlogMainMenuHandler } from './services/handlers/mainmenu'; import { AddonBlogTagAreaHandler } from './services/handlers/tag-area'; import { AddonBlogUserHandler } from './services/handlers/user'; +import { ADDON_BLOG_MAINMENU_PAGE_NAME } from './constants'; const routes: Routes = [ { - path: AddonBlogMainMenuHandlerService.PAGE_NAME, + path: ADDON_BLOG_MAINMENU_PAGE_NAME, loadChildren: () => import('@addons/blog/blog-lazy.module').then(m => m.AddonBlogLazyModule), }, ]; diff --git a/src/addons/blog/constants.ts b/src/addons/blog/constants.ts new file mode 100644 index 000000000..572cd8f9e --- /dev/null +++ b/src/addons/blog/constants.ts @@ -0,0 +1,15 @@ +// (C) Copyright 2015 Moodle Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +export const ADDON_BLOG_MAINMENU_PAGE_NAME = 'blog'; diff --git a/src/addons/blog/services/handlers/course-option.ts b/src/addons/blog/services/handlers/course-option.ts index e9bf4fe7e..9a996d903 100644 --- a/src/addons/blog/services/handlers/course-option.ts +++ b/src/addons/blog/services/handlers/course-option.ts @@ -26,7 +26,7 @@ import { CoreSites } from '@services/sites'; import { CoreWSFile } from '@services/ws'; import { makeSingleton } from '@singletons'; import { AddonBlog } from '../blog'; -import { AddonBlogMainMenuHandlerService } from './mainmenu'; +import { ADDON_BLOG_MAINMENU_PAGE_NAME } from '@addons/blog/constants'; /** * Course nav handler. @@ -75,7 +75,7 @@ export class AddonBlogCourseOptionHandlerService implements CoreCourseOptionsHan return { title: 'addon.blog.blog', class: 'addon-blog-handler', - page: AddonBlogMainMenuHandlerService.PAGE_NAME, + page: ADDON_BLOG_MAINMENU_PAGE_NAME, }; } diff --git a/src/addons/blog/services/handlers/mainmenu.ts b/src/addons/blog/services/handlers/mainmenu.ts index 142a3d679..eb99ca346 100644 --- a/src/addons/blog/services/handlers/mainmenu.ts +++ b/src/addons/blog/services/handlers/mainmenu.ts @@ -16,6 +16,7 @@ import { Injectable } from '@angular/core'; import { CoreMainMenuHandler, CoreMainMenuHandlerData } from '@features/mainmenu/services/mainmenu-delegate'; import { makeSingleton } from '@singletons'; import { AddonBlog } from '../blog'; +import { ADDON_BLOG_MAINMENU_PAGE_NAME } from '@addons/blog/constants'; /** * Handler to inject an option into main menu. @@ -23,8 +24,6 @@ import { AddonBlog } from '../blog'; @Injectable({ providedIn: 'root' }) export class AddonBlogMainMenuHandlerService implements CoreMainMenuHandler { - static readonly PAGE_NAME = 'blog'; - name = 'AddonBlog'; priority = 500; @@ -42,7 +41,7 @@ export class AddonBlogMainMenuHandlerService implements CoreMainMenuHandler { return { icon: 'far-newspaper', title: 'addon.blog.siteblogheading', - page: AddonBlogMainMenuHandlerService.PAGE_NAME, + page: ADDON_BLOG_MAINMENU_PAGE_NAME, class: 'addon-blog-handler', }; } diff --git a/src/addons/calendar/constants.ts b/src/addons/calendar/constants.ts new file mode 100644 index 000000000..d4632c2b8 --- /dev/null +++ b/src/addons/calendar/constants.ts @@ -0,0 +1,15 @@ +// (C) Copyright 2015 Moodle Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +export const ADDON_CALENDAR_COMPONENT = 'AddonCalendarEvents'; diff --git a/src/addons/calendar/pages/edit-event/edit-event.ts b/src/addons/calendar/pages/edit-event/edit-event.ts index 653aa35b9..f95dec762 100644 --- a/src/addons/calendar/pages/edit-event/edit-event.ts +++ b/src/addons/calendar/pages/edit-event/edit-event.ts @@ -45,6 +45,7 @@ import { CoreForms } from '@singletons/form'; import { CoreReminders, CoreRemindersService, CoreRemindersUnits } from '@features/reminders/services/reminders'; import { CoreRemindersSetReminderMenuComponent } from '@features/reminders/components/set-reminder-menu/set-reminder-menu'; import moment from 'moment-timezone'; +import { ADDON_CALENDAR_COMPONENT } from '@addons/calendar/constants'; /** * Page that displays a form to create/edit an event. @@ -60,7 +61,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { @ViewChild('editEventForm') formElement!: ElementRef; title = 'addon.calendar.newevent'; - component = AddonCalendarProvider.COMPONENT; + component = ADDON_CALENDAR_COMPONENT; loaded = false; hasOffline = false; eventTypes: AddonCalendarEventTypeOption[] = []; @@ -179,7 +180,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { promises.push(AddonCalendarSync.waitForSync(AddonCalendarSyncProvider.SYNC_ID).then(async () => { // Do not block if the scope is already destroyed. if (!this.isDestroyed && this.eventId) { - CoreSync.blockOperation(AddonCalendarProvider.COMPONENT, eventId); + CoreSync.blockOperation(ADDON_CALENDAR_COMPONENT, eventId); } let eventForm: AddonCalendarEvent | AddonCalendarOfflineEventDBRecord | undefined; @@ -597,7 +598,7 @@ export class AddonCalendarEditEventPage implements OnInit, OnDestroy, CanLeave { */ protected unblockSync(): void { if (this.eventId) { - CoreSync.unblockOperation(AddonCalendarProvider.COMPONENT, this.eventId); + CoreSync.unblockOperation(ADDON_CALENDAR_COMPONENT, this.eventId); } } diff --git a/src/addons/calendar/services/calendar-helper.ts b/src/addons/calendar/services/calendar-helper.ts index ca154b7ee..be7426e56 100644 --- a/src/addons/calendar/services/calendar-helper.ts +++ b/src/addons/calendar/services/calendar-helper.ts @@ -38,6 +38,7 @@ import { CoreCategoryData } from '@features/courses/services/courses'; import { CoreTimeUtils } from '@services/utils/time'; import { CoreReminders, CoreRemindersService } from '@features/reminders/services/reminders'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; +import { ADDON_CALENDAR_COMPONENT } from '../constants'; /** * Context levels enumeration. @@ -330,7 +331,7 @@ export class AddonCalendarHelperProvider { const reminders = await CoreReminders.getReminders( { instanceId: eventId, - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, }, siteId, ); diff --git a/src/addons/calendar/services/calendar-sync.ts b/src/addons/calendar/services/calendar-sync.ts index cc9cb00b0..bad6607d5 100644 --- a/src/addons/calendar/services/calendar-sync.ts +++ b/src/addons/calendar/services/calendar-sync.ts @@ -21,7 +21,6 @@ import { CoreUtils } from '@services/utils/utils'; import { AddonCalendar, AddonCalendarEvent, - AddonCalendarProvider, AddonCalendarSubmitCreateUpdateFormDataWSParams, } from './calendar'; import { AddonCalendarOffline } from './calendar-offline'; @@ -30,6 +29,7 @@ import { makeSingleton, Translate } from '@singletons'; import { CoreSync, CoreSyncResult } from '@services/sync'; import { CoreNetworkError } from '@classes/errors/network-error'; import moment from 'moment-timezone'; +import { ADDON_CALENDAR_COMPONENT } from '../constants'; /** * Service to sync calendar. @@ -173,7 +173,7 @@ export class AddonCalendarSyncProvider extends CoreSyncBaseProvider { // Verify that event isn't blocked. - if (CoreSync.isBlocked(AddonCalendarProvider.COMPONENT, eventId, siteId)) { + if (CoreSync.isBlocked(ADDON_CALENDAR_COMPONENT, eventId, siteId)) { this.logger.debug('Cannot sync event ' + eventId + ' because it is blocked.'); throw new CoreSyncBlockedError(Translate.instant( diff --git a/src/addons/calendar/services/calendar.ts b/src/addons/calendar/services/calendar.ts index 9bafd3be7..97c601cfb 100644 --- a/src/addons/calendar/services/calendar.ts +++ b/src/addons/calendar/services/calendar.ts @@ -51,6 +51,7 @@ import { import { CoreReminderDBRecord } from '@features/reminders/services/database/reminders'; import { CoreEvents } from '@singletons/events'; import { CoreSiteWSPreSets } from '@classes/sites/authenticated-site'; +import { ADDON_CALENDAR_COMPONENT } from '../constants'; const ROOT_CACHE_KEY = 'mmaCalendar:'; @@ -103,7 +104,6 @@ declare module '@singletons/events' { export class AddonCalendarProvider { static readonly DAYS_INTERVAL = 30; - static readonly COMPONENT = 'AddonCalendarEvents'; static readonly STARTING_WEEK_DAY = 'addon_calendar_starting_week_day'; static readonly NEW_EVENT_EVENT = 'addon_calendar_new_event'; @@ -279,7 +279,7 @@ export class AddonCalendarProvider { )); promises.push(CoreReminders.removeReminders({ instanceId: eventId, - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, } , siteId)); await CoreUtils.ignoreErrors(Promise.all(promises)); @@ -292,7 +292,7 @@ export class AddonCalendarProvider { */ async initialize(): Promise { CoreLocalNotifications.registerClick( - AddonCalendarProvider.COMPONENT, + ADDON_CALENDAR_COMPONENT, async (notification) => { await ApplicationInit.donePromise; @@ -740,7 +740,7 @@ export class AddonCalendarProvider { const previousReminders = await CoreReminders.getReminders({ instanceId: event.id, - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, }, siteId); if (previousReminders.some((reminder) => reminder.timebefore === timebefore)) { @@ -753,7 +753,7 @@ export class AddonCalendarProvider { : ''; const reminder: CoreReminderData = { - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, instanceId: event.id, type: event.eventtype, time: event.timestart, @@ -887,7 +887,7 @@ export class AddonCalendarProvider { async getEventReminders(eventId: number, siteId?: string): Promise { return CoreReminders.getReminders({ instanceId: eventId, - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, }, siteId); } @@ -1448,12 +1448,12 @@ export class AddonCalendarProvider { // The event has already started, don't schedule it. // @TODO Decide when to completelly remove expired events. - return CoreReminders.cancelReminder(event.id, AddonCalendarProvider.COMPONENT, siteId); + return CoreReminders.cancelReminder(event.id, ADDON_CALENDAR_COMPONENT, siteId); } const reminders = await CoreReminders.getReminders({ instanceId: event.id, - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, }, siteId); await Promise.all(reminders.map(async (reminder) => { @@ -1572,7 +1572,7 @@ export class AddonCalendarProvider { const reminders = await CoreReminders.getReminders({ instanceId: event.id, - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, }, siteId); if (reminders.length > 0) { @@ -1725,7 +1725,7 @@ export class AddonCalendarProvider { { instanceId: result.event.id }, { instanceId: eventId, - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, }, siteId, ), diff --git a/src/addons/mod/forum/components/index/index.ts b/src/addons/mod/forum/components/index/index.ts index eb52118e8..f3fd74957 100644 --- a/src/addons/mod/forum/components/index/index.ts +++ b/src/addons/mod/forum/components/index/index.ts @@ -58,8 +58,7 @@ import { CoreListItemsManager } from '@classes/items-management/list-items-manag import { CoreRoutedItemsManagerSourcesTracker } from '@classes/items-management/routed-items-manager-sources-tracker'; import { CorePromisedValue } from '@classes/promised-value'; import { CoreNavigator } from '@services/navigator'; -import { FORUM_SEARCH_PAGE_NAME } from '@addons/mod/forum/forum.module'; - +import { ADDON_MOD_FORUM_SEARCH_PAGE_NAME } from '@addons/mod/forum/constants'; /** * Component that displays a forum entry page. */ @@ -342,7 +341,7 @@ export class AddonModForumIndexComponent extends CoreCourseModuleMainActivityCom return; } - await CoreNavigator.navigateToSitePath(FORUM_SEARCH_PAGE_NAME, { + await CoreNavigator.navigateToSitePath(ADDON_MOD_FORUM_SEARCH_PAGE_NAME, { params: { courseId: this.courseId, forumId: this.forum.id, diff --git a/src/addons/mod/forum/constants.ts b/src/addons/mod/forum/constants.ts new file mode 100644 index 000000000..e238a9e5f --- /dev/null +++ b/src/addons/mod/forum/constants.ts @@ -0,0 +1,15 @@ +// (C) Copyright 2015 Moodle Pty Ltd. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +export const ADDON_MOD_FORUM_SEARCH_PAGE_NAME = 'forum/search'; diff --git a/src/addons/mod/forum/forum.module.ts b/src/addons/mod/forum/forum.module.ts index 321aecb6a..0531275cc 100644 --- a/src/addons/mod/forum/forum.module.ts +++ b/src/addons/mod/forum/forum.module.ts @@ -41,6 +41,7 @@ import { AddonModForumPushClickHandler } from './services/handlers/push-click'; import { AddonModForumProvider } from './services/forum'; import { COURSE_CONTENTS_PATH } from '@features/course/course.module'; import { CoreCourseHelper } from '@features/course/services/course-helper'; +import { ADDON_MOD_FORUM_SEARCH_PAGE_NAME } from './constants'; /** * Get mod Forum services. @@ -61,11 +62,9 @@ export async function getModForumServices(): Promise[]> { ]; } -export const FORUM_SEARCH_PAGE_NAME = 'forum/search'; - const mainMenuRoutes: Routes = [ { - path: FORUM_SEARCH_PAGE_NAME, + path: ADDON_MOD_FORUM_SEARCH_PAGE_NAME, loadChildren: () => import('./forum-search-lazy.module').then(m => m.AddonModForumSearchLazyModule), }, { diff --git a/src/core/features/course/components/module-summary/module-summary.ts b/src/core/features/course/components/module-summary/module-summary.ts index e4f219605..42d3b28b0 100644 --- a/src/core/features/course/components/module-summary/module-summary.ts +++ b/src/core/features/course/components/module-summary/module-summary.ts @@ -14,7 +14,7 @@ import { CoreConstants, DownloadStatus } from '@/core/constants'; import { AddonBlog } from '@addons/blog/services/blog'; -import { AddonBlogMainMenuHandlerService } from '@addons/blog/services/handlers/mainmenu'; +import { ADDON_BLOG_MAINMENU_PAGE_NAME } from '@addons/blog/constants'; import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { Params } from '@angular/router'; import { CoreCourse } from '@features/course/services/course'; @@ -238,7 +238,7 @@ export class CoreCourseModuleSummaryComponent implements OnInit, OnDestroy { async gotoBlog(): Promise { const params: Params = { cmId: this.moduleId }; - await CoreNavigator.navigateToSitePath(AddonBlogMainMenuHandlerService.PAGE_NAME, { params }); + await CoreNavigator.navigateToSitePath(ADDON_BLOG_MAINMENU_PAGE_NAME, { params }); } /** diff --git a/src/core/features/mainmenu/mainmenu-home-lazy.module.ts b/src/core/features/mainmenu/mainmenu-home-lazy.module.ts index c84e2b91a..99d14e33d 100644 --- a/src/core/features/mainmenu/mainmenu-home-lazy.module.ts +++ b/src/core/features/mainmenu/mainmenu-home-lazy.module.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injector, NgModule } from '@angular/core'; -import { RouterModule, ROUTES, Routes } from '@angular/router'; +import { ROUTES, Routes } from '@angular/router'; import { CoreSharedModule } from '@/core/shared.module'; @@ -56,8 +56,5 @@ function buildRoutes(injector: Injector): Routes { declarations: [ CoreMainMenuHomePage, ], - exports: [ - RouterModule, - ], }) export class CoreMainMenuHomeLazyModule {} diff --git a/src/core/features/reminders/services/database/reminders.ts b/src/core/features/reminders/services/database/reminders.ts index 6d2713f36..00427ef0b 100644 --- a/src/core/features/reminders/services/database/reminders.ts +++ b/src/core/features/reminders/services/database/reminders.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { AddonCalendarProvider } from '@addons/calendar/services/calendar'; +import { ADDON_CALENDAR_COMPONENT } from '@addons/calendar/constants'; import { AddonCalendarEventDBRecord, EVENTS_TABLE } from '@addons/calendar/services/database/calendar'; import { SQLiteDB } from '@classes/sqlitedb'; import { CoreSiteSchema } from '@services/sites'; @@ -194,7 +194,7 @@ const createReminder = async ( reminderTime: number, ): Promise => { const reminder: CoreReminderData = { - component: AddonCalendarProvider.COMPONENT, + component: ADDON_CALENDAR_COMPONENT, instanceId: event.id, type: event.eventtype, timebefore: reminderTime, diff --git a/src/core/features/sitehome/sitehome.module.ts b/src/core/features/sitehome/sitehome.module.ts index 8000557c2..c968d4625 100644 --- a/src/core/features/sitehome/sitehome.module.ts +++ b/src/core/features/sitehome/sitehome.module.ts @@ -43,7 +43,6 @@ const mainMenuHomeRoutes: Routes = [ @NgModule({ imports: [CoreMainMenuHomeRoutingModule.forChild({ children: mainMenuHomeRoutes })], - exports: [CoreMainMenuHomeRoutingModule], providers: [ { provide: APP_INITIALIZER, From f7d2992ca4eb83c16b9d42c883872a1ba000622f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 12 Mar 2024 15:37:17 +0100 Subject: [PATCH 2/4] MOBILE-3947 compile: Remove module services without plugins --- .../bigbluebuttonbn/bigbluebuttonbn.module.ts | 15 +----- src/addons/mod/book/book.module.ts | 15 +----- src/addons/mod/chat/chat.module.ts | 28 +---------- src/addons/mod/choice/choice.module.ts | 19 +------ src/addons/mod/data/data.module.ts | 25 +--------- src/addons/mod/feedback/feedback.module.ts | 21 +------- src/addons/mod/folder/folder.module.ts | 17 +------ src/addons/mod/forum/forum.module.ts | 21 +------- src/addons/mod/glossary/glossary.module.ts | 21 +------- .../mod/h5pactivity/h5pactivity.module.ts | 17 +------ src/addons/mod/imscp/imscp.module.ts | 15 +----- src/addons/mod/lesson/lesson.module.ts | 21 +------- src/addons/mod/lti/lti.module.ts | 17 +------ src/addons/mod/page/page.module.ts | 17 +------ src/addons/mod/resource/resource.module.ts | 15 +----- src/addons/mod/scorm/scorm.module.ts | 21 +------- src/addons/mod/survey/survey.module.ts | 32 +----------- src/addons/mod/url/url.module.ts | 17 +------ src/addons/mod/wiki/wiki.module.ts | 19 +------ src/core/features/compile/services/compile.ts | 50 ++++--------------- upgrade.txt | 1 + 21 files changed, 30 insertions(+), 394 deletions(-) diff --git a/src/addons/mod/bigbluebuttonbn/bigbluebuttonbn.module.ts b/src/addons/mod/bigbluebuttonbn/bigbluebuttonbn.module.ts index e12818f5a..d24550af8 100644 --- a/src/addons/mod/bigbluebuttonbn/bigbluebuttonbn.module.ts +++ b/src/addons/mod/bigbluebuttonbn/bigbluebuttonbn.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; @@ -22,19 +22,6 @@ import { AddonModBBBIndexLinkHandler } from './services/handlers/index-link'; import { AddonModBBBListLinkHandler } from './services/handlers/list-link'; import { AddonModBBBModuleHandler, ADDON_MOD_BBB_MAIN_MENU_PAGE_NAME } from './services/handlers/module'; -/** - * Get mod BBB services. - * - * @returns Returns mod BBB services. - */ -export async function getModBBBServices(): Promise[]> { - const { AddonModBBBService } = await import('@addons/mod/bigbluebuttonbn/services/bigbluebuttonbn'); - - return [ - AddonModBBBService, - ]; -} - const routes: Routes = [ { path: ADDON_MOD_BBB_MAIN_MENU_PAGE_NAME, diff --git a/src/addons/mod/book/book.module.ts b/src/addons/mod/book/book.module.ts index 08aa7cc42..5514fac89 100644 --- a/src/addons/mod/book/book.module.ts +++ b/src/addons/mod/book/book.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; @@ -28,19 +28,6 @@ import { AddonModBookTagAreaHandler } from './services/handlers/tag-area'; import { CORE_SITE_SCHEMAS } from '@services/sites'; import { BOOK_SITE_SCHEMA } from './services/database/book'; -/** - * Get mod book services. - * - * @returns Returns mod book services. - */ -export async function getModBookServices(): Promise[]> { - const { AddonModBookProvider } = await import('@addons/mod/book/services/book'); - - return [ - AddonModBookProvider, - ]; -} - const routes: Routes = [ { path: AddonModBookModuleHandlerService.PAGE_NAME, diff --git a/src/addons/mod/chat/chat.module.ts b/src/addons/mod/chat/chat.module.ts index d3127557c..0a0494558 100644 --- a/src/addons/mod/chat/chat.module.ts +++ b/src/addons/mod/chat/chat.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseHelper } from '@features/course/services/course-helper'; @@ -25,32 +25,6 @@ import { AddonModChatModuleHandler } from './services/handlers/module'; import { getPrefetchHandlerInstance } from './services/handlers/prefetch'; import { ADDON_MOD_CHAT_COMPONENT, ADDON_MOD_CHAT_PAGE_NAME } from './constants'; -/** - * Get mod chat services. - * - * @returns Returns mod chat services. - */ -export async function getModChatServices(): Promise[]> { - const { AddonModChatProvider } = await import('@addons/mod/chat/services/chat'); - const { AddonModChatHelperProvider } = await import('@addons/mod/chat/services/chat-helper'); - - return [ - AddonModChatProvider, - AddonModChatHelperProvider, - ]; -} - -/** - * Get mod chat component modules. - * - * @returns Chat component modules. - */ -export async function getModChatComponentModules(): Promise { - const { AddonModChatComponentsModule } = await import('@addons/mod/chat/components/components.module'); - - return [AddonModChatComponentsModule]; -} - const routes: Routes = [ { path: ADDON_MOD_CHAT_PAGE_NAME, diff --git a/src/addons/mod/choice/choice.module.ts b/src/addons/mod/choice/choice.module.ts index 13df56be8..5d4bf37a6 100644 --- a/src/addons/mod/choice/choice.module.ts +++ b/src/addons/mod/choice/choice.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; @@ -31,23 +31,6 @@ import { AddonModChoiceModuleHandler, AddonModChoiceModuleHandlerService } from import { AddonModChoicePrefetchHandler } from './services/handlers/prefetch'; import { AddonModChoiceSyncCronHandler } from './services/handlers/sync-cron'; -/** - * Get mod choice services. - * - * @returns Returns mod choice services. - */ -export async function getModChoiceServices(): Promise[]> { - const { AddonModChoiceProvider } = await import('@addons/mod/choice/services/choice'); - const { AddonModChoiceOfflineProvider } = await import('@addons/mod/choice/services/choice-offline'); - const { AddonModChoiceSyncProvider } = await import('@addons/mod/choice/services/choice-sync'); - - return [ - AddonModChoiceProvider, - AddonModChoiceOfflineProvider, - AddonModChoiceSyncProvider, - ]; -} - const routes: Routes = [ { path: AddonModChoiceModuleHandlerService.PAGE_NAME, diff --git a/src/addons/mod/data/data.module.ts b/src/addons/mod/data/data.module.ts index 0075a3193..dc7816a58 100644 --- a/src/addons/mod/data/data.module.ts +++ b/src/addons/mod/data/data.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; @@ -34,30 +34,8 @@ import { AddonModDataShowLinkHandler } from './services/handlers/show-link'; import { AddonModDataSyncCronHandler } from './services/handlers/sync-cron'; import { AddonModDataTagAreaHandler } from './services/handlers/tag-area'; import { AddonModDataFieldModule } from './fields/field.module'; -import { AddonModDataComponentsModule } from './components/components.module'; import { CoreCourseHelper } from '@features/course/services/course-helper'; -/** - * Get mod data services. - * - * @returns Returns mod data services. - */ -export async function getModDataServices(): Promise[]> { - const { AddonModDataProvider } = await import('@addons/mod/data/services/data'); - const { AddonModDataOfflineProvider } = await import('@addons/mod/data/services/data-offline'); - const { AddonModDataSyncProvider } = await import('@addons/mod/data/services/data-sync'); - const { AddonModDataHelperProvider } = await import('@addons/mod/data/services/data-helper'); - const { AddonModDataFieldsDelegateService } = await import('@addons/mod/data/services/data-fields-delegate'); - - return [ - AddonModDataProvider, - AddonModDataHelperProvider, - AddonModDataSyncProvider, - AddonModDataOfflineProvider, - AddonModDataFieldsDelegateService, - ]; -} - const routes: Routes = [ { path: AddonModDataModuleHandlerService.PAGE_NAME, @@ -69,7 +47,6 @@ const routes: Routes = [ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), AddonModDataFieldModule, - AddonModDataComponentsModule, ], providers: [ { diff --git a/src/addons/mod/feedback/feedback.module.ts b/src/addons/mod/feedback/feedback.module.ts index efa8c98e3..4585e8a42 100644 --- a/src/addons/mod/feedback/feedback.module.ts +++ b/src/addons/mod/feedback/feedback.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseHelper } from '@features/course/services/course-helper'; @@ -37,25 +37,6 @@ import { AddonModFeedbackShowEntriesLinkHandler } from './services/handlers/show import { AddonModFeedbackShowNonRespondentsLinkHandler } from './services/handlers/show-non-respondents-link'; import { AddonModFeedbackSyncCronHandler } from './services/handlers/sync-cron'; -/** - * Get mod Feedback services. - * - * @returns Returns mod Feedback services. - */ -export async function getModFeedbackServices(): Promise[]> { - const { AddonModFeedbackProvider } = await import('@addons/mod/feedback/services/feedback'); - const { AddonModFeedbackOfflineProvider } = await import('@addons/mod/feedback/services/feedback-offline'); - const { AddonModFeedbackHelperProvider } = await import('@addons/mod/feedback/services/feedback-helper'); - const { AddonModFeedbackSyncProvider } = await import('@addons/mod/feedback/services/feedback-sync'); - - return [ - AddonModFeedbackProvider, - AddonModFeedbackOfflineProvider, - AddonModFeedbackHelperProvider, - AddonModFeedbackSyncProvider, - ]; -} - const routes: Routes = [ { path: AddonModFeedbackModuleHandlerService.PAGE_NAME, diff --git a/src/addons/mod/folder/folder.module.ts b/src/addons/mod/folder/folder.module.ts index 6b7b76677..963ec3ebe 100644 --- a/src/addons/mod/folder/folder.module.ts +++ b/src/addons/mod/folder/folder.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; @@ -26,21 +26,6 @@ import { AddonModFolderModuleHandler, AddonModFolderModuleHandlerService } from import { AddonModFolderPluginFileHandler } from './services/handlers/pluginfile'; import { AddonModFolderPrefetchHandler } from './services/handlers/prefetch'; -/** - * Get mod Folder services. - * - * @returns Returns mod Folder services. - */ -export async function getModFolderServices(): Promise[]> { - const { AddonModFolderProvider } = await import('@addons/mod/folder/services/folder'); - const { AddonModFolderHelperProvider } = await import('@addons/mod/folder/services/folder-helper'); - - return [ - AddonModFolderProvider, - AddonModFolderHelperProvider, - ]; -} - const routes: Routes = [ { path: AddonModFolderModuleHandlerService.PAGE_NAME, diff --git a/src/addons/mod/forum/forum.module.ts b/src/addons/mod/forum/forum.module.ts index 0531275cc..732fd1870 100644 --- a/src/addons/mod/forum/forum.module.ts +++ b/src/addons/mod/forum/forum.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { conditionalRoutes } from '@/app/app-routing.module'; @@ -43,25 +43,6 @@ import { COURSE_CONTENTS_PATH } from '@features/course/course.module'; import { CoreCourseHelper } from '@features/course/services/course-helper'; import { ADDON_MOD_FORUM_SEARCH_PAGE_NAME } from './constants'; -/** - * Get mod Forum services. - * - * @returns Returns mod Forum services. - */ -export async function getModForumServices(): Promise[]> { - const { AddonModForumProvider } = await import('@addons/mod/forum/services/forum'); - const { AddonModForumOfflineProvider } = await import('@addons/mod/forum/services/forum-offline'); - const { AddonModForumHelperProvider } = await import('@addons/mod/forum/services/forum-helper'); - const { AddonModForumSyncProvider } = await import('@addons/mod/forum/services/forum-sync'); - - return [ - AddonModForumProvider, - AddonModForumOfflineProvider, - AddonModForumHelperProvider, - AddonModForumSyncProvider, - ]; -} - const mainMenuRoutes: Routes = [ { path: ADDON_MOD_FORUM_SEARCH_PAGE_NAME, diff --git a/src/addons/mod/glossary/glossary.module.ts b/src/addons/mod/glossary/glossary.module.ts index 19f4ce909..2e92a32f2 100644 --- a/src/addons/mod/glossary/glossary.module.ts +++ b/src/addons/mod/glossary/glossary.module.ts @@ -13,7 +13,7 @@ // limitations under the License. import { conditionalRoutes } from '@/app/app-routing.module'; -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { COURSE_CONTENTS_PATH } from '@features/course/course.module'; @@ -38,25 +38,6 @@ import { AddonModGlossaryPrefetchHandler } from './services/handlers/prefetch'; import { AddonModGlossarySyncCronHandler } from './services/handlers/sync-cron'; import { AddonModGlossaryTagAreaHandler } from './services/handlers/tag-area'; -/** - * Get mod Glossary services. - * - * @returns Returns mod Glossary services. - */ -export async function getModGlossaryServices(): Promise[]> { - const { AddonModGlossaryProvider } = await import('@addons/mod/glossary/services/glossary'); - const { AddonModGlossaryOfflineProvider } = await import('@addons/mod/glossary/services/glossary-offline'); - const { AddonModGlossarySyncProvider } = await import('@addons/mod/glossary/services/glossary-sync'); - const { AddonModGlossaryHelperProvider } = await import('@addons/mod/glossary/services/glossary-helper'); - - return [ - AddonModGlossaryProvider, - AddonModGlossaryOfflineProvider, - AddonModGlossarySyncProvider, - AddonModGlossaryHelperProvider, - ]; -} - const mainMenuRoutes: Routes = [ // Link handlers navigation. { diff --git a/src/addons/mod/h5pactivity/h5pactivity.module.ts b/src/addons/mod/h5pactivity/h5pactivity.module.ts index 11cbc8afd..3cfc1cf59 100644 --- a/src/addons/mod/h5pactivity/h5pactivity.module.ts +++ b/src/addons/mod/h5pactivity/h5pactivity.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; @@ -26,21 +26,6 @@ import { AddonModH5PActivityPrefetchHandler } from './services/handlers/prefetch import { AddonModH5PActivityReportLinkHandler } from './services/handlers/report-link'; import { AddonModH5PActivitySyncCronHandler } from './services/handlers/sync-cron'; -/** - * Get mod H5P activity services. - * - * @returns Returns mod H5P activity services. - */ -export async function getModH5PActivityServices(): Promise[]> { - const { AddonModH5PActivityProvider } = await import('@addons/mod/h5pactivity/services/h5pactivity'); - const { AddonModH5PActivitySyncProvider } = await import('@addons/mod/h5pactivity/services/h5pactivity-sync'); - - return [ - AddonModH5PActivityProvider, - AddonModH5PActivitySyncProvider, - ]; -} - const routes: Routes = [ { path: AddonModH5PActivityModuleHandlerService.PAGE_NAME, diff --git a/src/addons/mod/imscp/imscp.module.ts b/src/addons/mod/imscp/imscp.module.ts index 56489df0e..f8930e93b 100644 --- a/src/addons/mod/imscp/imscp.module.ts +++ b/src/addons/mod/imscp/imscp.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; @@ -26,19 +26,6 @@ import { AddonModImscpModuleHandler, AddonModImscpModuleHandlerService } from '. import { AddonModImscpPluginFileHandler } from './services/handlers/pluginfile'; import { AddonModImscpPrefetchHandler } from './services/handlers/prefetch'; -/** - * Get mod Imscp services. - * - * @returns Returns mod Imscp services. - */ -export async function getModImscpServices(): Promise[]> { - const { AddonModImscpProvider } = await import('@addons/mod/imscp/services/imscp'); - - return [ - AddonModImscpProvider, - ]; -} - const routes: Routes = [ { path: AddonModImscpModuleHandlerService.PAGE_NAME, diff --git a/src/addons/mod/lesson/lesson.module.ts b/src/addons/mod/lesson/lesson.module.ts index e3631d637..fb9216ee1 100644 --- a/src/addons/mod/lesson/lesson.module.ts +++ b/src/addons/mod/lesson/lesson.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseHelper } from '@features/course/services/course-helper'; @@ -35,25 +35,6 @@ import { AddonModLessonReportLinkHandler } from './services/handlers/report-link import { AddonModLessonSyncCronHandler } from './services/handlers/sync-cron'; import { AddonModLessonProvider } from './services/lesson'; -/** - * Get mod Lesson services. - * - * @returns Returns mod Lesson services. - */ -export async function getModLessonServices(): Promise[]> { - const { AddonModLessonProvider } = await import('@addons/mod/lesson/services/lesson'); - const { AddonModLessonOfflineProvider } = await import('@addons/mod/lesson/services/lesson-offline'); - const { AddonModLessonSyncProvider } = await import('@addons/mod/lesson/services/lesson-sync'); - const { AddonModLessonHelperProvider } = await import('@addons/mod/lesson/services/lesson-helper'); - - return [ - AddonModLessonProvider, - AddonModLessonOfflineProvider, - AddonModLessonSyncProvider, - AddonModLessonHelperProvider, - ]; -} - const routes: Routes = [ { path: AddonModLessonModuleHandlerService.PAGE_NAME, diff --git a/src/addons/mod/lti/lti.module.ts b/src/addons/mod/lti/lti.module.ts index 1deaff582..7a91fa3db 100644 --- a/src/addons/mod/lti/lti.module.ts +++ b/src/addons/mod/lti/lti.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; @@ -25,21 +25,6 @@ import { AddonModLtiModuleHandler, AddonModLtiModuleHandlerService } from './ser import { AddonModLtiPrefetchHandler } from './services/handlers/prefetch'; import { AddonModLtiHelper } from './services/lti-helper'; -/** - * Get mod Lti services. - * - * @returns Returns mod Lti services. - */ -export async function getModLtiServices(): Promise[]> { - const { AddonModLtiProvider } = await import('@addons/mod/lti/services/lti'); - const { AddonModLtiHelperProvider } = await import('@addons/mod/lti/services/lti-helper'); - - return [ - AddonModLtiProvider, - AddonModLtiHelperProvider, - ]; -} - const routes: Routes = [ { path: AddonModLtiModuleHandlerService.PAGE_NAME, diff --git a/src/addons/mod/page/page.module.ts b/src/addons/mod/page/page.module.ts index 7bc2d58a9..d356586eb 100644 --- a/src/addons/mod/page/page.module.ts +++ b/src/addons/mod/page/page.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; @@ -26,21 +26,6 @@ import { AddonModPageModuleHandler, AddonModPageModuleHandlerService } from './s import { AddonModPagePluginFileHandler } from './services/handlers/pluginfile'; import { AddonModPagePrefetchHandler } from './services/handlers/prefetch'; -/** - * Get mod Page services. - * - * @returns Returns mod Page services. - */ -export async function getModPageServices(): Promise[]> { - const { AddonModPageProvider } = await import('@addons/mod/page/services/page'); - const { AddonModPageHelperProvider } = await import('@addons/mod/page/services/page-helper'); - - return [ - AddonModPageProvider, - AddonModPageHelperProvider, - ]; -} - const routes: Routes = [ { path: AddonModPageModuleHandlerService.PAGE_NAME, diff --git a/src/addons/mod/resource/resource.module.ts b/src/addons/mod/resource/resource.module.ts index bb06f3432..349c59a90 100644 --- a/src/addons/mod/resource/resource.module.ts +++ b/src/addons/mod/resource/resource.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; @@ -26,19 +26,6 @@ import { AddonModResourceModuleHandlerService, AddonModResourceModuleHandler } f import { AddonModResourcePluginFileHandler } from './services/handlers/pluginfile'; import { AddonModResourcePrefetchHandler } from './services/handlers/prefetch'; -/** - * Get mod Resource services. - * - * @returns Returns mod Resource services. - */ -export async function getModResourceServices(): Promise[]> { - const { AddonModResourceProvider } = await import('@addons/mod/resource/services/resource'); - - return [ - AddonModResourceProvider, - ]; -} - const routes: Routes = [ { path: AddonModResourceModuleHandlerService.PAGE_NAME, diff --git a/src/addons/mod/scorm/scorm.module.ts b/src/addons/mod/scorm/scorm.module.ts index 68c9a3266..643b03890 100644 --- a/src/addons/mod/scorm/scorm.module.ts +++ b/src/addons/mod/scorm/scorm.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseHelper } from '@features/course/services/course-helper'; @@ -34,25 +34,6 @@ import { AddonModScormPrefetchHandler } from './services/handlers/prefetch'; import { AddonModScormSyncCronHandler } from './services/handlers/sync-cron'; import { AddonModScormProvider } from './services/scorm'; -/** - * Get mod Scorm services. - * - * @returns Returns mod Scorm services. - */ -export async function getModScormServices(): Promise[]> { - const { AddonModScormProvider } = await import('@addons/mod/scorm/services/scorm'); - const { AddonModScormOfflineProvider } = await import('@addons/mod/scorm/services/scorm-offline'); - const { AddonModScormHelperProvider } = await import('@addons/mod/scorm/services/scorm-helper'); - const { AddonModScormSyncProvider } = await import('@addons/mod/scorm/services/scorm-sync'); - - return [ - AddonModScormProvider, - AddonModScormOfflineProvider, - AddonModScormHelperProvider, - AddonModScormSyncProvider, - ]; -} - const routes: Routes = [ { path: AddonModScormModuleHandlerService.PAGE_NAME, diff --git a/src/addons/mod/survey/survey.module.ts b/src/addons/mod/survey/survey.module.ts index ac12ab352..707f22845 100644 --- a/src/addons/mod/survey/survey.module.ts +++ b/src/addons/mod/survey/survey.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; @@ -28,36 +28,6 @@ import { getPrefetchHandlerInstance } from './services/handlers/prefetch'; import { getCronHandlerInstance } from './services/handlers/sync-cron'; import { ADDON_MOD_SURVEY_PAGE_NAME } from '@addons/mod/survey/constants'; -/** - * Get mod Survey services. - * - * @returns Returns mod Survey services. - */ -export async function getModSurveyServices(): Promise[]> { - const { AddonModSurveyProvider } = await import('@addons/mod/survey/services/survey'); - const { AddonModSurveyOfflineProvider } = await import('@addons/mod/survey/services/survey-offline'); - const { AddonModSurveySyncProvider } = await import('@addons/mod/survey/services/survey-sync'); - const { AddonModSurveyHelperProvider } = await import('@addons/mod/survey/services/survey-helper'); - - return [ - AddonModSurveyProvider, - AddonModSurveyHelperProvider, - AddonModSurveySyncProvider, - AddonModSurveyOfflineProvider, - ]; -} - -/** - * Get survey component modules. - * - * @returns Survey component modules. - */ -export async function getModSurveyComponentModules(): Promise { - const { AddonModSurveyComponentsModule } = await import('@addons/mod/survey/components/components.module'); - - return [AddonModSurveyComponentsModule]; -} - const routes: Routes = [ { path: ADDON_MOD_SURVEY_PAGE_NAME, diff --git a/src/addons/mod/url/url.module.ts b/src/addons/mod/url/url.module.ts index 215faea1d..5a354c96c 100644 --- a/src/addons/mod/url/url.module.ts +++ b/src/addons/mod/url/url.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; @@ -25,21 +25,6 @@ import { AddonModUrlModuleHandler } from './services/handlers/module'; import { AddonModUrlPrefetchHandler } from './services/handlers/prefetch'; import { ADDON_MOD_URL_PAGE_NAME } from './constants'; -/** - * Get mod Url services. - * - * @returns Returns mod Url services. - */ -export async function getModUrlServices(): Promise[]> { - const { AddonModUrlProvider } = await import('@addons/mod/url/services/url'); - const { AddonModUrlHelperProvider } = await import('@addons/mod/url/services/url-helper'); - - return [ - AddonModUrlProvider, - AddonModUrlHelperProvider, - ]; -} - const routes: Routes = [ { path: ADDON_MOD_URL_PAGE_NAME, diff --git a/src/addons/mod/wiki/wiki.module.ts b/src/addons/mod/wiki/wiki.module.ts index 2686d4f73..18dbef296 100644 --- a/src/addons/mod/wiki/wiki.module.ts +++ b/src/addons/mod/wiki/wiki.module.ts @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -import { APP_INITIALIZER, NgModule, Type } from '@angular/core'; +import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseHelper } from '@features/course/services/course-helper'; @@ -35,23 +35,6 @@ import { AddonModWikiSyncCronHandler } from './services/handlers/sync-cron'; import { AddonModWikiTagAreaHandler } from './services/handlers/tag-area'; import { AddonModWikiProvider } from './services/wiki'; -/** - * Get mod Wiki services. - * - * @returns Returns mod Wiki services. - */ -export async function getModWikiServices(): Promise[]> { - const { AddonModWikiProvider } = await import('@addons/mod/wiki/services/wiki'); - const { AddonModWikiOfflineProvider } = await import('@addons/mod/wiki/services/wiki-offline'); - const { AddonModWikiSyncProvider } = await import('@addons/mod/wiki/services/wiki-sync'); - - return [ - AddonModWikiProvider, - AddonModWikiOfflineProvider, - AddonModWikiSyncProvider, - ]; -} - const routes: Routes = [ { path: AddonModWikiModuleHandlerService.PAGE_NAME, diff --git a/src/core/features/compile/services/compile.ts b/src/core/features/compile/services/compile.ts index fff30cd5f..310f92da0 100644 --- a/src/core/features/compile/services/compile.ts +++ b/src/core/features/compile/services/compile.ts @@ -130,31 +130,13 @@ import { getCourseCompletionServices } from '@addons/coursecompletion/coursecomp import { getMessageOutputServices } from '@addons/messageoutput/messageoutput.module'; import { getMessagesServices } from '@addons/messages/messages.module'; import { getModAssignServices } from '@addons/mod/assign/assign.module'; -import { getModBookServices } from '@addons/mod/book/book.module'; -import { getModChatServices, getModChatComponentModules } from '@addons/mod/chat/chat.module'; -import { getModChoiceServices } from '@addons/mod/choice/choice.module'; -import { getModFeedbackServices } from '@addons/mod/feedback/feedback.module'; -import { getModFolderServices } from '@addons/mod/folder/folder.module'; -import { getModForumServices } from '@addons/mod/forum/forum.module'; -import { getModGlossaryServices } from '@addons/mod/glossary/glossary.module'; -import { getModH5PActivityServices } from '@addons/mod/h5pactivity/h5pactivity.module'; -import { getModImscpServices } from '@addons/mod/imscp/imscp.module'; -import { getModLessonServices } from '@addons/mod/lesson/lesson.module'; -import { getModLtiServices } from '@addons/mod/lti/lti.module'; -import { getModPageServices } from '@addons/mod/page/page.module'; import { getModQuizServices } from '@addons/mod/quiz/quiz.module'; -import { getModResourceServices } from '@addons/mod/resource/resource.module'; -import { getModScormServices } from '@addons/mod/scorm/scorm.module'; -import { getModSurveyComponentModules, getModSurveyServices } from '@addons/mod/survey/survey.module'; -import { getModUrlServices } from '@addons/mod/url/url.module'; -import { getModWikiServices } from '@addons/mod/wiki/wiki.module'; import { getModWorkshopComponentModules, getModWorkshopServices } from '@addons/mod/workshop/workshop.module'; import { getNotesServices } from '@addons/notes/notes.module'; import { getNotificationsServices } from '@addons/notifications/notifications.module'; import { getPrivateFilesServices } from '@addons/privatefiles/privatefiles.module'; // Import some addon modules that define components, directives and pipes. Only import the important ones. -import { AddonModAssignComponentsModule } from '@addons/mod/assign/components/components.module'; import { CorePromisedValue } from '@classes/promised-value'; import { CorePlatform } from '@services/platform'; @@ -177,15 +159,20 @@ export class CoreCompileProvider { // List of imports for dynamic module. Since the template can have any component we need to import all core components modules. protected readonly IMPORTS = [ - CoreSharedModule, CoreCourseComponentsModule, CoreCoursesComponentsModule, CoreUserComponentsModule, - CoreCourseDirectivesModule, CoreQuestionComponentsModule, AddonModAssignComponentsModule, - CoreBlockComponentsModule, CoreEditorComponentsModule, CoreSearchComponentsModule, CoreSitePluginsDirectivesModule, + CoreSharedModule, + CoreCourseComponentsModule, + CoreCoursesComponentsModule, + CoreUserComponentsModule, + CoreCourseDirectivesModule, + CoreQuestionComponentsModule, + CoreBlockComponentsModule, + CoreEditorComponentsModule, + CoreSearchComponentsModule, + CoreSitePluginsDirectivesModule, ]; protected readonly LAZY_IMPORTS = [ getModWorkshopComponentModules, - getModSurveyComponentModules, - getModChatComponentModules, ]; constructor(protected injector: Injector) { @@ -393,24 +380,7 @@ export class CoreCompileProvider { getMessageOutputServices(), getMessagesServices(), getModAssignServices(), - getModBookServices(), - getModChatServices(), - getModChoiceServices(), - getModFeedbackServices(), - getModFolderServices(), - getModForumServices(), - getModGlossaryServices(), - getModH5PActivityServices(), - getModImscpServices(), - getModLessonServices(), - getModLtiServices(), - getModPageServices(), getModQuizServices(), - getModResourceServices(), - getModScormServices(), - getModSurveyServices(), - getModUrlServices(), - getModWikiServices(), getModWorkshopServices(), getNotesServices(), getNotificationsServices(), diff --git a/upgrade.txt b/upgrade.txt index 1d41a4d00..21bdec12d 100644 --- a/upgrade.txt +++ b/upgrade.txt @@ -15,6 +15,7 @@ For more information about upgrading, read the official documentation: https://m - Due to a breaking change in cordova-plugin-file, avoid using FileEntry.toURL(). Use CoreFileProvider.getFileEntryURL instead. - FileTransfer service is no longer available, now we recommend use window.FileTransfer instead. - CSS variable --font-size-normal has been deprecated in favor of --font-size-md. + - Activity modules services that does not admit plugins are not avaible for site plugins anymore. === 4.3.0 === From f6b9ce021292277d1dcc66d0966eb6f7121b16dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 12 Mar 2024 14:44:33 +0100 Subject: [PATCH 3/4] MOBILE-3947 chore: Remove import of components module in activity module --- src/addons/mod/assign/assign.module.ts | 13 +++++++++++-- .../mod/bigbluebuttonbn/bigbluebuttonbn.module.ts | 2 -- src/addons/mod/book/book.module.ts | 2 -- src/addons/mod/choice/choice.module.ts | 2 -- src/addons/mod/feedback/feedback.module.ts | 2 -- src/addons/mod/folder/folder.module.ts | 2 -- src/addons/mod/forum/forum.module.ts | 2 -- src/addons/mod/glossary/glossary.module.ts | 2 -- src/addons/mod/h5pactivity/h5pactivity.module.ts | 2 -- src/addons/mod/imscp/imscp.module.ts | 2 -- src/addons/mod/lesson/lesson.module.ts | 2 -- src/addons/mod/lti/lti.module.ts | 2 -- src/addons/mod/page/page.module.ts | 2 -- src/addons/mod/quiz/quiz.module.ts | 13 +++++++++++-- src/addons/mod/resource/resource.module.ts | 2 -- src/addons/mod/scorm/scorm.module.ts | 2 -- src/addons/mod/url/url.module.ts | 2 -- src/addons/mod/wiki/wiki.module.ts | 2 -- src/core/features/compile/services/compile.ts | 6 ++++-- 19 files changed, 26 insertions(+), 38 deletions(-) diff --git a/src/addons/mod/assign/assign.module.ts b/src/addons/mod/assign/assign.module.ts index 349fa9ee5..9203223a9 100644 --- a/src/addons/mod/assign/assign.module.ts +++ b/src/addons/mod/assign/assign.module.ts @@ -22,7 +22,6 @@ import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-ro import { CorePushNotificationsDelegate } from '@features/pushnotifications/services/push-delegate'; import { CoreCronDelegate } from '@services/cron'; import { CORE_SITE_SCHEMAS } from '@services/sites'; -import { AddonModAssignComponentsModule } from './components/components.module'; import { AddonModAssignFeedbackModule } from './feedback/feedback.module'; import { AddonModAssignProvider } from './services/assign'; import { OFFLINE_SITE_SCHEMA } from './services/database/assign'; @@ -57,6 +56,17 @@ export async function getModAssignServices(): Promise[]> { ]; } +/** + * Get assign component modules. + * + * @returns Assign component modules. + */ +export async function getModAssignComponentModules(): Promise { + const { AddonModAssignComponentsModule } = await import('@addons/mod/assign/components/components.module'); + + return [AddonModAssignComponentsModule]; +} + const routes: Routes = [ { path: AddonModAssignModuleHandlerService.PAGE_NAME, @@ -67,7 +77,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModAssignComponentsModule, AddonModAssignSubmissionModule, AddonModAssignFeedbackModule, ], diff --git a/src/addons/mod/bigbluebuttonbn/bigbluebuttonbn.module.ts b/src/addons/mod/bigbluebuttonbn/bigbluebuttonbn.module.ts index d24550af8..131966598 100644 --- a/src/addons/mod/bigbluebuttonbn/bigbluebuttonbn.module.ts +++ b/src/addons/mod/bigbluebuttonbn/bigbluebuttonbn.module.ts @@ -17,7 +17,6 @@ import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; -import { AddonModBBBComponentsModule } from './components/components.module'; import { AddonModBBBIndexLinkHandler } from './services/handlers/index-link'; import { AddonModBBBListLinkHandler } from './services/handlers/list-link'; import { AddonModBBBModuleHandler, ADDON_MOD_BBB_MAIN_MENU_PAGE_NAME } from './services/handlers/module'; @@ -32,7 +31,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModBBBComponentsModule, ], providers: [ { diff --git a/src/addons/mod/book/book.module.ts b/src/addons/mod/book/book.module.ts index 5514fac89..82c5f9f33 100644 --- a/src/addons/mod/book/book.module.ts +++ b/src/addons/mod/book/book.module.ts @@ -19,7 +19,6 @@ import { CoreCourseModuleDelegate } from '@features/course/services/module-deleg import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreTagAreaDelegate } from '@features/tag/services/tag-area-delegate'; -import { AddonModBookComponentsModule } from './components/components.module'; import { AddonModBookModuleHandler, AddonModBookModuleHandlerService } from './services/handlers/module'; import { AddonModBookIndexLinkHandler } from './services/handlers/index-link'; import { AddonModBookListLinkHandler } from './services/handlers/list-link'; @@ -38,7 +37,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModBookComponentsModule, ], providers: [ { diff --git a/src/addons/mod/choice/choice.module.ts b/src/addons/mod/choice/choice.module.ts index 5d4bf37a6..dbf056f0f 100644 --- a/src/addons/mod/choice/choice.module.ts +++ b/src/addons/mod/choice/choice.module.ts @@ -22,7 +22,6 @@ import { CoreCourseModulePrefetchDelegate } from '@features/course/services/modu import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreCronDelegate } from '@services/cron'; import { CORE_SITE_SCHEMAS } from '@services/sites'; -import { AddonModChoiceComponentsModule } from './components/components.module'; import { AddonModChoiceProvider } from './services/choice'; import { OFFLINE_SITE_SCHEMA } from './services/database/choice'; import { AddonModChoiceIndexLinkHandler } from './services/handlers/index-link'; @@ -41,7 +40,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModChoiceComponentsModule, ], providers: [ { diff --git a/src/addons/mod/feedback/feedback.module.ts b/src/addons/mod/feedback/feedback.module.ts index 4585e8a42..a13902749 100644 --- a/src/addons/mod/feedback/feedback.module.ts +++ b/src/addons/mod/feedback/feedback.module.ts @@ -22,7 +22,6 @@ import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-ro import { CorePushNotificationsDelegate } from '@features/pushnotifications/services/push-delegate'; import { CoreCronDelegate } from '@services/cron'; import { CORE_SITE_SCHEMAS } from '@services/sites'; -import { AddonModFeedbackComponentsModule } from './components/components.module'; import { OFFLINE_SITE_SCHEMA } from './services/database/feedback'; import { AddonModFeedbackProvider } from './services/feedback'; import { AddonModFeedbackAnalysisLinkHandler } from './services/handlers/analysis-link'; @@ -47,7 +46,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModFeedbackComponentsModule, ], providers: [ { diff --git a/src/addons/mod/folder/folder.module.ts b/src/addons/mod/folder/folder.module.ts index 963ec3ebe..f27d0ddac 100644 --- a/src/addons/mod/folder/folder.module.ts +++ b/src/addons/mod/folder/folder.module.ts @@ -19,7 +19,6 @@ import { CoreCourseModuleDelegate } from '@features/course/services/module-deleg import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CorePluginFileDelegate } from '@services/plugin-file-delegate'; -import { AddonModFolderComponentsModule } from './components/components.module'; import { AddonModFolderIndexLinkHandler } from './services/handlers/index-link'; import { AddonModFolderListLinkHandler } from './services/handlers/list-link'; import { AddonModFolderModuleHandler, AddonModFolderModuleHandlerService } from './services/handlers/module'; @@ -36,7 +35,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModFolderComponentsModule, ], providers: [ { diff --git a/src/addons/mod/forum/forum.module.ts b/src/addons/mod/forum/forum.module.ts index 732fd1870..6c7d4479a 100644 --- a/src/addons/mod/forum/forum.module.ts +++ b/src/addons/mod/forum/forum.module.ts @@ -22,7 +22,6 @@ import { CoreCourseModuleDelegate } from '@features/course/services/module-deleg import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreScreen } from '@services/screen'; -import { AddonModForumComponentsModule } from './components/components.module'; import { AddonModForumModuleHandler, AddonModForumModuleHandlerService } from './services/handlers/module'; import { SITE_SCHEMA } from './services/database/offline'; import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; @@ -94,7 +93,6 @@ const courseContentsRoutes: Routes = conditionalRoutes( imports: [ CoreMainMenuTabRoutingModule.forChild(mainMenuRoutes), CoreCourseContentsRoutingModule.forChild({ children: courseContentsRoutes }), - AddonModForumComponentsModule, ], providers: [ { diff --git a/src/addons/mod/glossary/glossary.module.ts b/src/addons/mod/glossary/glossary.module.ts index 2e92a32f2..f7fe4c4f4 100644 --- a/src/addons/mod/glossary/glossary.module.ts +++ b/src/addons/mod/glossary/glossary.module.ts @@ -26,7 +26,6 @@ import { CoreTagAreaDelegate } from '@features/tag/services/tag-area-delegate'; import { CoreCronDelegate } from '@services/cron'; import { CoreScreen } from '@services/screen'; import { CORE_SITE_SCHEMAS } from '@services/sites'; -import { AddonModGlossaryComponentsModule } from './components/components.module'; import { SITE_SCHEMA, OFFLINE_SITE_SCHEMA } from './services/database/glossary'; import { AddonModGlossaryProvider } from './services/glossary'; import { AddonModGlossaryEditLinkHandler } from './services/handlers/edit-link'; @@ -86,7 +85,6 @@ const courseContentsRoutes: Routes = conditionalRoutes( imports: [ CoreMainMenuTabRoutingModule.forChild(mainMenuRoutes), CoreCourseContentsRoutingModule.forChild({ children: courseContentsRoutes }), - AddonModGlossaryComponentsModule, ], providers: [ { diff --git a/src/addons/mod/h5pactivity/h5pactivity.module.ts b/src/addons/mod/h5pactivity/h5pactivity.module.ts index 3cfc1cf59..a5a411de0 100644 --- a/src/addons/mod/h5pactivity/h5pactivity.module.ts +++ b/src/addons/mod/h5pactivity/h5pactivity.module.ts @@ -19,7 +19,6 @@ import { CoreCourseModuleDelegate } from '@features/course/services/module-deleg import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreCronDelegate } from '@services/cron'; -import { AddonModH5PActivityComponentsModule } from './components/components.module'; import { AddonModH5PActivityIndexLinkHandler } from './services/handlers/index-link'; import { AddonModH5PActivityModuleHandler, AddonModH5PActivityModuleHandlerService } from './services/handlers/module'; import { AddonModH5PActivityPrefetchHandler } from './services/handlers/prefetch'; @@ -36,7 +35,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModH5PActivityComponentsModule, ], providers: [ { diff --git a/src/addons/mod/imscp/imscp.module.ts b/src/addons/mod/imscp/imscp.module.ts index f8930e93b..6014981a1 100644 --- a/src/addons/mod/imscp/imscp.module.ts +++ b/src/addons/mod/imscp/imscp.module.ts @@ -19,7 +19,6 @@ import { CoreCourseModuleDelegate } from '@features/course/services/module-deleg import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CorePluginFileDelegate } from '@services/plugin-file-delegate'; -import { AddonModImscpComponentsModule } from './components/components.module'; import { AddonModImscpIndexLinkHandler } from './services/handlers/index-link'; import { AddonModImscpListLinkHandler } from './services/handlers/list-link'; import { AddonModImscpModuleHandler, AddonModImscpModuleHandlerService } from './services/handlers/module'; @@ -36,7 +35,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModImscpComponentsModule, ], providers: [ { diff --git a/src/addons/mod/lesson/lesson.module.ts b/src/addons/mod/lesson/lesson.module.ts index fb9216ee1..dd05e9f6e 100644 --- a/src/addons/mod/lesson/lesson.module.ts +++ b/src/addons/mod/lesson/lesson.module.ts @@ -23,7 +23,6 @@ import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-ro import { CorePushNotificationsDelegate } from '@features/pushnotifications/services/push-delegate'; import { CoreCronDelegate } from '@services/cron'; import { CORE_SITE_SCHEMAS } from '@services/sites'; -import { AddonModLessonComponentsModule } from './components/components.module'; import { SITE_SCHEMA, OFFLINE_SITE_SCHEMA, SYNC_SITE_SCHEMA } from './services/database/lesson'; import { AddonModLessonGradeLinkHandler } from './services/handlers/grade-link'; import { AddonModLessonIndexLinkHandler } from './services/handlers/index-link'; @@ -45,7 +44,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModLessonComponentsModule, ], providers: [ { diff --git a/src/addons/mod/lti/lti.module.ts b/src/addons/mod/lti/lti.module.ts index 7a91fa3db..27cd783da 100644 --- a/src/addons/mod/lti/lti.module.ts +++ b/src/addons/mod/lti/lti.module.ts @@ -18,7 +18,6 @@ import { CoreContentLinksDelegate } from '@features/contentlinks/services/conten import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; -import { AddonModLtiComponentsModule } from './components/components.module'; import { AddonModLtiIndexLinkHandler } from './services/handlers/index-link'; import { AddonModLtiListLinkHandler } from './services/handlers/list-link'; import { AddonModLtiModuleHandler, AddonModLtiModuleHandlerService } from './services/handlers/module'; @@ -35,7 +34,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModLtiComponentsModule, ], providers: [ { diff --git a/src/addons/mod/page/page.module.ts b/src/addons/mod/page/page.module.ts index d356586eb..edcd8fd94 100644 --- a/src/addons/mod/page/page.module.ts +++ b/src/addons/mod/page/page.module.ts @@ -19,7 +19,6 @@ import { CoreCourseModuleDelegate } from '@features/course/services/module-deleg import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CorePluginFileDelegate } from '@services/plugin-file-delegate'; -import { AddonModPageComponentsModule } from './components/components.module'; import { AddonModPageIndexLinkHandler } from './services/handlers/index-link'; import { AddonModPageListLinkHandler } from './services/handlers/list-link'; import { AddonModPageModuleHandler, AddonModPageModuleHandlerService } from './services/handlers/module'; @@ -36,7 +35,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModPageComponentsModule, ], providers: [ { diff --git a/src/addons/mod/quiz/quiz.module.ts b/src/addons/mod/quiz/quiz.module.ts index 8d7f40ee5..3dbf6688e 100644 --- a/src/addons/mod/quiz/quiz.module.ts +++ b/src/addons/mod/quiz/quiz.module.ts @@ -24,7 +24,6 @@ import { CorePushNotificationsDelegate } from '@features/pushnotifications/servi import { CoreCronDelegate } from '@services/cron'; import { CORE_SITE_SCHEMAS } from '@services/sites'; import { AddonModQuizAccessRulesModule } from './accessrules/accessrules.module'; -import { AddonModQuizComponentsModule } from './components/components.module'; import { SITE_SCHEMA } from './services/database/quiz'; import { AddonModQuizGradeLinkHandler } from './services/handlers/grade-link'; import { AddonModQuizIndexLinkHandler } from './services/handlers/index-link'; @@ -57,6 +56,17 @@ export async function getModQuizServices(): Promise[]> { ]; } +/** + * Get quiz component modules. + * + * @returns Quiz component modules. + */ +export async function getModQuizComponentModules(): Promise { + const { AddonModQuizComponentsModule } = await import('@addons/mod/quiz/components/components.module'); + + return [AddonModQuizComponentsModule]; +} + const routes: Routes = [ { path: AddonModQuizModuleHandlerService.PAGE_NAME, @@ -67,7 +77,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModQuizComponentsModule, AddonModQuizAccessRulesModule, ], providers: [ diff --git a/src/addons/mod/resource/resource.module.ts b/src/addons/mod/resource/resource.module.ts index 349c59a90..d27d47f95 100644 --- a/src/addons/mod/resource/resource.module.ts +++ b/src/addons/mod/resource/resource.module.ts @@ -19,7 +19,6 @@ import { CoreCourseModuleDelegate } from '@features/course/services/module-deleg import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CorePluginFileDelegate } from '@services/plugin-file-delegate'; -import { AddonModResourceComponentsModule } from './components/components.module'; import { AddonModResourceIndexLinkHandler } from './services/handlers/index-link'; import { AddonModResourceListLinkHandler } from './services/handlers/list-link'; import { AddonModResourceModuleHandlerService, AddonModResourceModuleHandler } from './services/handlers/module'; @@ -36,7 +35,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModResourceComponentsModule, ], providers: [ { diff --git a/src/addons/mod/scorm/scorm.module.ts b/src/addons/mod/scorm/scorm.module.ts index 643b03890..559edea16 100644 --- a/src/addons/mod/scorm/scorm.module.ts +++ b/src/addons/mod/scorm/scorm.module.ts @@ -22,7 +22,6 @@ import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-ro import { CoreCronDelegate } from '@services/cron'; import { CorePluginFileDelegate } from '@services/plugin-file-delegate'; import { CORE_SITE_SCHEMAS } from '@services/sites'; -import { AddonModScormComponentsModule } from './components/components.module'; import { OFFLINE_SITE_SCHEMA } from './services/database/scorm'; import { AddonModScormGradeLinkHandler } from './services/handlers/grade-link'; import { AddonModScormIndexLinkHandler } from './services/handlers/index-link'; @@ -44,7 +43,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModScormComponentsModule, ], providers: [ { diff --git a/src/addons/mod/url/url.module.ts b/src/addons/mod/url/url.module.ts index 5a354c96c..2699d006b 100644 --- a/src/addons/mod/url/url.module.ts +++ b/src/addons/mod/url/url.module.ts @@ -18,7 +18,6 @@ import { CoreContentLinksDelegate } from '@features/contentlinks/services/conten import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; import { CoreCourseModulePrefetchDelegate } from '@features/course/services/module-prefetch-delegate'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; -import { AddonModUrlComponentsModule } from './components/components.module'; import { AddonModUrlIndexLinkHandler } from './services/handlers/index-link'; import { AddonModUrlListLinkHandler } from './services/handlers/list-link'; import { AddonModUrlModuleHandler } from './services/handlers/module'; @@ -35,7 +34,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModUrlComponentsModule, ], providers: [ { diff --git a/src/addons/mod/wiki/wiki.module.ts b/src/addons/mod/wiki/wiki.module.ts index 18dbef296..7625d9987 100644 --- a/src/addons/mod/wiki/wiki.module.ts +++ b/src/addons/mod/wiki/wiki.module.ts @@ -22,7 +22,6 @@ import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-ro import { CoreTagAreaDelegate } from '@features/tag/services/tag-area-delegate'; import { CoreCronDelegate } from '@services/cron'; import { CORE_SITE_SCHEMAS } from '@services/sites'; -import { AddonModWikiComponentsModule } from './components/components.module'; import { OFFLINE_SITE_SCHEMA } from './services/database/wiki'; import { AddonModWikiCreateLinkHandler } from './services/handlers/create-link'; import { AddonModWikiEditLinkHandler } from './services/handlers/edit-link'; @@ -45,7 +44,6 @@ const routes: Routes = [ @NgModule({ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), - AddonModWikiComponentsModule, ], providers: [ { diff --git a/src/core/features/compile/services/compile.ts b/src/core/features/compile/services/compile.ts index 310f92da0..182cd13f4 100644 --- a/src/core/features/compile/services/compile.ts +++ b/src/core/features/compile/services/compile.ts @@ -129,8 +129,8 @@ import { getCompetencyServices } from '@addons/competency/competency.module'; import { getCourseCompletionServices } from '@addons/coursecompletion/coursecompletion.module'; import { getMessageOutputServices } from '@addons/messageoutput/messageoutput.module'; import { getMessagesServices } from '@addons/messages/messages.module'; -import { getModAssignServices } from '@addons/mod/assign/assign.module'; -import { getModQuizServices } from '@addons/mod/quiz/quiz.module'; +import { getModAssignComponentModules, getModAssignServices } from '@addons/mod/assign/assign.module'; +import { getModQuizComponentModules, getModQuizServices } from '@addons/mod/quiz/quiz.module'; import { getModWorkshopComponentModules, getModWorkshopServices } from '@addons/mod/workshop/workshop.module'; import { getNotesServices } from '@addons/notes/notes.module'; import { getNotificationsServices } from '@addons/notifications/notifications.module'; @@ -172,6 +172,8 @@ export class CoreCompileProvider { ]; protected readonly LAZY_IMPORTS = [ + getModAssignComponentModules, + getModQuizComponentModules, getModWorkshopComponentModules, ]; From 537dc0758721ced84a620e0aaf29f6f290fc3eb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 12 Mar 2024 15:24:54 +0100 Subject: [PATCH 4/4] MOBILE-3947 chore: Remove unnecessary route module exports --- src/addons/blog/blog-lazy.module.ts | 3 +-- src/addons/blog/blog.module.ts | 1 - src/addons/calendar/calendar-lazy.module.ts | 3 +-- src/addons/calendar/calendar.module.ts | 1 - src/addons/competency/competency.module.ts | 2 -- src/addons/coursecompletion/coursecompletion-lazy.module.ts | 1 - src/addons/messages/messages-lazy.module.ts | 3 +-- src/addons/messages/messages-settings-lazy.module.ts | 1 - src/addons/notes/notes-lazy.module.ts | 1 - src/addons/notifications/notifications-lazy.module.ts | 3 +-- .../notifications/notifications-settings-lazy.module.ts | 1 - src/addons/notifications/notifications.module.ts | 1 - src/addons/privatefiles/privatefiles-lazy.module.ts | 3 +-- src/addons/privatefiles/privatefiles.module.ts | 1 - src/addons/report/insights/insights.module.ts | 2 -- src/addons/storagemanager/storagemanager-lazy.module.ts | 1 - src/addons/storagemanager/storagemanager.module.ts | 1 - src/app/app-routing.module.ts | 1 - src/core/features/course/course-contents-lazy.module.ts | 3 +-- src/core/features/course/course-lazy.module.ts | 3 +-- src/core/features/course/course-summary-lazy.module.ts | 1 - src/core/features/course/course.module.ts | 1 - src/core/features/courses/courses-dashboard-lazy.module.ts | 1 - src/core/features/courses/courses-lazy.module.ts | 3 +-- src/core/features/courses/courses-my-lazy.module.ts | 1 - src/core/features/courses/courses.module.ts | 1 - src/core/features/login/login-credentials-lazy.module.ts | 1 - src/core/features/login/login-reconnect-lazy.module.ts | 1 - src/core/features/mainmenu/mainmenu-more-lazy.module.ts | 5 +---- src/core/features/mainmenu/mainmenu-reload-lazy.module.ts | 1 - src/core/features/reportbuilder/reportbuilder.module.ts | 2 -- src/core/features/search/search-lazy.module.ts | 3 +-- src/core/features/settings/settings-site-lazy.module.ts | 3 +-- src/core/features/sitehome/sitehome-lazy.module.ts | 1 - src/core/features/tag/tag-lazy.module.ts | 3 +-- src/core/features/tag/tag.module.ts | 1 - src/core/features/user/user-app-lazy.module.ts | 1 - src/core/features/user/user-profile-lazy.module.ts | 1 - 38 files changed, 12 insertions(+), 55 deletions(-) diff --git a/src/addons/blog/blog-lazy.module.ts b/src/addons/blog/blog-lazy.module.ts index 4ee04963b..452aef95a 100644 --- a/src/addons/blog/blog-lazy.module.ts +++ b/src/addons/blog/blog-lazy.module.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injector, NgModule } from '@angular/core'; -import { RouterModule, ROUTES, Routes } from '@angular/router'; +import { ROUTES, Routes } from '@angular/router'; import { CoreSharedModule } from '@/core/shared.module'; import { AddonBlogEntriesPage } from './pages/entries/entries'; @@ -48,7 +48,6 @@ function buildRoutes(injector: Injector): Routes { CoreTagComponentsModule, CoreMainMenuComponentsModule, ], - exports: [RouterModule], providers: [ { provide: ROUTES, diff --git a/src/addons/blog/blog.module.ts b/src/addons/blog/blog.module.ts index b2dbfdde1..2d5f71ff4 100644 --- a/src/addons/blog/blog.module.ts +++ b/src/addons/blog/blog.module.ts @@ -42,7 +42,6 @@ const routes: Routes = [ CoreMainMenuRoutingModule.forChild({ children: routes }), CoreCourseIndexRoutingModule.forChild({ children: routes }), ], - exports: [CoreMainMenuRoutingModule], providers: [ { provide: APP_INITIALIZER, diff --git a/src/addons/calendar/calendar-lazy.module.ts b/src/addons/calendar/calendar-lazy.module.ts index 86f19555f..f423766d3 100644 --- a/src/addons/calendar/calendar-lazy.module.ts +++ b/src/addons/calendar/calendar-lazy.module.ts @@ -20,7 +20,7 @@ import { AddonCalendarEventPage } from '@addons/calendar/pages/event/event'; import { AddonCalendarIndexPage } from '@addons/calendar/pages/index'; import { AddonCalendarSettingsPage } from '@addons/calendar/pages/settings/settings'; import { Injector, NgModule } from '@angular/core'; -import { RouterModule, ROUTES, Routes } from '@angular/router'; +import { ROUTES, Routes } from '@angular/router'; import { CoreEditorComponentsModule } from '@features/editor/components/components.module'; import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module'; @@ -70,7 +70,6 @@ function buildRoutes(injector: Injector): Routes { CoreMainMenuComponentsModule, CoreEditorComponentsModule, ], - exports: [RouterModule], declarations: [ AddonCalendarDayPage, AddonCalendarEditEventPage, diff --git a/src/addons/calendar/calendar.module.ts b/src/addons/calendar/calendar.module.ts index 2faf6597e..f57cfbc76 100644 --- a/src/addons/calendar/calendar.module.ts +++ b/src/addons/calendar/calendar.module.ts @@ -62,7 +62,6 @@ const mainMenuChildrenRoutes: Routes = [ CoreMainMenuRoutingModule.forChild({ children: mainMenuChildrenRoutes }), AddonCalendarComponentsModule, ], - exports: [CoreMainMenuRoutingModule], providers: [ { provide: CORE_SITE_SCHEMAS, diff --git a/src/addons/competency/competency.module.ts b/src/addons/competency/competency.module.ts index 8cf0c600b..373b2b4a0 100644 --- a/src/addons/competency/competency.module.ts +++ b/src/addons/competency/competency.module.ts @@ -25,7 +25,6 @@ import { AddonCompetencyPushClickHandler } from './services/handlers/push-click' import { AddonCompetencyUserCompetencyLinkHandler } from './services/handlers/user-competency-link'; import { AddonCompetencyUserHandler } from './services/handlers/user'; import { Routes } from '@angular/router'; -import { CoreMainMenuRoutingModule } from '@features/mainmenu/mainmenu-routing.module'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreCourseIndexRoutingModule } from '@features/course/course-routing.module'; import { COURSE_PAGE_NAME } from '@features/course/course.module'; @@ -77,7 +76,6 @@ const courseIndexRoutes: Routes = [ CoreMainMenuTabRoutingModule.forChild(mainMenuChildrenRoutes), CoreCourseIndexRoutingModule.forChild({ children: courseIndexRoutes }), ], - exports: [CoreMainMenuRoutingModule], providers: [ { provide: APP_INITIALIZER, diff --git a/src/addons/coursecompletion/coursecompletion-lazy.module.ts b/src/addons/coursecompletion/coursecompletion-lazy.module.ts index 2231a59b8..2cf6534f8 100644 --- a/src/addons/coursecompletion/coursecompletion-lazy.module.ts +++ b/src/addons/coursecompletion/coursecompletion-lazy.module.ts @@ -33,7 +33,6 @@ const routes: Routes = [ CoreCommentsComponentsModule, CoreTagComponentsModule, ], - exports: [RouterModule], declarations: [ AddonCourseCompletionReportPage, ], diff --git a/src/addons/messages/messages-lazy.module.ts b/src/addons/messages/messages-lazy.module.ts index e5db4055f..e6ec40442 100644 --- a/src/addons/messages/messages-lazy.module.ts +++ b/src/addons/messages/messages-lazy.module.ts @@ -22,7 +22,7 @@ import { AddonMessagesGroupConversationsPage } from '@addons/messages/pages/grou import { AddonMessagesSearchPage } from '@addons/messages/pages/search/search'; import { AddonMessagesMainMenuHandlerService } from '@addons/messages/services/handlers/mainmenu'; import { Injector, NgModule } from '@angular/core'; -import { Route, RouterModule, ROUTES, Routes } from '@angular/router'; +import { Route, ROUTES, Routes } from '@angular/router'; import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module'; import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module'; @@ -139,7 +139,6 @@ function buildRoutes(injector: Injector): Routes { AddonMessagesGroupConversationsPage, AddonMessagesSearchPage, ], - exports: [RouterModule], providers: [ { provide: ROUTES, diff --git a/src/addons/messages/messages-settings-lazy.module.ts b/src/addons/messages/messages-settings-lazy.module.ts index 0bebb54e4..dbfc1d4da 100644 --- a/src/addons/messages/messages-settings-lazy.module.ts +++ b/src/addons/messages/messages-settings-lazy.module.ts @@ -33,6 +33,5 @@ const routes: Routes = [ declarations: [ AddonMessagesSettingsPage, ], - exports: [RouterModule], }) export class AddonMessagesSettingsLazyModule {} diff --git a/src/addons/notes/notes-lazy.module.ts b/src/addons/notes/notes-lazy.module.ts index 90203dd1d..49997cb2e 100644 --- a/src/addons/notes/notes-lazy.module.ts +++ b/src/addons/notes/notes-lazy.module.ts @@ -33,7 +33,6 @@ const routes: Routes = [ CoreCommentsComponentsModule, CoreTagComponentsModule, ], - exports: [RouterModule], declarations: [ AddonNotesListPage, ], diff --git a/src/addons/notifications/notifications-lazy.module.ts b/src/addons/notifications/notifications-lazy.module.ts index 152192646..fddc7ecf5 100644 --- a/src/addons/notifications/notifications-lazy.module.ts +++ b/src/addons/notifications/notifications-lazy.module.ts @@ -17,7 +17,7 @@ import { CoreSharedModule } from '@/core/shared.module'; import { AddonNotificationsListPage } from '@addons/notifications/pages/list/list'; import { AddonNotificationsNotificationPage } from '@addons/notifications/pages/notification/notification'; import { Injector, NgModule } from '@angular/core'; -import { RouterModule, ROUTES, Routes } from '@angular/router'; +import { ROUTES, Routes } from '@angular/router'; import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module'; import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module'; @@ -69,7 +69,6 @@ function buildRoutes(injector: Injector): Routes { AddonNotificationsListPage, AddonNotificationsNotificationPage, ], - exports: [RouterModule], providers: [ { provide: ROUTES, diff --git a/src/addons/notifications/notifications-settings-lazy.module.ts b/src/addons/notifications/notifications-settings-lazy.module.ts index 9c455d4ce..83d2cd48f 100644 --- a/src/addons/notifications/notifications-settings-lazy.module.ts +++ b/src/addons/notifications/notifications-settings-lazy.module.ts @@ -33,6 +33,5 @@ const routes: Routes = [ declarations: [ AddonNotificationsSettingsPage, ], - exports: [RouterModule], }) export class AddonNotificationsSettingsLazyModule {} diff --git a/src/addons/notifications/notifications.module.ts b/src/addons/notifications/notifications.module.ts index d6b47baa5..855191c7e 100644 --- a/src/addons/notifications/notifications.module.ts +++ b/src/addons/notifications/notifications.module.ts @@ -64,7 +64,6 @@ const preferencesRoutes: Routes = [ CoreMainMenuTabRoutingModule.forChild(routes), CoreSitePreferencesRoutingModule.forChild(preferencesRoutes), ], - exports: [CoreMainMenuRoutingModule], providers: [ { provide: APP_INITIALIZER, diff --git a/src/addons/privatefiles/privatefiles-lazy.module.ts b/src/addons/privatefiles/privatefiles-lazy.module.ts index 43af7745a..b3a68659b 100644 --- a/src/addons/privatefiles/privatefiles-lazy.module.ts +++ b/src/addons/privatefiles/privatefiles-lazy.module.ts @@ -15,7 +15,7 @@ import { CoreSharedModule } from '@/core/shared.module'; import { AddonPrivateFilesIndexPage } from '@addons/privatefiles/pages/index'; import { Injector, NgModule } from '@angular/core'; -import { RouterModule, ROUTES, Routes } from '@angular/router'; +import { ROUTES, Routes } from '@angular/router'; import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module'; @@ -49,7 +49,6 @@ function buildRoutes(injector: Injector): Routes { declarations: [ AddonPrivateFilesIndexPage, ], - exports: [RouterModule], providers: [ { provide: ROUTES, diff --git a/src/addons/privatefiles/privatefiles.module.ts b/src/addons/privatefiles/privatefiles.module.ts index 99fa913e0..2bdaa95ca 100644 --- a/src/addons/privatefiles/privatefiles.module.ts +++ b/src/addons/privatefiles/privatefiles.module.ts @@ -47,7 +47,6 @@ const routes: Routes = [ CoreMainMenuTabRoutingModule.forChild(routes), CoreMainMenuRoutingModule.forChild({ children: routes }), ], - exports: [CoreMainMenuRoutingModule], providers: [ { provide: APP_INITIALIZER, diff --git a/src/addons/report/insights/insights.module.ts b/src/addons/report/insights/insights.module.ts index cd4a43f9b..334121686 100644 --- a/src/addons/report/insights/insights.module.ts +++ b/src/addons/report/insights/insights.module.ts @@ -18,8 +18,6 @@ import { CoreContentLinksDelegate } from '@features/contentlinks/services/conten import { AddonReportInsightsActionLinkHandler } from './services/handlers/action-link'; @NgModule({ - imports: [], - exports: [], providers: [ { provide: APP_INITIALIZER, diff --git a/src/addons/storagemanager/storagemanager-lazy.module.ts b/src/addons/storagemanager/storagemanager-lazy.module.ts index 7eeeac233..0978a1b64 100644 --- a/src/addons/storagemanager/storagemanager-lazy.module.ts +++ b/src/addons/storagemanager/storagemanager-lazy.module.ts @@ -35,7 +35,6 @@ const routes: Routes = [ RouterModule.forChild(routes), CoreSharedModule, ], - exports: [RouterModule], declarations: [ AddonStorageManagerCoursesStoragePage, AddonStorageManagerCourseStoragePage, diff --git a/src/addons/storagemanager/storagemanager.module.ts b/src/addons/storagemanager/storagemanager.module.ts index 82f6d5e8b..fce59aaec 100644 --- a/src/addons/storagemanager/storagemanager.module.ts +++ b/src/addons/storagemanager/storagemanager.module.ts @@ -33,7 +33,6 @@ const routes: Routes = [ CoreMainMenuRoutingModule.forChild({ children: routes }), CoreSitePreferencesRoutingModule.forChild(routes), ], - exports: [CoreMainMenuRoutingModule], providers: [ { provide: APP_INITIALIZER, diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index fca7c6f00..0b7abbfa2 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -226,7 +226,6 @@ export const APP_ROUTES = new InjectionToken('APP_ROUTES'); providers: [ { provide: ROUTES, multi: true, useFactory: buildAppRoutes, deps: [Injector] }, ], - exports: [RouterModule], }) export class AppRoutingModule { diff --git a/src/core/features/course/course-contents-lazy.module.ts b/src/core/features/course/course-contents-lazy.module.ts index d5b6f9aa1..fbbd96d6d 100644 --- a/src/core/features/course/course-contents-lazy.module.ts +++ b/src/core/features/course/course-contents-lazy.module.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injector, NgModule } from '@angular/core'; -import { RouterModule, ROUTES, Routes } from '@angular/router'; +import { ROUTES, Routes } from '@angular/router'; import { CoreCourseComponentsModule } from '@features/course/components/components.module'; import { CoreSharedModule } from '@/core/shared.module'; @@ -50,6 +50,5 @@ function buildRoutes(injector: Injector): Routes { declarations: [ CoreCourseContentsPage, ], - exports: [RouterModule], }) export class CoreCourseContentsLazyModule {} diff --git a/src/core/features/course/course-lazy.module.ts b/src/core/features/course/course-lazy.module.ts index c706c4240..d89541958 100644 --- a/src/core/features/course/course-lazy.module.ts +++ b/src/core/features/course/course-lazy.module.ts @@ -14,7 +14,7 @@ import { CoreSharedModule } from '@/core/shared.module'; import { Injector, NgModule } from '@angular/core'; -import { RouterModule, ROUTES, Routes } from '@angular/router'; +import { ROUTES, Routes } from '@angular/router'; import { CoreCourseComponentsModule } from '@features/course/components/components.module'; import { resolveIndexRoutes } from '@features/course/course-routing.module'; import { CoreCourseSummaryPageModule } from '@features/course/pages/course-summary/course-summary.module'; @@ -75,7 +75,6 @@ function buildRoutes(injector: Injector): Routes { CoreCourseComponentsModule, CoreCourseSummaryPageModule, ], - exports: [RouterModule], providers: [ { provide: ROUTES, diff --git a/src/core/features/course/course-summary-lazy.module.ts b/src/core/features/course/course-summary-lazy.module.ts index 22ff6911c..ab2c5d617 100644 --- a/src/core/features/course/course-summary-lazy.module.ts +++ b/src/core/features/course/course-summary-lazy.module.ts @@ -34,6 +34,5 @@ const routes: Routes = [ CoreRemindersComponentsModule, CoreCourseSummaryPageModule, ], - exports: [RouterModule], }) export class CoreCourseSummaryLazyModule {} diff --git a/src/core/features/course/course.module.ts b/src/core/features/course/course.module.ts index 227b3852e..1ff7255f0 100644 --- a/src/core/features/course/course.module.ts +++ b/src/core/features/course/course.module.ts @@ -86,7 +86,6 @@ const courseIndexRoutes: Routes = [ CoreMainMenuTabRoutingModule.forChild(routes), CoreCourseFormatModule, ], - exports: [CoreCourseIndexRoutingModule], providers: [ { provide: CORE_SITE_SCHEMAS, diff --git a/src/core/features/courses/courses-dashboard-lazy.module.ts b/src/core/features/courses/courses-dashboard-lazy.module.ts index c43129073..dfd408585 100644 --- a/src/core/features/courses/courses-dashboard-lazy.module.ts +++ b/src/core/features/courses/courses-dashboard-lazy.module.ts @@ -35,6 +35,5 @@ const routes: Routes = [ declarations: [ CoreCoursesDashboardPage, ], - exports: [RouterModule], }) export class CoreCoursesDashboardLazyModule {} diff --git a/src/core/features/courses/courses-lazy.module.ts b/src/core/features/courses/courses-lazy.module.ts index 178e63114..d51c13f01 100644 --- a/src/core/features/courses/courses-lazy.module.ts +++ b/src/core/features/courses/courses-lazy.module.ts @@ -14,7 +14,7 @@ import { CoreSharedModule } from '@/core/shared.module'; import { Injector, NgModule } from '@angular/core'; -import { RouterModule, ROUTES, Routes } from '@angular/router'; +import { ROUTES, Routes } from '@angular/router'; import { CoreCoursesComponentsModule } from '@features/courses/components/components.module'; import { CoreCoursesCategoriesPage } from '@features/courses/pages/categories/categories'; import { CoreCoursesListPage } from '@features/courses/pages/list/list'; @@ -70,7 +70,6 @@ function buildRoutes(injector: Injector): Routes { CoreCoursesCategoriesPage, CoreCoursesListPage, ], - exports: [RouterModule], providers: [ { provide: ROUTES, diff --git a/src/core/features/courses/courses-my-lazy.module.ts b/src/core/features/courses/courses-my-lazy.module.ts index 5af380251..9f41349db 100644 --- a/src/core/features/courses/courses-my-lazy.module.ts +++ b/src/core/features/courses/courses-my-lazy.module.ts @@ -38,6 +38,5 @@ const routes: Routes = [ declarations: [ CoreCoursesMyPage, ], - exports: [RouterModule], }) export class CoreCoursesMyLazyModule {} diff --git a/src/core/features/courses/courses.module.ts b/src/core/features/courses/courses.module.ts index 418638d3b..1a9faaa6b 100644 --- a/src/core/features/courses/courses.module.ts +++ b/src/core/features/courses/courses.module.ts @@ -78,7 +78,6 @@ const routes: Routes = [ CoreMainMenuRoutingModule.forChild({ children: routes }), CoreMainMenuTabRoutingModule.forChild(routes), ], - exports: [CoreMainMenuRoutingModule], providers: [ { provide: APP_INITIALIZER, diff --git a/src/core/features/login/login-credentials-lazy.module.ts b/src/core/features/login/login-credentials-lazy.module.ts index 3c5d14e09..498025e90 100644 --- a/src/core/features/login/login-credentials-lazy.module.ts +++ b/src/core/features/login/login-credentials-lazy.module.ts @@ -35,6 +35,5 @@ const routes: Routes = [ declarations: [ CoreLoginCredentialsPage, ], - exports: [RouterModule], }) export class CoreLoginCredentialsLazyModule {} diff --git a/src/core/features/login/login-reconnect-lazy.module.ts b/src/core/features/login/login-reconnect-lazy.module.ts index dafd7e819..156ebd210 100644 --- a/src/core/features/login/login-reconnect-lazy.module.ts +++ b/src/core/features/login/login-reconnect-lazy.module.ts @@ -35,6 +35,5 @@ const routes: Routes = [ declarations: [ CoreLoginReconnectPage, ], - exports: [RouterModule], }) export class CoreLoginReconnectLazyModule {} diff --git a/src/core/features/mainmenu/mainmenu-more-lazy.module.ts b/src/core/features/mainmenu/mainmenu-more-lazy.module.ts index e7d53aafc..0c3f9f667 100644 --- a/src/core/features/mainmenu/mainmenu-more-lazy.module.ts +++ b/src/core/features/mainmenu/mainmenu-more-lazy.module.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injector, NgModule } from '@angular/core'; -import { RouterModule, Routes, ROUTES } from '@angular/router'; +import { Routes, ROUTES } from '@angular/router'; import { CoreSharedModule } from '@/core/shared.module'; import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module'; @@ -52,8 +52,5 @@ function buildRoutes(injector: Injector): Routes { declarations: [ CoreMainMenuMorePage, ], - exports: [ - RouterModule, - ], }) export class CoreMainMenuMoreLazyModule {} diff --git a/src/core/features/mainmenu/mainmenu-reload-lazy.module.ts b/src/core/features/mainmenu/mainmenu-reload-lazy.module.ts index d9fab0633..b1aaa8baa 100644 --- a/src/core/features/mainmenu/mainmenu-reload-lazy.module.ts +++ b/src/core/features/mainmenu/mainmenu-reload-lazy.module.ts @@ -32,6 +32,5 @@ const routes: Routes = [ declarations: [ CoreMainMenuReloadPage, ], - exports: [RouterModule], }) export class CoreMainMenuReloadLazyModule {} diff --git a/src/core/features/reportbuilder/reportbuilder.module.ts b/src/core/features/reportbuilder/reportbuilder.module.ts index c985b7605..98680d344 100644 --- a/src/core/features/reportbuilder/reportbuilder.module.ts +++ b/src/core/features/reportbuilder/reportbuilder.module.ts @@ -15,7 +15,6 @@ import { APP_INITIALIZER, NgModule } from '@angular/core'; import { Routes } from '@angular/router'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; -import { CoreMainMenuRoutingModule } from '@features/mainmenu/mainmenu-routing.module'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreUserDelegate } from '@features/user/services/user-delegate'; import { CoreReportBuilderLinkHandler } from './services/handlers/reportbuilder-link'; @@ -32,7 +31,6 @@ const routes: Routes = [ imports: [ CoreMainMenuTabRoutingModule.forChild(routes), ], - exports: [CoreMainMenuRoutingModule], providers: [ { provide: APP_INITIALIZER, diff --git a/src/core/features/search/search-lazy.module.ts b/src/core/features/search/search-lazy.module.ts index bc07b9618..55d6d5862 100644 --- a/src/core/features/search/search-lazy.module.ts +++ b/src/core/features/search/search-lazy.module.ts @@ -14,7 +14,7 @@ import { CoreSharedModule } from '@/core/shared.module'; import { NgModule, Injector } from '@angular/core'; -import { RouterModule, Routes, ROUTES } from '@angular/router'; +import { Routes, ROUTES } from '@angular/router'; import { CoreSearchGlobalSearchPage } from './pages/global-search/global-search'; import { CoreSearchComponentsModule } from '@features/search/components/components.module'; import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module'; @@ -38,7 +38,6 @@ function buildRoutes(injector: Injector): Routes { CoreSearchComponentsModule, CoreMainMenuComponentsModule, ], - exports: [RouterModule], declarations: [ CoreSearchGlobalSearchPage, ], diff --git a/src/core/features/settings/settings-site-lazy.module.ts b/src/core/features/settings/settings-site-lazy.module.ts index 29bd49fec..82ccd0259 100644 --- a/src/core/features/settings/settings-site-lazy.module.ts +++ b/src/core/features/settings/settings-site-lazy.module.ts @@ -13,7 +13,7 @@ // limitations under the License. import { Injector, NgModule } from '@angular/core'; -import { RouterModule, ROUTES, Routes } from '@angular/router'; +import { ROUTES, Routes } from '@angular/router'; import { CoreSharedModule } from '@/core/shared.module'; import { conditionalRoutes } from '@/app/app-routing.module'; @@ -60,6 +60,5 @@ function buildRoutes(injector: Injector): Routes { imports: [ CoreSharedModule, ], - exports: [RouterModule], }) export class CoreettingsSiteLazyModule {} diff --git a/src/core/features/sitehome/sitehome-lazy.module.ts b/src/core/features/sitehome/sitehome-lazy.module.ts index 82ef0772b..ce14d218e 100644 --- a/src/core/features/sitehome/sitehome-lazy.module.ts +++ b/src/core/features/sitehome/sitehome-lazy.module.ts @@ -37,6 +37,5 @@ const routes: Routes = [ declarations: [ CoreSiteHomeIndexPage, ], - exports: [RouterModule], }) export class CoreSiteHomeLazyModule {} diff --git a/src/core/features/tag/tag-lazy.module.ts b/src/core/features/tag/tag-lazy.module.ts index a6f3b6c7a..12b563ee2 100644 --- a/src/core/features/tag/tag-lazy.module.ts +++ b/src/core/features/tag/tag-lazy.module.ts @@ -15,7 +15,7 @@ import { conditionalRoutes } from '@/app/app-routing.module'; import { CoreSharedModule } from '@/core/shared.module'; import { Injector, NgModule } from '@angular/core'; -import { Route, RouterModule, ROUTES, Routes } from '@angular/router'; +import { Route, ROUTES, Routes } from '@angular/router'; import { CoreMainMenuComponentsModule } from '@features/mainmenu/components/components.module'; import { buildTabMainRoutes } from '@features/mainmenu/mainmenu-tab-routing.module'; @@ -86,7 +86,6 @@ function buildRoutes(injector: Injector): Routes { CoreTagSearchPage, CoreTagIndexAreaPage, ], - exports: [RouterModule], providers: [ { provide: ROUTES, diff --git a/src/core/features/tag/tag.module.ts b/src/core/features/tag/tag.module.ts index 5bdc0dd31..b64146380 100644 --- a/src/core/features/tag/tag.module.ts +++ b/src/core/features/tag/tag.module.ts @@ -53,7 +53,6 @@ const routes: Routes = [ CoreMainMenuRoutingModule.forChild({ children: routes }), CoreTagComponentsModule, ], - exports: [CoreMainMenuRoutingModule], providers: [ { provide: APP_INITIALIZER, diff --git a/src/core/features/user/user-app-lazy.module.ts b/src/core/features/user/user-app-lazy.module.ts index d036817e8..e5126a789 100644 --- a/src/core/features/user/user-app-lazy.module.ts +++ b/src/core/features/user/user-app-lazy.module.ts @@ -32,6 +32,5 @@ const routes: Routes = [ declarations: [ CoreUserCompleteProfilePage, ], - exports: [RouterModule], }) export class CoreUserAppLazyModule {} diff --git a/src/core/features/user/user-profile-lazy.module.ts b/src/core/features/user/user-profile-lazy.module.ts index 926b471c7..5a184f5e8 100644 --- a/src/core/features/user/user-profile-lazy.module.ts +++ b/src/core/features/user/user-profile-lazy.module.ts @@ -33,6 +33,5 @@ const routes: Routes = [ declarations: [ CoreUserProfilePage, ], - exports: [RouterModule], }) export class CoreUserProfileLazyModule {}