diff --git a/gulpfile.js b/gulpfile.js index 7994ecc06..1fc070779 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -293,7 +293,8 @@ var templatesSrc = [ './src/core/**/components/**/*.html', './src/core/**/component/**/*.html', // Only some addon components are injected to compile to decrease load time. Copy only the ones that are needed. - './src/addon/mod/assign/components/**/*.html' + './src/addon/mod/assign/components/**/*.html', + './src/addon/mod/workshop/components/**/*.html' ], templatesDest = './www/templates'; diff --git a/src/addon/mod/workshop/components/assessment-strategy/assessment-strategy.html b/src/addon/mod/workshop/components/assessment-strategy/addon-mod-workshop-assessment-strategy.html similarity index 100% rename from src/addon/mod/workshop/components/assessment-strategy/assessment-strategy.html rename to src/addon/mod/workshop/components/assessment-strategy/addon-mod-workshop-assessment-strategy.html diff --git a/src/addon/mod/workshop/components/assessment-strategy/assessment-strategy.ts b/src/addon/mod/workshop/components/assessment-strategy/assessment-strategy.ts index 05431ba3d..b4c0fa51a 100644 --- a/src/addon/mod/workshop/components/assessment-strategy/assessment-strategy.ts +++ b/src/addon/mod/workshop/components/assessment-strategy/assessment-strategy.ts @@ -33,7 +33,7 @@ import { AddonWorkshopAssessmentStrategyDelegate } from '../../providers/assessm */ @Component({ selector: 'addon-mod-workshop-assessment-strategy', - templateUrl: 'assessment-strategy.html', + templateUrl: 'addon-mod-workshop-assessment-strategy.html', }) export class AddonModWorkshopAssessmentStrategyComponent implements OnInit { diff --git a/src/addon/mod/workshop/components/assessment/assessment.html b/src/addon/mod/workshop/components/assessment/addon-mod-workshop-assessment.html similarity index 100% rename from src/addon/mod/workshop/components/assessment/assessment.html rename to src/addon/mod/workshop/components/assessment/addon-mod-workshop-assessment.html diff --git a/src/addon/mod/workshop/components/assessment/assessment.ts b/src/addon/mod/workshop/components/assessment/assessment.ts index 7e16f1491..6df7556f9 100644 --- a/src/addon/mod/workshop/components/assessment/assessment.ts +++ b/src/addon/mod/workshop/components/assessment/assessment.ts @@ -25,7 +25,7 @@ import { AddonModWorkshopOfflineProvider } from '../../providers/offline'; */ @Component({ selector: 'addon-mod-workshop-assessment', - templateUrl: 'assessment.html', + templateUrl: 'addon-mod-workshop-assessment.html', }) export class AddonModWorkshopAssessmentComponent implements OnInit { @Input() assessment: any; diff --git a/src/addon/mod/workshop/components/index/index.html b/src/addon/mod/workshop/components/index/addon-mod-workshop-index.html similarity index 100% rename from src/addon/mod/workshop/components/index/index.html rename to src/addon/mod/workshop/components/index/addon-mod-workshop-index.html diff --git a/src/addon/mod/workshop/components/index/index.ts b/src/addon/mod/workshop/components/index/index.ts index ffa4ee648..5a1004709 100644 --- a/src/addon/mod/workshop/components/index/index.ts +++ b/src/addon/mod/workshop/components/index/index.ts @@ -27,7 +27,7 @@ import { AddonModWorkshopOfflineProvider } from '../../providers/offline'; */ @Component({ selector: 'addon-mod-workshop-index', - templateUrl: 'index.html', + templateUrl: 'addon-mod-workshop-index.html', }) export class AddonModWorkshopIndexComponent extends CoreCourseModuleMainActivityComponent { @Input() group = 0; diff --git a/src/addon/mod/workshop/components/submission/submission.html b/src/addon/mod/workshop/components/submission/addon-mod-workshop-submission.html similarity index 100% rename from src/addon/mod/workshop/components/submission/submission.html rename to src/addon/mod/workshop/components/submission/addon-mod-workshop-submission.html diff --git a/src/addon/mod/workshop/components/submission/submission.ts b/src/addon/mod/workshop/components/submission/submission.ts index b704faac7..235a8d179 100644 --- a/src/addon/mod/workshop/components/submission/submission.ts +++ b/src/addon/mod/workshop/components/submission/submission.ts @@ -25,7 +25,7 @@ import { AddonModWorkshopOfflineProvider } from '../../providers/offline'; */ @Component({ selector: 'addon-mod-workshop-submission', - templateUrl: 'submission.html', + templateUrl: 'addon-mod-workshop-submission.html', }) export class AddonModWorkshopSubmissionComponent implements OnInit { @Input() submission: any; diff --git a/src/addon/mod/workshop/workshop.module.ts b/src/addon/mod/workshop/workshop.module.ts index c8883148b..cff6c9151 100644 --- a/src/addon/mod/workshop/workshop.module.ts +++ b/src/addon/mod/workshop/workshop.module.ts @@ -30,6 +30,15 @@ import { AddonModWorkshopPrefetchHandler } from './providers/prefetch-handler'; import { AddonModWorkshopSyncCronHandler } from './providers/sync-cron-handler'; import { CoreUpdateManagerProvider } from '@providers/update-manager'; +// List of providers (without handlers). +export const ADDON_MOD_WORKSHOP_PROVIDERS: any[] = [ + AddonModWorkshopProvider, + AddonModWorkshopOfflineProvider, + AddonModWorkshopSyncProvider, + AddonModWorkshopHelperProvider, + AddonWorkshopAssessmentStrategyDelegate +]; + @NgModule({ declarations: [ ], diff --git a/src/core/compile/providers/compile.ts b/src/core/compile/providers/compile.ts index ec515a010..0d5eab7b8 100644 --- a/src/core/compile/providers/compile.ts +++ b/src/core/compile/providers/compile.ts @@ -108,6 +108,7 @@ import { ADDON_MOD_SCORM_PROVIDERS } from '@addon/mod/scorm/scorm.module'; import { ADDON_MOD_SURVEY_PROVIDERS } from '@addon/mod/survey/survey.module'; import { ADDON_MOD_URL_PROVIDERS } from '@addon/mod/url/url.module'; import { ADDON_MOD_WIKI_PROVIDERS } from '@addon/mod/wiki/wiki.module'; +import { ADDON_MOD_WORKSHOP_PROVIDERS } from '@addon/mod/workshop/workshop.module'; import { ADDON_NOTES_PROVIDERS } from '@addon/notes/notes.module'; import { ADDON_NOTIFICATIONS_PROVIDERS } from '@addon/notifications/notifications.module'; import { ADDON_PUSHNOTIFICATIONS_PROVIDERS } from '@addon/pushnotifications/pushnotifications.module'; @@ -115,6 +116,7 @@ import { ADDON_REMOTETHEMES_PROVIDERS } from '@addon/remotethemes/remotethemes.m // Import some addon modules that define components, directives and pipes. Only import the important ones. import { AddonModAssignComponentsModule } from '@addon/mod/assign/components/components.module'; +import { AddonModWorkshopComponentsModule } from '@addon/mod/workshop/components/components.module'; /** * Service to provide functionalities regarding compiling dynamic HTML and Javascript. @@ -136,6 +138,7 @@ export class CoreCompileProvider { IonicModule, TranslateModule.forChild(), CoreComponentsModule, CoreDirectivesModule, CorePipesModule, CoreCourseComponentsModule, CoreCoursesComponentsModule, CoreSiteHomeComponentsModule, CoreUserComponentsModule, CoreCourseDirectivesModule, CoreSitePluginsDirectivesModule, CoreQuestionComponentsModule, AddonModAssignComponentsModule, + AddonModWorkshopComponentsModule ]; constructor(protected injector: Injector, logger: CoreLoggerProvider, compilerFactory: JitCompilerFactory) { @@ -222,7 +225,7 @@ export class CoreCompileProvider { .concat(ADDON_MOD_LESSON_PROVIDERS).concat(ADDON_MOD_LTI_PROVIDERS).concat(ADDON_MOD_PAGE_PROVIDERS) .concat(ADDON_MOD_QUIZ_PROVIDERS).concat(ADDON_MOD_RESOURCE_PROVIDERS).concat(ADDON_MOD_SCORM_PROVIDERS) .concat(ADDON_MOD_SURVEY_PROVIDERS).concat(ADDON_MOD_URL_PROVIDERS).concat(ADDON_MOD_WIKI_PROVIDERS) - .concat(ADDON_NOTES_PROVIDERS).concat(ADDON_NOTIFICATIONS_PROVIDERS) + .concat(ADDON_MOD_WORKSHOP_PROVIDERS).concat(ADDON_NOTES_PROVIDERS).concat(ADDON_NOTIFICATIONS_PROVIDERS) .concat(ADDON_PUSHNOTIFICATIONS_PROVIDERS).concat(ADDON_REMOTETHEMES_PROVIDERS); // We cannot inject anything to this constructor. Use the Injector to inject all the providers into the instance.