MOBILE-4653 handlers: Decouple handlers from its components

main
Pau Ferrer Ocaña 2024-11-06 12:07:25 +01:00
parent e69eed4f4c
commit 40b200d6da
57 changed files with 187 additions and 156 deletions

View File

@ -13,7 +13,6 @@
// limitations under the License. // limitations under the License.
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreTagFeedComponent } from '@features/tag/components/feed/feed';
import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate'; import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate';
import { CoreTagFeedElement, CoreTagHelper } from '@features/tag/services/tag-helper'; import { CoreTagFeedElement, CoreTagHelper } from '@features/tag/services/tag-helper';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
@ -45,7 +44,9 @@ export class AddonBadgesTagAreaHandlerService implements CoreTagAreaHandler {
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> | Promise<Type<unknown>> { async getComponent(): Promise<Type<unknown>> {
const { CoreTagFeedComponent } = await import('@features/tag/components/feed/feed');
return CoreTagFeedComponent; return CoreTagFeedComponent;
} }

View File

@ -13,7 +13,6 @@
// limitations under the License. // limitations under the License.
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreTagFeedComponent } from '@features/tag/components/feed/feed';
import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate'; import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate';
import { CoreTagFeedElement, CoreTagHelper } from '@features/tag/services/tag-helper'; import { CoreTagFeedElement, CoreTagHelper } from '@features/tag/services/tag-helper';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
@ -45,9 +44,11 @@ export class AddonBlogTagAreaHandlerService implements CoreTagAreaHandler {
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> | Promise<Type<unknown>> { async getComponent(): Promise<Type<unknown>> {
return CoreTagFeedComponent; const { CoreTagFeedComponent } = await import('@features/tag/components/feed/feed');
}
return CoreTagFeedComponent;
}
} }
export const AddonBlogTagAreaHandler = makeSingleton(AddonBlogTagAreaHandlerService); export const AddonBlogTagAreaHandler = makeSingleton(AddonBlogTagAreaHandlerService);

View File

@ -28,7 +28,6 @@ import { CoreText } from '@singletons/text';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { CoreWSFile } from '@services/ws'; import { CoreWSFile } from '@services/ws';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonModAssignFeedbackCommentsComponent } from '../component/comments';
import { CoreFileHelper } from '@services/file-helper'; import { CoreFileHelper } from '@services/file-helper';
/** /**
@ -73,7 +72,9 @@ export class AddonModAssignFeedbackCommentsHandlerService implements AddonModAss
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<IAddonModAssignFeedbackPluginComponent> { async getComponent(): Promise<Type<IAddonModAssignFeedbackPluginComponent>> {
const { AddonModAssignFeedbackCommentsComponent } = await import('../component/comments');
return AddonModAssignFeedbackCommentsComponent; return AddonModAssignFeedbackCommentsComponent;
} }

View File

@ -22,7 +22,6 @@ import { AddonModAssignFeedbackHandler } from '@addons/mod/assign/services/feedb
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreWSFile } from '@services/ws'; import { CoreWSFile } from '@services/ws';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonModAssignFeedbackEditPdfComponent } from '../component/editpdf';
import type { IAddonModAssignFeedbackPluginComponent } from '@addons/mod/assign/classes/base-feedback-plugin-component'; import type { IAddonModAssignFeedbackPluginComponent } from '@addons/mod/assign/classes/base-feedback-plugin-component';
/** /**
@ -37,7 +36,9 @@ export class AddonModAssignFeedbackEditPdfHandlerService implements AddonModAssi
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<IAddonModAssignFeedbackPluginComponent> { async getComponent(): Promise<Type<IAddonModAssignFeedbackPluginComponent>> {
const { AddonModAssignFeedbackEditPdfComponent } = await import('../component/editpdf');
return AddonModAssignFeedbackEditPdfComponent; return AddonModAssignFeedbackEditPdfComponent;
} }

View File

@ -23,7 +23,6 @@ import { AddonModAssignFeedbackHandler } from '@addons/mod/assign/services/feedb
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreWSFile } from '@services/ws'; import { CoreWSFile } from '@services/ws';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonModAssignFeedbackFileComponent } from '../component/file';
/** /**
* Handler for file feedback plugin. * Handler for file feedback plugin.
@ -37,7 +36,9 @@ export class AddonModAssignFeedbackFileHandlerService implements AddonModAssignF
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<IAddonModAssignFeedbackPluginComponent> { async getComponent(): Promise<Type<IAddonModAssignFeedbackPluginComponent>> {
const { AddonModAssignFeedbackFileComponent } = await import('../component/file');
return AddonModAssignFeedbackFileComponent; return AddonModAssignFeedbackFileComponent;
} }

View File

@ -28,7 +28,6 @@ import { CoreFileSession } from '@services/file-session';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { CoreWSFile } from '@services/ws'; import { CoreWSFile } from '@services/ws';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonModAssignSubmissionFileComponent } from '../component/file';
import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { FileEntry } from '@awesome-cordova-plugins/file/ngx';
import type { AddonModAssignSubmissionPluginBaseComponent } from '@addons/mod/assign/classes/base-submission-plugin-component'; import type { AddonModAssignSubmissionPluginBaseComponent } from '@addons/mod/assign/classes/base-submission-plugin-component';
import { ADDON_MOD_ASSIGN_COMPONENT } from '@addons/mod/assign/constants'; import { ADDON_MOD_ASSIGN_COMPONENT } from '@addons/mod/assign/constants';
@ -101,7 +100,9 @@ export class AddonModAssignSubmissionFileHandlerService implements AddonModAssig
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<AddonModAssignSubmissionPluginBaseComponent> { async getComponent(): Promise<Type<AddonModAssignSubmissionPluginBaseComponent>> {
const { AddonModAssignSubmissionFileComponent } = await import('../component/file');
return AddonModAssignSubmissionFileComponent; return AddonModAssignSubmissionFileComponent;
} }

View File

@ -29,7 +29,6 @@ import { CoreText } from '@singletons/text';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { CoreWSFile } from '@services/ws'; import { CoreWSFile } from '@services/ws';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { AddonModAssignSubmissionOnlineTextComponent } from '../component/onlinetext';
/** /**
* Handler for online text submission plugin. * Handler for online text submission plugin.
@ -111,7 +110,9 @@ export class AddonModAssignSubmissionOnlineTextHandlerService implements AddonMo
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<AddonModAssignSubmissionPluginBaseComponent> { async getComponent(): Promise<Type<AddonModAssignSubmissionPluginBaseComponent>> {
const { AddonModAssignSubmissionOnlineTextComponent } = await import('../component/onlinetext');
return AddonModAssignSubmissionOnlineTextComponent; return AddonModAssignSubmissionOnlineTextComponent;
} }

View File

@ -14,7 +14,6 @@
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreCourse } from '@features/course/services/course'; import { CoreCourse } from '@features/course/services/course';
import { CoreTagFeedComponent } from '@features/tag/components/feed/feed';
import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate'; import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate';
import { CoreTagFeedElement, CoreTagHelper } from '@features/tag/services/tag-helper'; import { CoreTagFeedElement, CoreTagHelper } from '@features/tag/services/tag-helper';
import { CoreSitesReadingStrategy } from '@services/sites'; import { CoreSitesReadingStrategy } from '@services/sites';
@ -68,11 +67,11 @@ export class AddonModBookTagAreaHandlerService implements CoreTagAreaHandler {
} }
/** /**
* Get the component to use to display items. * @inheritdoc
*
* @returns The component (or promise resolved with component) to use, undefined if not found.
*/ */
getComponent(): Type<unknown> | Promise<Type<unknown>> { async getComponent(): Promise<Type<unknown>> {
const { CoreTagFeedComponent } = await import('@features/tag/components/feed/feed');
return CoreTagFeedComponent; return CoreTagFeedComponent;
} }

