From 2a01965941a0200086b855d8425d0f6689c17c4e Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Mon, 8 May 2023 15:49:57 +0200 Subject: [PATCH] MOBILE-4188 grades: Improve course navigation --- src/core/classes/items-management/items-manager.ts | 3 ++- src/core/features/grades/pages/course/course.html | 2 +- src/core/features/grades/pages/course/course.page.ts | 3 +++ .../features/user/pages/participants/participants.page.ts | 8 +++++++- src/core/features/user/user-course-lazy.module.ts | 1 + 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/core/classes/items-management/items-manager.ts b/src/core/classes/items-management/items-manager.ts index 80f433fdb..0883521fe 100644 --- a/src/core/classes/items-management/items-manager.ts +++ b/src/core/classes/items-management/items-manager.ts @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +import { CoreSilentError } from '@classes/errors/silenterror'; import { CoreItemsManagerSource } from './items-manager-source'; /** @@ -45,7 +46,7 @@ export abstract class CoreItemsManager< */ getSource(): Source { if (!this.source) { - throw new Error('Source is missing from items manager'); + throw new CoreSilentError('Source is missing from items manager'); } return this.source.instance; diff --git a/src/core/features/grades/pages/course/course.html b/src/core/features/grades/pages/course/course.html index 908fc1671..a5c6dc447 100644 --- a/src/core/features/grades/pages/course/course.html +++ b/src/core/features/grades/pages/course/course.html @@ -12,7 +12,7 @@ - +
diff --git a/src/core/features/grades/pages/course/course.page.ts b/src/core/features/grades/pages/course/course.page.ts index 3cf1fcafb..7bca24a87 100644 --- a/src/core/features/grades/pages/course/course.page.ts +++ b/src/core/features/grades/pages/course/course.page.ts @@ -58,6 +58,7 @@ export class CoreGradesCoursePage implements AfterViewInit, OnDestroy { rowsOnView = 0; totalColumnsSpan?: number; withinSplitView?: boolean; + loaded = false; protected useLegacyLayout?: boolean; // Whether to use the layout before 4.1. protected fetchSuccess = false; @@ -111,6 +112,8 @@ export class CoreGradesCoursePage implements AfterViewInit, OnDestroy { await this.swipeManager?.start(); await this.fetchInitialGrades(); + + this.loaded = true; } /** diff --git a/src/core/features/user/pages/participants/participants.page.ts b/src/core/features/user/pages/participants/participants.page.ts index 47633f894..d851cefd9 100644 --- a/src/core/features/user/pages/participants/participants.page.ts +++ b/src/core/features/user/pages/participants/participants.page.ts @@ -72,8 +72,14 @@ export class CoreUserParticipantsPage implements OnInit, AfterViewInit, OnDestro */ async ngAfterViewInit(): Promise { await this.fetchInitialParticipants(); + await this.participants.start(this.splitView); + } - this.participants.start(this.splitView); + /** + * @inheritdoc + */ + async ionViewDidEnter(): Promise { + await this.participants.start(); } /** diff --git a/src/core/features/user/user-course-lazy.module.ts b/src/core/features/user/user-course-lazy.module.ts index 8653a7b50..a0a9cb34c 100644 --- a/src/core/features/user/user-course-lazy.module.ts +++ b/src/core/features/user/user-course-lazy.module.ts @@ -28,6 +28,7 @@ const routes: Routes = [ { path: ':userId', loadChildren: () => import('@features/user/user-profile-lazy.module').then(m => m.CoreUserProfileLazyModule), + data: { swipeManagerSource: 'participants' }, }, ], () => CoreScreen.isTablet), },