MOBILE-4498 tag: Decouple course tag services

main
Pau Ferrer Ocaña 2024-02-28 16:51:00 +01:00
parent 0efd23f019
commit 8190e638f0
2 changed files with 20 additions and 11 deletions

View File

@ -62,7 +62,7 @@ import { CORE_RATING_SERVICES } from '@features/rating/rating.module';
import { CORE_SEARCH_SERVICES } from '@features/search/search.module';
import { CORE_SETTINGS_SERVICES } from '@features/settings/settings.module';
import { CORE_SITEHOME_SERVICES } from '@features/sitehome/sitehome.module';
import { CORE_TAG_SERVICES } from '@features/tag/tag.module';
import { getTagServices } from '@features/tag/tag.module';
import { CORE_STYLE_SERVICES } from '@features/styles/styles.module';
import { CORE_USER_SERVICES } from '@features/user/user.module';
import { CORE_XAPI_SERVICES } from '@features/xapi/xapi.module';
@ -299,7 +299,6 @@ export class CoreCompileProvider {
...CORE_SHAREDFILES_SERVICES,
...CORE_SITEHOME_SERVICES,
CoreSitePluginsProvider,
...CORE_TAG_SERVICES,
...CORE_STYLE_SERVICES,
...CORE_USER_SERVICES,
...CORE_XAPI_SERVICES,
@ -411,11 +410,13 @@ export class CoreCompileProvider {
const ADDON_COURSECOMPLETION_SERVICES = await getCourseCompletionServices();
const CORE_COMMENTS_SERVICES = await getCommentsServices();
const CORE_TAG_SERVICES = await getTagServices();
return [
...ADDON_MOD_WORKSHOP_SERVICES,
...CORE_COMMENTS_SERVICES,
...ADDON_COURSECOMPLETION_SERVICES,
...CORE_COMMENTS_SERVICES,
...CORE_TAG_SERVICES,
];
}

View File

@ -22,15 +22,23 @@ import { CoreTagIndexLinkHandler } from './services/handlers/index-link';
import { CoreTagSearchLinkHandler } from './services/handlers/search-link';
import { CoreTagComponentsModule } from './components/components.module';
import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module';
import { CoreTagAreaDelegateService } from './services/tag-area-delegate';
import { CoreTagHelperProvider } from './services/tag-helper';
import { CoreTagProvider } from './services/tag';
export const CORE_TAG_SERVICES: Type<unknown>[] = [
CoreTagAreaDelegateService,
CoreTagHelperProvider,
CoreTagProvider,
];
/**
* Get tags services.
*
* @returns Tags services.
*/
export async function getTagServices(): Promise<Type<unknown>[]> {
const { CoreTagAreaDelegateService } = await import('@features/tag/services/tag-area-delegate');
const { CoreTagHelperProvider } = await import('@features/tag/services/tag-helper');
const { CoreTagProvider } = await import('@features/tag/services/tag');
return [
CoreTagAreaDelegateService,
CoreTagHelperProvider,
CoreTagProvider,
];
}
const routes: Routes = [
{