View File

@ -22,7 +22,6 @@ import { AddonModDataFieldHandler } from '@addons/mod/data/services/data-fields-
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { AddonModDataFieldCheckboxComponent } from '../component/checkbox';
import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component'; import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component';
/** /**
@ -37,7 +36,9 @@ export class AddonModDataFieldCheckboxHandlerService implements AddonModDataFiel
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<AddonModDataFieldPluginBaseComponent> { async getComponent(): Promise<Type<AddonModDataFieldPluginBaseComponent>> {
const { AddonModDataFieldCheckboxComponent } = await import('../component/checkbox');
return AddonModDataFieldCheckboxComponent; return AddonModDataFieldCheckboxComponent;
} }

View File

@ -23,7 +23,6 @@ import { Injectable, Type } from '@angular/core';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { CoreTimeUtils } from '@services/utils/time'; import { CoreTimeUtils } from '@services/utils/time';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { AddonModDataFieldDateComponent } from '../component/date';
import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component'; import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component';
/** /**
@ -38,7 +37,9 @@ export class AddonModDataFieldDateHandlerService implements AddonModDataFieldHan
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<AddonModDataFieldPluginBaseComponent> { async getComponent(): Promise<Type<AddonModDataFieldPluginBaseComponent>> {
const { AddonModDataFieldDateComponent } = await import('../component/date');
return AddonModDataFieldDateComponent; return AddonModDataFieldDateComponent;
} }

View File

@ -25,7 +25,6 @@ import { FileEntry } from '@awesome-cordova-plugins/file/ngx';
import { CoreFileSession } from '@services/file-session'; import { CoreFileSession } from '@services/file-session';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { AddonModDataFieldFileComponent } from '../component/file';
import { CoreFileEntry } from '@services/file-helper'; import { CoreFileEntry } from '@services/file-helper';
import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component'; import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component';
import { ADDON_MOD_DATA_COMPONENT } from '@addons/mod/data/constants'; import { ADDON_MOD_DATA_COMPONENT } from '@addons/mod/data/constants';
@ -42,7 +41,9 @@ export class AddonModDataFieldFileHandlerService implements AddonModDataFieldHan
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<AddonModDataFieldPluginBaseComponent> { async getComponent(): Promise<Type<AddonModDataFieldPluginBaseComponent>> {
const { AddonModDataFieldFileComponent } = await import('../component/file');
return AddonModDataFieldFileComponent; return AddonModDataFieldFileComponent;
} }

View File

@ -22,7 +22,6 @@ import { AddonModDataFieldHandler } from '@addons/mod/data/services/data-fields-
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { AddonModDataFieldLatlongComponent } from '../component/latlong';
import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component'; import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component';
/** /**
@ -37,7 +36,9 @@ export class AddonModDataFieldLatlongHandlerService implements AddonModDataField
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<AddonModDataFieldPluginBaseComponent> { async getComponent(): Promise<Type<AddonModDataFieldPluginBaseComponent>> {
const { AddonModDataFieldLatlongComponent } = await import('../component/latlong');
return AddonModDataFieldLatlongComponent; return AddonModDataFieldLatlongComponent;
} }

View File

@ -22,7 +22,6 @@ import { AddonModDataFieldHandler } from '@addons/mod/data/services/data-fields-
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { AddonModDataFieldMenuComponent } from '../component/menu';
import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component'; import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component';
/** /**
@ -37,7 +36,9 @@ export class AddonModDataFieldMenuHandlerService implements AddonModDataFieldHan
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<AddonModDataFieldPluginBaseComponent> { async getComponent(): Promise<Type<AddonModDataFieldPluginBaseComponent>> {
const { AddonModDataFieldMenuComponent } = await import('../component/menu');
return AddonModDataFieldMenuComponent; return AddonModDataFieldMenuComponent;
} }

View File

@ -22,7 +22,6 @@ import { AddonModDataFieldHandler } from '@addons/mod/data/services/data-fields-
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { AddonModDataFieldMultimenuComponent } from '../component/multimenu';
import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component'; import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component';
/** /**
@ -37,7 +36,9 @@ export class AddonModDataFieldMultimenuHandlerService implements AddonModDataFie
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<AddonModDataFieldPluginBaseComponent> { async getComponent(): Promise<Type<AddonModDataFieldPluginBaseComponent>> {
const { AddonModDataFieldMultimenuComponent } = await import('../component/multimenu');
return AddonModDataFieldMultimenuComponent; return AddonModDataFieldMultimenuComponent;
} }

View File

@ -17,7 +17,6 @@ import { Injectable, Type } from '@angular/core';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { AddonModDataFieldTextHandlerService } from '../../text/services/handler'; import { AddonModDataFieldTextHandlerService } from '../../text/services/handler';
import { AddonModDataFieldNumberComponent } from '../component/number';
import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component'; import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component';
/** /**
@ -32,7 +31,9 @@ export class AddonModDataFieldNumberHandlerService extends AddonModDataFieldText
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<AddonModDataFieldPluginBaseComponent> { async getComponent(): Promise<Type<AddonModDataFieldPluginBaseComponent>> {
const { AddonModDataFieldNumberComponent } = await import('../component/number');
return AddonModDataFieldNumberComponent; return AddonModDataFieldNumberComponent;
} }

View File

@ -25,7 +25,6 @@ import { FileEntry } from '@awesome-cordova-plugins/file/ngx';
import { CoreFileSession } from '@services/file-session'; import { CoreFileSession } from '@services/file-session';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { AddonModDataFieldPictureComponent } from '../component/picture';
import { CoreFileEntry } from '@services/file-helper'; import { CoreFileEntry } from '@services/file-helper';
import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component'; import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component';
import { ADDON_MOD_DATA_COMPONENT } from '@addons/mod/data/constants'; import { ADDON_MOD_DATA_COMPONENT } from '@addons/mod/data/constants';
@ -42,7 +41,9 @@ export class AddonModDataFieldPictureHandlerService implements AddonModDataField
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<AddonModDataFieldPluginBaseComponent> { async getComponent(): Promise<Type<AddonModDataFieldPluginBaseComponent>> {
const { AddonModDataFieldPictureComponent } = await import('../component/picture');
return AddonModDataFieldPictureComponent; return AddonModDataFieldPictureComponent;
} }

View File

@ -22,7 +22,6 @@ import { AddonModDataFieldHandler } from '@addons/mod/data/services/data-fields-
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { AddonModDataFieldRadiobuttonComponent } from '../component/radiobutton';
import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component'; import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component';
/** /**
@ -37,7 +36,9 @@ export class AddonModDataFieldRadiobuttonHandlerService implements AddonModDataF
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<AddonModDataFieldPluginBaseComponent> { async getComponent(): Promise<Type<AddonModDataFieldPluginBaseComponent>> {
const { AddonModDataFieldRadiobuttonComponent } = await import('../component/radiobutton');
return AddonModDataFieldRadiobuttonComponent; return AddonModDataFieldRadiobuttonComponent;
} }

View File

@ -22,7 +22,6 @@ import { AddonModDataFieldHandler } from '@addons/mod/data/services/data-fields-
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { AddonModDataFieldTextComponent } from '../component/text';
import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component'; import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component';
/** /**
@ -37,7 +36,9 @@ export class AddonModDataFieldTextHandlerService implements AddonModDataFieldHan
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<AddonModDataFieldPluginBaseComponent> { async getComponent(): Promise<Type<AddonModDataFieldPluginBaseComponent>> {
const { AddonModDataFieldTextComponent } = await import('../component/text');
return AddonModDataFieldTextComponent; return AddonModDataFieldTextComponent;
} }

View File

@ -19,7 +19,6 @@ import { CoreText } from '@singletons/text';
import { CoreWSFile } from '@services/ws'; import { CoreWSFile } from '@services/ws';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { AddonModDataFieldTextHandlerService } from '../../text/services/handler'; import { AddonModDataFieldTextHandlerService } from '../../text/services/handler';
import { AddonModDataFieldTextareaComponent } from '../component/textarea';
import { CoreFileEntry, CoreFileHelper } from '@services/file-helper'; import { CoreFileEntry, CoreFileHelper } from '@services/file-helper';
import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component'; import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component';
import { CoreDom } from '@singletons/dom'; import { CoreDom } from '@singletons/dom';
@ -36,7 +35,9 @@ export class AddonModDataFieldTextareaHandlerService extends AddonModDataFieldTe
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<AddonModDataFieldPluginBaseComponent> { async getComponent(): Promise<Type<AddonModDataFieldPluginBaseComponent>> {
const { AddonModDataFieldTextareaComponent } = await import('../component/textarea');
return AddonModDataFieldTextareaComponent; return AddonModDataFieldTextareaComponent;
} }

View File

@ -17,7 +17,6 @@ import { Injectable, Type } from '@angular/core';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { Translate, makeSingleton } from '@singletons'; import { Translate, makeSingleton } from '@singletons';
import { AddonModDataFieldTextHandlerService } from '../../text/services/handler'; import { AddonModDataFieldTextHandlerService } from '../../text/services/handler';
import { AddonModDataFieldUrlComponent } from '../component/url';
import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component'; import type { AddonModDataFieldPluginBaseComponent } from '@addons/mod/data/classes/base-field-plugin-component';
/** /**
@ -32,7 +31,9 @@ export class AddonModDataFieldUrlHandlerService extends AddonModDataFieldTextHan
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<AddonModDataFieldPluginBaseComponent> { async getComponent(): Promise<Type<AddonModDataFieldPluginBaseComponent>> {
const { AddonModDataFieldUrlComponent } = await import('../component/url');
return AddonModDataFieldUrlComponent; return AddonModDataFieldUrlComponent;
} }

View File

@ -45,7 +45,7 @@ export interface AddonModDataFieldHandler extends CoreDelegateHandler {
* @param field The field object. * @param field The field object.
* @returns The component to use, undefined if not found. * @returns The component to use, undefined if not found.
*/ */
getComponent?(plugin: AddonModDataField): Type<AddonModDataFieldPluginBaseComponent> | undefined; getComponent?(plugin: AddonModDataField): Promise<Type<AddonModDataFieldPluginBaseComponent> | undefined>;
/** /**
* Get field search data in the input data. * Get field search data in the input data.

View File

@ -13,7 +13,6 @@
// limitations under the License. // limitations under the License.
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreTagFeedComponent } from '@features/tag/components/feed/feed';
import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate'; import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate';
import { CoreTagFeedElement, CoreTagHelper } from '@features/tag/services/tag-helper'; import { CoreTagFeedElement, CoreTagHelper } from '@features/tag/services/tag-helper';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
@ -44,7 +43,9 @@ export class AddonModDataTagAreaHandlerService implements CoreTagAreaHandler {
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { CoreTagFeedComponent } = await import('@features/tag/components/feed/feed');
return CoreTagFeedComponent; return CoreTagFeedComponent;
} }

View File

@ -15,7 +15,6 @@
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate'; import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate';
import { CoreTagFeedComponent } from '@features/tag/components/feed/feed';
import { CoreTagHelper, CoreTagFeedElement } from '@features/tag/services/tag-helper'; import { CoreTagHelper, CoreTagFeedElement } from '@features/tag/services/tag-helper';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
@ -45,7 +44,9 @@ export class AddonModForumTagAreaHandlerService implements CoreTagAreaHandler {
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> | Promise<Type<unknown>> { async getComponent(): Promise<Type<unknown>> {
const { CoreTagFeedComponent } = await import('@features/tag/components/feed/feed');
return CoreTagFeedComponent; return CoreTagFeedComponent;
} }

View File

@ -13,7 +13,6 @@
// limitations under the License. // limitations under the License.
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreTagFeedComponent } from '@features/tag/components/feed/feed';
import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate'; import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate';
import { CoreTagFeedElement, CoreTagHelper } from '@features/tag/services/tag-helper'; import { CoreTagFeedElement, CoreTagHelper } from '@features/tag/services/tag-helper';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
@ -44,7 +43,9 @@ export class AddonModGlossaryTagAreaHandlerService implements CoreTagAreaHandler
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { CoreTagFeedComponent } = await import('@features/tag/components/feed/feed');
return CoreTagFeedComponent; return CoreTagFeedComponent;
} }

View File

@ -13,7 +13,6 @@
// limitations under the License. // limitations under the License.
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreTagFeedComponent } from '@features/tag/components/feed/feed';
import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate'; import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate';
import { CoreTagFeedElement, CoreTagHelper } from '@features/tag/services/tag-helper'; import { CoreTagFeedElement, CoreTagHelper } from '@features/tag/services/tag-helper';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
@ -44,7 +43,9 @@ export class AddonModWikiTagAreaHandlerService implements CoreTagAreaHandler {
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { CoreTagFeedComponent } = await import('@features/tag/components/feed/feed');
return CoreTagFeedComponent; return CoreTagFeedComponent;
} }

View File

@ -24,7 +24,6 @@ import { CoreGradesHelper } from '@features/grades/services/grades-helper';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { AddonWorkshopAssessmentStrategyHandler } from '../../../services/assessment-strategy-delegate'; import { AddonWorkshopAssessmentStrategyHandler } from '../../../services/assessment-strategy-delegate';
import { AddonModWorkshopAssessmentStrategyAccumulativeComponent } from '../component/accumulative';
import { AddonModWorkshopAssessmentStrategyAccumulativeHandlerService } from './handler'; import { AddonModWorkshopAssessmentStrategyAccumulativeHandlerService } from './handler';
/** /**
@ -38,7 +37,9 @@ export class AddonModWorkshopAssessmentStrategyAccumulativeHandlerLazyService
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { AddonModWorkshopAssessmentStrategyAccumulativeComponent } = await import('../component/accumulative');
return AddonModWorkshopAssessmentStrategyAccumulativeComponent; return AddonModWorkshopAssessmentStrategyAccumulativeComponent;
} }

View File

@ -23,7 +23,6 @@ import {
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { AddonModWorkshopAssessmentStrategyCommentsComponent } from '../component/comments';
import { AddonModWorkshopAssessmentStrategyCommentsHandlerService } from './handler'; import { AddonModWorkshopAssessmentStrategyCommentsHandlerService } from './handler';
/** /**
@ -37,7 +36,9 @@ export class AddonModWorkshopAssessmentStrategyCommentsHandlerLazyService
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { AddonModWorkshopAssessmentStrategyCommentsComponent } = await import('../component/comments');
return AddonModWorkshopAssessmentStrategyCommentsComponent; return AddonModWorkshopAssessmentStrategyCommentsComponent;
} }

View File

@ -23,7 +23,6 @@ import {
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { Translate, makeSingleton } from '@singletons'; import { Translate, makeSingleton } from '@singletons';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { AddonModWorkshopAssessmentStrategyNumErrorsComponent } from '../component/numerrors';
import { AddonModWorkshopAssessmentStrategyNumErrorsHandlerService } from './handler'; import { AddonModWorkshopAssessmentStrategyNumErrorsHandlerService } from './handler';
/** /**
@ -37,7 +36,9 @@ export class AddonModWorkshopAssessmentStrategyNumErrorsHandlerLazyService
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { AddonModWorkshopAssessmentStrategyNumErrorsComponent } = await import('../component/numerrors');
return AddonModWorkshopAssessmentStrategyNumErrorsComponent; return AddonModWorkshopAssessmentStrategyNumErrorsComponent;
} }

View File

@ -23,7 +23,6 @@ import {
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { Translate, makeSingleton } from '@singletons'; import { Translate, makeSingleton } from '@singletons';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { AddonModWorkshopAssessmentStrategyRubricComponent } from '../component/rubric';
import { AddonModWorkshopAssessmentStrategyRubricHandlerService } from './handler'; import { AddonModWorkshopAssessmentStrategyRubricHandlerService } from './handler';
/** /**
@ -37,7 +36,9 @@ export class AddonModWorkshopAssessmentStrategyRubricHandlerLazyService
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { AddonModWorkshopAssessmentStrategyRubricComponent } = await import('../component/rubric');
return AddonModWorkshopAssessmentStrategyRubricComponent; return AddonModWorkshopAssessmentStrategyRubricComponent;
} }

View File

@ -19,7 +19,6 @@ import { CoreQuestionHandler } from '@features/question/services/question-delega
import { convertTextToHTMLElement } from '@/core/utils/create-html-element'; import { convertTextToHTMLElement } from '@/core/utils/create-html-element';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonQtypeCalculatedComponent } from '../../component/calculated';
/** /**
* Handler to support calculated question type. * Handler to support calculated question type.
@ -41,7 +40,9 @@ export class AddonQtypeCalculatedHandlerService implements CoreQuestionHandler {
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { AddonQtypeCalculatedComponent } = await import('../../component/calculated');
return AddonQtypeCalculatedComponent; return AddonQtypeCalculatedComponent;
} }

View File

@ -14,7 +14,6 @@
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { AddonQtypeMultichoiceComponent } from '@addons/qtype/multichoice/component/multichoice';
import { CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '@features/question/services/question'; import { CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '@features/question/services/question';
import { CoreQuestionHandler } from '@features/question/services/question-delegate'; import { CoreQuestionHandler } from '@features/question/services/question-delegate';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
@ -32,8 +31,10 @@ export class AddonQtypeCalculatedMultiHandlerService implements CoreQuestionHand
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
// Calculated multi behaves like a multichoice, use the same component. // Calculated multi behaves like a multichoice, use the same component.
const { AddonQtypeMultichoiceComponent } = await import('@addons/qtype/multichoice/component/multichoice');
return AddonQtypeMultichoiceComponent; return AddonQtypeMultichoiceComponent;
} }

View File

@ -14,7 +14,6 @@
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { AddonQtypeCalculatedComponent } from '@addons/qtype/calculated/component/calculated';
import { CoreQuestionHandler } from '@features/question/services/question-delegate'; import { CoreQuestionHandler } from '@features/question/services/question-delegate';
import { AddonQtypeCalculatedHandler } from '@addons/qtype/calculated/services/handlers/calculated'; import { AddonQtypeCalculatedHandler } from '@addons/qtype/calculated/services/handlers/calculated';
import { CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '@features/question/services/question'; import { CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '@features/question/services/question';
@ -32,8 +31,10 @@ export class AddonQtypeCalculatedSimpleHandlerService implements CoreQuestionHan
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
// Calculated simple behaves like a calculated, use the same component. // Calculated simple behaves like a calculated, use the same component.
const { AddonQtypeCalculatedComponent } = await import('@addons/qtype/calculated/component/calculated');
return AddonQtypeCalculatedComponent; return AddonQtypeCalculatedComponent;
} }

View File

@ -17,7 +17,6 @@ import { Injectable, Type } from '@angular/core';
import { CoreQuestion, CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '@features/question/services/question'; import { CoreQuestion, CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '@features/question/services/question';
import { CoreQuestionHandler } from '@features/question/services/question-delegate'; import { CoreQuestionHandler } from '@features/question/services/question-delegate';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonQtypeDdImageOrTextComponent } from '../../component/ddimageortext';
/** /**
* Handler to support drag-and-drop onto image question type. * Handler to support drag-and-drop onto image question type.
@ -42,7 +41,9 @@ export class AddonQtypeDdImageOrTextHandlerService implements CoreQuestionHandle
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { AddonQtypeDdImageOrTextComponent } = await import('../../component/ddimageortext');
return AddonQtypeDdImageOrTextComponent; return AddonQtypeDdImageOrTextComponent;
} }

View File

@ -19,7 +19,6 @@ import { CoreQuestionHandler } from '@features/question/services/question-delega
import { CoreQuestionHelper, CoreQuestionQuestion } from '@features/question/services/question-helper'; import { CoreQuestionHelper, CoreQuestionQuestion } from '@features/question/services/question-helper';
import { CoreWSFile } from '@services/ws'; import { CoreWSFile } from '@services/ws';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonQtypeDdMarkerComponent } from '../../component/ddmarker';
/** /**
* Handler to support drag-and-drop markers question type. * Handler to support drag-and-drop markers question type.
@ -44,7 +43,9 @@ export class AddonQtypeDdMarkerHandlerService implements CoreQuestionHandler {
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { AddonQtypeDdMarkerComponent } = await import('../../component/ddmarker');
return AddonQtypeDdMarkerComponent; return AddonQtypeDdMarkerComponent;
} }

View File

@ -17,7 +17,6 @@ import { Injectable, Type } from '@angular/core';
import { CoreQuestion, CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '@features/question/services/question'; import { CoreQuestion, CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '@features/question/services/question';
import { CoreQuestionHandler } from '@features/question/services/question-delegate'; import { CoreQuestionHandler } from '@features/question/services/question-delegate';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonQtypeDdwtosComponent } from '../../component/ddwtos';
/** /**
* Handler to support drag-and-drop words into sentences question type. * Handler to support drag-and-drop words into sentences question type.
@ -42,7 +41,9 @@ export class AddonQtypeDdwtosHandlerService implements CoreQuestionHandler {
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { AddonQtypeDdwtosComponent } = await import('../../component/ddwtos');
return AddonQtypeDdwtosComponent; return AddonQtypeDdwtosComponent;
} }

View File

@ -16,7 +16,6 @@ import { Injectable, Type } from '@angular/core';
import { CoreQuestionHandler } from '@features/question/services/question-delegate'; import { CoreQuestionHandler } from '@features/question/services/question-delegate';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonQtypeDescriptionComponent } from '../../component/description';
/** /**
* Handler to support description question type. * Handler to support description question type.
@ -37,7 +36,9 @@ export class AddonQtypeDescriptionHandlerService implements CoreQuestionHandler
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { AddonQtypeDescriptionComponent } = await import('../../component/description');
return AddonQtypeDescriptionComponent; return AddonQtypeDescriptionComponent;
} }

View File

@ -27,7 +27,6 @@ import { CoreText } from '@singletons/text';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { CoreWSFile } from '@services/ws'; import { CoreWSFile } from '@services/ws';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { AddonQtypeEssayComponent } from '../../component/essay';
import { CoreFileHelper } from '@services/file-helper'; import { CoreFileHelper } from '@services/file-helper';
/** /**
@ -108,7 +107,9 @@ export class AddonQtypeEssayHandlerService implements CoreQuestionHandler {
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { AddonQtypeEssayComponent } = await import('../../component/essay');
return AddonQtypeEssayComponent; return AddonQtypeEssayComponent;
} }

View File

@ -17,7 +17,6 @@ import { Injectable, Type } from '@angular/core';
import { CoreQuestion, CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '@features/question/services/question'; import { CoreQuestion, CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '@features/question/services/question';
import { CoreQuestionHandler } from '@features/question/services/question-delegate'; import { CoreQuestionHandler } from '@features/question/services/question-delegate';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonQtypeGapSelectComponent } from '../../component/gapselect';
/** /**
* Handler to support gapselect question type. * Handler to support gapselect question type.
@ -42,7 +41,9 @@ export class AddonQtypeGapSelectHandlerService implements CoreQuestionHandler {
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { AddonQtypeGapSelectComponent } = await import('../../component/gapselect');
return AddonQtypeGapSelectComponent; return AddonQtypeGapSelectComponent;
} }

View File

@ -17,7 +17,6 @@ import { Injectable, Type } from '@angular/core';
import { CoreQuestion, CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '@features/question/services/question'; import { CoreQuestion, CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '@features/question/services/question';
import { CoreQuestionHandler } from '@features/question/services/question-delegate'; import { CoreQuestionHandler } from '@features/question/services/question-delegate';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonQtypeMatchComponent } from '../../component/match';
/** /**
* Handler to support match question type. * Handler to support match question type.
@ -42,7 +41,9 @@ export class AddonQtypeMatchHandlerService implements CoreQuestionHandler {
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { AddonQtypeMatchComponent } = await import('../../component/match');
return AddonQtypeMatchComponent; return AddonQtypeMatchComponent;
} }

View File

@ -18,7 +18,6 @@ import { CoreQuestion, CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '
import { CoreQuestionHandler } from '@features/question/services/question-delegate'; import { CoreQuestionHandler } from '@features/question/services/question-delegate';
import { CoreQuestionHelper } from '@features/question/services/question-helper'; import { CoreQuestionHelper } from '@features/question/services/question-helper';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonQtypeMultiAnswerComponent } from '../../component/multianswer';
/** /**
* Handler to support multianswer question type. * Handler to support multianswer question type.
@ -43,7 +42,9 @@ export class AddonQtypeMultiAnswerHandlerService implements CoreQuestionHandler
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { AddonQtypeMultiAnswerComponent } = await import('../../component/multianswer');
return AddonQtypeMultiAnswerComponent; return AddonQtypeMultiAnswerComponent;
} }

View File

@ -19,7 +19,6 @@ import { CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '@features/ques
import { CoreQuestionHandler } from '@features/question/services/question-delegate'; import { CoreQuestionHandler } from '@features/question/services/question-delegate';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonQtypeMultichoiceComponent } from '../../component/multichoice';
/** /**
* Handler to support multichoice question type. * Handler to support multichoice question type.
@ -33,7 +32,9 @@ export class AddonQtypeMultichoiceHandlerService implements CoreQuestionHandler
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { AddonQtypeMultichoiceComponent } = await import('../../component/multichoice');
return AddonQtypeMultichoiceComponent; return AddonQtypeMultichoiceComponent;
} }

View File

@ -18,7 +18,6 @@ import { CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '@features/ques
import { CoreQuestionHandler } from '@features/question/services/question-delegate'; import { CoreQuestionHandler } from '@features/question/services/question-delegate';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonQtypeShortAnswerComponent } from '../../component/shortanswer';
/** /**
* Handler to support short answer question type. * Handler to support short answer question type.
@ -32,7 +31,9 @@ export class AddonQtypeShortAnswerHandlerService implements CoreQuestionHandler
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { AddonQtypeShortAnswerComponent } = await import('../../component/shortanswer');
return AddonQtypeShortAnswerComponent; return AddonQtypeShortAnswerComponent;
} }

View File

@ -14,7 +14,6 @@
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { AddonQtypeMultichoiceComponent } from '@addons/qtype/multichoice/component/multichoice';
import { CoreQuestionHandler } from '@features/question/services/question-delegate'; import { CoreQuestionHandler } from '@features/question/services/question-delegate';
import { CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '@features/question/services/question'; import { CoreQuestionQuestionParsed, CoreQuestionsAnswers } from '@features/question/services/question';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
@ -33,8 +32,10 @@ export class AddonQtypeTrueFalseHandlerService implements CoreQuestionHandler {
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
// True/false behaves like a multichoice, use the same component. // True/false behaves like a multichoice, use the same component.
const { AddonQtypeMultichoiceComponent } = await import('@addons/qtype/multichoice/component/multichoice');
return AddonQtypeMultichoiceComponent; return AddonQtypeMultichoiceComponent;
} }

View File

@ -19,7 +19,6 @@ import { CoreUserProfileField } from '@features/user/services/user';
import { CoreUserProfileFieldHandler, CoreUserProfileFieldHandlerData } from '@features/user/services/user-profile-field-delegate'; import { CoreUserProfileFieldHandler, CoreUserProfileFieldHandlerData } from '@features/user/services/user-profile-field-delegate';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonUserProfileFieldCheckboxComponent } from '../../component/checkbox';
/** /**
* Checkbox user profile field handlers. * Checkbox user profile field handlers.
@ -66,12 +65,11 @@ export class AddonUserProfileFieldCheckboxHandlerService implements CoreUserProf
} }
/** /**
* Return the Component to use to display the user profile field. * @inheritdoc
* It's recommended to return the class of the component, but you can also return an instance of the component.
*
* @returns The component (or promise resolved with component) to use, undefined if not found.
*/ */
getComponent(): Type<unknown> | Promise<Type<unknown>> { async getComponent(): Promise<Type<unknown>> {
const { AddonUserProfileFieldCheckboxComponent } = await import('../../component/checkbox');
return AddonUserProfileFieldCheckboxComponent; return AddonUserProfileFieldCheckboxComponent;
} }

