MOBILE-4616 chore: Import modals during runtime
parent
cefe0e4ac1
commit
caa100979a
|
@ -16,7 +16,6 @@ import { Component, Input } from '@angular/core';
|
|||
import { CoreCanceledError } from '@classes/errors/cancelederror';
|
||||
import { CoreError } from '@classes/errors/error';
|
||||
import { CoreDomUtils } from '@services/utils/dom';
|
||||
import { AddonModAssignEditFeedbackModalComponent } from '../components/edit-feedback-modal/edit-feedback-modal';
|
||||
import { AddonModAssignFeedbackCommentsTextData } from '../feedback/comments/services/handler';
|
||||
import { AddonModAssignAssign, AddonModAssignPlugin, AddonModAssignSubmission } from '../services/assign';
|
||||
|
||||
|
@ -46,6 +45,9 @@ export class AddonModAssignFeedbackPluginBaseComponent implements IAddonModAssig
|
|||
throw new CoreError('Cannot edit feedback');
|
||||
}
|
||||
|
||||
const { AddonModAssignEditFeedbackModalComponent } =
|
||||
await import('@addons/mod/assign/components/edit-feedback-modal/edit-feedback-modal');
|
||||
|
||||
// Create the navigation modal.
|
||||
const modalData = await CoreDomUtils.openModal<AddonModAssignFeedbackCommentsTextData>({
|
||||
component: AddonModAssignEditFeedbackModalComponent,
|
||||
|
|
|
@ -20,7 +20,6 @@ import { AddonModAssignIndexComponent } from './index/index';
|
|||
import { AddonModAssignSubmissionComponent } from './submission/submission';
|
||||
import { AddonModAssignSubmissionPluginComponent } from './submission-plugin/submission-plugin';
|
||||
import { AddonModAssignFeedbackPluginComponent } from './feedback-plugin/feedback-plugin';
|
||||
import { AddonModAssignEditFeedbackModalComponent } from './edit-feedback-modal/edit-feedback-modal';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
|
@ -28,7 +27,6 @@ import { AddonModAssignEditFeedbackModalComponent } from './edit-feedback-modal/
|
|||
AddonModAssignSubmissionComponent,
|
||||
AddonModAssignSubmissionPluginComponent,
|
||||
AddonModAssignFeedbackPluginComponent,
|
||||
AddonModAssignEditFeedbackModalComponent,
|
||||
],
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
|
@ -39,7 +37,6 @@ import { AddonModAssignEditFeedbackModalComponent } from './edit-feedback-modal/
|
|||
AddonModAssignSubmissionComponent,
|
||||
AddonModAssignSubmissionPluginComponent,
|
||||
AddonModAssignFeedbackPluginComponent,
|
||||
AddonModAssignEditFeedbackModalComponent,
|
||||
],
|
||||
})
|
||||
export class AddonModAssignComponentsModule {}
|
||||
|
|
|
@ -20,6 +20,8 @@ import { CoreUtils } from '@services/utils/utils';
|
|||
import { ModalController, Translate } from '@singletons';
|
||||
import { AddonModAssignAssign, AddonModAssignPlugin, AddonModAssignSubmission } from '../../services/assign';
|
||||
import { AddonModAssignFeedbackDelegate } from '../../services/feedback-delegate';
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { AddonModAssignComponentsModule } from '../components.module';
|
||||
|
||||
/**
|
||||
* Modal that allows editing a feedback plugin.
|
||||
|
@ -27,6 +29,11 @@ import { AddonModAssignFeedbackDelegate } from '../../services/feedback-delegate
|
|||
@Component({
|
||||
selector: 'addon-mod-assign-edit-feedback-modal',
|
||||
templateUrl: 'edit-feedback-modal.html',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
AddonModAssignComponentsModule,
|
||||
],
|
||||
})
|
||||
export class AddonModAssignEditFeedbackModalComponent {
|
||||
|
||||
|
|
|
@ -16,14 +16,12 @@ import { NgModule } from '@angular/core';
|
|||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { CoreCourseComponentsModule } from '@features/course/components/components.module';
|
||||
import { AddonModDataIndexComponent } from './index';
|
||||
import { AddonModDataSearchComponent } from './search/search';
|
||||
import { CoreCompileHtmlComponentModule } from '@features/compile/components/compile-html/compile-html.module';
|
||||
import { AddonModDataActionsMenuComponent } from './actionsmenu/actionsmenu';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
AddonModDataIndexComponent,
|
||||
AddonModDataSearchComponent,
|
||||
AddonModDataActionsMenuComponent,
|
||||
],
|
||||
imports: [
|
||||
|
@ -33,7 +31,6 @@ import { AddonModDataActionsMenuComponent } from './actionsmenu/actionsmenu';
|
|||
],
|
||||
exports: [
|
||||
AddonModDataIndexComponent,
|
||||
AddonModDataSearchComponent,
|
||||
AddonModDataActionsMenuComponent,
|
||||
],
|
||||
})
|
||||
|
|
|
@ -40,7 +40,6 @@ import { AddonModDataHelper, AddonModDatDisplayFieldsOptions } from '../../servi
|
|||
import { AddonModDataAutoSyncData, AddonModDataSyncResult } from '../../services/data-sync';
|
||||
import { AddonModDataPrefetchHandler } from '../../services/handlers/prefetch-lazy';
|
||||
import { AddonModDataComponentsCompileModule } from '../components-compile.module';
|
||||
import { AddonModDataSearchComponent } from '../search/search';
|
||||
import { CoreUrlUtils } from '@services/utils/url';
|
||||
import { CoreTime } from '@singletons/time';
|
||||
import {
|
||||
|
@ -400,8 +399,10 @@ export class AddonModDataIndexComponent extends CoreCourseModuleMainActivityComp
|
|||
* Display the chat users modal.
|
||||
*/
|
||||
async showSearch(): Promise<void> {
|
||||
const { AddonModDataSearchModalComponent } = await import('@addons/mod/data/components/search-modal/search-modal');
|
||||
|
||||
const modalData = await CoreDomUtils.openModal<AddonModDataSearchDataParams>({
|
||||
component: AddonModDataSearchComponent,
|
||||
component: AddonModDataSearchModalComponent,
|
||||
componentProps: {
|
||||
search: this.search,
|
||||
fields: this.fields,
|
||||
|
|
|
@ -30,16 +30,23 @@ import { AddonModDataHelper } from '../../services/data-helper';
|
|||
import { AddonModDataComponentsCompileModule } from '../components-compile.module';
|
||||
import { AddonModDataSearchDataParams } from '../index';
|
||||
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.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'addon-mod-data-search-modal',
|
||||
templateUrl: 'search.html',
|
||||
templateUrl: 'search-modal.html',
|
||||
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;
|
||||
|
|
@ -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 {}
|
|
@ -22,6 +22,7 @@ import { ModalController, Translate } from '@singletons';
|
|||
import { AddonModQuizAccessRuleDelegate } from '../../services/access-rules-delegate';
|
||||
import { AddonModQuizAttemptWSData, AddonModQuizQuizWSData } from '../../services/quiz';
|
||||
import { CoreDom } from '@singletons/dom';
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
|
||||
/**
|
||||
* Modal that renders the access rules for a quiz.
|
||||
|
@ -29,6 +30,10 @@ import { CoreDom } from '@singletons/dom';
|
|||
@Component({
|
||||
selector: 'page-addon-mod-quiz-preflight-modal',
|
||||
templateUrl: 'preflight-modal.html',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
],
|
||||
})
|
||||
export class AddonModQuizPreflightModalComponent implements OnInit {
|
||||
|
|
@ -269,7 +269,7 @@ export class AddonModQuizHelperProvider {
|
|||
}
|
||||
|
||||
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.
|
||||
const modalData = await CoreDomUtils.openModal<Record<string, string>>({
|
||||
|
|
|
@ -19,7 +19,6 @@ import { CoreCourseComponentsModule } from '@features/course/components/componen
|
|||
import { CoreEditorComponentsModule } from '@features/editor/components/components.module';
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { AddonModWorkshopAssessmentComponentsModule } from '@addons/mod/workshop/assessment/assesment-components.module';
|
||||
import { AddonModWorkshopPhaseInfoComponent } from './phase/phase';
|
||||
import { AddonModWorkshopAssessmentComponent } from './assessment/assessment';
|
||||
import { AddonModWorkshopAssessmentStrategyComponent } from './assessment-strategy/assessment-strategy';
|
||||
|
||||
|
@ -27,7 +26,6 @@ import { AddonModWorkshopAssessmentStrategyComponent } from './assessment-strate
|
|||
declarations: [
|
||||
AddonModWorkshopIndexComponent,
|
||||
AddonModWorkshopSubmissionComponent,
|
||||
AddonModWorkshopPhaseInfoComponent,
|
||||
AddonModWorkshopAssessmentComponent,
|
||||
AddonModWorkshopAssessmentStrategyComponent,
|
||||
],
|
||||
|
@ -40,7 +38,6 @@ import { AddonModWorkshopAssessmentStrategyComponent } from './assessment-strate
|
|||
exports: [
|
||||
AddonModWorkshopIndexComponent,
|
||||
AddonModWorkshopSubmissionComponent,
|
||||
AddonModWorkshopPhaseInfoComponent,
|
||||
AddonModWorkshopAssessmentComponent,
|
||||
AddonModWorkshopAssessmentStrategyComponent,
|
||||
],
|
||||
|
|
|
@ -48,7 +48,6 @@ import {
|
|||
AddonModWorkshopAutoSyncData,
|
||||
AddonModWorkshopSyncResult,
|
||||
} from '../../services/workshop-sync';
|
||||
import { AddonModWorkshopPhaseInfoComponent } from '../phase/phase';
|
||||
import {
|
||||
ADDON_MOD_WORKSHOP_ASSESSMENT_SAVED,
|
||||
ADDON_MOD_WORKSHOP_AUTO_SYNCED,
|
||||
|
@ -398,9 +397,11 @@ export class AddonModWorkshopIndexComponent extends CoreCourseModuleMainActivity
|
|||
if (!this.phases || !this.workshop) {
|
||||
return;
|
||||
}
|
||||
const { AddonModWorkshopPhaseInfoModalComponent } =
|
||||
await import('@addons/mod/workshop/components/phase-modal/phase-modal');
|
||||
|
||||
const modalData = await CoreDomUtils.openModal<boolean>({
|
||||
component: AddonModWorkshopPhaseInfoComponent,
|
||||
component: AddonModWorkshopPhaseInfoModalComponent,
|
||||
componentProps: {
|
||||
phases: CoreUtils.objectToArray(this.phases),
|
||||
workshopPhase: this.workshop.phase,
|
||||
|
|
|
@ -17,14 +17,19 @@ import { CoreUtils } from '@services/utils/utils';
|
|||
import { ModalController } from '@singletons';
|
||||
import { AddonModWorkshopPhaseData, AddonModWorkshopPhaseTaskData } from '../../services/workshop';
|
||||
import { AddonModWorkshopPhase } from '../../constants';
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
|
||||
/**
|
||||
* Page that displays the phase info modal.
|
||||
*/
|
||||
@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() workshopPhase!: AddonModWorkshopPhase;
|
|
@ -19,12 +19,17 @@ import { CoreDomUtils, ToastDuration } from '@services/utils/dom';
|
|||
import { CoreForms } from '@singletons/form';
|
||||
import { ModalController } from '@singletons';
|
||||
import { CoreKeyboard } from '@singletons/keyboard';
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
|
||||
/**
|
||||
* Component that displays a text area for composing a note.
|
||||
*/
|
||||
@Component({
|
||||
templateUrl: 'add-modal.html',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
],
|
||||
})
|
||||
export class AddonNotesAddComponent {
|
||||
|
||||
|
|
|
@ -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 {}
|
|
@ -21,7 +21,6 @@ import { AddonNotesSyncCronHandler } from './services/handlers/sync-cron';
|
|||
import { AddonNotesUserHandler } from './services/handlers/user';
|
||||
import { CORE_SITE_SCHEMAS } from '@services/sites';
|
||||
import { NOTES_OFFLINE_SITE_SCHEMA } from './services/database/notes';
|
||||
import { AddonNotesComponentsModule } from './components/components.module';
|
||||
import { Routes } from '@angular/router';
|
||||
import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module';
|
||||
import { CoreCourseIndexRoutingModule } from '@features/course/course-routing.module';
|
||||
|
@ -54,7 +53,6 @@ const routes: Routes = [
|
|||
imports: [
|
||||
CoreMainMenuTabRoutingModule.forChild(routes),
|
||||
CoreCourseIndexRoutingModule.forChild({ children: routes }),
|
||||
AddonNotesComponentsModule,
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
// limitations under the License.
|
||||
|
||||
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 { AddonNotesOffline } from '@addons/notes/services/notes-offline';
|
||||
import { AddonNotesSync, AddonNotesSyncProvider } from '@addons/notes/services/notes-sync';
|
||||
|
@ -194,6 +194,8 @@ export class AddonNotesListPage implements OnInit, OnDestroy {
|
|||
|
||||
this.logViewAdd();
|
||||
|
||||
const { AddonNotesAddComponent } = await import('@addons/notes/components/add/add-modal');
|
||||
|
||||
const modalData = await CoreDomUtils.openModal<AddonNotesAddModalReturn>({
|
||||
component: AddonNotesAddComponent,
|
||||
componentProps: {
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import { CoreRefreshButtonModalComponent } from '@components/refresh-button-modal/refresh-button-modal';
|
||||
import { CoreNavigator } from '@services/navigator';
|
||||
import { CoreDomUtils } from '@services/utils/dom';
|
||||
import { Subject } from 'rxjs';
|
||||
|
@ -129,6 +128,9 @@ export class PageLoadsManager {
|
|||
* Notify the user, asking him if he wants to update the data.
|
||||
*/
|
||||
protected async notifyUser(): Promise<void> {
|
||||
const { CoreRefreshButtonModalComponent }
|
||||
= await import('@components/refresh-button-modal/refresh-button-modal');
|
||||
|
||||
await CoreDomUtils.openModal<boolean>({
|
||||
component: CoreRefreshButtonModalComponent,
|
||||
cssClass: 'core-modal-no-background core-modal-fullscreen',
|
||||
|
|
|
@ -61,7 +61,6 @@ import { CoreSwipeSlidesComponent } from './swipe-slides/swipe-slides';
|
|||
import { CoreSwipeNavigationTourComponent } from './swipe-navigation-tour/swipe-navigation-tour';
|
||||
import { CoreMessageComponent } from './message/message';
|
||||
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 { CoreCourseImageComponent } from '@components/course-image/course-image';
|
||||
import { CoreSitesListComponent } from './sites-list/sites-list';
|
||||
|
@ -123,7 +122,6 @@ export async function getCoreStandaloneComponents(): Promise<Type<unknown>[]> {
|
|||
CoreSpacerComponent,
|
||||
CoreHorizontalScrollControlsComponent,
|
||||
CoreSwipeNavigationTourComponent,
|
||||
CoreRefreshButtonModalComponent,
|
||||
CoreSheetModalComponent,
|
||||
CoreSitesListComponent,
|
||||
],
|
||||
|
@ -177,7 +175,6 @@ export async function getCoreStandaloneComponents(): Promise<Type<unknown>[]> {
|
|||
CoreSpacerComponent,
|
||||
CoreHorizontalScrollControlsComponent,
|
||||
CoreSwipeNavigationTourComponent,
|
||||
CoreRefreshButtonModalComponent,
|
||||
CoreSheetModalComponent,
|
||||
CoreSitesListComponent,
|
||||
],
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { Component } from '@angular/core';
|
||||
import { ModalController } from '@singletons';
|
||||
|
||||
|
@ -20,7 +21,11 @@ import { ModalController } from '@singletons';
|
|||
*/
|
||||
@Component({
|
||||
templateUrl: 'refresh-button-modal.html',
|
||||
styleUrls: ['refresh-button-modal.scss'],
|
||||
styleUrl: 'refresh-button-modal.scss',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
],
|
||||
})
|
||||
export class CoreRefreshButtonModalComponent {
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import { CoreContentLinksHelper } from '../../services/contentlinks-helper';
|
|||
import { CoreError } from '@classes/errors/error';
|
||||
import { CoreNavigator } from '@services/navigator';
|
||||
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.
|
||||
|
@ -28,6 +29,10 @@ import { CoreSitesFactory } from '@services/sites-factory';
|
|||
@Component({
|
||||
selector: 'core-content-links-choose-site-modal',
|
||||
templateUrl: 'choose-site-modal.html',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
],
|
||||
})
|
||||
export class CoreContentLinksChooseSiteModalComponent implements OnInit {
|
||||
|
||||
|
|
|
@ -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 {}
|
|
@ -13,7 +13,6 @@
|
|||
// limitations under the License.
|
||||
|
||||
import { NgModule, Type } from '@angular/core';
|
||||
import { CoreContentLinksComponentsModule } from './components/components.module';
|
||||
|
||||
/**
|
||||
* Get content links services.
|
||||
|
@ -50,8 +49,5 @@ export async function getContentLinksExportedObjects(): Promise<Record<string, u
|
|||
}
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CoreContentLinksComponentsModule,
|
||||
],
|
||||
})
|
||||
export class CoreContentLinksModule {}
|
||||
|
|
|
@ -19,7 +19,6 @@ import { CoreContentLinksDelegate, CoreContentLinksAction } from './contentlinks
|
|||
import { CoreSite } from '@classes/sites/site';
|
||||
import { makeSingleton, Translate } from '@singletons';
|
||||
import { CoreNavigator } from '@services/navigator';
|
||||
import { CoreContentLinksChooseSiteModalComponent } from '../components/choose-site-modal/choose-site-modal';
|
||||
import { CoreCustomURLSchemes } from '@services/urlschemes';
|
||||
|
||||
/**
|
||||
|
@ -96,6 +95,9 @@ export class CoreContentLinksHelperProvider {
|
|||
* @todo set correct root.
|
||||
*/
|
||||
async goToChooseSite(url: string): Promise<void> {
|
||||
const { CoreContentLinksChooseSiteModalComponent }
|
||||
= await import('@features/contentlinks/components/choose-site-modal/choose-site-modal');
|
||||
|
||||
await CoreDomUtils.openModal({
|
||||
component: CoreContentLinksChooseSiteModalComponent,
|
||||
componentProps: {
|
||||
|
|
|
@ -19,7 +19,6 @@ import { CoreBlockComponentsModule } from '@features/block/components/components
|
|||
import { CoreCourseFormatComponent } from './course-format/course-format';
|
||||
import { CoreCourseModuleComponent } from './module/module';
|
||||
import { CoreCourseModuleCompletionComponent } from './module-completion/module-completion';
|
||||
import { CoreCourseCourseIndexComponent } from './course-index/course-index';
|
||||
import { CoreCourseTagAreaComponent } from './tag-area/tag-area';
|
||||
import { CoreCourseUnsupportedModuleComponent } from './unsupported-module/unsupported-module';
|
||||
import { CoreCourseModuleCompletionLegacyComponent } from './module-completion-legacy/module-completion-legacy';
|
||||
|
@ -37,7 +36,6 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion-
|
|||
CoreCourseModuleCompletionComponent,
|
||||
CoreCourseModuleCompletionLegacyComponent,
|
||||
CoreCourseModuleInfoComponent,
|
||||
CoreCourseCourseIndexComponent,
|
||||
CoreCourseCourseIndexTourComponent,
|
||||
CoreCourseTagAreaComponent,
|
||||
CoreCourseUnsupportedModuleComponent,
|
||||
|
@ -56,7 +54,6 @@ import { CoreCourseModuleCompletionDetailsComponent } from './module-completion-
|
|||
CoreCourseModuleCompletionComponent,
|
||||
CoreCourseModuleCompletionLegacyComponent,
|
||||
CoreCourseModuleInfoComponent,
|
||||
CoreCourseCourseIndexComponent,
|
||||
CoreCourseCourseIndexTourComponent,
|
||||
CoreCourseTagAreaComponent,
|
||||
CoreCourseUnsupportedModuleComponent,
|
||||
|
|
|
@ -41,7 +41,7 @@ import { CoreCourseFormatDelegate } from '@features/course/services/format-deleg
|
|||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||
import { IonContent } from '@ionic/angular';
|
||||
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 { CoreNavigator } from '@services/navigator';
|
||||
import { CoreCourseModuleDelegate } from '@features/course/services/module-delegate';
|
||||
|
@ -429,6 +429,8 @@ export class CoreCourseFormatComponent implements OnInit, OnChanges, OnDestroy {
|
|||
async openCourseIndex(): Promise<void> {
|
||||
const selectedId = await this.getSelectedSectionId();
|
||||
|
||||
const { CoreCourseCourseIndexComponent } = await import('@features/course/components/course-index/course-index');
|
||||
|
||||
const data = await CoreDomUtils.openModal<CoreCourseIndexSectionWithModule>({
|
||||
component: CoreCourseCourseIndexComponent,
|
||||
initialBreakpoint: 1,
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { Component, ElementRef, Input, OnInit } from '@angular/core';
|
||||
import {
|
||||
CoreCourse,
|
||||
|
@ -33,7 +34,11 @@ import { CoreDom } from '@singletons/dom';
|
|||
@Component({
|
||||
selector: 'core-course-course-index',
|
||||
templateUrl: 'course-index.html',
|
||||
styleUrls: ['course-index.scss'],
|
||||
styleUrl: 'course-index.scss',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
],
|
||||
})
|
||||
export class CoreCourseCourseIndexComponent implements OnInit {
|
||||
|
||||
|
|
|
@ -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 {}
|
|
@ -12,6 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
import { CoreDataPrivacy } from '@features/dataprivacy/services/dataprivacy';
|
||||
|
@ -28,6 +29,11 @@ import { ModalController } from '@singletons';
|
|||
@Component({
|
||||
selector: 'core-data-privacy-contact-dpo',
|
||||
templateUrl: 'contactdpo.html',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
],
|
||||
|
||||
})
|
||||
export class CoreDataPrivacyContactDPOComponent implements OnInit {
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormControl, FormGroup, Validators } from '@angular/forms';
|
||||
import {
|
||||
|
@ -29,6 +30,10 @@ import { ModalController } from '@singletons';
|
|||
@Component({
|
||||
selector: 'core-data-privacy-new-request',
|
||||
templateUrl: 'newrequest.html',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
],
|
||||
})
|
||||
export class CoreDataPrivacyNewRequestComponent implements OnInit {
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ import { CoreUserDelegate } from '@features/user/services/user-delegate';
|
|||
import { CoreDataPrivacyUserHandler } from './services/handlers/user';
|
||||
import { Routes } from '@angular/router';
|
||||
import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module';
|
||||
import { CoreDataPrivacyComponentsModule } from './components/components.module';
|
||||
import { CORE_DATAPRIVACY_PAGE_NAME } from './constants';
|
||||
import { CoreContentLinksDelegate } from '@features/contentlinks/services/contentlinks-delegate';
|
||||
import { CoreDataPrivacyDataRequestsLinkHandler } from './services/handlers/datarequests-link';
|
||||
|
@ -33,7 +32,6 @@ const routes: Routes = [
|
|||
@NgModule({
|
||||
imports: [
|
||||
CoreMainMenuTabRoutingModule.forChild(routes),
|
||||
CoreDataPrivacyComponentsModule,
|
||||
],
|
||||
providers: [
|
||||
{
|
||||
|
|
|
@ -13,8 +13,6 @@
|
|||
// limitations under the License.
|
||||
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { CoreDataPrivacyContactDPOComponent } from '@features/dataprivacy/components/contactdpo/contactdpo';
|
||||
import { CoreDataPrivacyNewRequestComponent } from '@features/dataprivacy/components/newrequest/newrequest';
|
||||
import {
|
||||
CoreDataPrivacy,
|
||||
CoreDataPrivacyDataRequestType,
|
||||
|
@ -115,6 +113,9 @@ export class CoreDataPrivacyMainPage implements OnInit {
|
|||
* Open the contact DPO modal.
|
||||
*/
|
||||
async contactDPO(): Promise<void> {
|
||||
const { CoreDataPrivacyContactDPOComponent } =
|
||||
await import('@features/dataprivacy/components/contactdpo/contactdpo');
|
||||
|
||||
// Create and show the modal.
|
||||
const succeed = await CoreDomUtils.openModal<boolean>({
|
||||
component: CoreDataPrivacyContactDPOComponent,
|
||||
|
@ -134,6 +135,9 @@ export class CoreDataPrivacyMainPage implements OnInit {
|
|||
* Open the new request modal.
|
||||
*/
|
||||
async newRequest(createType?: CoreDataPrivacyDataRequestType): Promise<void> {
|
||||
const { CoreDataPrivacyNewRequestComponent } =
|
||||
await import('@features/dataprivacy/components/newrequest/newrequest');
|
||||
|
||||
// Create and show the modal.
|
||||
const succeed = await CoreDomUtils.openModal<boolean>({
|
||||
component: CoreDataPrivacyNewRequestComponent,
|
||||
|
|
|
@ -12,13 +12,18 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Input, OnDestroy, ViewChild } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'core-audio-histogram',
|
||||
templateUrl: 'audio-histogram.html',
|
||||
styleUrls: ['audio-histogram.scss'],
|
||||
styleUrl: 'audio-histogram.scss',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
],
|
||||
})
|
||||
export class CoreFileUploaderAudioHistogramComponent implements AfterViewInit, OnDestroy {
|
||||
|
||||
|
|
|
@ -27,12 +27,19 @@ import { CoreFileUploaderAudioRecording } from '@features/fileuploader/services/
|
|||
import { CoreFile, CoreFileProvider } from '@services/file';
|
||||
import { CorePath } from '@singletons/path';
|
||||
import { CoreNative } from '@features/native/services/native';
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { CoreFileUploaderAudioHistogramComponent } from '../audio-histogram/audio-histogram';
|
||||
|
||||
@Component({
|
||||
selector: 'core-fileuploader-audio-recorder',
|
||||
styleUrls: ['./audio-recorder.scss'],
|
||||
styleUrl: 'audio-recorder.scss',
|
||||
templateUrl: 'audio-recorder.html',
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
CoreFileUploaderAudioHistogramComponent,
|
||||
],
|
||||
})
|
||||
export class CoreFileUploaderAudioRecorderComponent extends CoreModalComponent<CoreFileUploaderAudioRecording>
|
||||
implements OnDestroy {
|
||||
|
|
|
@ -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 {}
|
|
@ -159,7 +159,7 @@ export class CoreFileUploaderProvider {
|
|||
*/
|
||||
async captureAudioInApp(): Promise<CoreFileUploaderAudioRecording> {
|
||||
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);
|
||||
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
|
||||
import { NgModule } from '@angular/core';
|
||||
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 { CoreLoginMethodsComponent } from './login-methods/login-methods';
|
||||
import { CoreLoginExceededAttemptsComponent } from '@features/login/components/exceeded-attempts/exceeded-attempts';
|
||||
|
@ -23,8 +21,6 @@ import { CoreLoginExceededAttemptsComponent } from '@features/login/components/e
|
|||
@NgModule({
|
||||
declarations: [
|
||||
CoreLoginExceededAttemptsComponent,
|
||||
CoreLoginSiteOnboardingComponent,
|
||||
CoreLoginSiteHelpComponent,
|
||||
CoreLoginSitesModalComponent,
|
||||
CoreLoginMethodsComponent,
|
||||
],
|
||||
|
@ -33,8 +29,6 @@ import { CoreLoginExceededAttemptsComponent } from '@features/login/components/e
|
|||
],
|
||||
exports: [
|
||||
CoreLoginExceededAttemptsComponent,
|
||||
CoreLoginSiteOnboardingComponent,
|
||||
CoreLoginSiteHelpComponent,
|
||||
CoreLoginSitesModalComponent,
|
||||
CoreLoginMethodsComponent,
|
||||
],
|
||||
|
|
|
@ -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 { CoreCancellablePromise } from '@classes/cancellable-promise';
|
||||
import { SubPartial } from '@/core/utils/types';
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
|
||||
/**
|
||||
* Component that displays help to connect to a site.
|
||||
|
@ -27,7 +28,11 @@ import { SubPartial } from '@/core/utils/types';
|
|||
@Component({
|
||||
selector: 'core-login-site-help',
|
||||
templateUrl: 'site-help.html',
|
||||
styleUrls: ['site-help.scss'],
|
||||
styleUrl: 'site-help.scss',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
],
|
||||
})
|
||||
export class CoreLoginSiteHelpComponent implements AfterViewInit, OnDestroy {
|
||||
|
||||
|
|
|
@ -18,6 +18,7 @@ import { CoreConfig } from '@services/config';
|
|||
import { CoreUtils } from '@services/utils/utils';
|
||||
import { GET_STARTED_URL, ONBOARDING_DONE } from '@features/login/constants';
|
||||
import { ModalController } from '@singletons';
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
|
||||
/**
|
||||
* Component that displays onboarding help regarding the CoreLoginSitePage.
|
||||
|
@ -26,6 +27,10 @@ import { ModalController } from '@singletons';
|
|||
selector: 'core-login-site-onboarding',
|
||||
templateUrl: 'site-onboarding.html',
|
||||
styleUrls: ['site-onboarding.scss', '../../login.scss'],
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
],
|
||||
})
|
||||
export class CoreLoginSiteOnboardingComponent {
|
||||
|
||||
|
|
|
@ -30,8 +30,6 @@ import { CoreConstants } from '@/core/constants';
|
|||
import { Translate } from '@singletons';
|
||||
import { CoreUrl } from '@singletons/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 { CoreCustomURLSchemes, CoreCustomURLSchemesHandleError } from '@services/urlschemes';
|
||||
import { CoreTextUtils } from '@services/utils/text';
|
||||
|
@ -258,6 +256,9 @@ export class CoreLoginSitePage implements OnInit {
|
|||
* Show a help modal.
|
||||
*/
|
||||
async showHelp(): Promise<void> {
|
||||
const { CoreLoginSiteHelpComponent } =
|
||||
await import('@features/login/components/site-help/site-help');
|
||||
|
||||
await CoreDomUtils.openModal({
|
||||
component: CoreLoginSiteHelpComponent,
|
||||
cssClass: 'core-modal-fullscreen',
|
||||
|
@ -268,6 +269,9 @@ export class CoreLoginSitePage implements OnInit {
|
|||
* Show an onboarding modal.
|
||||
*/
|
||||
async showOnboarding(): Promise<void> {
|
||||
const { CoreLoginSiteOnboardingComponent } =
|
||||
await import('@features/login/components/site-onboarding/site-onboarding');
|
||||
|
||||
await CoreDomUtils.openModal({
|
||||
component: CoreLoginSiteOnboardingComponent,
|
||||
cssClass: 'core-modal-fullscreen',
|
||||
|
|
|
@ -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 {}
|
|
@ -12,6 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { CorePolicySitePolicy } from '@features/policy/services/policy';
|
||||
import { ModalController } from '@singletons';
|
||||
|
@ -22,6 +23,10 @@ import { ModalController } from '@singletons';
|
|||
@Component({
|
||||
selector: 'core-policy-view-policy-modal',
|
||||
templateUrl: 'policy-modal.html',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
],
|
||||
})
|
||||
export class CorePolicyViewPolicyModalComponent {
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ import { CoreUtils } from '@services/utils/utils';
|
|||
import { CoreAnalytics, CoreAnalyticsEventType } from '@services/analytics';
|
||||
import { Translate } from '@singletons';
|
||||
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 { CoreScreen } from '@services/screen';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
@ -188,10 +187,13 @@ export class CorePolicyAcceptancesPage implements OnInit, OnDestroy {
|
|||
* @param event Event.
|
||||
* @param policy Policy.
|
||||
*/
|
||||
viewFullPolicy(event: Event, policy: CorePolicySitePolicy): void {
|
||||
async viewFullPolicy(event: Event, policy: CorePolicySitePolicy): Promise<void> {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
const { CorePolicyViewPolicyModalComponent } =
|
||||
await import('@features/policy/components/policy-modal/policy-modal');
|
||||
|
||||
CoreDomUtils.openModal({
|
||||
component: CorePolicyViewPolicyModalComponent,
|
||||
componentProps: { policy },
|
||||
|
|
|
@ -30,7 +30,6 @@ import { IonContent } from '@ionic/angular';
|
|||
import { CoreScreen } from '@services/screen';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { CoreDom } from '@singletons/dom';
|
||||
import { CorePolicyViewPolicyModalComponent } from '@features/policy/components/policy-modal/policy-modal';
|
||||
|
||||
/**
|
||||
* Page to accept a site policy.
|
||||
|
@ -464,7 +463,10 @@ export class CorePolicySitePolicyPage implements OnInit, OnDestroy {
|
|||
*
|
||||
* @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({
|
||||
component: CorePolicyViewPolicyModalComponent,
|
||||
componentProps: { policy },
|
||||
|
|
|
@ -18,7 +18,6 @@ import { RouterModule, Routes } from '@angular/router';
|
|||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { CorePolicySitePolicyPage } from '@features/policy/pages/site-policy/site-policy';
|
||||
import { ACCEPTANCES_PAGE_NAME, SITE_POLICY_PAGE_NAME } from './constants';
|
||||
import { CorePolicyComponentsModule } from './components/components.module';
|
||||
import { CorePolicyAcceptancesPage } from './pages/acceptances/acceptances';
|
||||
|
||||
const routes: Routes = [
|
||||
|
@ -36,7 +35,6 @@ const routes: Routes = [
|
|||
imports: [
|
||||
CoreSharedModule,
|
||||
RouterModule.forChild(routes),
|
||||
CorePolicyComponentsModule,
|
||||
],
|
||||
declarations: [
|
||||
CorePolicySitePolicyPage,
|
||||
|
|
|
@ -23,7 +23,6 @@ import {
|
|||
import { CoreSites } from '@services/sites';
|
||||
import { CoreDomUtils } from '@services/utils/dom';
|
||||
import { CoreEventObserver, CoreEvents } from '@singletons/events';
|
||||
import { CoreRatingRatingsComponent } from '../ratings/ratings';
|
||||
|
||||
/**
|
||||
* Component that displays the aggregation of a rating item.
|
||||
|
@ -118,6 +117,9 @@ export class CoreRatingAggregateComponent implements OnChanges, OnDestroy {
|
|||
return;
|
||||
}
|
||||
|
||||
const { CoreRatingRatingsComponent } =
|
||||
await import('@features/rating/components/ratings/ratings');
|
||||
|
||||
await CoreDomUtils.openModal({
|
||||
component: CoreRatingRatingsComponent,
|
||||
componentProps: {
|
||||
|
|
|
@ -16,13 +16,11 @@ import { NgModule } from '@angular/core';
|
|||
import { CoreRatingAggregateComponent } from './aggregate/aggregate';
|
||||
import { CoreRatingRateComponent } from './rate/rate';
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { CoreRatingRatingsComponent } from './ratings/ratings';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
CoreRatingAggregateComponent,
|
||||
CoreRatingRateComponent,
|
||||
CoreRatingRatingsComponent,
|
||||
],
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
|
@ -30,7 +28,6 @@ import { CoreRatingRatingsComponent } from './ratings/ratings';
|
|||
exports: [
|
||||
CoreRatingAggregateComponent,
|
||||
CoreRatingRateComponent,
|
||||
CoreRatingRatingsComponent,
|
||||
],
|
||||
})
|
||||
export class CoreRatingComponentsModule {}
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
// limitations under the License.
|
||||
|
||||
import { ContextLevel } from '@/core/constants';
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { CoreRating, CoreRatingItemRating } from '@features/rating/services/rating';
|
||||
import { CoreDomUtils } from '@services/utils/dom';
|
||||
|
@ -23,6 +24,10 @@ import { ModalController } from '@singletons';
|
|||
*/
|
||||
@Component({
|
||||
templateUrl: 'ratings-modal.html',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
],
|
||||
})
|
||||
export class CoreRatingRatingsComponent implements OnInit {
|
||||
|
||||
|
|
|
@ -16,19 +16,16 @@ import { NgModule } from '@angular/core';
|
|||
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { CoreSharedFilesListComponent } from './list/list';
|
||||
import { CoreSharedFilesListModalComponent } from './list-modal/list-modal';
|
||||
|
||||
@NgModule({
|
||||
declarations: [
|
||||
CoreSharedFilesListComponent,
|
||||
CoreSharedFilesListModalComponent,
|
||||
],
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
],
|
||||
exports: [
|
||||
CoreSharedFilesListComponent,
|
||||
CoreSharedFilesListModalComponent,
|
||||
],
|
||||
})
|
||||
export class CoreSharedFilesComponentsModule {}
|
||||
|
|
|
@ -12,11 +12,13 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { FileEntry } from '@awesome-cordova-plugins/file/ngx';
|
||||
|
||||
import { CoreFile } from '@services/file';
|
||||
import { ModalController, Translate } from '@singletons';
|
||||
import { CoreSharedFilesComponentsModule } from '../components.module';
|
||||
|
||||
/**
|
||||
* Modal to display the list of shared files.
|
||||
|
@ -24,6 +26,11 @@ import { ModalController, Translate } from '@singletons';
|
|||
@Component({
|
||||
selector: 'core-shared-files-list-modal',
|
||||
templateUrl: 'list-modal.html',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
CoreSharedFilesComponentsModule,
|
||||
],
|
||||
})
|
||||
export class CoreSharedFilesListModalComponent implements OnInit {
|
||||
|
||||
|
|
|
@ -25,7 +25,6 @@ import { CoreDomUtils } from '@services/utils/dom';
|
|||
import { AlertController, ApplicationInit, makeSingleton, Translate } from '@singletons';
|
||||
import { CoreEvents } from '@singletons/events';
|
||||
import { CoreLogger } from '@singletons/logger';
|
||||
import { CoreSharedFilesListModalComponent } from '../components/list-modal/list-modal';
|
||||
import { CoreSharedFiles } from './sharedfiles';
|
||||
import { SHAREDFILES_PAGE_NAME } from '../constants';
|
||||
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.
|
||||
*/
|
||||
async pickSharedFile(mimetypes?: string[]): Promise<CoreFileUploaderHandlerResult> {
|
||||
const { CoreSharedFilesListModalComponent } =
|
||||
await import('@features/sharedfiles/components/list-modal/list-modal');
|
||||
|
||||
const file = await CoreDomUtils.openModal<FileEntry>({
|
||||
component: CoreSharedFilesListModalComponent,
|
||||
cssClass: 'core-modal-fullscreen',
|
||||
|
|
|
@ -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 {}
|
|
@ -12,13 +12,14 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// 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 { CoreMath } from '@singletons/math';
|
||||
import { Swiper } from 'swiper';
|
||||
import { SwiperOptions } from 'swiper/types';
|
||||
import { CoreSwiper } from '@singletons/swiper';
|
||||
import { SafeResourceUrl } from '@angular/platform-browser';
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
|
||||
/**
|
||||
* Modal component to view an image.
|
||||
|
@ -26,7 +27,12 @@ import { SafeResourceUrl } from '@angular/platform-browser';
|
|||
@Component({
|
||||
selector: 'core-viewer-image',
|
||||
templateUrl: 'image.html',
|
||||
styleUrls: ['image.scss'],
|
||||
styleUrl: 'image.scss',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
],
|
||||
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
||||
})
|
||||
export class CoreViewerImageComponent implements OnInit {
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import { CoreDomUtils } from '@services/utils/dom';
|
||||
import { CoreUtils } from '@services/utils/utils';
|
||||
|
@ -23,6 +24,10 @@ import { ModalController, Translate } from '@singletons';
|
|||
@Component({
|
||||
selector: 'core-viewer-qr-scanner',
|
||||
templateUrl: 'qr-scanner.html',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
],
|
||||
})
|
||||
export class CoreViewerQRScannerComponent implements OnInit, OnDestroy {
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
// limitations under the License.
|
||||
|
||||
import { ContextLevel } from '@/core/constants';
|
||||
import { CoreSharedModule } from '@/core/shared.module';
|
||||
import { Component, Input } from '@angular/core';
|
||||
import { CoreFileEntry } from '@services/file-helper';
|
||||
|
||||
|
@ -25,7 +26,11 @@ import { ModalController } from '@singletons';
|
|||
@Component({
|
||||
selector: 'page-core-viewer-text',
|
||||
templateUrl: 'text.html',
|
||||
styleUrls: ['text.scss'],
|
||||
styleUrl: 'text.scss',
|
||||
standalone: true,
|
||||
imports: [
|
||||
CoreSharedModule,
|
||||
],
|
||||
})
|
||||
export class CoreViewerTextComponent {
|
||||
|
||||
|
|
|
@ -33,4 +33,4 @@ const routes: Routes = [
|
|||
CoreViewerIframePage,
|
||||
],
|
||||
})
|
||||
export class CoreViewerLazyModule {}
|
||||
export default class CoreViewerLazyModule {}
|
||||
|
|
|
@ -16,19 +16,17 @@ import { NgModule } from '@angular/core';
|
|||
import { Routes } from '@angular/router';
|
||||
|
||||
import { CoreMainMenuTabRoutingModule } from '@features/mainmenu/mainmenu-tab-routing.module';
|
||||
import { CoreViewerComponentsModule } from './components/components.module';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: 'viewer',
|
||||
loadChildren: () => import('./viewer-lazy.module').then(m => m.CoreViewerLazyModule),
|
||||
loadChildren: () => import('./viewer-lazy.module'),
|
||||
},
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CoreMainMenuTabRoutingModule.forChild(routes),
|
||||
CoreViewerComponentsModule,
|
||||
],
|
||||
})
|
||||
export class CoreViewerModule {}
|
||||
|
|
|
@ -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.
|
||||
return true;
|
||||
}
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// Site doesn't exist.
|
||||
return this.navigate('/login/sites', { reset: true });
|
||||
} finally {
|
||||
|
|
|
@ -43,7 +43,6 @@ import { CoreLogger } from '@singletons/logger';
|
|||
import { CoreFileSizeSum } from '@services/plugin-file-delegate';
|
||||
import { CoreNetworkError } from '@classes/errors/network-error';
|
||||
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 { CoreSites } from '@services/sites';
|
||||
import { NavigationStart } from '@angular/router';
|
||||
|
@ -1648,6 +1647,7 @@ export class CoreDomUtilsProvider {
|
|||
if (!image) {
|
||||
return;
|
||||
}
|
||||
const { CoreViewerImageComponent } = await import('@features/viewer/components/image/image');
|
||||
|
||||
await CoreDomUtils.openModal({
|
||||
component: CoreViewerImageComponent,
|
||||
|
|
|
@ -20,7 +20,6 @@ import { CoreAnyError, CoreError } from '@classes/errors/error';
|
|||
import { DomSanitizer, makeSingleton, Translate } from '@singletons';
|
||||
import { CoreWSFile } from '@services/ws';
|
||||
import { Locutus } from '@singletons/locutus';
|
||||
import { CoreViewerTextComponent } from '@features/viewer/components/text/text';
|
||||
import { CoreFileHelper } from '@services/file-helper';
|
||||
import { CoreDomUtils } from './dom';
|
||||
import { CoreUrl } from '@singletons/url';
|
||||
|
@ -1037,6 +1036,7 @@ export class CoreTextUtilsProvider {
|
|||
}
|
||||
|
||||
options = options || {};
|
||||
const { CoreViewerTextComponent } = await import('@features/viewer/components/text/text');
|
||||
|
||||
const modalOptions: ModalOptions = Object.assign(options.modalOptions || {}, {
|
||||
component: CoreViewerTextComponent,
|
||||
|
|
|
@ -25,7 +25,6 @@ import { CoreMimetypeUtils } from '@services/utils/mimetype';
|
|||
import { CoreTextUtils } from '@services/utils/text';
|
||||
import { makeSingleton, Clipboard, InAppBrowser, FileOpener, WebIntent, Translate, NgZone } from '@singletons';
|
||||
import { CoreLogger } from '@singletons/logger';
|
||||
import { CoreViewerQRScannerComponent } from '@features/viewer/components/qr-scanner/qr-scanner';
|
||||
import { CoreCanceledError } from '@classes/errors/cancelederror';
|
||||
import { CoreFileEntry } from '@services/file-helper';
|
||||
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.
|
||||
*/
|
||||
async scanQR(title?: string): Promise<string | undefined> {
|
||||
const { CoreViewerQRScannerComponent } = await import('@features/viewer/components/qr-scanner/qr-scanner');
|
||||
|
||||
return CoreDomUtils.openModal<string>({
|
||||
component: CoreViewerQRScannerComponent,
|
||||
cssClass: 'core-modal-fullscreen',
|
||||
|
|
Loading…
Reference in New Issue