MOBILE-4616 chore: Import modals during runtime

main
Pau Ferrer Ocaña 2024-07-15 16:00:01 +02:00
parent cefe0e4ac1
commit caa100979a
62 changed files with 178 additions and 308 deletions

View File

@ -16,7 +16,6 @@ import { Component, Input } from '@angular/core';
import { CoreCanceledError } from '@classes/errors/cancelederror'; import { CoreCanceledError } from '@classes/errors/cancelederror';
import { CoreError } from '@classes/errors/error'; import { CoreError } from '@classes/errors/error';
import { CoreDomUtils } from '@services/utils/dom'; import { CoreDomUtils } from '@services/utils/dom';
import { AddonModAssignEditFeedbackModalComponent } from '../components/edit-feedback-modal/edit-feedback-modal';
import { AddonModAssignFeedbackCommentsTextData } from '../feedback/comments/services/handler'; import { AddonModAssignFeedbackCommentsTextData } from '../feedback/comments/services/handler';
import { AddonModAssignAssign, AddonModAssignPlugin, AddonModAssignSubmission } from '../services/assign'; import { AddonModAssignAssign, AddonModAssignPlugin, AddonModAssignSubmission } from '../services/assign';
@ -46,6 +45,9 @@ export class AddonModAssignFeedbackPluginBaseComponent implements IAddonModAssig
throw new CoreError('Cannot edit feedback'); throw new CoreError('Cannot edit feedback');
} }
const { AddonModAssignEditFeedbackModalComponent } =
await import('@addons/mod/assign/components/edit-feedback-modal/edit-feedback-modal');
// Create the navigation modal. // Create the navigation modal.
const modalData = await CoreDomUtils.openModal<AddonModAssignFeedbackCommentsTextData>({ const modalData = await CoreDomUtils.openModal<AddonModAssignFeedbackCommentsTextData>({
component: AddonModAssignEditFeedbackModalComponent, component: AddonModAssignEditFeedbackModalComponent,

View File

@ -20,7 +20,6 @@ import { AddonModAssignIndexComponent } from './index/index';
import { AddonModAssignSubmissionComponent } from './submission/submission'; import { AddonModAssignSubmissionComponent } from './submission/submission';
import { AddonModAssignSubmissionPluginComponent } from './submission-plugin/submission-plugin'; import { AddonModAssignSubmissionPluginComponent } from './submission-plugin/submission-plugin';
import { AddonModAssignFeedbackPluginComponent } from './feedback-plugin/feedback-plugin'; import { AddonModAssignFeedbackPluginComponent } from './feedback-plugin/feedback-plugin';
import { AddonModAssignEditFeedbackModalComponent } from './edit-feedback-modal/edit-feedback-modal';
@NgModule({ @NgModule({
declarations: [ declarations: [
@ -28,7 +27,6 @@ import { AddonModAssignEditFeedbackModalComponent } from './edit-feedback-modal/
AddonModAssignSubmissionComponent, AddonModAssignSubmissionComponent,
AddonModAssignSubmissionPluginComponent, AddonModAssignSubmissionPluginComponent,
AddonModAssignFeedbackPluginComponent, AddonModAssignFeedbackPluginComponent,
AddonModAssignEditFeedbackModalComponent,
], ],
imports: [ imports: [
CoreSharedModule, CoreSharedModule,
@ -39,7 +37,6 @@ import { AddonModAssignEditFeedbackModalComponent } from './edit-feedback-modal/
AddonModAssignSubmissionComponent, AddonModAssignSubmissionComponent,
AddonModAssignSubmissionPluginComponent, AddonModAssignSubmissionPluginComponent,
AddonModAssignFeedbackPluginComponent, AddonModAssignFeedbackPluginComponent,
AddonModAssignEditFeedbackModalComponent,
], ],
}) })
export class AddonModAssignComponentsModule {} export class AddonModAssignComponentsModule {}

View File

@ -20,6 +20,8 @@ import { CoreUtils } from '@services/utils/utils';
import { ModalController, Translate } from '@singletons'; import { ModalController, Translate } from '@singletons';
import { AddonModAssignAssign, AddonModAssignPlugin, AddonModAssignSubmission } from '../../services/assign'; import { AddonModAssignAssign, AddonModAssignPlugin, AddonModAssignSubmission } from '../../services/assign';
import { AddonModAssignFeedbackDelegate } from '../../services/feedback-delegate'; import { AddonModAssignFeedbackDelegate } from '../../services/feedback-delegate';
import { CoreSharedModule } from '@/core/shared.module';
import { AddonModAssignComponentsModule } from '../components.module';
/** /**
* Modal that allows editing a feedback plugin. * Modal that allows editing a feedback plugin.
@ -27,6 +29,11 @@ import { AddonModAssignFeedbackDelegate } from '../../services/feedback-delegate
@Component({ @Component({
selector: 'addon-mod-assign-edit-feedback-modal', selector: 'addon-mod-assign-edit-feedback-modal',
templateUrl: 'edit-feedback-modal.html', templateUrl: 'edit-feedback-modal.html',
standalone: true,
imports: [
CoreSharedModule,
AddonModAssignComponentsModule,
],
}) })
export class AddonModAssignEditFeedbackModalComponent { export class AddonModAssignEditFeedbackModalComponent {

View File

@ -16,14 +16,12 @@ import { NgModule } from '@angular/core';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { CoreCourseComponentsModule } from '@features/course/components/components.module'; import { CoreCourseComponentsModule } from '@features/course/components/components.module';
import { AddonModDataIndexComponent } from './index'; import { AddonModDataIndexComponent } from './index';
import { AddonModDataSearchComponent } from './search/search';
import { CoreCompileHtmlComponentModule } from '@features/compile/components/compile-html/compile-html.module'; import { CoreCompileHtmlComponentModule } from '@features/compile/components/compile-html/compile-html.module';
import { AddonModDataActionsMenuComponent } from './actionsmenu/actionsmenu'; import { AddonModDataActionsMenuComponent } from './actionsmenu/actionsmenu';
@NgModule({ @NgModule({
declarations: [ declarations: [
AddonModDataIndexComponent, AddonModDataIndexComponent,
AddonModDataSearchComponent,
AddonModDataActionsMenuComponent, AddonModDataActionsMenuComponent,
], ],
imports: [ imports: [
@ -33,7 +31,6 @@ import { AddonModDataActionsMenuComponent } from './actionsmenu/actionsmenu';
], ],
exports: [ exports: [
AddonModDataIndexComponent, AddonModDataIndexComponent,
AddonModDataSearchComponent,
AddonModDataActionsMenuComponent, AddonModDataActionsMenuComponent,
], ],
}) })

View File

@ -40,7 +40,6 @@ import { AddonModDataHelper, AddonModDatDisplayFieldsOptions } from '../../servi
import { AddonModDataAutoSyncData, AddonModDataSyncResult } from '../../services/data-sync'; import { AddonModDataAutoSyncData, AddonModDataSyncResult } from '../../services/data-sync';
import { AddonModDataPrefetchHandler } from '../../services/handlers/prefetch-lazy'; import { AddonModDataPrefetchHandler } from '../../services/handlers/prefetch-lazy';
import { AddonModDataComponentsCompileModule } from '../components-compile.module'; import { AddonModDataComponentsCompileModule } from '../components-compile.module';
import { AddonModDataSearchComponent } from '../search/search';
import { CoreUrlUtils } from '@services/utils/url'; import { CoreUrlUtils } from '@services/utils/url';
import { CoreTime } from '@singletons/time'; import { CoreTime } from '@singletons/time';
import { import {
@ -400,8 +399,10 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp
* Display the chat users modal. * Display the chat users modal.
*/ */
async showSearch(): Promise<void> { async showSearch(): Promise<void> {
const { AddonModDataSearchModalComponent } = await import('@addons/mod/data/components/search-modal/search-modal');
const modalData = await CoreDomUtils.openModal<AddonModDataSearchDataParams>({ const modalData = await CoreDomUtils.openModal<AddonModDataSearchDataParams>({
component: AddonModDataSearchComponent, component: AddonModDataSearchModalComponent,
componentProps: { componentProps: {
search: this.search, search: this.search,
fields: this.fields, fields: this.fields,

View File

@ -30,16 +30,23 @@ import { AddonModDataHelper } from '../../services/data-helper';
import { AddonModDataComponentsCompileModule } from '../components-compile.module'; import { AddonModDataComponentsCompileModule } from '../components-compile.module';
import { AddonModDataSearchDataParams } from '../index'; import { AddonModDataSearchDataParams } from '../index';
import { AddonModDataTemplateType } from '../../constants'; import { AddonModDataTemplateType } from '../../constants';
import { CoreSharedModule } from '@/core/shared.module';
import { CoreCompileHtmlComponentModule } from '../../../../../core/features/compile/components/compile-html/compile-html.module';
/** /**
* Page that displays the search modal. * Page that displays the search modal.
*/ */
@Component({ @Component({
selector: 'addon-mod-data-search-modal', selector: 'addon-mod-data-search-modal',
templateUrl: 'search.html', templateUrl: 'search-modal.html',
styleUrls: ['../../data.scss', '../../data-forms.scss'], styleUrls: ['../../data.scss', '../../data-forms.scss'],
standalone: true,
imports: [
CoreSharedModule,
CoreCompileHtmlComponentModule,
],
}) })
export class AddonModDataSearchComponent implements OnInit { export class AddonModDataSearchModalComponent implements OnInit {
@ViewChild('searchFormEl') formElement!: ElementRef; @ViewChild('searchFormEl') formElement!: ElementRef;

View File

@ -1,36 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { CoreSharedModule } from '@/core/shared.module';
import { CoreCourseComponentsModule } from '@features/course/components/components.module';
import { AddonModQuizPreflightModalComponent } from './preflight-modal.component';
export { AddonModQuizPreflightModalComponent };
@NgModule({
declarations: [
AddonModQuizPreflightModalComponent,
],
imports: [
CoreSharedModule,
CoreCourseComponentsModule,
],
exports: [
AddonModQuizPreflightModalComponent,
],
})
export class AddonModQuizPreflightModalComponentModule {}

View File

@ -22,6 +22,7 @@ import { ModalController, Translate } from '@singletons';
import { AddonModQuizAccessRuleDelegate } from '../../services/access-rules-delegate'; import { AddonModQuizAccessRuleDelegate } from '../../services/access-rules-delegate';
import { AddonModQuizAttemptWSData, AddonModQuizQuizWSData } from '../../services/quiz'; import { AddonModQuizAttemptWSData, AddonModQuizQuizWSData } from '../../services/quiz';
import { CoreDom } from '@singletons/dom'; import { CoreDom } from '@singletons/dom';
import { CoreSharedModule } from '@/core/shared.module';
/** /**
* Modal that renders the access rules for a quiz. * Modal that renders the access rules for a quiz.
@ -29,6 +30,10 @@ import { CoreDom } from '@singletons/dom';
@Component({ @Component({
selector: 'page-addon-mod-quiz-preflight-modal', selector: 'page-addon-mod-quiz-preflight-modal',
templateUrl: 'preflight-modal.html', templateUrl: 'preflight-modal.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class AddonModQuizPreflightModalComponent implements OnInit { export class AddonModQuizPreflightModalComponent implements OnInit {

View File

@ -269,7 +269,7 @@ export class AddonModQuizHelperProvider {
} }
const { AddonModQuizPreflightModalComponent } = const { AddonModQuizPreflightModalComponent } =
await import('@addons/mod/quiz/components/preflight-modal/preflight-modal.module'); await import('@addons/mod/quiz/components/preflight-modal/preflight-modal');
// Create and show the modal. // Create and show the modal.
const modalData = await CoreDomUtils.openModal<Record<string, string>>({ const modalData = await CoreDomUtils.openModal<Record<string, string>>({

View File

@ -19,7 +19,6 @@ import { CoreCourseComponentsModule } from '@features/course/components/componen
import { CoreEditorComponentsModule } from '@features/editor/components/components.module'; import { CoreEditorComponentsModule } from '@features/editor/components/components.module';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { AddonModWorkshopAssessmentComponentsModule } from '@addons/mod/workshop/assessment/assesment-components.module'; import { AddonModWorkshopAssessmentComponentsModule } from '@addons/mod/workshop/assessment/assesment-components.module';
import { AddonModWorkshopPhaseInfoComponent } from './phase/phase';
import { AddonModWorkshopAssessmentComponent } from './assessment/assessment'; import { AddonModWorkshopAssessmentComponent } from './assessment/assessment';
import { AddonModWorkshopAssessmentStrategyComponent } from './assessment-strategy/assessment-strategy'; import { AddonModWorkshopAssessmentStrategyComponent } from './assessment-strategy/assessment-strategy';
@ -27,7 +26,6 @@ import { AddonModWorkshopAssessmentStrategyComponent } from './assessment-strate
declarations: [ declarations: [
AddonModWorkshopIndexComponent, AddonModWorkshopIndexComponent,
AddonModWorkshopSubmissionComponent, AddonModWorkshopSubmissionComponent,
AddonModWorkshopPhaseInfoComponent,
AddonModWorkshopAssessmentComponent, AddonModWorkshopAssessmentComponent,
AddonModWorkshopAssessmentStrategyComponent, AddonModWorkshopAssessmentStrategyComponent,
], ],
@ -40,7 +38,6 @@ import { AddonModWorkshopAssessmentStrategyComponent } from './assessment-strate
exports: [ exports: [
AddonModWorkshopIndexComponent, AddonModWorkshopIndexComponent,
AddonModWorkshopSubmissionComponent, AddonModWorkshopSubmissionComponent,
AddonModWorkshopPhaseInfoComponent,
AddonModWorkshopAssessmentComponent, AddonModWorkshopAssessmentComponent,
AddonModWorkshopAssessmentStrategyComponent, AddonModWorkshopAssessmentStrategyComponent,
], ],

View File

@ -48,7 +48,6 @@ import {
AddonModWorkshopAutoSyncData, AddonModWorkshopAutoSyncData,
AddonModWorkshopSyncResult, AddonModWorkshopSyncResult,
} from '../../services/workshop-sync'; } from '../../services/workshop-sync';
import { AddonModWorkshopPhaseInfoComponent } from '../phase/phase';
import { import {
ADDON_MOD_WORKSHOP_ASSESSMENT_SAVED, ADDON_MOD_WORKSHOP_ASSESSMENT_SAVED,
ADDON_MOD_WORKSHOP_AUTO_SYNCED, ADDON_MOD_WORKSHOP_AUTO_SYNCED,
@ -398,9 +397,11 @@ export class AddonModWorkshopIndexComponent extends CoreCourseModuleMainActivity
if (!this.phases || !this.workshop) { if (!this.phases || !this.workshop) {
return; return;
} }
const { AddonModWorkshopPhaseInfoModalComponent } =
await import('@addons/mod/workshop/components/phase-modal/phase-modal');
const modalData = await CoreDomUtils.openModal<boolean>({ const modalData = await CoreDomUtils.openModal<boolean>({
component: AddonModWorkshopPhaseInfoComponent, component: AddonModWorkshopPhaseInfoModalComponent,
componentProps: { componentProps: {
phases: CoreUtils.objectToArray(this.phases), phases: CoreUtils.objectToArray(this.phases),
workshopPhase: this.workshop.phase, workshopPhase: this.workshop.phase,

View File

@ -17,14 +17,19 @@ import { CoreUtils } from '@services/utils/utils';
import { ModalController } from '@singletons'; import { ModalController } from '@singletons';
import { AddonModWorkshopPhaseData, AddonModWorkshopPhaseTaskData } from '../../services/workshop'; import { AddonModWorkshopPhaseData, AddonModWorkshopPhaseTaskData } from '../../services/workshop';
import { AddonModWorkshopPhase } from '../../constants'; import { AddonModWorkshopPhase } from '../../constants';
import { CoreSharedModule } from '@/core/shared.module';
/** /**
* Page that displays the phase info modal. * Page that displays the phase info modal.
*/ */
@Component({ @Component({
templateUrl: 'phase.html', templateUrl: 'phase-modal.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class AddonModWorkshopPhaseInfoComponent implements OnInit { export class AddonModWorkshopPhaseInfoModalComponent implements OnInit {
@Input() phases!: AddonModWorkshopPhaseDataWithSwitch[]; @Input() phases!: AddonModWorkshopPhaseDataWithSwitch[];
@Input() workshopPhase!: AddonModWorkshopPhase; @Input() workshopPhase!: AddonModWorkshopPhase;

View File

@ -19,12 +19,17 @@ import { CoreDomUtils, ToastDuration } from '@services/utils/dom';
import { CoreForms } from '@singletons/form'; import { CoreForms } from '@singletons/form';
import { ModalController } from '@singletons'; import { ModalController } from '@singletons';
import { CoreKeyboard } from '@singletons/keyboard'; import { CoreKeyboard } from '@singletons/keyboard';
import { CoreSharedModule } from '@/core/shared.module';
/** /**
* Component that displays a text area for composing a note. * Component that displays a text area for composing a note.
*/ */
@Component({ @Component({
templateUrl: 'add-modal.html', templateUrl: 'add-modal.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class AddonNotesAddComponent { export class AddonNotesAddComponent {

View File

@ -1,30 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { NgModule } from '@angular/core';
import { AddonNotesAddComponent } from './add/add-modal';
@NgModule({
declarations: [
AddonNotesAddComponent,
],
imports: [
CoreSharedModule,
],
exports: [
AddonNotesAddComponent,
],
})
export class AddonNotesComponentsModule {}

View File

@ -21,7 +21,6 @@ import { AddonNotesSyncCronHandler } from './services/handlers/sync-cron';
import { AddonNotesUserHandler } from './services/handlers/user'; import { AddonNotesUserHandler } from './services/handlers/user';
import { CORE_SITE_SCHEMAS } from '@services/sites'; import { CORE_SITE_SCHEMAS } from '@services/sites';
import { NOTES_OFFLINE_SITE_SCHEMA } from './services/database/notes'; import { NOTES_OFFLINE_SITE_SCHEMA } from './services/database/notes';
import { AddonNotesComponentsModule } from './components/components.module';
import { Routes } from '@angular/router'; import { Routes } from '@angular/router';
import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module';
import { CoreCourseIndexRoutingModule } from '@features/course/course-routing.module'; import { CoreCourseIndexRoutingModule } from '@features/course/course-routing.module';
@ -54,7 +53,6 @@ const routes: Routes = [
imports: [ imports: [
CoreMainMenuTabRoutingModule.forChild(routes), CoreMainMenuTabRoutingModule.forChild(routes),
CoreCourseIndexRoutingModule.forChild({ children: routes }), CoreCourseIndexRoutingModule.forChild({ children: routes }),
AddonNotesComponentsModule,
], ],
providers: [ providers: [
{ {

View File

@ -13,7 +13,7 @@
// limitations under the License. // limitations under the License.
import { CoreConstants } from '@/core/constants'; import { CoreConstants } from '@/core/constants';
import { AddonNotesAddComponent, AddonNotesAddModalReturn } from '@addons/notes/components/add/add-modal'; import { AddonNotesAddModalReturn } from '@addons/notes/components/add/add-modal';
import { AddonNotes, AddonNotesNoteFormatted, AddonNotesPublishState } from '@addons/notes/services/notes'; import { AddonNotes, AddonNotesNoteFormatted, AddonNotesPublishState } from '@addons/notes/services/notes';
import { AddonNotesOffline } from '@addons/notes/services/notes-offline'; import { AddonNotesOffline } from '@addons/notes/services/notes-offline';
import { AddonNotesSync, AddonNotesSyncProvider } from '@addons/notes/services/notes-sync'; import { AddonNotesSync, AddonNotesSyncProvider } from '@addons/notes/services/notes-sync';
@ -194,6 +194,8 @@ export class AddonNotesListPage implements OnInit, OnDestroy {
this.logViewAdd(); this.logViewAdd();
const { AddonNotesAddComponent } = await import('@addons/notes/components/add/add-modal');
const modalData = await CoreDomUtils.openModal<AddonNotesAddModalReturn>({ const modalData = await CoreDomUtils.openModal<AddonNotesAddModalReturn>({
component: AddonNotesAddComponent, component: AddonNotesAddComponent,
componentProps: { componentProps: {

View File

@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreRefreshButtonModalComponent } from '@components/refresh-button-modal/refresh-button-modal';
import { CoreNavigator } from '@services/navigator'; import { CoreNavigator } from '@services/navigator';
import { CoreDomUtils } from '@services/utils/dom'; import { CoreDomUtils } from '@services/utils/dom';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
@ -129,6 +128,9 @@ export class PageLoadsManager {
* Notify the user, asking him if he wants to update the data. * Notify the user, asking him if he wants to update the data.
*/ */
protected async notifyUser(): Promise<void> { protected async notifyUser(): Promise<void> {
const { CoreRefreshButtonModalComponent }
= await import('@components/refresh-button-modal/refresh-button-modal');
await CoreDomUtils.openModal<boolean>({ await CoreDomUtils.openModal<boolean>({
component: CoreRefreshButtonModalComponent, component: CoreRefreshButtonModalComponent,
cssClass: 'core-modal-no-background core-modal-fullscreen', cssClass: 'core-modal-no-background core-modal-fullscreen',

View File

@ -61,7 +61,6 @@ import { CoreSwipeSlidesComponent } from './swipe-slides/swipe-slides';
import { CoreSwipeNavigationTourComponent } from './swipe-navigation-tour/swipe-navigation-tour'; import { CoreSwipeNavigationTourComponent } from './swipe-navigation-tour/swipe-navigation-tour';
import { CoreMessageComponent } from './message/message'; import { CoreMessageComponent } from './message/message';
import { CoreGroupSelectorComponent } from './group-selector/group-selector'; import { CoreGroupSelectorComponent } from './group-selector/group-selector';
import { CoreRefreshButtonModalComponent } from './refresh-button-modal/refresh-button-modal';
import { CoreSheetModalComponent } from '@components/sheet-modal/sheet-modal'; import { CoreSheetModalComponent } from '@components/sheet-modal/sheet-modal';
import { CoreCourseImageComponent } from '@components/course-image/course-image'; import { CoreCourseImageComponent } from '@components/course-image/course-image';
import { CoreSitesListComponent } from './sites-list/sites-list'; import { CoreSitesListComponent } from './sites-list/sites-list';
@ -123,7 +122,6 @@ export async function getCoreStandaloneComponents(): Promise<Type<unknown>[]> {
CoreSpacerComponent, CoreSpacerComponent,
CoreHorizontalScrollControlsComponent, CoreHorizontalScrollControlsComponent,
CoreSwipeNavigationTourComponent, CoreSwipeNavigationTourComponent,
CoreRefreshButtonModalComponent,
CoreSheetModalComponent, CoreSheetModalComponent,
CoreSitesListComponent, CoreSitesListComponent,
], ],
@ -177,7 +175,6 @@ export async function getCoreStandaloneComponents(): Promise<Type<unknown>[]> {
CoreSpacerComponent, CoreSpacerComponent,
CoreHorizontalScrollControlsComponent, CoreHorizontalScrollControlsComponent,
CoreSwipeNavigationTourComponent, CoreSwipeNavigationTourComponent,
CoreRefreshButtonModalComponent,
CoreSheetModalComponent, CoreSheetModalComponent,
CoreSitesListComponent, CoreSitesListComponent,
], ],

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { ModalController } from '@singletons'; import { ModalController } from '@singletons';
@ -20,7 +21,11 @@ import { ModalController } from '@singletons';
*/ */
@Component({ @Component({
templateUrl: 'refresh-button-modal.html', templateUrl: 'refresh-button-modal.html',
styleUrls: ['refresh-button-modal.scss'], styleUrl: 'refresh-button-modal.scss',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreRefreshButtonModalComponent { export class CoreRefreshButtonModalComponent {

View File

@ -21,6 +21,7 @@ import { CoreContentLinksHelper } from '../../services/contentlinks-helper';
import { CoreError } from '@classes/errors/error'; import { CoreError } from '@classes/errors/error';
import { CoreNavigator } from '@services/navigator'; import { CoreNavigator } from '@services/navigator';
import { CoreSitesFactory } from '@services/sites-factory'; import { CoreSitesFactory } from '@services/sites-factory';
import { CoreSharedModule } from '@/core/shared.module';
/** /**
* Page to display the list of sites to choose one to perform a content link action. * Page to display the list of sites to choose one to perform a content link action.
@ -28,6 +29,10 @@ import { CoreSitesFactory } from '@services/sites-factory';
@Component({ @Component({
selector: 'core-content-links-choose-site-modal', selector: 'core-content-links-choose-site-modal',
templateUrl: 'choose-site-modal.html', templateUrl: 'choose-site-modal.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreContentLinksChooseSiteModalComponent implements OnInit { export class CoreContentLinksChooseSiteModalComponent implements OnInit {

View File

@ -1,30 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { NgModule } from '@angular/core';
import { CoreContentLinksChooseSiteModalComponent } from './choose-site-modal/choose-site-modal';
@NgModule({
declarations: [
CoreContentLinksChooseSiteModalComponent,
],
imports: [
CoreSharedModule,
],
exports: [
CoreContentLinksChooseSiteModalComponent,
],
})
export class CoreContentLinksComponentsModule {}

View File

@ -13,7 +13,6 @@
// limitations under the License. // limitations under the License.
import { NgModule, Type } from '@angular/core'; import { NgModule, Type } from '@angular/core';
import { CoreContentLinksComponentsModule } from './components/components.module';
/** /**
* Get content links services. * Get content links services.
@ -50,8 +49,5 @@ export async function getContentLinksExportedObjects(): Promise<Record<string, u
} }
@NgModule({ @NgModule({
imports: [
CoreContentLinksComponentsModule,
],
}) })
export class CoreContentLinksModule {} export class CoreContentLinksModule {}

View File

@ -19,7 +19,6 @@ import { CoreContentLinksDelegate, CoreContentLinksAction } from './contentlinks
import { CoreSite } from '@classes/sites/site'; import { CoreSite } from '@classes/sites/site';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { CoreNavigator } from '@services/navigator'; import { CoreNavigator } from '@services/navigator';
import { CoreContentLinksChooseSiteModalComponent } from '../components/choose-site-modal/choose-site-modal';
import { CoreCustomURLSchemes } from '@services/urlschemes'; import { CoreCustomURLSchemes } from '@services/urlschemes';
/** /**
@ -96,6 +95,9 @@ export class CoreContentLinksHelperProvider {
* @todo set correct root. * @todo set correct root.
*/ */
async goToChooseSite(url: string): Promise<void> { async goToChooseSite(url: string): Promise<void> {
const { CoreContentLinksChooseSiteModalComponent }
= await import('@features/contentlinks/components/choose-site-modal/choose-site-modal');
await CoreDomUtils.openModal({ await CoreDomUtils.openModal({
component: CoreContentLinksChooseSiteModalComponent, component: CoreContentLinksChooseSiteModalComponent,
componentProps: { componentProps: {

View File

@ -19,7 +19,6 @@ import { CoreBlockComponentsModule } from '@features/block/components/components
import { CoreCourseFormatComponent } from './course-format/course-format'; import { CoreCourseFormatComponent } from './course-format/course-format';
import { CoreCourseModuleComponent } from './module/module'; import { CoreCourseModuleComponent } from './module/module';
import { CoreCourseModuleCompletionComponent } from './module-completion/module-completion'; import { CoreCourseModuleCompletionComponent } from './module-completion/module-completion';
import { CoreCourseCourseIndexComponent } from './course-index/course-index';
import { CoreCourseTagAreaComponent } from './tag-area/tag-area'; import { CoreCourseTagAreaComponent } from './tag-area/tag-area';
import { CoreCourseUnsupportedModuleComponent } from './unsupported-module/unsupported-module'; import { CoreCourseUnsupportedModuleComponent } from './unsupported-module/unsupported-module';
import { CoreCourseModuleCompletionLegacyComponent } from './module-completion-legacy/module-completion-legacy'; import { CoreCourseModuleCompletionLegacyComponent } from './module-completion-legacy/module-completion-legacy';
@ -37,7 +36,6 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion-
CoreCourseModuleCompletionComponent, CoreCourseModuleCompletionComponent,
CoreCourseModuleCompletionLegacyComponent, CoreCourseModuleCompletionLegacyComponent,
CoreCourseModuleInfoComponent, CoreCourseModuleInfoComponent,
CoreCourseCourseIndexComponent,
CoreCourseCourseIndexTourComponent, CoreCourseCourseIndexTourComponent,
CoreCourseTagAreaComponent, CoreCourseTagAreaComponent,
CoreCourseUnsupportedModuleComponent, CoreCourseUnsupportedModuleComponent,
@ -56,7 +54,6 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion-
CoreCourseModuleCompletionComponent, CoreCourseModuleCompletionComponent,
CoreCourseModuleCompletionLegacyComponent, CoreCourseModuleCompletionLegacyComponent,
CoreCourseModuleInfoComponent, CoreCourseModuleInfoComponent,
CoreCourseCourseIndexComponent,
CoreCourseCourseIndexTourComponent, CoreCourseCourseIndexTourComponent,
CoreCourseTagAreaComponent, CoreCourseTagAreaComponent,
CoreCourseUnsupportedModuleComponent, CoreCourseUnsupportedModuleComponent,

View File

@ -41,7 +41,7 @@ import { CoreCourseFormatDelegate } from '@features/course/services/format-deleg
import { CoreEventObserver, CoreEvents } from '@singletons/events'; import { CoreEventObserver, CoreEvents } from '@singletons/events';
import { IonContent } from '@ionic/angular'; import { IonContent } from '@ionic/angular';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { CoreCourseCourseIndexComponent, CoreCourseIndexSectionWithModule } from '../course-index/course-index'; import { CoreCourseIndexSectionWithModule } from '../course-index/course-index';
import { CoreBlockHelper } from '@features/block/services/block-helper'; import { CoreBlockHelper } from '@features/block/services/block-helper';
import { CoreNavigator } from '@services/navigator'; import { CoreNavigator } from '@services/navigator';
import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate'; import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate';
@ -429,6 +429,8 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
async openCourseIndex(): Promise<void> { async openCourseIndex(): Promise<void> {
const selectedId = await this.getSelectedSectionId(); const selectedId = await this.getSelectedSectionId();
const { CoreCourseCourseIndexComponent } = await import('@features/course/components/course-index/course-index');
const data = await CoreDomUtils.openModal<CoreCourseIndexSectionWithModule>({ const data = await CoreDomUtils.openModal<CoreCourseIndexSectionWithModule>({
component: CoreCourseCourseIndexComponent, component: CoreCourseCourseIndexComponent,
initialBreakpoint: 1, initialBreakpoint: 1,

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component, ElementRef, Input, OnInit } from '@angular/core'; import { Component, ElementRef, Input, OnInit } from '@angular/core';
import { import {
CoreCourse, CoreCourse,
@ -33,7 +34,11 @@ import { CoreDom } from '@singletons/dom';
@Component({ @Component({
selector: 'core-course-course-index', selector: 'core-course-course-index',
templateUrl: 'course-index.html', templateUrl: 'course-index.html',
styleUrls: ['course-index.scss'], styleUrl: 'course-index.scss',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreCourseCourseIndexComponent implements OnInit { export class CoreCourseCourseIndexComponent implements OnInit {

View File

@ -1,33 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { CoreSharedModule } from '@/core/shared.module';
import { CoreDataPrivacyContactDPOComponent } from './contactdpo/contactdpo';
import { CoreDataPrivacyNewRequestComponent } from './newrequest/newrequest';
@NgModule({
declarations: [
CoreDataPrivacyContactDPOComponent,
CoreDataPrivacyNewRequestComponent,
],
imports: [
CoreSharedModule,
],
exports: [
CoreDataPrivacyContactDPOComponent,
CoreDataPrivacyNewRequestComponent,
],
})
export class CoreDataPrivacyComponentsModule {}

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms'; import { FormGroup, FormBuilder, Validators } from '@angular/forms';
import { CoreDataPrivacy } from '@features/dataprivacy/services/dataprivacy'; import { CoreDataPrivacy } from '@features/dataprivacy/services/dataprivacy';
@ -28,6 +29,11 @@ import { ModalController } from '@singletons';
@Component({ @Component({
selector: 'core-data-privacy-contact-dpo', selector: 'core-data-privacy-contact-dpo',
templateUrl: 'contactdpo.html', templateUrl: 'contactdpo.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreDataPrivacyContactDPOComponent implements OnInit { export class CoreDataPrivacyContactDPOComponent implements OnInit {

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms'; import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
import { import {
@ -29,6 +30,10 @@ import { ModalController } from '@singletons';
@Component({ @Component({
selector: 'core-data-privacy-new-request', selector: 'core-data-privacy-new-request',
templateUrl: 'newrequest.html', templateUrl: 'newrequest.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreDataPrivacyNewRequestComponent implements OnInit { export class CoreDataPrivacyNewRequestComponent implements OnInit {

View File

@ -17,7 +17,6 @@ import { CoreUserDelegate } from '@features/user/services/user-delegate';
import { CoreDataPrivacyUserHandler } from './services/handlers/user'; import { CoreDataPrivacyUserHandler } from './services/handlers/user';
import { Routes } from '@angular/router'; import { Routes } from '@angular/router';
import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module';
import { CoreDataPrivacyComponentsModule } from './components/components.module';
import { CORE_DATAPRIVACY_PAGE_NAME } from './constants'; import { CORE_DATAPRIVACY_PAGE_NAME } from './constants';
import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate'; import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate';
import { CoreDataPrivacyDataRequestsLinkHandler } from './services/handlers/datarequests-link'; import { CoreDataPrivacyDataRequestsLinkHandler } from './services/handlers/datarequests-link';
@ -33,7 +32,6 @@ const routes: Routes = [
@NgModule({ @NgModule({
imports: [ imports: [
CoreMainMenuTabRoutingModule.forChild(routes), CoreMainMenuTabRoutingModule.forChild(routes),
CoreDataPrivacyComponentsModule,
], ],
providers: [ providers: [
{ {

View File

@ -13,8 +13,6 @@
// limitations under the License. // limitations under the License.
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { CoreDataPrivacyContactDPOComponent } from '@features/dataprivacy/components/contactdpo/contactdpo';
import { CoreDataPrivacyNewRequestComponent } from '@features/dataprivacy/components/newrequest/newrequest';
import { import {
CoreDataPrivacy, CoreDataPrivacy,
CoreDataPrivacyDataRequestType, CoreDataPrivacyDataRequestType,
@ -115,6 +113,9 @@ export class CoreDataPrivacyMainPage implements OnInit {
* Open the contact DPO modal. * Open the contact DPO modal.
*/ */
async contactDPO(): Promise<void> { async contactDPO(): Promise<void> {
const { CoreDataPrivacyContactDPOComponent } =
await import('@features/dataprivacy/components/contactdpo/contactdpo');
// Create and show the modal. // Create and show the modal.
const succeed = await CoreDomUtils.openModal<boolean>({ const succeed = await CoreDomUtils.openModal<boolean>({
component: CoreDataPrivacyContactDPOComponent, component: CoreDataPrivacyContactDPOComponent,
@ -134,6 +135,9 @@ export class CoreDataPrivacyMainPage implements OnInit {
* Open the new request modal. * Open the new request modal.
*/ */
async newRequest(createType?: CoreDataPrivacyDataRequestType): Promise<void> { async newRequest(createType?: CoreDataPrivacyDataRequestType): Promise<void> {
const { CoreDataPrivacyNewRequestComponent } =
await import('@features/dataprivacy/components/newrequest/newrequest');
// Create and show the modal. // Create and show the modal.
const succeed = await CoreDomUtils.openModal<boolean>({ const succeed = await CoreDomUtils.openModal<boolean>({
component: CoreDataPrivacyNewRequestComponent, component: CoreDataPrivacyNewRequestComponent,

View File

@ -12,13 +12,18 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Input, OnDestroy, ViewChild } from '@angular/core'; import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Input, OnDestroy, ViewChild } from '@angular/core';
@Component({ @Component({
selector: 'core-audio-histogram', selector: 'core-audio-histogram',
templateUrl: 'audio-histogram.html', templateUrl: 'audio-histogram.html',
styleUrls: ['audio-histogram.scss'], styleUrl: 'audio-histogram.scss',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreFileUploaderAudioHistogramComponent implements AfterViewInit, OnDestroy { export class CoreFileUploaderAudioHistogramComponent implements AfterViewInit, OnDestroy {

View File

@ -27,12 +27,19 @@ import { CoreFileUploaderAudioRecording } from '@features/fileuploader/services/
import { CoreFile, CoreFileProvider } from '@services/file'; import { CoreFile, CoreFileProvider } from '@services/file';
import { CorePath } from '@singletons/path'; import { CorePath } from '@singletons/path';
import { CoreNative } from '@features/native/services/native'; import { CoreNative } from '@features/native/services/native';
import { CoreSharedModule } from '@/core/shared.module';
import { CoreFileUploaderAudioHistogramComponent } from '../audio-histogram/audio-histogram';
@Component({ @Component({
selector: 'core-fileuploader-audio-recorder', selector: 'core-fileuploader-audio-recorder',
styleUrls: ['./audio-recorder.scss'], styleUrl: 'audio-recorder.scss',
templateUrl: 'audio-recorder.html', templateUrl: 'audio-recorder.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
standalone: true,
imports: [
CoreSharedModule,
CoreFileUploaderAudioHistogramComponent,
],
}) })
export class CoreFileUploaderAudioRecorderComponent extends CoreModalComponent<CoreFileUploaderAudioRecording> export class CoreFileUploaderAudioRecorderComponent extends CoreModalComponent<CoreFileUploaderAudioRecording>
implements OnDestroy { implements OnDestroy {

View File

@ -1,32 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { NgModule } from '@angular/core';
import { CoreFileUploaderAudioHistogramComponent } from '@features/fileuploader/components/audio-histogram/audio-histogram';
import { CoreFileUploaderAudioRecorderComponent } from './audio-recorder.component';
export { CoreFileUploaderAudioRecorderComponent };
@NgModule({
imports: [
CoreSharedModule,
],
declarations: [
CoreFileUploaderAudioRecorderComponent,
CoreFileUploaderAudioHistogramComponent,
],
})
export class CoreFileUploaderAudioRecorderComponentModule {}

View File

@ -159,7 +159,7 @@ export class CoreFileUploaderProvider {
*/ */
async captureAudioInApp(): Promise<CoreFileUploaderAudioRecording> { async captureAudioInApp(): Promise<CoreFileUploaderAudioRecording> {
const { CoreFileUploaderAudioRecorderComponent } = const { CoreFileUploaderAudioRecorderComponent } =
await import('@features/fileuploader/components/audio-recorder/audio-recorder.module'); await import('@features/fileuploader/components/audio-recorder/audio-recorder.component');
const recording = await CoreModals.openSheet(CoreFileUploaderAudioRecorderComponent); const recording = await CoreModals.openSheet(CoreFileUploaderAudioRecorderComponent);

View File

@ -14,8 +14,6 @@
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { CoreLoginSiteOnboardingComponent } from './site-onboarding/site-onboarding';
import { CoreLoginSiteHelpComponent } from './site-help/site-help';
import { CoreLoginSitesModalComponent } from './sites-modal/sites-modal'; import { CoreLoginSitesModalComponent } from './sites-modal/sites-modal';
import { CoreLoginMethodsComponent } from './login-methods/login-methods'; import { CoreLoginMethodsComponent } from './login-methods/login-methods';
import { CoreLoginExceededAttemptsComponent } from '@features/login/components/exceeded-attempts/exceeded-attempts'; import { CoreLoginExceededAttemptsComponent } from '@features/login/components/exceeded-attempts/exceeded-attempts';
@ -23,8 +21,6 @@ import { CoreLoginExceededAttemptsComponent } from '@features/login/components/e
@NgModule({ @NgModule({
declarations: [ declarations: [
CoreLoginExceededAttemptsComponent, CoreLoginExceededAttemptsComponent,
CoreLoginSiteOnboardingComponent,
CoreLoginSiteHelpComponent,
CoreLoginSitesModalComponent, CoreLoginSitesModalComponent,
CoreLoginMethodsComponent, CoreLoginMethodsComponent,
], ],
@ -33,8 +29,6 @@ import { CoreLoginExceededAttemptsComponent } from '@features/login/components/e
], ],
exports: [ exports: [
CoreLoginExceededAttemptsComponent, CoreLoginExceededAttemptsComponent,
CoreLoginSiteOnboardingComponent,
CoreLoginSiteHelpComponent,
CoreLoginSitesModalComponent, CoreLoginSitesModalComponent,
CoreLoginMethodsComponent, CoreLoginMethodsComponent,
], ],

View File

@ -20,6 +20,7 @@ import { FAQ_QRCODE_IMAGE_HTML, FAQ_URL_IMAGE_HTML, GET_STARTED_URL } from '@fea
import { CoreDomUtils } from '@services/utils/dom'; import { CoreDomUtils } from '@services/utils/dom';
import { CoreCancellablePromise } from '@classes/cancellable-promise'; import { CoreCancellablePromise } from '@classes/cancellable-promise';
import { SubPartial } from '@/core/utils/types'; import { SubPartial } from '@/core/utils/types';
import { CoreSharedModule } from '@/core/shared.module';
/** /**
* Component that displays help to connect to a site. * Component that displays help to connect to a site.
@ -27,7 +28,11 @@ import { SubPartial } from '@/core/utils/types';
@Component({ @Component({
selector: 'core-login-site-help', selector: 'core-login-site-help',
templateUrl: 'site-help.html', templateUrl: 'site-help.html',
styleUrls: ['site-help.scss'], styleUrl: 'site-help.scss',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreLoginSiteHelpComponent implements AfterViewInit, OnDestroy { export class CoreLoginSiteHelpComponent implements AfterViewInit, OnDestroy {

View File

@ -18,6 +18,7 @@ import { CoreConfig } from '@services/config';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { GET_STARTED_URL, ONBOARDING_DONE } from '@features/login/constants'; import { GET_STARTED_URL, ONBOARDING_DONE } from '@features/login/constants';
import { ModalController } from '@singletons'; import { ModalController } from '@singletons';
import { CoreSharedModule } from '@/core/shared.module';
/** /**
* Component that displays onboarding help regarding the CoreLoginSitePage. * Component that displays onboarding help regarding the CoreLoginSitePage.
@ -26,6 +27,10 @@ import { ModalController } from '@singletons';
selector: 'core-login-site-onboarding', selector: 'core-login-site-onboarding',
templateUrl: 'site-onboarding.html', templateUrl: 'site-onboarding.html',
styleUrls: ['site-onboarding.scss', '../../login.scss'], styleUrls: ['site-onboarding.scss', '../../login.scss'],
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreLoginSiteOnboardingComponent { export class CoreLoginSiteOnboardingComponent {

View File

@ -30,8 +30,6 @@ import { CoreConstants } from '@/core/constants';
import { Translate } from '@singletons'; import { Translate } from '@singletons';
import { CoreUrl } from '@singletons/url'; import { CoreUrl } from '@singletons/url';
import { CoreUrlUtils } from '@services/utils/url'; import { CoreUrlUtils } from '@services/utils/url';
import { CoreLoginSiteHelpComponent } from '@features/login/components/site-help/site-help';
import { CoreLoginSiteOnboardingComponent } from '@features/login/components/site-onboarding/site-onboarding';
import { CoreNavigator } from '@services/navigator'; import { CoreNavigator } from '@services/navigator';
import { CoreCustomURLSchemes, CoreCustomURLSchemesHandleError } from '@services/urlschemes'; import { CoreCustomURLSchemes, CoreCustomURLSchemesHandleError } from '@services/urlschemes';
import { CoreTextUtils } from '@services/utils/text'; import { CoreTextUtils } from '@services/utils/text';
@ -258,6 +256,9 @@ export class CoreLoginSitePage implements OnInit {
* Show a help modal. * Show a help modal.
*/ */
async showHelp(): Promise<void> { async showHelp(): Promise<void> {
const { CoreLoginSiteHelpComponent } =
await import('@features/login/components/site-help/site-help');
await CoreDomUtils.openModal({ await CoreDomUtils.openModal({
component: CoreLoginSiteHelpComponent, component: CoreLoginSiteHelpComponent,
cssClass: 'core-modal-fullscreen', cssClass: 'core-modal-fullscreen',
@ -268,6 +269,9 @@ export class CoreLoginSitePage implements OnInit {
* Show an onboarding modal. * Show an onboarding modal.
*/ */
async showOnboarding(): Promise<void> { async showOnboarding(): Promise<void> {
const { CoreLoginSiteOnboardingComponent } =
await import('@features/login/components/site-onboarding/site-onboarding');
await CoreDomUtils.openModal({ await CoreDomUtils.openModal({
component: CoreLoginSiteOnboardingComponent, component: CoreLoginSiteOnboardingComponent,
cssClass: 'core-modal-fullscreen', cssClass: 'core-modal-fullscreen',

View File

@ -1,31 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { NgModule } from '@angular/core';
import { CoreSharedModule } from '@/core/shared.module';
import { CorePolicyViewPolicyModalComponent } from './policy-modal/policy-modal';
@NgModule({
declarations: [
CorePolicyViewPolicyModalComponent,
],
imports: [
CoreSharedModule,
],
exports: [
CorePolicyViewPolicyModalComponent,
],
})
export class CorePolicyComponentsModule {}

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { CorePolicySitePolicy } from '@features/policy/services/policy'; import { CorePolicySitePolicy } from '@features/policy/services/policy';
import { ModalController } from '@singletons'; import { ModalController } from '@singletons';
@ -22,6 +23,10 @@ import { ModalController } from '@singletons';
@Component({ @Component({
selector: 'core-policy-view-policy-modal', selector: 'core-policy-view-policy-modal',
templateUrl: 'policy-modal.html', templateUrl: 'policy-modal.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CorePolicyViewPolicyModalComponent { export class CorePolicyViewPolicyModalComponent {

View File

@ -20,7 +20,6 @@ import { CoreUtils } from '@services/utils/utils';
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics'; import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
import { Translate } from '@singletons'; import { Translate } from '@singletons';
import { CorePolicy, CorePolicySitePolicy, CorePolicyStatus } from '@features/policy/services/policy'; import { CorePolicy, CorePolicySitePolicy, CorePolicyStatus } from '@features/policy/services/policy';
import { CorePolicyViewPolicyModalComponent } from '@features/policy/components/policy-modal/policy-modal';
import { CoreTime } from '@singletons/time'; import { CoreTime } from '@singletons/time';
import { CoreScreen } from '@services/screen'; import { CoreScreen } from '@services/screen';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
@ -188,10 +187,13 @@ export class CorePolicyAcceptancesPage implements OnInit, OnDestroy {
* @param event Event. * @param event Event.
* @param policy Policy. * @param policy Policy.
*/ */
viewFullPolicy(event: Event, policy: CorePolicySitePolicy): void { async viewFullPolicy(event: Event, policy: CorePolicySitePolicy): Promise<void> {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
const { CorePolicyViewPolicyModalComponent } =
await import('@features/policy/components/policy-modal/policy-modal');
CoreDomUtils.openModal({ CoreDomUtils.openModal({
component: CorePolicyViewPolicyModalComponent, component: CorePolicyViewPolicyModalComponent,
componentProps: { policy }, componentProps: { policy },

View File

@ -30,7 +30,6 @@ import { IonContent } from '@ionic/angular';
import { CoreScreen } from '@services/screen'; import { CoreScreen } from '@services/screen';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
import { CoreDom } from '@singletons/dom'; import { CoreDom } from '@singletons/dom';
import { CorePolicyViewPolicyModalComponent } from '@features/policy/components/policy-modal/policy-modal';
/** /**
* Page to accept a site policy. * Page to accept a site policy.
@ -464,7 +463,10 @@ export class CorePolicySitePolicyPage implements OnInit, OnDestroy {
* *
* @param policy Policy. * @param policy Policy.
*/ */
viewFullPolicy(policy: CorePolicySitePolicy): void { async viewFullPolicy(policy: CorePolicySitePolicy): Promise<void> {
const { CorePolicyViewPolicyModalComponent } =
await import('@features/policy/components/policy-modal/policy-modal');
CoreDomUtils.openModal({ CoreDomUtils.openModal({
component: CorePolicyViewPolicyModalComponent, component: CorePolicyViewPolicyModalComponent,
componentProps: { policy }, componentProps: { policy },

View File

@ -18,7 +18,6 @@ import { RouterModule, Routes } from '@angular/router';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { CorePolicySitePolicyPage } from '@features/policy/pages/site-policy/site-policy'; import { CorePolicySitePolicyPage } from '@features/policy/pages/site-policy/site-policy';
import { ACCEPTANCES_PAGE_NAME, SITE_POLICY_PAGE_NAME } from './constants'; import { ACCEPTANCES_PAGE_NAME, SITE_POLICY_PAGE_NAME } from './constants';
import { CorePolicyComponentsModule } from './components/components.module';
import { CorePolicyAcceptancesPage } from './pages/acceptances/acceptances'; import { CorePolicyAcceptancesPage } from './pages/acceptances/acceptances';
const routes: Routes = [ const routes: Routes = [
@ -36,7 +35,6 @@ const routes: Routes = [
imports: [ imports: [
CoreSharedModule, CoreSharedModule,
RouterModule.forChild(routes), RouterModule.forChild(routes),
CorePolicyComponentsModule,
], ],
declarations: [ declarations: [
CorePolicySitePolicyPage, CorePolicySitePolicyPage,

View File

@ -23,7 +23,6 @@ import {
import { CoreSites } from '@services/sites'; import { CoreSites } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom'; import { CoreDomUtils } from '@services/utils/dom';
import { CoreEventObserver, CoreEvents } from '@singletons/events'; import { CoreEventObserver, CoreEvents } from '@singletons/events';
import { CoreRatingRatingsComponent } from '../ratings/ratings';
/** /**
* Component that displays the aggregation of a rating item. * Component that displays the aggregation of a rating item.
@ -118,6 +117,9 @@ export class CoreRatingAggregateComponent implements OnChanges, OnDestroy {
return; return;
} }
const { CoreRatingRatingsComponent } =
await import('@features/rating/components/ratings/ratings');
await CoreDomUtils.openModal({ await CoreDomUtils.openModal({
component: CoreRatingRatingsComponent, component: CoreRatingRatingsComponent,
componentProps: { componentProps: {

View File

@ -16,13 +16,11 @@ import { NgModule } from '@angular/core';
import { CoreRatingAggregateComponent } from './aggregate/aggregate'; import { CoreRatingAggregateComponent } from './aggregate/aggregate';
import { CoreRatingRateComponent } from './rate/rate'; import { CoreRatingRateComponent } from './rate/rate';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { CoreRatingRatingsComponent } from './ratings/ratings';
@NgModule({ @NgModule({
declarations: [ declarations: [
CoreRatingAggregateComponent, CoreRatingAggregateComponent,
CoreRatingRateComponent, CoreRatingRateComponent,
CoreRatingRatingsComponent,
], ],
imports: [ imports: [
CoreSharedModule, CoreSharedModule,
@ -30,7 +28,6 @@ import { CoreRatingRatingsComponent } from './ratings/ratings';
exports: [ exports: [
CoreRatingAggregateComponent, CoreRatingAggregateComponent,
CoreRatingRateComponent, CoreRatingRateComponent,
CoreRatingRatingsComponent,
], ],
}) })
export class CoreRatingComponentsModule {} export class CoreRatingComponentsModule {}

View File

@ -13,6 +13,7 @@
// limitations under the License. // limitations under the License.
import { ContextLevel } from '@/core/constants'; import { ContextLevel } from '@/core/constants';
import { CoreSharedModule } from '@/core/shared.module';
import { Component, Input, OnInit } from '@angular/core'; import { Component, Input, OnInit } from '@angular/core';
import { CoreRating, CoreRatingItemRating } from '@features/rating/services/rating'; import { CoreRating, CoreRatingItemRating } from '@features/rating/services/rating';
import { CoreDomUtils } from '@services/utils/dom'; import { CoreDomUtils } from '@services/utils/dom';
@ -23,6 +24,10 @@ import { ModalController } from '@singletons';
*/ */
@Component({ @Component({
templateUrl: 'ratings-modal.html', templateUrl: 'ratings-modal.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreRatingRatingsComponent implements OnInit { export class CoreRatingRatingsComponent implements OnInit {

View File

@ -16,19 +16,16 @@ import { NgModule } from '@angular/core';
import { CoreSharedModule } from '@/core/shared.module'; import { CoreSharedModule } from '@/core/shared.module';
import { CoreSharedFilesListComponent } from './list/list'; import { CoreSharedFilesListComponent } from './list/list';
import { CoreSharedFilesListModalComponent } from './list-modal/list-modal';
@NgModule({ @NgModule({
declarations: [ declarations: [
CoreSharedFilesListComponent, CoreSharedFilesListComponent,
CoreSharedFilesListModalComponent,
], ],
imports: [ imports: [
CoreSharedModule, CoreSharedModule,
], ],
exports: [ exports: [
CoreSharedFilesListComponent, CoreSharedFilesListComponent,
CoreSharedFilesListModalComponent,
], ],
}) })
export class CoreSharedFilesComponentsModule {} export class CoreSharedFilesComponentsModule {}

View File

@ -12,11 +12,13 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input } from '@angular/core';
import { FileEntry } from '@awesome-cordova-plugins/file/ngx'; import { FileEntry } from '@awesome-cordova-plugins/file/ngx';
import { CoreFile } from '@services/file'; import { CoreFile } from '@services/file';
import { ModalController, Translate } from '@singletons'; import { ModalController, Translate } from '@singletons';
import { CoreSharedFilesComponentsModule } from '../components.module';
/** /**
* Modal to display the list of shared files. * Modal to display the list of shared files.
@ -24,6 +26,11 @@ import { ModalController, Translate } from '@singletons';
@Component({ @Component({
selector: 'core-shared-files-list-modal', selector: 'core-shared-files-list-modal',
templateUrl: 'list-modal.html', templateUrl: 'list-modal.html',
standalone: true,
imports: [
CoreSharedModule,
CoreSharedFilesComponentsModule,
],
}) })
export class CoreSharedFilesListModalComponent implements OnInit { export class CoreSharedFilesListModalComponent implements OnInit {

View File

@ -25,7 +25,6 @@ import { CoreDomUtils } from '@services/utils/dom';
import { AlertController, ApplicationInit, makeSingleton, Translate } from '@singletons'; import { AlertController, ApplicationInit, makeSingleton, Translate } from '@singletons';
import { CoreEvents } from '@singletons/events'; import { CoreEvents } from '@singletons/events';
import { CoreLogger } from '@singletons/logger'; import { CoreLogger } from '@singletons/logger';
import { CoreSharedFilesListModalComponent } from '../components/list-modal/list-modal';
import { CoreSharedFiles } from './sharedfiles'; import { CoreSharedFiles } from './sharedfiles';
import { SHAREDFILES_PAGE_NAME } from '../constants'; import { SHAREDFILES_PAGE_NAME } from '../constants';
import { CoreSharedFilesChooseSitePage } from '../pages/choose-site/choose-site'; import { CoreSharedFilesChooseSitePage } from '../pages/choose-site/choose-site';
@ -150,6 +149,9 @@ export class CoreSharedFilesHelperProvider {
* @returns Promise resolved when a file is picked, rejected if file picker is closed without selecting a file. * @returns Promise resolved when a file is picked, rejected if file picker is closed without selecting a file.
*/ */
async pickSharedFile(mimetypes?: string[]): Promise<CoreFileUploaderHandlerResult> { async pickSharedFile(mimetypes?: string[]): Promise<CoreFileUploaderHandlerResult> {
const { CoreSharedFilesListModalComponent } =
await import('@features/sharedfiles/components/list-modal/list-modal');
const file = await CoreDomUtils.openModal<FileEntry>({ const file = await CoreDomUtils.openModal<FileEntry>({
component: CoreSharedFilesListModalComponent, component: CoreSharedFilesListModalComponent,
cssClass: 'core-modal-fullscreen', cssClass: 'core-modal-fullscreen',

View File

@ -1,38 +0,0 @@
// (C) Copyright 2015 Moodle Pty Ltd.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
import { CoreSharedModule } from '@/core/shared.module';
import { CoreViewerImageComponent } from './image/image';
import { CoreViewerQRScannerComponent } from './qr-scanner/qr-scanner';
import { CoreViewerTextComponent } from './text/text';
@NgModule({
declarations: [
CoreViewerImageComponent,
CoreViewerQRScannerComponent,
CoreViewerTextComponent,
],
imports: [
CoreSharedModule,
],
exports: [
CoreViewerImageComponent,
CoreViewerQRScannerComponent,
CoreViewerTextComponent,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
})
export class CoreViewerComponentsModule {}

View File

@ -12,13 +12,14 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { Component, ElementRef, Input, OnInit, ViewChild } from '@angular/core'; import { Component, ElementRef, Input, OnInit, ViewChild, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { DomSanitizer, ModalController, Translate } from '@singletons'; import { DomSanitizer, ModalController, Translate } from '@singletons';
import { CoreMath } from '@singletons/math'; import { CoreMath } from '@singletons/math';
import { Swiper } from 'swiper'; import { Swiper } from 'swiper';
import { SwiperOptions } from 'swiper/types'; import { SwiperOptions } from 'swiper/types';
import { CoreSwiper } from '@singletons/swiper'; import { CoreSwiper } from '@singletons/swiper';
import { SafeResourceUrl } from '@angular/platform-browser'; import { SafeResourceUrl } from '@angular/platform-browser';
import { CoreSharedModule } from '@/core/shared.module';
/** /**
* Modal component to view an image. * Modal component to view an image.
@ -26,7 +27,12 @@ import { SafeResourceUrl } from '@angular/platform-browser';
@Component({ @Component({
selector: 'core-viewer-image', selector: 'core-viewer-image',
templateUrl: 'image.html', templateUrl: 'image.html',
styleUrls: ['image.scss'], styleUrl: 'image.scss',
standalone: true,
imports: [
CoreSharedModule,
],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
}) })
export class CoreViewerImageComponent implements OnInit { export class CoreViewerImageComponent implements OnInit {

View File

@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
import { CoreSharedModule } from '@/core/shared.module';
import { Component, Input, OnDestroy, OnInit } from '@angular/core'; import { Component, Input, OnDestroy, OnInit } from '@angular/core';
import { CoreDomUtils } from '@services/utils/dom'; import { CoreDomUtils } from '@services/utils/dom';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
@ -23,6 +24,10 @@ import { ModalController, Translate } from '@singletons';
@Component({ @Component({
selector: 'core-viewer-qr-scanner', selector: 'core-viewer-qr-scanner',
templateUrl: 'qr-scanner.html', templateUrl: 'qr-scanner.html',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreViewerQRScannerComponent implements OnInit, OnDestroy { export class CoreViewerQRScannerComponent implements OnInit, OnDestroy {

View File

@ -13,6 +13,7 @@
// limitations under the License. // limitations under the License.
import { ContextLevel } from '@/core/constants'; import { ContextLevel } from '@/core/constants';
import { CoreSharedModule } from '@/core/shared.module';
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { CoreFileEntry } from '@services/file-helper'; import { CoreFileEntry } from '@services/file-helper';
@ -25,7 +26,11 @@ import { ModalController } from '@singletons';
@Component({ @Component({
selector: 'page-core-viewer-text', selector: 'page-core-viewer-text',
templateUrl: 'text.html', templateUrl: 'text.html',
styleUrls: ['text.scss'], styleUrl: 'text.scss',
standalone: true,
imports: [
CoreSharedModule,
],
}) })
export class CoreViewerTextComponent { export class CoreViewerTextComponent {

View File

@ -33,4 +33,4 @@ const routes: Routes = [
CoreViewerIframePage, CoreViewerIframePage,
], ],
}) })
export class CoreViewerLazyModule {} export default class CoreViewerLazyModule {}

View File

@ -16,19 +16,17 @@ import { NgModule } from '@angular/core';
import { Routes } from '@angular/router'; import { Routes } from '@angular/router';
import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module'; import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module';
import { CoreViewerComponentsModule } from './components/components.module';
const routes: Routes = [ const routes: Routes = [
{ {
path: 'viewer', path: 'viewer',
loadChildren: () => import('./viewer-lazy.module').then(m => m.CoreViewerLazyModule), loadChildren: () => import('./viewer-lazy.module'),
}, },
]; ];
@NgModule({ @NgModule({
imports: [ imports: [
CoreMainMenuTabRoutingModule.forChild(routes), CoreMainMenuTabRoutingModule.forChild(routes),
CoreViewerComponentsModule,
], ],
}) })
export class CoreViewerModule {} export class CoreViewerModule {}

View File

@ -244,7 +244,7 @@ export class CoreNavigatorService {
// User has been redirected to the login page and will be redirected to the site path after login. // User has been redirected to the login page and will be redirected to the site path after login.
return true; return true;
} }
} catch (error) { } catch {
// Site doesn't exist. // Site doesn't exist.
return this.navigate('/login/sites', { reset: true }); return this.navigate('/login/sites', { reset: true });
} finally { } finally {

View File

@ -43,7 +43,6 @@ import { CoreLogger } from '@singletons/logger';
import { CoreFileSizeSum } from '@services/plugin-file-delegate'; import { CoreFileSizeSum } from '@services/plugin-file-delegate';
import { CoreNetworkError } from '@classes/errors/network-error'; import { CoreNetworkError } from '@classes/errors/network-error';
import { CoreBSTooltipComponent } from '@components/bs-tooltip/bs-tooltip'; import { CoreBSTooltipComponent } from '@components/bs-tooltip/bs-tooltip';
import { CoreViewerImageComponent } from '@features/viewer/components/image/image';
import { CoreModalLateralTransitionEnter, CoreModalLateralTransitionLeave } from '@classes/modal-lateral-transition'; import { CoreModalLateralTransitionEnter, CoreModalLateralTransitionLeave } from '@classes/modal-lateral-transition';
import { CoreSites } from '@services/sites'; import { CoreSites } from '@services/sites';
import { NavigationStart } from '@angular/router'; import { NavigationStart } from '@angular/router';
@ -1648,6 +1647,7 @@ export class CoreDomUtilsProvider {
if (!image) { if (!image) {
return; return;
} }
const { CoreViewerImageComponent } = await import('@features/viewer/components/image/image');
await CoreDomUtils.openModal({ await CoreDomUtils.openModal({
component: CoreViewerImageComponent, component: CoreViewerImageComponent,

View File

@ -20,7 +20,6 @@ import { CoreAnyError, CoreError } from '@classes/errors/error';
import { DomSanitizer, makeSingleton, Translate } from '@singletons'; import { DomSanitizer, makeSingleton, Translate } from '@singletons';
import { CoreWSFile } from '@services/ws'; import { CoreWSFile } from '@services/ws';
import { Locutus } from '@singletons/locutus'; import { Locutus } from '@singletons/locutus';
import { CoreViewerTextComponent } from '@features/viewer/components/text/text';
import { CoreFileHelper } from '@services/file-helper'; import { CoreFileHelper } from '@services/file-helper';
import { CoreDomUtils } from './dom'; import { CoreDomUtils } from './dom';
import { CoreUrl } from '@singletons/url'; import { CoreUrl } from '@singletons/url';
@ -1037,6 +1036,7 @@ export class CoreTextUtilsProvider {
} }
options = options || {}; options = options || {};
const { CoreViewerTextComponent } = await import('@features/viewer/components/text/text');
const modalOptions: ModalOptions = Object.assign(options.modalOptions || {}, { const modalOptions: ModalOptions = Object.assign(options.modalOptions || {}, {
component: CoreViewerTextComponent, component: CoreViewerTextComponent,

View File

@ -25,7 +25,6 @@ import { CoreMimetypeUtils } from '@services/utils/mimetype';
import { CoreTextUtils } from '@services/utils/text'; import { CoreTextUtils } from '@services/utils/text';
import { makeSingleton, Clipboard, InAppBrowser, FileOpener, WebIntent, Translate, NgZone } from '@singletons'; import { makeSingleton, Clipboard, InAppBrowser, FileOpener, WebIntent, Translate, NgZone } from '@singletons';
import { CoreLogger } from '@singletons/logger'; import { CoreLogger } from '@singletons/logger';
import { CoreViewerQRScannerComponent } from '@features/viewer/components/qr-scanner/qr-scanner';
import { CoreCanceledError } from '@classes/errors/cancelederror'; import { CoreCanceledError } from '@classes/errors/cancelederror';
import { CoreFileEntry } from '@services/file-helper'; import { CoreFileEntry } from '@services/file-helper';
import { CoreConstants } from '@/core/constants'; import { CoreConstants } from '@/core/constants';
@ -1664,6 +1663,8 @@ export class CoreUtilsProvider {
* @returns Promise resolved with the captured text or undefined if cancelled or error. * @returns Promise resolved with the captured text or undefined if cancelled or error.
*/ */
async scanQR(title?: string): Promise<string | undefined> { async scanQR(title?: string): Promise<string | undefined> {
const { CoreViewerQRScannerComponent } = await import('@features/viewer/components/qr-scanner/qr-scanner');
return CoreDomUtils.openModal<string>({ return CoreDomUtils.openModal<string>({
component: CoreViewerQRScannerComponent, component: CoreViewerQRScannerComponent,
cssClass: 'core-modal-fullscreen', cssClass: 'core-modal-fullscreen',