View File

@ -19,7 +19,6 @@ import { CoreUserProfileField } from '@features/user/services/user';
import { CoreUserProfileFieldHandler, CoreUserProfileFieldHandlerData } from '@features/user/services/user-profile-field-delegate'; import { CoreUserProfileFieldHandler, CoreUserProfileFieldHandlerData } from '@features/user/services/user-profile-field-delegate';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonUserProfileFieldDatetimeComponent } from '../../component/datetime';
import moment from 'moment-timezone'; import moment from 'moment-timezone';
/** /**
@ -67,14 +66,13 @@ export class AddonUserProfileFieldDatetimeHandlerService implements CoreUserProf
} }
/** /**
* Return the Component to use to display the user profile field. * @inheritdoc
* It's recommended to return the class of the component, but you can also return an instance of the component.
*
* @returns The component (or promise resolved with component) to use, undefined if not found.
*/ */
getComponent(): Type<unknown> | Promise<Type<unknown>> { async getComponent(): Promise<Type<unknown>> {
return AddonUserProfileFieldDatetimeComponent; const { AddonUserProfileFieldDatetimeComponent } = await import('../../component/datetime');
}
return AddonUserProfileFieldDatetimeComponent;
}
} }

View File

@ -19,7 +19,6 @@ import { CoreUserProfileField } from '@features/user/services/user';
import { CoreUserProfileFieldHandler, CoreUserProfileFieldHandlerData } from '@features/user/services/user-profile-field-delegate'; import { CoreUserProfileFieldHandler, CoreUserProfileFieldHandlerData } from '@features/user/services/user-profile-field-delegate';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
import { AddonUserProfileFieldMenuComponent } from '../../component/menu';
/** /**
* Menu user profile field handlers. * Menu user profile field handlers.
@ -66,12 +65,11 @@ export class AddonUserProfileFieldMenuHandlerService implements CoreUserProfileF
} }
/** /**
* Return the Component to use to display the user profile field. * @inheritdoc
* It's recommended to return the class of the component, but you can also return an instance of the component.
*
* @returns The component (or promise resolved with component) to use, undefined if not found.
*/ */
getComponent(): Type<unknown> | Promise<Type<unknown>> { async getComponent(): Promise<Type<unknown>> {
const { AddonUserProfileFieldMenuComponent } = await import('../../component/menu');
return AddonUserProfileFieldMenuComponent; return AddonUserProfileFieldMenuComponent;
} }

