MOBILE-4470 quiz: Fix pipe translate not found in prefetch

main
Dani Palou 2024-06-11 08:22:43 +02:00
parent fcea6c311c
commit ad08fcf4b9
4 changed files with 39 additions and 4 deletions

View File

@ -19,7 +19,6 @@ import { CoreCourseComponentsModule } from '@features/course/components/componen
import { AddonModQuizConnectionErrorComponent } from './connection-error/connection-error'; import { AddonModQuizConnectionErrorComponent } from './connection-error/connection-error';
import { AddonModQuizIndexComponent } from './index/index'; import { AddonModQuizIndexComponent } from './index/index';
import { AddonModQuizNavigationModalComponent } from './navigation-modal/navigation-modal'; import { AddonModQuizNavigationModalComponent } from './navigation-modal/navigation-modal';
import { AddonModQuizPreflightModalComponent } from './preflight-modal/preflight-modal';
import { AddonModQuizAttemptInfoComponent } from './attempt-info/attempt-info'; import { AddonModQuizAttemptInfoComponent } from './attempt-info/attempt-info';
import { AddonModQuizAttemptStateComponent } from './attempt-state/attempt-state'; import { AddonModQuizAttemptStateComponent } from './attempt-state/attempt-state';
import { AddonModQuizQuestionCardComponent } from './question-card/question-card'; import { AddonModQuizQuestionCardComponent } from './question-card/question-card';
@ -31,7 +30,6 @@ import { AddonModQuizQuestionCardComponent } from './question-card/question-card
AddonModQuizIndexComponent, AddonModQuizIndexComponent,
AddonModQuizConnectionErrorComponent, AddonModQuizConnectionErrorComponent,
AddonModQuizNavigationModalComponent, AddonModQuizNavigationModalComponent,
AddonModQuizPreflightModalComponent,
AddonModQuizQuestionCardComponent, AddonModQuizQuestionCardComponent,
], ],
imports: [ imports: [
@ -44,7 +42,6 @@ import { AddonModQuizQuestionCardComponent } from './question-card/question-card
AddonModQuizIndexComponent, AddonModQuizIndexComponent,
AddonModQuizConnectionErrorComponent, AddonModQuizConnectionErrorComponent,
AddonModQuizNavigationModalComponent, AddonModQuizNavigationModalComponent,
AddonModQuizPreflightModalComponent,
AddonModQuizQuestionCardComponent, AddonModQuizQuestionCardComponent,
], ],

View File

@ -0,0 +1,36 @@
// (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,7 +22,6 @@ import { CoreSites, CoreSitesReadingStrategy } from '@services/sites';
import { CoreDomUtils } from '@services/utils/dom'; import { CoreDomUtils } from '@services/utils/dom';
import { CoreUtils } from '@services/utils/utils'; import { CoreUtils } from '@services/utils/utils';
import { makeSingleton, Translate } from '@singletons'; import { makeSingleton, Translate } from '@singletons';
import { AddonModQuizPreflightModalComponent } from '../components/preflight-modal/preflight-modal';
import { AddonModQuizAccessRuleDelegate } from './access-rules-delegate'; import { AddonModQuizAccessRuleDelegate } from './access-rules-delegate';
import { AddonModQuizModuleHandlerService } from './handlers/module'; import { AddonModQuizModuleHandlerService } from './handlers/module';
import { import {
@ -269,6 +268,9 @@ export class AddonModQuizHelperProvider {
); );
} }
const { AddonModQuizPreflightModalComponent } =
await import('@addons/mod/quiz/components/preflight-modal/preflight-modal.module');
// 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>>({
component: AddonModQuizPreflightModalComponent, component: AddonModQuizPreflightModalComponent,