From 48259062fd49f30e3f6588fced055a83ee11d41b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 16 Jul 2024 16:12:21 +0200 Subject: [PATCH] MOBILE-4616 chore: Import side modals during runtime --- .../calendar/components/components.module.ts | 3 -- .../calendar/components/filter/filter.ts | 5 ++++ src/addons/calendar/pages/day/day.ts | 3 +- src/addons/calendar/pages/index/index.ts | 3 +- .../components/components.module.ts | 2 -- .../mod/book/components/components.module.ts | 3 -- src/addons/mod/book/components/toc/toc.ts | 7 ++++- .../mod/book/pages/contents/contents.ts | 3 +- .../mod/chat/components/components.module.ts | 3 -- .../components/users-modal/users-modal.ts | 6 +++- src/addons/mod/chat/pages/chat/chat.ts | 4 ++- .../choice/components/components.module.ts | 2 -- .../feedback/components/components.module.ts | 2 -- .../glossary/components/components.module.ts | 2 -- .../components/components.module.ts | 2 -- .../mod/imscp/components/components.module.ts | 3 -- src/addons/mod/imscp/components/toc/toc.ts | 5 ++++ src/addons/mod/imscp/pages/view/view.ts | 3 +- .../lesson/components/components.module.ts | 5 ---- .../components/menu-modal/menu-modal.ts | 5 ++++ src/addons/mod/lesson/pages/player/player.ts | 3 +- .../mod/quiz/components/components.module.ts | 3 -- .../navigation-modal/navigation-modal.ts | 5 ++++ src/addons/mod/quiz/pages/player/player.ts | 3 +- src/addons/mod/quiz/pages/review/review.ts | 3 +- .../resource/components/components.module.ts | 2 -- .../mod/scorm/components/components.module.ts | 5 ---- src/addons/mod/scorm/components/toc/toc.ts | 5 ++++ src/addons/mod/scorm/pages/player/player.ts | 3 +- .../mod/wiki/components/components.module.ts | 6 ---- src/addons/mod/wiki/components/index/index.ts | 4 ++- src/addons/mod/wiki/components/map/map.ts | 5 ++++ .../subwiki-picker/subwiki-picker.ts | 5 ++++ .../block/components/components.module.ts | 3 -- .../side-blocks-button/side-blocks-button.ts | 5 ++-- .../components/side-blocks/side-blocks.ts | 9 +++++- .../course/classes/main-resource-component.ts | 4 ++- .../course/components/components.module.ts | 3 -- .../components/course-format/course-format.ts | 3 +- .../module-summary/module-summary.ts | 7 ++++- .../pages/module-preview/module-preview.ts | 7 ++--- .../features/course/services/course-helper.ts | 6 ++-- .../editor/components/components.module.ts | 2 -- .../h5p/components/components.module.ts | 2 -- .../login/components/components.module.ts | 3 -- .../components/sites-modal/sites-modal.ts | 5 ++++ .../mainmenu/components/components.module.ts | 3 -- .../user-menu-button/user-menu-button.ts | 5 ++-- .../components/user-menu/user-menu.ts | 10 +++++-- .../components/components.module.ts | 3 -- .../report-summary/report-summary.ts | 13 +++++++- .../reportbuilder/pages/report/report.ts | 10 +++++-- .../global-search-filters.component.ts | 5 ++++ .../global-search-filters.module.ts | 30 ------------------- .../pages/global-search/global-search.ts | 2 +- .../features/sitehome/pages/index/index.ts | 5 ++-- .../components/module-index/module-index.ts | 7 ++--- 57 files changed, 145 insertions(+), 130 deletions(-) delete mode 100644 src/core/features/search/components/global-search-filters/global-search-filters.module.ts diff --git a/src/addons/calendar/components/components.module.ts b/src/addons/calendar/components/components.module.ts index fffd48aa8..aa476bee7 100644 --- a/src/addons/calendar/components/components.module.ts +++ b/src/addons/calendar/components/components.module.ts @@ -18,13 +18,11 @@ import { CoreSharedModule } from '@/core/shared.module'; import { AddonCalendarCalendarComponent } from './calendar/calendar'; import { AddonCalendarUpcomingEventsComponent } from './upcoming-events/upcoming-events'; -import { AddonCalendarFilterComponent } from './filter/filter'; @NgModule({ declarations: [ AddonCalendarCalendarComponent, AddonCalendarUpcomingEventsComponent, - AddonCalendarFilterComponent, ], imports: [ CoreSharedModule, @@ -32,7 +30,6 @@ import { AddonCalendarFilterComponent } from './filter/filter'; exports: [ AddonCalendarCalendarComponent, AddonCalendarUpcomingEventsComponent, - AddonCalendarFilterComponent, ], }) export class AddonCalendarComponentsModule {} diff --git a/src/addons/calendar/components/filter/filter.ts b/src/addons/calendar/components/filter/filter.ts index 8c1330e68..94db1a1ca 100644 --- a/src/addons/calendar/components/filter/filter.ts +++ b/src/addons/calendar/components/filter/filter.ts @@ -20,6 +20,7 @@ import { CoreEvents } from '@singletons/events'; import { AddonCalendarEventType, AddonCalendarProvider } from '../../services/calendar'; import { AddonCalendarFilter, AddonCalendarEventIcons } from '../../services/calendar-helper'; import { ALL_COURSES_ID } from '@features/courses/services/courses-helper'; +import { CoreSharedModule } from '@/core/shared.module'; /** * Component to display the events filter that includes events types and a list of courses. @@ -28,6 +29,10 @@ import { ALL_COURSES_ID } from '@features/courses/services/courses-helper'; selector: 'addon-calendar-filter', templateUrl: 'filter.html', styleUrls: ['../../calendar-common.scss', 'filter.scss'], + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonCalendarFilterComponent implements OnInit { diff --git a/src/addons/calendar/pages/day/day.ts b/src/addons/calendar/pages/day/day.ts index 88183fd6c..16faee918 100644 --- a/src/addons/calendar/pages/day/day.ts +++ b/src/addons/calendar/pages/day/day.ts @@ -30,7 +30,6 @@ import { AddonCalendarFilter, AddonCalendarHelper } from '../../services/calenda import { AddonCalendarSync, AddonCalendarSyncProvider } from '../../services/calendar-sync'; import { CoreCategoryData, CoreCourses, CoreEnrolledCourseData } from '@features/courses/services/courses'; import { CoreCoursesHelper } from '@features/courses/services/courses-helper'; -import { AddonCalendarFilterComponent } from '../../components/filter/filter'; import moment from 'moment-timezone'; import { NgZone, Translate } from '@singletons'; import { CoreNavigator } from '@services/navigator'; @@ -376,6 +375,8 @@ export class AddonCalendarDayPage implements OnInit, OnDestroy { * Show the filter menu. */ async openFilter(): Promise { + const { AddonCalendarFilterComponent } = await import('../../components/filter/filter'); + await CoreModals.openSideModal({ component: AddonCalendarFilterComponent, componentProps: { diff --git a/src/addons/calendar/pages/index/index.ts b/src/addons/calendar/pages/index/index.ts index 7201116a0..7ee837bf6 100644 --- a/src/addons/calendar/pages/index/index.ts +++ b/src/addons/calendar/pages/index/index.ts @@ -28,7 +28,6 @@ import { CoreEnrolledCourseData } from '@features/courses/services/courses'; import { ActivatedRoute, Params } from '@angular/router'; import { AddonCalendarCalendarComponent } from '../../components/calendar/calendar'; import { AddonCalendarUpcomingEventsComponent } from '../../components/upcoming-events/upcoming-events'; -import { AddonCalendarFilterComponent } from '../../components/filter/filter'; import { CoreNavigator } from '@services/navigator'; import { CoreConstants } from '@/core/constants'; import { CoreMainMenuDeepLinkManager } from '@features/mainmenu/classes/deep-link-manager'; @@ -331,6 +330,8 @@ export class AddonCalendarIndexPage implements OnInit, OnDestroy { * Show the filter menu. */ async openFilter(): Promise { + const { AddonCalendarFilterComponent } = await import('../../components/filter/filter'); + await CoreModals.openSideModal({ component: AddonCalendarFilterComponent, componentProps: { diff --git a/src/addons/mod/bigbluebuttonbn/components/components.module.ts b/src/addons/mod/bigbluebuttonbn/components/components.module.ts index d786b230c..db3d5cf55 100644 --- a/src/addons/mod/bigbluebuttonbn/components/components.module.ts +++ b/src/addons/mod/bigbluebuttonbn/components/components.module.ts @@ -25,8 +25,6 @@ import { CoreCourseComponentsModule } from '@features/course/components/componen CoreSharedModule, CoreCourseComponentsModule, ], - providers: [ - ], exports: [ AddonModBBBIndexComponent, ], diff --git a/src/addons/mod/book/components/components.module.ts b/src/addons/mod/book/components/components.module.ts index d31d09782..c3f80c2b4 100644 --- a/src/addons/mod/book/components/components.module.ts +++ b/src/addons/mod/book/components/components.module.ts @@ -18,12 +18,10 @@ import { CoreSharedModule } from '@/core/shared.module'; import { CoreCourseComponentsModule } from '@features/course/components/components.module'; import { AddonModBookIndexComponent } from './index/index'; -import { AddonModBookTocComponent } from './toc/toc'; @NgModule({ declarations: [ AddonModBookIndexComponent, - AddonModBookTocComponent, ], imports: [ CoreSharedModule, @@ -31,7 +29,6 @@ import { AddonModBookTocComponent } from './toc/toc'; ], exports: [ AddonModBookIndexComponent, - AddonModBookTocComponent, ], }) export class AddonModBookComponentsModule {} diff --git a/src/addons/mod/book/components/toc/toc.ts b/src/addons/mod/book/components/toc/toc.ts index f59ccdf2f..8aa4cf2ad 100644 --- a/src/addons/mod/book/components/toc/toc.ts +++ b/src/addons/mod/book/components/toc/toc.ts @@ -16,6 +16,7 @@ import { Component, Input, OnInit } from '@angular/core'; import { ModalController } from '@singletons'; import { AddonModBookTocChapter, AddonModBookBookWSData } from '../../services/book'; import { AddonModBookNumbering } from '../../constants'; +import { CoreSharedModule } from '@/core/shared.module'; /** * Modal to display the TOC of a book. @@ -23,7 +24,11 @@ import { AddonModBookNumbering } from '../../constants'; @Component({ selector: 'addon-mod-book-toc', templateUrl: 'toc.html', - styleUrls: ['toc.scss'], + styleUrl: 'toc.scss', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonModBookTocComponent implements OnInit { diff --git a/src/addons/mod/book/pages/contents/contents.ts b/src/addons/mod/book/pages/contents/contents.ts index 6376ddb63..39b975103 100644 --- a/src/addons/mod/book/pages/contents/contents.ts +++ b/src/addons/mod/book/pages/contents/contents.ts @@ -30,7 +30,6 @@ import { CoreDomUtils } from '@services/utils/dom'; import { CoreTextUtils } from '@services/utils/text'; import { CoreUtils } from '@services/utils/utils'; import { Translate } from '@singletons'; -import { AddonModBookTocComponent } from '../../components/toc/toc'; import { AddonModBook, AddonModBookBookWSData, @@ -251,6 +250,8 @@ export class AddonModBookContentsPage implements OnInit, OnDestroy { // Create the toc modal. const visibleChapter = this.manager?.getSelectedItem(); + const { AddonModBookTocComponent } = await import('../../components/toc/toc'); + const modalData = await CoreModals.openSideModal({ component: AddonModBookTocComponent, componentProps: { diff --git a/src/addons/mod/chat/components/components.module.ts b/src/addons/mod/chat/components/components.module.ts index c0bdb4ad4..4f5182ce3 100644 --- a/src/addons/mod/chat/components/components.module.ts +++ b/src/addons/mod/chat/components/components.module.ts @@ -16,12 +16,10 @@ import { NgModule } from '@angular/core'; import { AddonModChatIndexComponent } from './index/index'; import { CoreSharedModule } from '@/core/shared.module'; import { CoreCourseComponentsModule } from '@features/course/components/components.module'; -import { AddonModChatUsersModalComponent } from './users-modal/users-modal'; @NgModule({ declarations: [ AddonModChatIndexComponent, - AddonModChatUsersModalComponent, ], imports: [ CoreSharedModule, @@ -29,7 +27,6 @@ import { AddonModChatUsersModalComponent } from './users-modal/users-modal'; ], exports: [ AddonModChatIndexComponent, - AddonModChatUsersModalComponent, ], }) export class AddonModChatComponentsModule {} diff --git a/src/addons/mod/chat/components/users-modal/users-modal.ts b/src/addons/mod/chat/components/users-modal/users-modal.ts index 3a8e0b435..1ebd510e7 100644 --- a/src/addons/mod/chat/components/users-modal/users-modal.ts +++ b/src/addons/mod/chat/components/users-modal/users-modal.ts @@ -11,7 +11,6 @@ // 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. - import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { CoreNetwork } from '@services/network'; import { CoreSites } from '@services/sites'; @@ -19,6 +18,7 @@ import { CoreDomUtils } from '@services/utils/dom'; import { ModalController, NgZone } from '@singletons'; import { Subscription } from 'rxjs'; import { AddonModChat, AddonModChatUser } from '../../services/chat'; +import { CoreSharedModule } from '@/core/shared.module'; /** * MMdal that displays the chat session users. @@ -26,6 +26,10 @@ import { AddonModChat, AddonModChatUser } from '../../services/chat'; @Component({ selector: 'addon-mod-chat-users-modal', templateUrl: 'users-modal.html', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonModChatUsersModalComponent implements OnInit, OnDestroy { diff --git a/src/addons/mod/chat/pages/chat/chat.ts b/src/addons/mod/chat/pages/chat/chat.ts index aa8de8521..4565e5c72 100644 --- a/src/addons/mod/chat/pages/chat/chat.ts +++ b/src/addons/mod/chat/pages/chat/chat.ts @@ -24,7 +24,7 @@ import { CoreUtils } from '@services/utils/utils'; import { NgZone, Translate } from '@singletons'; import { CoreEvents } from '@singletons/events'; import { Subscription } from 'rxjs'; -import { AddonModChatUsersModalComponent, AddonModChatUsersModalResult } from '../../components/users-modal/users-modal'; +import { AddonModChatUsersModalResult } from '../../components/users-modal/users-modal'; import { AddonModChat, AddonModChatUser } from '../../services/chat'; import { AddonModChatFormattedMessage, AddonModChatHelper } from '../../services/chat-helper'; import { CoreTime } from '@singletons/time'; @@ -187,6 +187,8 @@ export class AddonModChatChatPage implements OnInit, OnDestroy, CanLeave { * Display the chat users modal. */ async showChatUsers(): Promise { + const { AddonModChatUsersModalComponent } = await import('../../components/users-modal/users-modal'); + // Create the toc modal. const modalData = await CoreModals.openSideModal({ component: AddonModChatUsersModalComponent, diff --git a/src/addons/mod/choice/components/components.module.ts b/src/addons/mod/choice/components/components.module.ts index 9a1aeb7fe..bef917cc3 100644 --- a/src/addons/mod/choice/components/components.module.ts +++ b/src/addons/mod/choice/components/components.module.ts @@ -25,8 +25,6 @@ import { AddonModChoiceIndexComponent } from './index/index'; CoreSharedModule, CoreCourseComponentsModule, ], - providers: [ - ], exports: [ AddonModChoiceIndexComponent, ], diff --git a/src/addons/mod/feedback/components/components.module.ts b/src/addons/mod/feedback/components/components.module.ts index ce2b48392..4db944b52 100644 --- a/src/addons/mod/feedback/components/components.module.ts +++ b/src/addons/mod/feedback/components/components.module.ts @@ -25,8 +25,6 @@ import { AddonModFeedbackIndexComponent } from './index/index'; CoreSharedModule, CoreCourseComponentsModule, ], - providers: [ - ], exports: [ AddonModFeedbackIndexComponent, ], diff --git a/src/addons/mod/glossary/components/components.module.ts b/src/addons/mod/glossary/components/components.module.ts index b35fa3942..f425cfff7 100644 --- a/src/addons/mod/glossary/components/components.module.ts +++ b/src/addons/mod/glossary/components/components.module.ts @@ -29,8 +29,6 @@ import { CoreSearchComponentsModule } from '@features/search/components/componen CoreCourseComponentsModule, CoreSearchComponentsModule, ], - providers: [ - ], exports: [ AddonModGlossaryIndexComponent, AddonModGlossaryModePickerPopoverComponent, diff --git a/src/addons/mod/h5pactivity/components/components.module.ts b/src/addons/mod/h5pactivity/components/components.module.ts index f0dc5a0ca..4147400cc 100644 --- a/src/addons/mod/h5pactivity/components/components.module.ts +++ b/src/addons/mod/h5pactivity/components/components.module.ts @@ -28,8 +28,6 @@ import { CoreH5PComponentsModule } from '@features/h5p/components/components.mod CoreCourseComponentsModule, CoreH5PComponentsModule, ], - providers: [ - ], exports: [ AddonModH5PActivityIndexComponent, ], diff --git a/src/addons/mod/imscp/components/components.module.ts b/src/addons/mod/imscp/components/components.module.ts index afd155ba6..de14a9f5a 100644 --- a/src/addons/mod/imscp/components/components.module.ts +++ b/src/addons/mod/imscp/components/components.module.ts @@ -18,12 +18,10 @@ import { CoreSharedModule } from '@/core/shared.module'; import { CoreCourseComponentsModule } from '@features/course/components/components.module'; import { AddonModImscpIndexComponent } from './index'; -import { AddonModImscpTocComponent } from './toc/toc'; @NgModule({ declarations: [ AddonModImscpIndexComponent, - AddonModImscpTocComponent, ], imports: [ CoreSharedModule, @@ -31,7 +29,6 @@ import { AddonModImscpTocComponent } from './toc/toc'; ], exports: [ AddonModImscpIndexComponent, - AddonModImscpTocComponent, ], }) export class AddonModImscpComponentsModule {} diff --git a/src/addons/mod/imscp/components/toc/toc.ts b/src/addons/mod/imscp/components/toc/toc.ts index 9378ba647..22527d45b 100644 --- a/src/addons/mod/imscp/components/toc/toc.ts +++ b/src/addons/mod/imscp/components/toc/toc.ts @@ -15,6 +15,7 @@ import { Component, Input } from '@angular/core'; import { ModalController } from '@singletons'; import { AddonModImscpTocItem } from '../../services/imscp'; +import { CoreSharedModule } from '@/core/shared.module'; /** * Modal to display the TOC of a imscp. @@ -22,6 +23,10 @@ import { AddonModImscpTocItem } from '../../services/imscp'; @Component({ selector: 'addon-mod-imscp-toc', templateUrl: 'toc.html', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonModImscpTocComponent { diff --git a/src/addons/mod/imscp/pages/view/view.ts b/src/addons/mod/imscp/pages/view/view.ts index 60e1cf34c..41d3b782c 100644 --- a/src/addons/mod/imscp/pages/view/view.ts +++ b/src/addons/mod/imscp/pages/view/view.ts @@ -26,7 +26,6 @@ import { CoreDomUtils } from '@services/utils/dom'; import { CoreTextUtils } from '@services/utils/text'; import { CoreUtils } from '@services/utils/utils'; import { Translate } from '@singletons'; -import { AddonModImscpTocComponent } from '../../components/toc/toc'; import { AddonModImscp, AddonModImscpImscp, AddonModImscpTocItem } from '../../services/imscp'; import { CoreModals } from '@services/modals'; @@ -273,6 +272,8 @@ export class AddonModImscpViewPage implements OnInit { * Show the TOC. */ async showToc(): Promise { + const { AddonModImscpTocComponent } = await import('../../components/toc/toc'); + // Create the toc modal. const itemHref = await CoreModals.openSideModal({ component: AddonModImscpTocComponent, diff --git a/src/addons/mod/lesson/components/components.module.ts b/src/addons/mod/lesson/components/components.module.ts index 6daa4ec51..6822ef34b 100644 --- a/src/addons/mod/lesson/components/components.module.ts +++ b/src/addons/mod/lesson/components/components.module.ts @@ -17,22 +17,17 @@ import { NgModule } from '@angular/core'; import { CoreSharedModule } from '@/core/shared.module'; import { CoreCourseComponentsModule } from '@features/course/components/components.module'; import { AddonModLessonIndexComponent } from './index/index'; -import { AddonModLessonMenuModalPage } from './menu-modal/menu-modal'; @NgModule({ declarations: [ AddonModLessonIndexComponent, - AddonModLessonMenuModalPage, ], imports: [ CoreSharedModule, CoreCourseComponentsModule, ], - providers: [ - ], exports: [ AddonModLessonIndexComponent, - AddonModLessonMenuModalPage, ], }) export class AddonModLessonComponentsModule {} diff --git a/src/addons/mod/lesson/components/menu-modal/menu-modal.ts b/src/addons/mod/lesson/components/menu-modal/menu-modal.ts index 73b257e79..f448e86f1 100644 --- a/src/addons/mod/lesson/components/menu-modal/menu-modal.ts +++ b/src/addons/mod/lesson/components/menu-modal/menu-modal.ts @@ -16,6 +16,7 @@ import { Component, Input } from '@angular/core'; import { ModalController } from '@singletons'; import { AddonModLessonPlayerPage } from '../../pages/player/player'; +import { CoreSharedModule } from '@/core/shared.module'; /** * Modal that renders the lesson menu and media file. @@ -23,6 +24,10 @@ import { AddonModLessonPlayerPage } from '../../pages/player/player'; @Component({ selector: 'page-addon-mod-lesson-menu-modal', templateUrl: 'menu-modal.html', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonModLessonMenuModalPage { diff --git a/src/addons/mod/lesson/pages/player/player.ts b/src/addons/mod/lesson/pages/player/player.ts index 85203bfba..57c984ef3 100644 --- a/src/addons/mod/lesson/pages/player/player.ts +++ b/src/addons/mod/lesson/pages/player/player.ts @@ -28,7 +28,6 @@ import { CoreUtils } from '@services/utils/utils'; import { CoreWSExternalFile } from '@services/ws'; import { ModalController, Translate } from '@singletons'; import { CoreEvents } from '@singletons/events'; -import { AddonModLessonMenuModalPage } from '../../components/menu-modal/menu-modal'; import { AddonModLesson, AddonModLessonEOLPageDataEntry, @@ -830,6 +829,8 @@ export class AddonModLessonPlayerPage implements OnInit, OnDestroy, CanLeave { async showMenu(): Promise { this.menuShown = true; + const { AddonModLessonMenuModalPage } = await import('../../components/menu-modal/menu-modal'); + await CoreModals.openSideModal({ component: AddonModLessonMenuModalPage, componentProps: { diff --git a/src/addons/mod/quiz/components/components.module.ts b/src/addons/mod/quiz/components/components.module.ts index 32f249166..82eb41016 100644 --- a/src/addons/mod/quiz/components/components.module.ts +++ b/src/addons/mod/quiz/components/components.module.ts @@ -18,7 +18,6 @@ import { CoreSharedModule } from '@/core/shared.module'; import { CoreCourseComponentsModule } from '@features/course/components/components.module'; import { AddonModQuizConnectionErrorComponent } from './connection-error/connection-error'; import { AddonModQuizIndexComponent } from './index/index'; -import { AddonModQuizNavigationModalComponent } from './navigation-modal/navigation-modal'; import { AddonModQuizAttemptInfoComponent } from './attempt-info/attempt-info'; import { AddonModQuizAttemptStateComponent } from './attempt-state/attempt-state'; import { AddonModQuizQuestionCardComponent } from './question-card/question-card'; @@ -29,7 +28,6 @@ import { AddonModQuizQuestionCardComponent } from './question-card/question-card AddonModQuizAttemptStateComponent, AddonModQuizIndexComponent, AddonModQuizConnectionErrorComponent, - AddonModQuizNavigationModalComponent, AddonModQuizQuestionCardComponent, ], imports: [ @@ -41,7 +39,6 @@ import { AddonModQuizQuestionCardComponent } from './question-card/question-card AddonModQuizAttemptStateComponent, AddonModQuizIndexComponent, AddonModQuizConnectionErrorComponent, - AddonModQuizNavigationModalComponent, AddonModQuizQuestionCardComponent, ], diff --git a/src/addons/mod/quiz/components/navigation-modal/navigation-modal.ts b/src/addons/mod/quiz/components/navigation-modal/navigation-modal.ts index 711ef23f8..1b71ea075 100644 --- a/src/addons/mod/quiz/components/navigation-modal/navigation-modal.ts +++ b/src/addons/mod/quiz/components/navigation-modal/navigation-modal.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { CoreSharedModule } from '@/core/shared.module'; import { Component, Input } from '@angular/core'; import { CoreQuestionQuestionParsed } from '@features/question/services/question'; @@ -23,6 +24,10 @@ import { ModalController } from '@singletons'; @Component({ selector: 'addon-mod-quiz-navigation-modal', templateUrl: 'navigation-modal.html', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonModQuizNavigationModalComponent { diff --git a/src/addons/mod/quiz/pages/player/player.ts b/src/addons/mod/quiz/pages/player/player.ts index 7a1b56f99..997fd63e4 100644 --- a/src/addons/mod/quiz/pages/player/player.ts +++ b/src/addons/mod/quiz/pages/player/player.ts @@ -33,7 +33,6 @@ import { ModalController, Translate } from '@singletons'; import { CoreEvents } from '@singletons/events'; import { AddonModQuizAutoSave } from '../../classes/auto-save'; import { - AddonModQuizNavigationModalComponent, AddonModQuizNavigationModalReturn, AddonModQuizNavigationQuestion, } from '../../components/navigation-modal/navigation-modal'; @@ -728,6 +727,8 @@ export class AddonModQuizPlayerPage implements OnInit, OnDestroy, CanLeave { this.reloadNavigation = false; } + const { AddonModQuizNavigationModalComponent } = await import('../../components/navigation-modal/navigation-modal'); + // Create the navigation modal. const modalData = await CoreModals.openSideModal({ component: AddonModQuizNavigationModalComponent, diff --git a/src/addons/mod/quiz/pages/review/review.ts b/src/addons/mod/quiz/pages/review/review.ts index 13c95f478..5cfb5e244 100644 --- a/src/addons/mod/quiz/pages/review/review.ts +++ b/src/addons/mod/quiz/pages/review/review.ts @@ -22,7 +22,6 @@ import { CoreUtils } from '@services/utils/utils'; import { CoreDom } from '@singletons/dom'; import { CoreTime } from '@singletons/time'; import { - AddonModQuizNavigationModalComponent, AddonModQuizNavigationModalReturn, AddonModQuizNavigationQuestion, } from '../../components/navigation-modal/navigation-modal'; @@ -266,6 +265,8 @@ export class AddonModQuizReviewPage implements OnInit { } async openNavigation(): Promise { + const { AddonModQuizNavigationModalComponent } = await import('../../components/navigation-modal/navigation-modal'); + // Create the navigation modal. const modalData = await CoreModals.openSideModal({ component: AddonModQuizNavigationModalComponent, diff --git a/src/addons/mod/resource/components/components.module.ts b/src/addons/mod/resource/components/components.module.ts index a4e217b90..36d0dee31 100644 --- a/src/addons/mod/resource/components/components.module.ts +++ b/src/addons/mod/resource/components/components.module.ts @@ -27,8 +27,6 @@ import { AddonModResourceIndexComponent } from './index/index'; CoreSharedModule, CoreCourseComponentsModule, ], - providers: [ - ], exports: [ AddonModResourceIndexComponent, ], diff --git a/src/addons/mod/scorm/components/components.module.ts b/src/addons/mod/scorm/components/components.module.ts index 407c08e0b..a93ced361 100644 --- a/src/addons/mod/scorm/components/components.module.ts +++ b/src/addons/mod/scorm/components/components.module.ts @@ -16,22 +16,17 @@ import { NgModule } from '@angular/core'; import { AddonModScormIndexComponent } from './index/index'; import { CoreSharedModule } from '@/core/shared.module'; import { CoreCourseComponentsModule } from '@features/course/components/components.module'; -import { AddonModScormTocComponent } from './toc/toc'; @NgModule({ declarations: [ AddonModScormIndexComponent, - AddonModScormTocComponent, ], imports: [ CoreSharedModule, CoreCourseComponentsModule, ], - providers: [ - ], exports: [ AddonModScormIndexComponent, - AddonModScormTocComponent, ], }) export class AddonModScormComponentsModule {} diff --git a/src/addons/mod/scorm/components/toc/toc.ts b/src/addons/mod/scorm/components/toc/toc.ts index d1b48186f..42199ba11 100644 --- a/src/addons/mod/scorm/components/toc/toc.ts +++ b/src/addons/mod/scorm/components/toc/toc.ts @@ -17,6 +17,7 @@ import { ModalController } from '@singletons'; import { AddonModScormGetScormAccessInformationWSResponse } from '../../services/scorm'; import { AddonModScormTOCScoWithIcon } from '../../services/scorm-helper'; import { AddonModScormMode } from '../../constants'; +import { CoreSharedModule } from '@/core/shared.module'; /** * Modal to display the TOC of a SCORM. @@ -24,6 +25,10 @@ import { AddonModScormMode } from '../../constants'; @Component({ selector: 'addon-mod-scorm-toc', templateUrl: 'toc.html', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonModScormTocComponent implements OnInit { diff --git a/src/addons/mod/scorm/pages/player/player.ts b/src/addons/mod/scorm/pages/player/player.ts index f93df0c48..e3d29384d 100644 --- a/src/addons/mod/scorm/pages/player/player.ts +++ b/src/addons/mod/scorm/pages/player/player.ts @@ -23,7 +23,6 @@ import { CoreTimeUtils } from '@services/utils/time'; import { CoreUtils } from '@services/utils/utils'; import { CoreEventObserver, CoreEvents } from '@singletons/events'; import { AddonModScormDataModel12 } from '../../classes/data-model-12'; -import { AddonModScormTocComponent } from '../../components/toc/toc'; import { AddonModScorm, AddonModScormAttemptCountResult, @@ -514,6 +513,8 @@ export class AddonModScormPlayerPage implements OnInit, OnDestroy { * Show the TOC. */ async openToc(): Promise { + const { AddonModScormTocComponent } = await import('../../components/toc/toc'); + const modalData = await CoreModals.openSideModal({ component: AddonModScormTocComponent, componentProps: { diff --git a/src/addons/mod/wiki/components/components.module.ts b/src/addons/mod/wiki/components/components.module.ts index 92b38259d..23e3e31ff 100644 --- a/src/addons/mod/wiki/components/components.module.ts +++ b/src/addons/mod/wiki/components/components.module.ts @@ -17,14 +17,10 @@ import { NgModule } from '@angular/core'; import { CoreCourseComponentsModule } from '@features/course/components/components.module'; import { CoreTagComponentsModule } from '@features/tag/components/components.module'; import { AddonModWikiIndexComponent } from './index/index'; -import { AddonModWikiMapModalComponent } from './map/map'; -import { AddonModWikiSubwikiPickerComponent } from './subwiki-picker/subwiki-picker'; @NgModule({ declarations: [ AddonModWikiIndexComponent, - AddonModWikiSubwikiPickerComponent, - AddonModWikiMapModalComponent, ], imports: [ CoreSharedModule, @@ -33,8 +29,6 @@ import { AddonModWikiSubwikiPickerComponent } from './subwiki-picker/subwiki-pic ], exports: [ AddonModWikiIndexComponent, - AddonModWikiSubwikiPickerComponent, - AddonModWikiMapModalComponent, ], }) export class AddonModWikiComponentsModule {} diff --git a/src/addons/mod/wiki/components/index/index.ts b/src/addons/mod/wiki/components/index/index.ts index 590245828..853ac31f1 100644 --- a/src/addons/mod/wiki/components/index/index.ts +++ b/src/addons/mod/wiki/components/index/index.ts @@ -664,8 +664,9 @@ export class AddonModWikiIndexComponent extends CoreCourseModuleMainActivityComp * Show the map. */ async openMap(): Promise { - // Create the toc modal. const { AddonModWikiMapModalComponent } = await import('../map/map'); + + // Create the map modal. const modalData = await CoreModals.openSideModal({ component: AddonModWikiMapModalComponent, componentProps: { @@ -885,6 +886,7 @@ export class AddonModWikiIndexComponent extends CoreCourseModuleMainActivityComp */ async showSubwikiPicker(event: MouseEvent): Promise { const { AddonModWikiSubwikiPickerComponent } = await import('../subwiki-picker/subwiki-picker'); + const subwiki = await CoreDomUtils.openPopover({ component: AddonModWikiSubwikiPickerComponent, componentProps: { diff --git a/src/addons/mod/wiki/components/map/map.ts b/src/addons/mod/wiki/components/map/map.ts index 9884350b0..9af480058 100644 --- a/src/addons/mod/wiki/components/map/map.ts +++ b/src/addons/mod/wiki/components/map/map.ts @@ -17,6 +17,7 @@ import { ModalController } from '@singletons'; import { AddonModWikiPageDBRecord } from '../../services/database/wiki'; import { AddonModWikiSubwikiPage, AddonModWikiWiki } from '../../services/wiki'; import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; +import { CoreSharedModule } from '@/core/shared.module'; /** * Modal to display the map of a Wiki. @@ -24,6 +25,10 @@ import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; @Component({ selector: 'page-addon-mod-wiki-map', templateUrl: 'map.html', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonModWikiMapModalComponent implements OnInit { diff --git a/src/addons/mod/wiki/components/subwiki-picker/subwiki-picker.ts b/src/addons/mod/wiki/components/subwiki-picker/subwiki-picker.ts index ffbbb93e8..878d918d3 100644 --- a/src/addons/mod/wiki/components/subwiki-picker/subwiki-picker.ts +++ b/src/addons/mod/wiki/components/subwiki-picker/subwiki-picker.ts @@ -15,6 +15,7 @@ import { Component, Input } from '@angular/core'; import { PopoverController } from '@singletons'; import { AddonModWikiSubwiki, AddonModWikiSubwikiListGrouping } from '../../services/wiki'; +import { CoreSharedModule } from '@/core/shared.module'; /** * Component to display the a list of subwikis in a wiki. @@ -22,6 +23,10 @@ import { AddonModWikiSubwiki, AddonModWikiSubwikiListGrouping } from '../../serv @Component({ selector: 'addon-mod-wiki-subwiki-picker', templateUrl: 'addon-mod-wiki-subwiki-picker.html', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class AddonModWikiSubwikiPickerComponent { diff --git a/src/core/features/block/components/components.module.ts b/src/core/features/block/components/components.module.ts index 62552af04..7ebf07bd9 100644 --- a/src/core/features/block/components/components.module.ts +++ b/src/core/features/block/components/components.module.ts @@ -17,7 +17,6 @@ import { CoreBlockComponent } from './block/block'; import { CoreBlockOnlyTitleComponent } from './only-title-block/only-title-block'; import { CoreBlockPreRenderedComponent } from './pre-rendered-block/pre-rendered-block'; import { CoreSharedModule } from '@/core/shared.module'; -import { CoreBlockSideBlocksComponent } from './side-blocks/side-blocks'; import { CoreBlockSideBlocksButtonComponent } from './side-blocks-button/side-blocks-button'; import { CoreBlockSideBlocksTourComponent } from './side-blocks-tour/side-blocks-tour'; @@ -26,7 +25,6 @@ import { CoreBlockSideBlocksTourComponent } from './side-blocks-tour/side-blocks CoreBlockComponent, CoreBlockOnlyTitleComponent, CoreBlockPreRenderedComponent, - CoreBlockSideBlocksComponent, CoreBlockSideBlocksButtonComponent, CoreBlockSideBlocksTourComponent, ], @@ -37,7 +35,6 @@ import { CoreBlockSideBlocksTourComponent } from './side-blocks-tour/side-blocks CoreBlockComponent, CoreBlockOnlyTitleComponent, CoreBlockPreRenderedComponent, - CoreBlockSideBlocksComponent, CoreBlockSideBlocksButtonComponent, CoreBlockSideBlocksTourComponent, ], diff --git a/src/core/features/block/components/side-blocks-button/side-blocks-button.ts b/src/core/features/block/components/side-blocks-button/side-blocks-button.ts index 77ca2aacb..a9d9f51ec 100644 --- a/src/core/features/block/components/side-blocks-button/side-blocks-button.ts +++ b/src/core/features/block/components/side-blocks-button/side-blocks-button.ts @@ -19,7 +19,6 @@ import { CoreUserToursAlignment, CoreUserToursSide } from '@features/usertours/s import { CoreModals } from '@services/modals'; import { CoreDom } from '@singletons/dom'; import { CoreBlockSideBlocksTourComponent } from '../side-blocks-tour/side-blocks-tour'; -import { CoreBlockSideBlocksComponent } from '../side-blocks/side-blocks'; import { ContextLevel } from '@/core/constants'; /** @@ -67,7 +66,9 @@ export class CoreBlockSideBlocksButtonComponent implements OnInit, OnDestroy { /** * Open side blocks. */ - openBlocks(): void { + async openBlocks(): Promise { + const { CoreBlockSideBlocksComponent } = await import('@features/block/components/side-blocks/side-blocks'); + CoreModals.openSideModal({ component: CoreBlockSideBlocksComponent, componentProps: { diff --git a/src/core/features/block/components/side-blocks/side-blocks.ts b/src/core/features/block/components/side-blocks/side-blocks.ts index b677274a5..d4ac02876 100644 --- a/src/core/features/block/components/side-blocks/side-blocks.ts +++ b/src/core/features/block/components/side-blocks/side-blocks.ts @@ -24,6 +24,8 @@ import { CoreTextUtils } from '@services/utils/text'; import { CoreDom } from '@singletons/dom'; import { ContextLevel } from '@/core/constants'; import { CoreWait } from '@singletons/wait'; +import { CoreSharedModule } from '@/core/shared.module'; +import { CoreBlockComponentsModule } from '../components.module'; /** * Component that displays the list of side blocks. @@ -31,7 +33,12 @@ import { CoreWait } from '@singletons/wait'; @Component({ selector: 'core-block-side-blocks', templateUrl: 'side-blocks.html', - styleUrls: ['side-blocks.scss'], + styleUrl: 'side-blocks.scss', + standalone: true, + imports: [ + CoreSharedModule, + CoreBlockComponentsModule, + ], }) export class CoreBlockSideBlocksComponent implements OnInit { diff --git a/src/core/features/course/classes/main-resource-component.ts b/src/core/features/course/classes/main-resource-component.ts index a2e8c5d95..e3b994b08 100644 --- a/src/core/features/course/classes/main-resource-component.ts +++ b/src/core/features/course/classes/main-resource-component.ts @@ -24,7 +24,7 @@ import { CoreUtils } from '@services/utils/utils'; import { Translate } from '@singletons'; import { CoreEventObserver, CoreEvents } from '@singletons/events'; import { CoreLogger } from '@singletons/logger'; -import { CoreCourseModuleSummaryComponent, CoreCourseModuleSummaryResult } from '../components/module-summary/module-summary'; +import { CoreCourseModuleSummaryResult } from '../components/module-summary/module-summary'; import { CoreCourseContentsPage } from '../pages/contents/contents'; import { CoreCourse } from '../services/course'; import { CoreCourseHelper, CoreCourseModuleData } from '../services/course-helper'; @@ -425,6 +425,8 @@ export class CoreCourseModuleMainResourceComponent implements OnInit, OnDestroy, return; } + const { CoreCourseModuleSummaryComponent } = await import('@features/course/components/module-summary/module-summary'); + const data = await CoreModals.openSideModal({ component: CoreCourseModuleSummaryComponent, componentProps: { diff --git a/src/core/features/course/components/components.module.ts b/src/core/features/course/components/components.module.ts index 4a8a1d4f1..dcac3d294 100644 --- a/src/core/features/course/components/components.module.ts +++ b/src/core/features/course/components/components.module.ts @@ -24,7 +24,6 @@ import { CoreCourseUnsupportedModuleComponent } from './unsupported-module/unsup import { CoreCourseModuleCompletionLegacyComponent } from './module-completion-legacy/module-completion-legacy'; import { CoreCourseModuleInfoComponent } from './module-info/module-info'; import { CoreCourseModuleNavigationComponent } from './module-navigation/module-navigation'; -import { CoreCourseModuleSummaryComponent } from './module-summary/module-summary'; import { CoreCourseCourseIndexTourComponent } from './course-index-tour/course-index-tour'; import { CoreRemindersComponentsModule } from '@features/reminders/components/components.module'; import { CoreCourseModuleCompletionDetailsComponent } from './module-completion-details/module-completion-details'; @@ -40,7 +39,6 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion- CoreCourseTagAreaComponent, CoreCourseUnsupportedModuleComponent, CoreCourseModuleNavigationComponent, - CoreCourseModuleSummaryComponent, CoreCourseModuleCompletionDetailsComponent, ], imports: [ @@ -58,7 +56,6 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion- CoreCourseTagAreaComponent, CoreCourseUnsupportedModuleComponent, CoreCourseModuleNavigationComponent, - CoreCourseModuleSummaryComponent, CoreCourseModuleCompletionDetailsComponent, ], }) diff --git a/src/core/features/course/components/course-format/course-format.ts b/src/core/features/course/components/course-format/course-format.ts index e836d75d7..e89377e26 100644 --- a/src/core/features/course/components/course-format/course-format.ts +++ b/src/core/features/course/components/course-format/course-format.ts @@ -51,7 +51,6 @@ import { CoreCourseCourseIndexTourComponent } from '../course-index-tour/course- import { CoreDom } from '@singletons/dom'; import { CoreUserTourDirectiveOptions } from '@directives/user-tour'; import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; -import { CoreBlockSideBlocksComponent } from '@features/block/components/side-blocks/side-blocks'; import { ContextLevel } from '@/core/constants'; import { CoreModals } from '@services/modals'; @@ -317,6 +316,8 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy { this.sectionChanged(section); } } else if (this.initialBlockInstanceId && this.displayBlocks && this.hasBlocks) { + const { CoreBlockSideBlocksComponent } = await import('@features/block/components/side-blocks/side-blocks'); + CoreModals.openSideModal({ component: CoreBlockSideBlocksComponent, componentProps: { 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 edaae3b37..45c6fe5d9 100644 --- a/src/core/features/course/components/module-summary/module-summary.ts +++ b/src/core/features/course/components/module-summary/module-summary.ts @@ -33,6 +33,7 @@ import { CoreUtils } from '@services/utils/utils'; import { ModalController, NgZone } from '@singletons'; import { CoreEventObserver, CoreEvents } from '@singletons/events'; import { Subscription } from 'rxjs'; +import { CoreSharedModule } from '@/core/shared.module'; /** * Component to display a module summary modal. @@ -40,7 +41,11 @@ import { Subscription } from 'rxjs'; @Component({ selector: 'core-course-module-summary', templateUrl: 'module-summary.html', - styleUrls: ['module-summary.scss'], + styleUrl: 'module-summary.scss', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class CoreCourseModuleSummaryComponent implements OnInit, OnDestroy { diff --git a/src/core/features/course/pages/module-preview/module-preview.ts b/src/core/features/course/pages/module-preview/module-preview.ts index 86219e53e..c47db58f3 100644 --- a/src/core/features/course/pages/module-preview/module-preview.ts +++ b/src/core/features/course/pages/module-preview/module-preview.ts @@ -13,10 +13,7 @@ // limitations under the License. import { Component, OnInit } from '@angular/core'; -import { - CoreCourseModuleSummaryResult, - CoreCourseModuleSummaryComponent, -} from '@features/course/components/module-summary/module-summary'; +import { CoreCourseModuleSummaryResult } from '@features/course/components/module-summary/module-summary'; import { CoreCourse } from '@features/course/services/course'; import { CoreCourseHelper, CoreCourseModuleData, CoreCourseSection } from '@features/course/services/course-helper'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; @@ -107,6 +104,8 @@ export class CoreCourseModulePreviewPage implements OnInit { return; } + const { CoreCourseModuleSummaryComponent } = await import('@features/course/components/module-summary/module-summary'); + const data = await CoreModals.openSideModal({ component: CoreCourseModuleSummaryComponent, componentProps: { diff --git a/src/core/features/course/services/course-helper.ts b/src/core/features/course/services/course-helper.ts index f0671b3f4..109ab4dbd 100644 --- a/src/core/features/course/services/course-helper.ts +++ b/src/core/features/course/services/course-helper.ts @@ -69,7 +69,6 @@ import { CoreNavigationOptions, CoreNavigator } from '@services/navigator'; import { CoreSiteHomeHomeHandlerService } from '@features/sitehome/services/handlers/sitehome-home'; import { CoreStatusWithWarningsWSResponse } from '@services/ws'; import { CoreCourseWithImageAndColor } from '@features/courses/services/courses-helper'; -import { CoreCourseSummaryPage } from '../pages/course-summary/course-summary.page'; import { CoreRemindersPushNotificationData } from '@features/reminders/services/reminders'; import { CoreLocalNotifications } from '@services/local-notifications'; import { CoreEnrol } from '@features/enrol/services/enrol'; @@ -1997,6 +1996,7 @@ export class CoreCourseHelperProvider { /** * Retrieves course summary page module. + * This is meant to be here so it can be overriden. * * @returns Course summary page module. */ @@ -2009,7 +2009,9 @@ export class CoreCourseHelperProvider { * * @param course Course selected */ - openCourseSummary(course: CoreCourseWithImageAndColor & CoreCourseAnyCourseData): void { + async openCourseSummary(course: CoreCourseWithImageAndColor & CoreCourseAnyCourseData): Promise { + const { CoreCourseSummaryPage } = await import('../pages/course-summary/course-summary.page'); + CoreModals.openSideModal({ component: CoreCourseSummaryPage, componentProps: { diff --git a/src/core/features/editor/components/components.module.ts b/src/core/features/editor/components/components.module.ts index 8bc9e4105..b5e3bfb65 100644 --- a/src/core/features/editor/components/components.module.ts +++ b/src/core/features/editor/components/components.module.ts @@ -24,8 +24,6 @@ import { CoreSharedModule } from '@/core/shared.module'; imports: [ CoreSharedModule, ], - providers: [ - ], exports: [ CoreEditorRichTextEditorComponent, ], diff --git a/src/core/features/h5p/components/components.module.ts b/src/core/features/h5p/components/components.module.ts index 509b92edb..8e806fce4 100644 --- a/src/core/features/h5p/components/components.module.ts +++ b/src/core/features/h5p/components/components.module.ts @@ -26,8 +26,6 @@ import { CoreH5PIframeComponent } from './h5p-iframe/h5p-iframe'; imports: [ CoreSharedModule, ], - providers: [ - ], exports: [ CoreH5PPlayerComponent, CoreH5PIframeComponent, diff --git a/src/core/features/login/components/components.module.ts b/src/core/features/login/components/components.module.ts index 6407dd57b..1d2fc3fa7 100644 --- a/src/core/features/login/components/components.module.ts +++ b/src/core/features/login/components/components.module.ts @@ -14,14 +14,12 @@ import { NgModule } from '@angular/core'; import { CoreSharedModule } from '@/core/shared.module'; -import { CoreLoginSitesModalComponent } from './sites-modal/sites-modal'; import { CoreLoginMethodsComponent } from './login-methods/login-methods'; import { CoreLoginExceededAttemptsComponent } from '@features/login/components/exceeded-attempts/exceeded-attempts'; @NgModule({ declarations: [ CoreLoginExceededAttemptsComponent, - CoreLoginSitesModalComponent, CoreLoginMethodsComponent, ], imports: [ @@ -29,7 +27,6 @@ import { CoreLoginExceededAttemptsComponent } from '@features/login/components/e ], exports: [ CoreLoginExceededAttemptsComponent, - CoreLoginSitesModalComponent, CoreLoginMethodsComponent, ], }) diff --git a/src/core/features/login/components/sites-modal/sites-modal.ts b/src/core/features/login/components/sites-modal/sites-modal.ts index e938c4f7e..897f27487 100644 --- a/src/core/features/login/components/sites-modal/sites-modal.ts +++ b/src/core/features/login/components/sites-modal/sites-modal.ts @@ -21,6 +21,7 @@ import { CoreNavigator } from '@services/navigator'; import { CoreFilter } from '@features/filter/services/filter'; import { CoreAnimations } from '@components/animations'; import { ModalController } from '@singletons'; +import { CoreSharedModule } from '@/core/shared.module'; /** * Modal that displays a list of sites to be able to enter or delete a site. @@ -29,6 +30,10 @@ import { ModalController } from '@singletons'; selector: 'core-login-sites-modal', templateUrl: 'sites-modal.html', animations: [CoreAnimations.SLIDE_IN_OUT, CoreAnimations.SHOW_HIDE], + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class CoreLoginSitesModalComponent implements OnInit { diff --git a/src/core/features/mainmenu/components/components.module.ts b/src/core/features/mainmenu/components/components.module.ts index c81a44b1d..763cbd86a 100644 --- a/src/core/features/mainmenu/components/components.module.ts +++ b/src/core/features/mainmenu/components/components.module.ts @@ -15,14 +15,12 @@ import { NgModule } from '@angular/core'; import { CoreSharedModule } from '@/core/shared.module'; import { CoreMainMenuUserButtonComponent } from './user-menu-button/user-menu-button'; -import { CoreMainMenuUserMenuComponent } from './user-menu/user-menu'; import { CoreLoginComponentsModule } from '@features/login/components/components.module'; import { CoreMainMenuUserMenuTourComponent } from './user-menu-tour/user-menu-tour'; @NgModule({ declarations: [ CoreMainMenuUserButtonComponent, - CoreMainMenuUserMenuComponent, CoreMainMenuUserMenuTourComponent, ], imports: [ @@ -31,7 +29,6 @@ import { CoreMainMenuUserMenuTourComponent } from './user-menu-tour/user-menu-to ], exports: [ CoreMainMenuUserButtonComponent, - CoreMainMenuUserMenuComponent, CoreMainMenuUserMenuTourComponent, ], }) diff --git a/src/core/features/mainmenu/components/user-menu-button/user-menu-button.ts b/src/core/features/mainmenu/components/user-menu-button/user-menu-button.ts index b520be854..369dfc41e 100644 --- a/src/core/features/mainmenu/components/user-menu-button/user-menu-button.ts +++ b/src/core/features/mainmenu/components/user-menu-button/user-menu-button.ts @@ -21,7 +21,6 @@ import { CoreScreen } from '@services/screen'; import { CoreSites } from '@services/sites'; import { CoreModals } from '@services/modals'; import { CoreMainMenuUserMenuTourComponent } from '../user-menu-tour/user-menu-tour'; -import { CoreMainMenuUserMenuComponent } from '../user-menu/user-menu'; import { CoreMainMenuPage } from '@features/mainmenu/pages/menu/menu'; /** @@ -62,10 +61,12 @@ export class CoreMainMenuUserButtonComponent implements OnInit { * * @param event Click event. */ - openUserMenu(event: Event): void { + async openUserMenu(event: Event): Promise { event.preventDefault(); event.stopPropagation(); + const { CoreMainMenuUserMenuComponent } = await import('../user-menu/user-menu'); + CoreModals.openSideModal({ component: CoreMainMenuUserMenuComponent, }); diff --git a/src/core/features/mainmenu/components/user-menu/user-menu.ts b/src/core/features/mainmenu/components/user-menu/user-menu.ts index 1387bea70..6cedcae32 100644 --- a/src/core/features/mainmenu/components/user-menu/user-menu.ts +++ b/src/core/features/mainmenu/components/user-menu/user-menu.ts @@ -13,11 +13,11 @@ // limitations under the License. import { CoreConstants } from '@/core/constants'; +import { CoreSharedModule } from '@/core/shared.module'; import { Component, OnDestroy, OnInit } from '@angular/core'; import { CoreSite } from '@classes/sites/site'; import { CoreSiteInfo } from '@classes/sites/unauthenticated-site'; import { CoreFilter } from '@features/filter/services/filter'; -import { CoreLoginSitesModalComponent } from '@features/login/components/sites-modal/sites-modal'; import { CoreLoginHelper } from '@features/login/services/login-helper'; import { CoreUserAuthenticatedSupportConfig } from '@features/user/classes/support/authenticated-support-config'; import { CoreUserSupport } from '@features/user/services/support'; @@ -42,7 +42,11 @@ import { Subscription } from 'rxjs'; @Component({ selector: 'core-main-menu-user-menu', templateUrl: 'user-menu.html', - styleUrls: ['user-menu.scss'], + styleUrl: 'user-menu.scss', + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class CoreMainMenuUserMenuComponent implements OnInit, OnDestroy { @@ -249,6 +253,8 @@ export class CoreMainMenuUserMenuComponent implements OnInit, OnDestroy { event.preventDefault(); event.stopPropagation(); + const { CoreLoginSitesModalComponent } = await import('@features/login/components/sites-modal/sites-modal'); + const closeAll = await CoreModals.openSideModal({ component: CoreLoginSitesModalComponent, cssClass: 'core-modal-lateral core-modal-lateral-sm', diff --git a/src/core/features/reportbuilder/components/components.module.ts b/src/core/features/reportbuilder/components/components.module.ts index f8f269fc3..958aaaf4f 100644 --- a/src/core/features/reportbuilder/components/components.module.ts +++ b/src/core/features/reportbuilder/components/components.module.ts @@ -16,7 +16,6 @@ import { NgModule } from '@angular/core'; import { CoreSharedModule } from '@/core/shared.module'; import { CoreReportBuilderReportColumnComponent } from './report-column/report-column'; import { CoreReportBuilderReportDetailComponent } from './report-detail/report-detail'; -import { CoreReportBuilderReportSummaryComponent } from './report-summary/report-summary'; @NgModule({ imports: [ @@ -25,12 +24,10 @@ import { CoreReportBuilderReportSummaryComponent } from './report-summary/report declarations: [ CoreReportBuilderReportDetailComponent, CoreReportBuilderReportColumnComponent, - CoreReportBuilderReportSummaryComponent, ], exports: [ CoreReportBuilderReportDetailComponent, CoreReportBuilderReportColumnComponent, - CoreReportBuilderReportSummaryComponent, ], }) export class CoreReportBuilderComponentsModule {} diff --git a/src/core/features/reportbuilder/components/report-summary/report-summary.ts b/src/core/features/reportbuilder/components/report-summary/report-summary.ts index a08e8cd95..13b3650c5 100644 --- a/src/core/features/reportbuilder/components/report-summary/report-summary.ts +++ b/src/core/features/reportbuilder/components/report-summary/report-summary.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { CoreSharedModule } from '@/core/shared.module'; import { ChangeDetectionStrategy, Component, Input, OnInit } from '@angular/core'; import { CoreReportBuilderReportDetail } from '@features/reportbuilder/services/reportbuilder'; import { CoreFormatDatePipe } from '@pipes/format-date'; @@ -21,8 +22,12 @@ import { ModalController } from '@singletons'; @Component({ selector: 'core-report-builder-report-summary', templateUrl: './report-summary.html', - styleUrls: ['./report-summary.scss'], + styleUrl: './report-summary.scss', changeDetection: ChangeDetectionStrategy.OnPush, + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class CoreReportBuilderReportSummaryComponent implements OnInit { @@ -30,6 +35,9 @@ export class CoreReportBuilderReportSummaryComponent implements OnInit { reportUrl!: string; reportDetailToDisplay!: { title: string; text: string }[]; + /** + * @inheritdoc + */ ngOnInit(): void { const formatDate = new CoreFormatDatePipe(); const site = CoreSites.getRequiredCurrentSite(); @@ -54,6 +62,9 @@ export class CoreReportBuilderReportSummaryComponent implements OnInit { ]; } + /** + * Close the modal. + */ closeModal(): void { ModalController.dismiss(); } diff --git a/src/core/features/reportbuilder/pages/report/report.ts b/src/core/features/reportbuilder/pages/report/report.ts index c44252df5..1321e4629 100644 --- a/src/core/features/reportbuilder/pages/report/report.ts +++ b/src/core/features/reportbuilder/pages/report/report.ts @@ -13,7 +13,6 @@ // limitations under the License. import { Component, OnInit } from '@angular/core'; -import { CoreReportBuilderReportSummaryComponent } from '@features/reportbuilder/components/report-summary/report-summary'; import { CoreReportBuilderReportDetail } from '@features/reportbuilder/services/reportbuilder'; import { CoreModals } from '@services/modals'; import { CoreNavigator } from '@services/navigator'; @@ -26,6 +25,7 @@ export class CoreReportBuilderReportPage implements OnInit { reportId!: string; reportDetail?: CoreReportBuilderReportDetail; + /** * @inheritdoc */ @@ -42,7 +42,13 @@ export class CoreReportBuilderReportPage implements OnInit { this.reportDetail = reportDetail; } - openInfo(): void { + /** + * Open the report info modal. + */ + async openInfo(): Promise { + const { CoreReportBuilderReportSummaryComponent } = + await import('@features/reportbuilder/components/report-summary/report-summary'); + CoreModals.openSideModal({ component: CoreReportBuilderReportSummaryComponent, componentProps: { reportDetail: this.reportDetail }, diff --git a/src/core/features/search/components/global-search-filters/global-search-filters.component.ts b/src/core/features/search/components/global-search-filters/global-search-filters.component.ts index 75eae485b..dbd15dc0a 100644 --- a/src/core/features/search/components/global-search-filters/global-search-filters.component.ts +++ b/src/core/features/search/components/global-search-filters/global-search-filters.component.ts @@ -23,6 +23,7 @@ import { import { CoreEvents } from '@singletons/events'; import { ModalController } from '@singletons'; import { CoreUtils } from '@services/utils/utils'; +import { CoreSharedModule } from '@/core/shared.module'; type Filter = T & { checked: boolean }; @@ -30,6 +31,10 @@ type Filter = T & { checked: boolean }; selector: 'core-search-global-search-filters', templateUrl: 'global-search-filters.html', styleUrls: ['./global-search-filters.scss'], + standalone: true, + imports: [ + CoreSharedModule, + ], }) export class CoreSearchGlobalSearchFiltersComponent implements OnInit { diff --git a/src/core/features/search/components/global-search-filters/global-search-filters.module.ts b/src/core/features/search/components/global-search-filters/global-search-filters.module.ts deleted file mode 100644 index 0cd203468..000000000 --- a/src/core/features/search/components/global-search-filters/global-search-filters.module.ts +++ /dev/null @@ -1,30 +0,0 @@ -// (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. - -import { CoreSharedModule } from '@/core/shared.module'; -import { NgModule } from '@angular/core'; - -import { CoreSearchGlobalSearchFiltersComponent } from './global-search-filters.component'; - -export { CoreSearchGlobalSearchFiltersComponent }; - -@NgModule({ - imports: [ - CoreSharedModule, - ], - declarations: [ - CoreSearchGlobalSearchFiltersComponent, - ], -}) -export class CoreSearchGlobalSearchFiltersComponentModule {} diff --git a/src/core/features/search/pages/global-search/global-search.ts b/src/core/features/search/pages/global-search/global-search.ts index 059899d8c..00451e924 100644 --- a/src/core/features/search/pages/global-search/global-search.ts +++ b/src/core/features/search/pages/global-search/global-search.ts @@ -138,7 +138,7 @@ export class CoreSearchGlobalSearchPage implements OnInit, OnDestroy, AfterViewI */ async openFilters(): Promise { const { CoreSearchGlobalSearchFiltersComponent } = - await import('@features/search/components/global-search-filters/global-search-filters.module'); + await import('@features/search/components/global-search-filters/global-search-filters.component'); await CoreModals.openSideModal({ component: CoreSearchGlobalSearchFiltersComponent, diff --git a/src/core/features/sitehome/pages/index/index.ts b/src/core/features/sitehome/pages/index/index.ts index 30ff59412..8e116aabf 100644 --- a/src/core/features/sitehome/pages/index/index.ts +++ b/src/core/features/sitehome/pages/index/index.ts @@ -30,7 +30,6 @@ import { CoreBlockHelper } from '@features/block/services/block-helper'; import { CoreUtils } from '@services/utils/utils'; import { CoreTime } from '@singletons/time'; import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; -import { CoreBlockSideBlocksComponent } from '@features/block/components/side-blocks/side-blocks'; import { ContextLevel } from '@/core/constants'; import { CoreModals } from '@services/modals'; @@ -228,12 +227,14 @@ export class CoreSiteHomeIndexPage implements OnInit, OnDestroy { /** * Check whether there is a focused instance in the page parameters and open it. */ - private openFocusedInstance() { + private async openFocusedInstance() { const blockInstanceId = CoreNavigator.getRouteNumberParam('blockInstanceId'); if (!blockInstanceId) { return; } + const { CoreBlockSideBlocksComponent } = await import('@features/block/components/side-blocks/side-blocks'); + CoreModals.openSideModal({ component: CoreBlockSideBlocksComponent, componentProps: { diff --git a/src/core/features/siteplugins/components/module-index/module-index.ts b/src/core/features/siteplugins/components/module-index/module-index.ts index 970092bb7..6d6291235 100644 --- a/src/core/features/siteplugins/components/module-index/module-index.ts +++ b/src/core/features/siteplugins/components/module-index/module-index.ts @@ -15,10 +15,7 @@ import { Component, OnInit, OnDestroy, Input, ViewChild, HostBinding } from '@angular/core'; import { CoreSiteWSPreSets } from '@classes/sites/authenticated-site'; -import { - CoreCourseModuleSummaryResult, - CoreCourseModuleSummaryComponent, -} from '@features/course/components/module-summary/module-summary'; +import { CoreCourseModuleSummaryResult } from '@features/course/components/module-summary/module-summary'; import { CoreCourse } from '@features/course/services/course'; import { CoreCourseModuleData } from '@features/course/services/course-helper'; import { @@ -157,6 +154,8 @@ export class CoreSitePluginsModuleIndexComponent implements OnInit, OnDestroy, C return; } + const { CoreCourseModuleSummaryComponent } = await import('@features/course/components/module-summary/module-summary'); + const data = await CoreModals.openSideModal({ component: CoreCourseModuleSummaryComponent, componentProps: {