diff --git a/src/core/features/course/components/components.module.ts b/src/core/features/course/components/components.module.ts index dcac3d294..72b78780f 100644 --- a/src/core/features/course/components/components.module.ts +++ b/src/core/features/course/components/components.module.ts @@ -16,7 +16,6 @@ import { NgModule } from '@angular/core'; import { CoreSharedModule } from '@/core/shared.module'; import { CoreBlockComponentsModule } from '@features/block/components/components.module'; -import { CoreCourseFormatComponent } from './course-format/course-format'; import { CoreCourseModuleComponent } from './module/module'; import { CoreCourseModuleCompletionComponent } from './module-completion/module-completion'; import { CoreCourseTagAreaComponent } from './tag-area/tag-area'; @@ -30,7 +29,6 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion- @NgModule({ declarations: [ - CoreCourseFormatComponent, CoreCourseModuleComponent, CoreCourseModuleCompletionComponent, CoreCourseModuleCompletionLegacyComponent, @@ -47,7 +45,6 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion- CoreSharedModule, ], exports: [ - CoreCourseFormatComponent, CoreCourseModuleComponent, CoreCourseModuleCompletionComponent, CoreCourseModuleCompletionLegacyComponent, 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 e89377e26..2f472b486 100644 --- a/src/core/features/course/components/course-format/course-format.ts +++ b/src/core/features/course/components/course-format/course-format.ts @@ -53,6 +53,9 @@ import { CoreUserTourDirectiveOptions } from '@directives/user-tour'; import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; import { ContextLevel } from '@/core/constants'; import { CoreModals } from '@services/modals'; +import { CoreSharedModule } from '@/core/shared.module'; +import { CoreBlockComponentsModule } from '@features/block/components/components.module'; +import { CoreCourseComponentsModule } from '../components.module'; /** * Component to display course contents using a certain format. If the format isn't found, use default one. @@ -68,6 +71,12 @@ import { CoreModals } from '@services/modals'; selector: 'core-course-format', templateUrl: 'course-format.html', styleUrls: ['course-format.scss'], + standalone: true, + imports: [ + CoreSharedModule, + CoreBlockComponentsModule, + CoreCourseComponentsModule, + ], }) export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy { diff --git a/src/core/features/course/course-contents-lazy.module.ts b/src/core/features/course/course-contents-lazy.module.ts index fbbd96d6d..0d1d84b74 100644 --- a/src/core/features/course/course-contents-lazy.module.ts +++ b/src/core/features/course/course-contents-lazy.module.ts @@ -19,6 +19,7 @@ import { CoreCourseComponentsModule } from '@features/course/components/componen import { CoreSharedModule } from '@/core/shared.module'; import { resolveContentsRoutes } from '@features/course/course-contents-routing.module'; import { CoreCourseContentsPage } from '@features/course/pages/contents/contents'; +import { CoreCourseFormatComponent } from './components/course-format/course-format'; /** * Build module routes. @@ -46,6 +47,7 @@ function buildRoutes(injector: Injector): Routes { imports: [ CoreSharedModule, CoreCourseComponentsModule, + CoreCourseFormatComponent, ], declarations: [ CoreCourseContentsPage, diff --git a/src/core/features/course/course.module.ts b/src/core/features/course/course.module.ts index bddcbe8a4..1cd36f03a 100644 --- a/src/core/features/course/course.module.ts +++ b/src/core/features/course/course.module.ts @@ -99,10 +99,13 @@ export async function getCourseStandaloneComponents(): Promise[]> // eslint-disable-next-line deprecation/deprecation const { CoreCourseModuleManualCompletionComponent } = await import('@features/course/components/module-manual-completion/module-manual-completion'); + const { CoreCourseFormatComponent } = + await import('@features/course/components/course-format/course-format'); return [ CoreCourseModuleDescriptionComponent, CoreCourseModuleManualCompletionComponent, + CoreCourseFormatComponent, ]; } diff --git a/src/core/features/course/services/course.ts b/src/core/features/course/services/course.ts index dfb5e833e..2e6b48830 100644 --- a/src/core/features/course/services/course.ts +++ b/src/core/features/course/services/course.ts @@ -1400,7 +1400,7 @@ export class CoreCourseProvider { }); return; - } catch (error) { + } catch { // The site plugin failed to load. The user needs to restart the app to try loading it again. const message = Translate.instant('core.courses.errorloadplugins'); const reload = Translate.instant('core.courses.reload');