View File

@ -15,7 +15,6 @@
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreUserProfileFieldHandler, CoreUserProfileFieldHandlerData } from '@features/user/services/user-profile-field-delegate'; import { CoreUserProfileFieldHandler, CoreUserProfileFieldHandlerData } from '@features/user/services/user-profile-field-delegate';
import { AddonUserProfileFieldSocialComponent } from '../../component/social';
import { CoreText } from '@singletons/text'; import { CoreText } from '@singletons/text';
import { AuthEmailSignupProfileField } from '@features/login/services/login-helper'; import { AuthEmailSignupProfileField } from '@features/login/services/login-helper';
import { CoreUserProfileField } from '@features/user/services/user'; import { CoreUserProfileField } from '@features/user/services/user';
@ -65,12 +64,11 @@ export class AddonUserProfileFieldSocialHandlerService implements CoreUserProfil
} }
/** /**
* Return the Component to use to display the user profile field. * @inheritdoc
* It's recommended to return the class of the component, but you can also return an instance of the component.
*
* @returns The component (or promise resolved with component) to use, undefined if not found.
*/ */
getComponent(): Type<unknown> | Promise<Type<unknown>> { async getComponent(): Promise<Type<unknown>> {
const { AddonUserProfileFieldSocialComponent } = await import('../../component/social');
return AddonUserProfileFieldSocialComponent; return AddonUserProfileFieldSocialComponent;
} }

