From 47a8d5da355d6cab2c1e1ed5f29f9ba5c160f583 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 10 May 2023 12:31:15 +0200 Subject: [PATCH 1/4] MOBILE-4270 iframe: Fix auto-login not working sometimes This was because core-loading removed the iframe from DOM, and then the WebView canceled the request. But the request could have consumed the single use key already. --- src/core/components/iframe/core-iframe.html | 16 ++++++++++------ src/core/components/iframe/iframe.scss | 4 ++++ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/core/components/iframe/core-iframe.html b/src/core/components/iframe/core-iframe.html index 28ce77c89..bf4921455 100644 --- a/src/core/components/iframe/core-iframe.html +++ b/src/core/components/iframe/core-iframe.html @@ -1,5 +1,10 @@ - - + + + + + + + @@ -7,13 +12,12 @@ - - {{ 'core.iframehelp' | translate }} - + diff --git a/src/core/components/iframe/iframe.scss b/src/core/components/iframe/iframe.scss index e71baa682..d8778a5d6 100644 --- a/src/core/components/iframe/iframe.scss +++ b/src/core/components/iframe/iframe.scss @@ -1,5 +1,9 @@ :host { flex-grow: 1; + + .core-iframe-loading { + display: none; + } } :host-context(.core-iframe-fullscreen) { From 9dd98f874353b83b4e7e1d3e9cf4e04f54025a38 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Wed, 10 May 2023 14:37:02 +0200 Subject: [PATCH 2/4] MOBILE-4270 core: Remove some AppComponent logs --- src/app/app.component.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index badb8dc75..dafc3ff30 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -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'); From 29483572b7fe8acef0514c0aa17923bdca5cf129 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 11 May 2023 11:44:45 +0200 Subject: [PATCH 3/4] MOBILE-4270 forum: Fix discussion link handler in tablet This part of code changed in 1fbb4c3880e4789832c593270bb5dd6efe5f8502 to fix navigation, but now it didn't work in tablets because it tried to load the forum index page. Maybe this change breaks a case we haven't detected --- src/addons/mod/forum/services/handlers/discussion-link.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/addons/mod/forum/services/handlers/discussion-link.ts b/src/addons/mod/forum/services/handlers/discussion-link.ts index edb09160b..f00ed9ed5 100644 --- a/src/addons/mod/forum/services/handlers/discussion-link.ts +++ b/src/addons/mod/forum/services/handlers/discussion-link.ts @@ -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 }, ); }, From 5eb4d17ca4f470c624e6e1a8a429171fbbc0c453 Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 11 May 2023 12:19:16 +0200 Subject: [PATCH 4/4] MOBILE-4270 feedback: Display profile image in user attempt page --- src/addons/mod/feedback/pages/attempt/attempt.ts | 9 ++++----- src/addons/mod/feedback/services/feedback-helper.ts | 6 +++--- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/addons/mod/feedback/pages/attempt/attempt.ts b/src/addons/mod/feedback/pages/attempt/attempt.ts index 762aa611c..e2db40423 100644 --- a/src/addons/mod/feedback/pages/attempt/attempt.ts +++ b/src/addons/mod/feedback/pages/attempt/attempt.ts @@ -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); } diff --git a/src/addons/mod/feedback/services/feedback-helper.ts b/src/addons/mod/feedback/services/feedback-helper.ts index 47920a859..1b312968e 100644 --- a/src/addons/mod/feedback/services/feedback-helper.ts +++ b/src/addons/mod/feedback/services/feedback-helper.ts @@ -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; - protected async addImageProfile(entries: AddonModFeedbackWSNonRespondent[]): Promise; - protected async addImageProfile( + async addImageProfile(entries: AddonModFeedbackWSAttempt[]): Promise; + async addImageProfile(entries: AddonModFeedbackWSNonRespondent[]): Promise; + async addImageProfile( entries: (AddonModFeedbackWSAttempt | AddonModFeedbackWSNonRespondent)[], ): Promise<(AddonModFeedbackAttempt | AddonModFeedbackNonRespondent)[]> { return Promise.all(entries.map(async (entry: AddonModFeedbackAttempt | AddonModFeedbackNonRespondent) => {