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] 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 ===