View File

@ -15,7 +15,6 @@
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreUserProfileFieldHandler, CoreUserProfileFieldHandlerData } from '@features/user/services/user-profile-field-delegate'; import { CoreUserProfileFieldHandler, CoreUserProfileFieldHandlerData } from '@features/user/services/user-profile-field-delegate';
import { AddonUserProfileFieldTextComponent } from '../../component/text';
import { CoreText } from '@singletons/text'; import { CoreText } from '@singletons/text';
import { AuthEmailSignupProfileField } from '@features/login/services/login-helper'; import { AuthEmailSignupProfileField } from '@features/login/services/login-helper';
import { CoreUserProfileField } from '@features/user/services/user'; import { CoreUserProfileField } from '@features/user/services/user';
@ -65,12 +64,11 @@ export class AddonUserProfileFieldTextHandlerService implements CoreUserProfileF
} }
/** /**
* Return the Component to use to display the user profile field. * @inheritdoc
* It's recommended to return the class of the component, but you can also return an instance of the component.
*
* @returns The component (or promise resolved with component) to use, undefined if not found.
*/ */
getComponent(): Type<unknown> | Promise<Type<unknown>> { async getComponent(): Promise<Type<unknown>> {
const { AddonUserProfileFieldTextComponent } = await import('../../component/text');
return AddonUserProfileFieldTextComponent; return AddonUserProfileFieldTextComponent;
} }

