commit
147edf5cc5
|
@ -24,10 +24,9 @@ import {
|
||||||
AddonModFeedback,
|
AddonModFeedback,
|
||||||
AddonModFeedbackProvider,
|
AddonModFeedbackProvider,
|
||||||
AddonModFeedbackWSAnonAttempt,
|
AddonModFeedbackWSAnonAttempt,
|
||||||
AddonModFeedbackWSAttempt,
|
|
||||||
AddonModFeedbackWSFeedback,
|
AddonModFeedbackWSFeedback,
|
||||||
} from '../../services/feedback';
|
} 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.
|
* Page that displays a feedback attempt review.
|
||||||
|
@ -41,7 +40,7 @@ export class AddonModFeedbackAttemptPage implements OnInit, OnDestroy {
|
||||||
cmId: number;
|
cmId: number;
|
||||||
courseId: number;
|
courseId: number;
|
||||||
feedback?: AddonModFeedbackWSFeedback;
|
feedback?: AddonModFeedbackWSFeedback;
|
||||||
attempt?: AddonModFeedbackWSAttempt;
|
attempt?: AddonModFeedbackAttempt;
|
||||||
attempts: AddonModFeedbackAttemptsSwipeManager;
|
attempts: AddonModFeedbackAttemptsSwipeManager;
|
||||||
anonAttempt?: AddonModFeedbackWSAnonAttempt;
|
anonAttempt?: AddonModFeedbackWSAnonAttempt;
|
||||||
items: AddonModFeedbackAttemptItem[] = [];
|
items: AddonModFeedbackAttemptItem[] = [];
|
||||||
|
@ -102,7 +101,7 @@ export class AddonModFeedbackAttemptPage implements OnInit, OnDestroy {
|
||||||
this.anonAttempt = attempt;
|
this.anonAttempt = attempt;
|
||||||
delete this.attempt;
|
delete this.attempt;
|
||||||
} else {
|
} else {
|
||||||
this.attempt = attempt;
|
this.attempt = (await AddonModFeedbackHelper.addImageProfile([attempt]))[0];
|
||||||
delete this.anonAttempt;
|
delete this.anonAttempt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,7 +144,7 @@ export class AddonModFeedbackAttemptPage implements OnInit, OnDestroy {
|
||||||
* @param attempt Attempt to check.
|
* @param attempt Attempt to check.
|
||||||
* @returns If attempt is anonymous.
|
* @returns If attempt is anonymous.
|
||||||
*/
|
*/
|
||||||
isAnonAttempt(attempt: AddonModFeedbackWSAttempt | AddonModFeedbackWSAnonAttempt): attempt is AddonModFeedbackWSAnonAttempt {
|
isAnonAttempt(attempt: AddonModFeedbackAttempt | AddonModFeedbackWSAnonAttempt): attempt is AddonModFeedbackWSAnonAttempt {
|
||||||
return !('fullname' in attempt);
|
return !('fullname' in attempt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -220,9 +220,9 @@ export class AddonModFeedbackHelperProvider {
|
||||||
* @param entries Entries array to get profile from.
|
* @param entries Entries array to get profile from.
|
||||||
* @returns Returns the same array with the profileimageurl added if found.
|
* @returns Returns the same array with the profileimageurl added if found.
|
||||||
*/
|
*/
|
||||||
protected async addImageProfile(entries: AddonModFeedbackWSAttempt[]): Promise<AddonModFeedbackAttempt[]>;
|
async addImageProfile(entries: AddonModFeedbackWSAttempt[]): Promise<AddonModFeedbackAttempt[]>;
|
||||||
protected async addImageProfile(entries: AddonModFeedbackWSNonRespondent[]): Promise<AddonModFeedbackNonRespondent[]>;
|
async addImageProfile(entries: AddonModFeedbackWSNonRespondent[]): Promise<AddonModFeedbackNonRespondent[]>;
|
||||||
protected async addImageProfile(
|
async addImageProfile(
|
||||||
entries: (AddonModFeedbackWSAttempt | AddonModFeedbackWSNonRespondent)[],
|
entries: (AddonModFeedbackWSAttempt | AddonModFeedbackWSNonRespondent)[],
|
||||||
): Promise<(AddonModFeedbackAttempt | AddonModFeedbackNonRespondent)[]> {
|
): Promise<(AddonModFeedbackAttempt | AddonModFeedbackNonRespondent)[]> {
|
||||||
return Promise.all(entries.map(async (entry: AddonModFeedbackAttempt | AddonModFeedbackNonRespondent) => {
|
return Promise.all(entries.map(async (entry: AddonModFeedbackAttempt | AddonModFeedbackNonRespondent) => {
|
||||||
|
|
|
@ -65,12 +65,8 @@ export class AddonModForumDiscussionLinkHandlerService extends CoreContentLinksH
|
||||||
pageParams.parent = parseInt(params.parent);
|
pageParams.parent = parseInt(params.parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
const path = cmId && courseId
|
|
||||||
? `${AddonModForumModuleHandlerService.PAGE_NAME}/${courseId}/${cmId}/${discussionId}`
|
|
||||||
: `${AddonModForumModuleHandlerService.PAGE_NAME}/discussion/${discussionId}`;
|
|
||||||
|
|
||||||
CoreNavigator.navigateToSitePath(
|
CoreNavigator.navigateToSitePath(
|
||||||
path,
|
`${AddonModForumModuleHandlerService.PAGE_NAME}/discussion/${discussionId}`,
|
||||||
{ siteId, params: pageParams },
|
{ siteId, params: pageParams },
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
|
@ -196,15 +196,12 @@ export class AppComponent implements OnInit, AfterViewInit {
|
||||||
*/
|
*/
|
||||||
ngAfterViewInit(): void {
|
ngAfterViewInit(): void {
|
||||||
if (!this.outlet) {
|
if (!this.outlet) {
|
||||||
this.logger.debug('Aftew view init: no outlet found');
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.debug('Aftew view init');
|
this.logger.debug('App component initialized');
|
||||||
|
|
||||||
CoreSubscriptions.once(this.outlet.activateEvents, async () => {
|
CoreSubscriptions.once(this.outlet.activateEvents, async () => {
|
||||||
this.logger.debug('Activate event triggered');
|
|
||||||
await CorePlatform.ready();
|
await CorePlatform.ready();
|
||||||
|
|
||||||
this.logger.debug('Hide splash screen');
|
this.logger.debug('Hide splash screen');
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
<core-loading [hideUntil]="!loading && safeUrl">
|
<!-- Display a loading until the iframe page is loaded. -->
|
||||||
<core-navbar-buttons slot="end" prepend *ngIf="initialized && showFullscreenOnToolbar">
|
<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()"
|
<ion-button fill="clear" (click)="toggleFullscreen()"
|
||||||
[attr.aria-label]="(fullscreen ? 'core.disablefullscreen' : 'core.fullscreen') | translate">
|
[attr.aria-label]="(fullscreen ? 'core.disablefullscreen' : 'core.fullscreen') | translate">
|
||||||
<ion-icon *ngIf="!fullscreen" name="fas-expand" slot="icon-only" aria-hidden="true"></ion-icon>
|
<ion-icon *ngIf="!fullscreen" name="fas-expand" slot="icon-only" aria-hidden="true"></ion-icon>
|
||||||
|
@ -7,13 +12,12 @@
|
||||||
</ion-button>
|
</ion-button>
|
||||||
</core-navbar-buttons>
|
</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 class="core-iframe" [ngStyle]="{'width': iframeWidth, 'height': iframeHeight}" [src]="safeUrl"
|
||||||
<iframe #iframe *ngIf="safeUrl" [hidden]="loading" class="core-iframe" [ngStyle]="{'width': iframeWidth, 'height': iframeHeight}"
|
[attr.allowfullscreen]="allowFullscreen ? 'allowfullscreen' : null" [class.core-iframe-loading]="loading">
|
||||||
[src]="safeUrl" [attr.allowfullscreen]="allowFullscreen ? 'allowfullscreen' : null">
|
|
||||||
</iframe>
|
</iframe>
|
||||||
|
|
||||||
<ion-button *ngIf="!loading && displayHelp" expand="block" fill="clear" (click)="openIframeHelpModal()" aria-haspopup="dialog"
|
<ion-button *ngIf="!loading && displayHelp" expand="block" fill="clear" (click)="openIframeHelpModal()" aria-haspopup="dialog"
|
||||||
class="core-button-as-link core-iframe-help">
|
class="core-button-as-link core-iframe-help">
|
||||||
{{ 'core.iframehelp' | translate }}
|
{{ 'core.iframehelp' | translate }}
|
||||||
</ion-button>
|
</ion-button>
|
||||||
</core-loading>
|
</ng-container>
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
:host {
|
:host {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
|
||||||
|
.core-iframe-loading {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
:host-context(.core-iframe-fullscreen) {
|
:host-context(.core-iframe-fullscreen) {
|
||||||
|
|
Loading…
Reference in New Issue