Merge pull request #3673 from dpalou/MOBILE-4270

Mobile 4270
main
Pau Ferrer Ocaña 2023-05-11 13:08:44 +02:00 committed by GitHub
commit 147edf5cc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 23 deletions

View File

@ -24,10 +24,9 @@ import {
AddonModFeedback,
AddonModFeedbackProvider,
AddonModFeedbackWSAnonAttempt,
AddonModFeedbackWSAttempt,
AddonModFeedbackWSFeedback,
} from '../../services/feedback';
import { AddonModFeedbackFormItem, AddonModFeedbackHelper } from '../../services/feedback-helper';
import { AddonModFeedbackAttempt, AddonModFeedbackFormItem, AddonModFeedbackHelper } from '../../services/feedback-helper';
/**
* Page that displays a feedback attempt review.
@ -41,7 +40,7 @@ export class AddonModFeedbackAttemptPage implements OnInit, OnDestroy {
cmId: number;
courseId: number;
feedback?: AddonModFeedbackWSFeedback;
attempt?: AddonModFeedbackWSAttempt;
attempt?: AddonModFeedbackAttempt;
attempts: AddonModFeedbackAttemptsSwipeManager;
anonAttempt?: AddonModFeedbackWSAnonAttempt;
items: AddonModFeedbackAttemptItem[] = [];
@ -102,7 +101,7 @@ export class AddonModFeedbackAttemptPage implements OnInit, OnDestroy {
this.anonAttempt = attempt;
delete this.attempt;
} else {
this.attempt = attempt;
this.attempt = (await AddonModFeedbackHelper.addImageProfile([attempt]))[0];
delete this.anonAttempt;
}
@ -145,7 +144,7 @@ export class AddonModFeedbackAttemptPage implements OnInit, OnDestroy {
* @param attempt Attempt to check.
* @returns If attempt is anonymous.
*/
isAnonAttempt(attempt: AddonModFeedbackWSAttempt | AddonModFeedbackWSAnonAttempt): attempt is AddonModFeedbackWSAnonAttempt {
isAnonAttempt(attempt: AddonModFeedbackAttempt | AddonModFeedbackWSAnonAttempt): attempt is AddonModFeedbackWSAnonAttempt {
return !('fullname' in attempt);
}

View File

@ -220,9 +220,9 @@ export class AddonModFeedbackHelperProvider {
* @param entries Entries array to get profile from.
* @returns Returns the same array with the profileimageurl added if found.
*/
protected async addImageProfile(entries: AddonModFeedbackWSAttempt[]): Promise<AddonModFeedbackAttempt[]>;
protected async addImageProfile(entries: AddonModFeedbackWSNonRespondent[]): Promise<AddonModFeedbackNonRespondent[]>;
protected async addImageProfile(
async addImageProfile(entries: AddonModFeedbackWSAttempt[]): Promise<AddonModFeedbackAttempt[]>;
async addImageProfile(entries: AddonModFeedbackWSNonRespondent[]): Promise<AddonModFeedbackNonRespondent[]>;
async addImageProfile(
entries: (AddonModFeedbackWSAttempt | AddonModFeedbackWSNonRespondent)[],
): Promise<(AddonModFeedbackAttempt | AddonModFeedbackNonRespondent)[]> {
return Promise.all(entries.map(async (entry: AddonModFeedbackAttempt | AddonModFeedbackNonRespondent) => {

View File

@ -65,12 +65,8 @@ export class AddonModForumDiscussionLinkHandlerService extends CoreContentLinksH
pageParams.parent = parseInt(params.parent);
}
const path = cmId && courseId
? `${AddonModForumModuleHandlerService.PAGE_NAME}/${courseId}/${cmId}/${discussionId}`
: `${AddonModForumModuleHandlerService.PAGE_NAME}/discussion/${discussionId}`;
CoreNavigator.navigateToSitePath(
path,
`${AddonModForumModuleHandlerService.PAGE_NAME}/discussion/${discussionId}`,
{ siteId, params: pageParams },
);
},

View File

@ -196,15 +196,12 @@ export class AppComponent implements OnInit, AfterViewInit {
*/
ngAfterViewInit(): void {
if (!this.outlet) {
this.logger.debug('Aftew view init: no outlet found');
return;
}
this.logger.debug('Aftew view init');
this.logger.debug('App component initialized');
CoreSubscriptions.once(this.outlet.activateEvents, async () => {
this.logger.debug('Activate event triggered');
await CorePlatform.ready();
this.logger.debug('Hide splash screen');

View File

@ -1,5 +1,10 @@
<core-loading [hideUntil]="!loading && safeUrl">
<core-navbar-buttons slot="end" prepend *ngIf="initialized && showFullscreenOnToolbar">
<!-- Display a loading until the iframe page is loaded. -->
<core-loading [hideUntil]="!loading && safeUrl"></core-loading>
<!--The iframe needs to be outside of core-loading, otherwise the request is canceled while loading. -->
<!-- Don't add the iframe until safeUrl is set, adding an iframe with null as src causes the iframe to load the whole app. -->
<ng-container *ngIf="safeUrl">
<core-navbar-buttons slot="end" prepend *ngIf="initialized && showFullscreenOnToolbar && !loading">
<ion-button fill="clear" (click)="toggleFullscreen()"
[attr.aria-label]="(fullscreen ? 'core.disablefullscreen' : 'core.fullscreen') | translate">
<ion-icon *ngIf="!fullscreen" name="fas-expand" slot="icon-only" aria-hidden="true"></ion-icon>
@ -7,13 +12,12 @@
</ion-button>
</core-navbar-buttons>
<!-- Don't add the iframe until safeUrl is set, adding an iframe with null as src causes the iframe to load the whole app. -->
<iframe #iframe *ngIf="safeUrl" [hidden]="loading" class="core-iframe" [ngStyle]="{'width': iframeWidth, 'height': iframeHeight}"
[src]="safeUrl" [attr.allowfullscreen]="allowFullscreen ? 'allowfullscreen' : null">
<iframe #iframe class="core-iframe" [ngStyle]="{'width': iframeWidth, 'height': iframeHeight}" [src]="safeUrl"
[attr.allowfullscreen]="allowFullscreen ? 'allowfullscreen' : null" [class.core-iframe-loading]="loading">
</iframe>
<ion-button *ngIf="!loading && displayHelp" expand="block" fill="clear" (click)="openIframeHelpModal()" aria-haspopup="dialog"
class="core-button-as-link core-iframe-help">
{{ 'core.iframehelp' | translate }}
</ion-button>
</core-loading>
</ng-container>

View File

@ -1,5 +1,9 @@
:host {
flex-grow: 1;
.core-iframe-loading {
display: none;
}
}
:host-context(.core-iframe-fullscreen) {