View File

@ -15,7 +15,6 @@
import { Injectable, Type } from '@angular/core'; import { Injectable, Type } from '@angular/core';
import { CoreUserProfileFieldHandler, CoreUserProfileFieldHandlerData } from '@features/user/services/user-profile-field-delegate'; import { CoreUserProfileFieldHandler, CoreUserProfileFieldHandlerData } from '@features/user/services/user-profile-field-delegate';
import { AddonUserProfileFieldTextareaComponent } from '../../component/textarea';
import { CoreText } from '@singletons/text'; import { CoreText } from '@singletons/text';
import { AuthEmailSignupProfileField } from '@features/login/services/login-helper'; import { AuthEmailSignupProfileField } from '@features/login/services/login-helper';
import { CoreUserProfileField } from '@features/user/services/user'; import { CoreUserProfileField } from '@features/user/services/user';
@ -74,12 +73,11 @@ export class AddonUserProfileFieldTextareaHandlerService implements CoreUserProf
} }
/** /**
* Return the Component to use to display the user profile field. * @inheritdoc
* It's recommended to return the class of the component, but you can also return an instance of the component.
*
* @returns The component (or promise resolved with component) to use, undefined if not found.
*/ */
getComponent(): Type<unknown> | Promise<Type<unknown>> { async getComponent(): Promise<Type<unknown>> {
const { AddonUserProfileFieldTextareaComponent } = await import('../../component/textarea');
return AddonUserProfileFieldTextareaComponent; return AddonUserProfileFieldTextareaComponent;
} }

