MOBILE-4389 course: Course format standalone component

main
Pau Ferrer Ocaña 2024-07-29 07:46:42 +02:00
parent 9e75f4c01f
commit e3b41c169e
5 changed files with 15 additions and 4 deletions

View File

@ -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,

View File

@ -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 {

View File

@ -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,

View File

@ -99,10 +99,13 @@ export async function getCourseStandaloneComponents(): Promise<Type<unknown>[]>
// 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,
];
}

View File

@ -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');