From 4ea7b56bde3d1514891275fca8cb5e53f4b29a24 Mon Sep 17 00:00:00 2001 From: Dani Palou <dani@moodle.com> Date: Wed, 27 Sep 2023 11:25:43 +0200 Subject: [PATCH 1/3] MOBILE-4362 calendar: Always display chevron in course item --- src/addons/calendar/pages/event/event.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/addons/calendar/pages/event/event.html b/src/addons/calendar/pages/event/event.html index f41b9804d..494a78e42 100644 --- a/src/addons/calendar/pages/event/event.html +++ b/src/addons/calendar/pages/event/event.html @@ -72,7 +72,7 @@ <p>{{ 'addon.calendar.type' + event.formattedType | translate }}</p> </ion-label> </ion-item> - <ion-item class="ion-text-wrap" *ngIf="courseName" [href]="courseUrl" core-link capture="true"> + <ion-item class="ion-text-wrap" *ngIf="courseName" [href]="courseUrl" core-link capture="true" detail="true"> <ion-label> <p class="item-heading">{{ 'core.course' | translate}}</p> <p> From 2d1a018304c3e51196f9871ee1f1e7c163f5589c Mon Sep 17 00:00:00 2001 From: Dani Palou <dani@moodle.com> Date: Thu, 28 Sep 2023 12:43:29 +0200 Subject: [PATCH 2/3] MOBILE-4362 course: Keep scroll position after refresh --- src/core/features/course/pages/contents/contents.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/features/course/pages/contents/contents.ts b/src/core/features/course/pages/contents/contents.ts index 82afe676d..31d6a537b 100644 --- a/src/core/features/course/pages/contents/contents.ts +++ b/src/core/features/course/pages/contents/contents.ts @@ -357,6 +357,10 @@ export class CoreCourseContentsPage implements OnInit, OnDestroy, CoreRefreshCon * @returns Promise resolved when done. */ protected async showLoadingAndRefresh(sync = false, invalidateData = true): Promise<void> { + // Try to keep current scroll position. + const scrollElement = await CoreUtils.ignoreErrors(this.content?.getScrollElement()); + const scrollTop = scrollElement?.scrollTop ?? -1; + this.updatingData = true; this.changeDetectorRef.detectChanges(); @@ -371,6 +375,11 @@ export class CoreCourseContentsPage implements OnInit, OnDestroy, CoreRefreshCon } finally { this.updatingData = false; this.changeDetectorRef.detectChanges(); + + if (scrollTop > 0) { + await CoreUtils.nextTick(); + this.content?.scrollToPoint(0, scrollTop, 0); + } } } From e6a14ffac56360edd7703c4b6e71bd385fdea6be Mon Sep 17 00:00:00 2001 From: Dani Palou <dani@moodle.com> Date: Thu, 28 Sep 2023 15:40:07 +0200 Subject: [PATCH 3/3] MOBILE-4362 coursecompletion: Display same info as LMS Two of the fields displayed are only used in the block in LMS, the details page displays other values --- src/addons/coursecompletion/pages/report/report.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/addons/coursecompletion/pages/report/report.html b/src/addons/coursecompletion/pages/report/report.html index 395cab171..d31d01da6 100644 --- a/src/addons/coursecompletion/pages/report/report.html +++ b/src/addons/coursecompletion/pages/report/report.html @@ -50,7 +50,8 @@ <core-format-text clean="true" [text]="criteria.details.requirement" [filter]="false"></core-format-text> </p> </ion-label> - <strong slot="end">{{ criteria.status }}</strong> + <strong slot="end" *ngIf="criteria.complete">{{ 'core.yes' | translate }}</strong> + <strong slot="end" *ngIf="!criteria.complete">{{ 'core.no' | translate }}</strong> </ion-item> <ion-item class="ion-hide-md-down ion-text-wrap"> <ion-label> @@ -64,7 +65,7 @@ </ion-row> <ion-row *ngFor="let criteria of completion.completions"> <ion-col> - <core-format-text clean="true" [text]="criteria.title" [filter]="false"></core-format-text> + <core-format-text clean="true" [text]="criteria.details.type" [filter]="false"></core-format-text> </ion-col> <ion-col> <core-format-text clean="true" [text]="criteria.details.criteria" [filter]="false"></core-format-text> @@ -75,7 +76,8 @@ <ion-col> <core-format-text [text]="criteria.details.status" [filter]="false"></core-format-text> </ion-col> - <ion-col>{{ criteria.status }}</ion-col> + <ion-col *ngIf="criteria.complete">{{ 'core.yes' | translate }}</ion-col> + <ion-col *ngIf="!criteria.complete">{{ 'core.no' | translate }}</ion-col> <ion-col *ngIf="criteria.timecompleted"> {{ criteria.timecompleted * 1000 | coreFormatDate :'strftimedatetimeshort' }} </ion-col>