View File

@ -16,7 +16,6 @@ import { Injectable, Type } from '@angular/core';
import { convertTextToHTMLElement } from '@/core/utils/create-html-element'; import { convertTextToHTMLElement } from '@/core/utils/create-html-element';
import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate'; import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate';
import { CoreCourseTagAreaComponent } from '../../components/tag-area/tag-area';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
/** /**
@ -65,11 +64,11 @@ export class CoreCourseTagAreaHandlerService implements CoreTagAreaHandler {
} }
/** /**
* Get the component to use to display items. * @inheritdoc
*
* @returns The component (or promise resolved with component) to use, undefined if not found.
*/ */
getComponent(): Type<unknown> | Promise<Type<unknown>> { async getComponent(): Promise<Type<unknown>> {
const { CoreCourseTagAreaComponent } = await import('../../components/tag-area/tag-area');
return CoreCourseTagAreaComponent; return CoreCourseTagAreaComponent;
} }

View File

@ -16,7 +16,6 @@ import { Injectable, Type } from '@angular/core';
import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate'; import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate';
import { CoreTagFeedElement, CoreTagHelper } from '@features/tag/services/tag-helper'; import { CoreTagFeedElement, CoreTagHelper } from '@features/tag/services/tag-helper';
import { CoreTagFeedComponent } from '@features/tag/components/feed/feed';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
/** /**
@ -48,11 +47,11 @@ export class CoreCourseModulesTagAreaHandlerService implements CoreTagAreaHandle
} }
/** /**
* Get the component to use to display items. * @inheritdoc
*
* @returns The component (or promise resolved with component) to use, undefined if not found.
*/ */
getComponent(): Type<unknown> | Promise<Type<unknown>> { async getComponent(): Promise<Type<unknown>> {
const { CoreTagFeedComponent } = await import('@features/tag/components/feed/feed');
return CoreTagFeedComponent; return CoreTagFeedComponent;
} }

View File

@ -16,7 +16,6 @@ import { Type } from '@angular/core';
import { AddonModAssignDefaultFeedbackHandler } from '@addons/mod/assign/services/handlers/default-feedback'; import { AddonModAssignDefaultFeedbackHandler } from '@addons/mod/assign/services/handlers/default-feedback';
import { AddonModAssignPlugin } from '@addons/mod/assign/services/assign'; import { AddonModAssignPlugin } from '@addons/mod/assign/services/assign';
import { CoreSitePluginsAssignFeedbackComponent } from '@features/siteplugins/components/assign-feedback/assign-feedback';
import { Translate } from '@singletons'; import { Translate } from '@singletons';
import type{ IAddonModAssignFeedbackPluginComponent } from '@addons/mod/assign/classes/base-feedback-plugin-component'; import type{ IAddonModAssignFeedbackPluginComponent } from '@addons/mod/assign/classes/base-feedback-plugin-component';
@ -32,7 +31,10 @@ export class CoreSitePluginsAssignFeedbackHandler extends AddonModAssignDefaultF
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<IAddonModAssignFeedbackPluginComponent> | undefined { async getComponent(): Promise<Type<IAddonModAssignFeedbackPluginComponent>> {
const { CoreSitePluginsAssignFeedbackComponent } =
await import('@features/siteplugins/components/assign-feedback/assign-feedback');
return CoreSitePluginsAssignFeedbackComponent; return CoreSitePluginsAssignFeedbackComponent;
} }

View File

@ -17,7 +17,6 @@ import { Type } from '@angular/core';
import { AddonModAssignPlugin } from '@addons/mod/assign/services/assign'; import { AddonModAssignPlugin } from '@addons/mod/assign/services/assign';
import { AddonModAssignDefaultSubmissionHandler } from '@addons/mod/assign/services/handlers/default-submission'; import { AddonModAssignDefaultSubmissionHandler } from '@addons/mod/assign/services/handlers/default-submission';
import { Translate } from '@singletons'; import { Translate } from '@singletons';
import { CoreSitePluginsAssignSubmissionComponent } from '../../components/assign-submission/assign-submission';
import type { AddonModAssignSubmissionPluginBaseComponent } from '@addons/mod/assign/classes/base-submission-plugin-component'; import type { AddonModAssignSubmissionPluginBaseComponent } from '@addons/mod/assign/classes/base-submission-plugin-component';
/** /**
@ -32,7 +31,9 @@ export class CoreSitePluginsAssignSubmissionHandler extends AddonModAssignDefaul
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<AddonModAssignSubmissionPluginBaseComponent> { async getComponent(): Promise<Type<AddonModAssignSubmissionPluginBaseComponent>> {
const { CoreSitePluginsAssignSubmissionComponent } = await import('../../components/assign-submission/assign-submission');
return CoreSitePluginsAssignSubmissionComponent; return CoreSitePluginsAssignSubmissionComponent;
} }

View File

@ -15,7 +15,6 @@
import { Type } from '@angular/core'; import { Type } from '@angular/core';
import { CoreQuestionBaseHandler } from '@features/question/classes/base-question-handler'; import { CoreQuestionBaseHandler } from '@features/question/classes/base-question-handler';
import { CoreSitePluginsQuestionComponent } from '@features/siteplugins/components/question/question';
/** /**
* Handler to display a question site plugin. * Handler to display a question site plugin.
@ -29,7 +28,9 @@ export class CoreSitePluginsQuestionHandler extends CoreQuestionBaseHandler {
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { CoreSitePluginsQuestionComponent } = await import('@features/siteplugins/components/question/question');
return CoreSitePluginsQuestionComponent; return CoreSitePluginsQuestionComponent;
} }

View File

@ -15,7 +15,6 @@
import { Type } from '@angular/core'; import { Type } from '@angular/core';
import { AuthEmailSignupProfileField } from '@features/login/services/login-helper'; import { AuthEmailSignupProfileField } from '@features/login/services/login-helper';
import { CoreSitePluginsUserProfileFieldComponent } from '@features/siteplugins/components/user-profile-field/user-profile-field';
import { CoreUserProfileField } from '@features/user/services/user'; import { CoreUserProfileField } from '@features/user/services/user';
import { CoreUserProfileFieldHandler, CoreUserProfileFieldHandlerData } from '@features/user/services/user-profile-field-delegate'; import { CoreUserProfileFieldHandler, CoreUserProfileFieldHandlerData } from '@features/user/services/user-profile-field-delegate';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
@ -33,7 +32,10 @@ export class CoreSitePluginsUserProfileFieldHandler extends CoreSitePluginsBaseH
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { CoreSitePluginsUserProfileFieldComponent } =
await import('@features/siteplugins/components/user-profile-field/user-profile-field');
return CoreSitePluginsUserProfileFieldComponent; return CoreSitePluginsUserProfileFieldComponent;
} }

View File

@ -15,9 +15,6 @@
import { AddonWorkshopAssessmentStrategyHandler } from '@addons/mod/workshop/services/assessment-strategy-delegate'; import { AddonWorkshopAssessmentStrategyHandler } from '@addons/mod/workshop/services/assessment-strategy-delegate';
import { AddonModWorkshopGetAssessmentFormFieldsParsedData } from '@addons/mod/workshop/services/workshop'; import { AddonModWorkshopGetAssessmentFormFieldsParsedData } from '@addons/mod/workshop/services/workshop';
import { Type } from '@angular/core'; import { Type } from '@angular/core';
import {
CoreSitePluginsWorkshopAssessmentStrategyComponent,
} from '@features/siteplugins/components/workshop-assessment-strategy/workshop-assessment-strategy';
import { CoreFormFields } from '@singletons/form'; import { CoreFormFields } from '@singletons/form';
import { CoreSitePluginsBaseHandler } from './base-handler'; import { CoreSitePluginsBaseHandler } from './base-handler';
@ -35,7 +32,10 @@ export class CoreSitePluginsWorkshopAssessmentStrategyHandler
/** /**
* @inheritdoc * @inheritdoc
*/ */
getComponent(): Type<unknown> { async getComponent(): Promise<Type<unknown>> {
const { CoreSitePluginsWorkshopAssessmentStrategyComponent } =
await import('@features/siteplugins/components/workshop-assessment-strategy/workshop-assessment-strategy');
return CoreSitePluginsWorkshopAssessmentStrategyComponent; return CoreSitePluginsWorkshopAssessmentStrategyComponent;
} }

View File

@ -16,7 +16,6 @@ import { Injectable, Type } from '@angular/core';
import { convertTextToHTMLElement } from '@/core/utils/create-html-element'; import { convertTextToHTMLElement } from '@/core/utils/create-html-element';
import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate'; import { CoreTagAreaHandler } from '@features/tag/services/tag-area-delegate';
import { CoreUserTagAreaComponent } from '@features/user/components/tag-area/tag-area';
import { CoreTagFeedElement } from '@features/tag/services/tag-helper'; import { CoreTagFeedElement } from '@features/tag/services/tag-helper';
import { CoreUserBasicData } from '../user'; import { CoreUserBasicData } from '../user';
import { makeSingleton } from '@singletons'; import { makeSingleton } from '@singletons';
@ -81,12 +80,12 @@ export class CoreUserTagAreaHandlerService implements CoreTagAreaHandler {
} }
/** /**
* Get the component to use to display items. * @inheritdoc
*
* @returns The component (or promise resolved with component) to use, undefined if not found.
*/ */
getComponent(): Type<unknown> | Promise<Type<unknown>> { async getComponent(): Promise<Type<unknown>> {
return CoreUserTagAreaComponent; const { CoreTagFeedComponent } = await import('@features/tag/components/feed/feed');
return CoreTagFeedComponent;
} }
} }