From e0c4e4702da7e9da0b529ec93a2f32f5c3f14378 Mon Sep 17 00:00:00 2001 From: Stephan Krusche Date: Sun, 3 Nov 2024 21:39:47 +0100 Subject: [PATCH] Development: Fix an issue with the exercise selection when navigating into the course --- .../lti/lti13-exercise-launch.component.ts | 2 +- .../course-exercises.component.html | 4 +- .../course-exercises.component.ts | 6 +- .../overview/course-overview.component.html | 380 +++++++++--------- .../app/overview/course-overview.component.ts | 6 +- .../shared/layouts/main/main.component.html | 6 +- .../app/shared/layouts/main/main.component.ts | 6 +- .../webapp/app/shared/service/lti.service.ts | 8 +- .../course/course-overview.component.spec.ts | 2 +- 9 files changed, 213 insertions(+), 207 deletions(-) diff --git a/src/main/webapp/app/lti/lti13-exercise-launch.component.ts b/src/main/webapp/app/lti/lti13-exercise-launch.component.ts index bbb1757c77f5..2c939e994279 100644 --- a/src/main/webapp/app/lti/lti13-exercise-launch.component.ts +++ b/src/main/webapp/app/lti/lti13-exercise-launch.component.ts @@ -146,7 +146,7 @@ export class Lti13ExerciseLaunchComponent implements OnInit { } replaceWindowLocationWrapper(url: string): void { - this.ltiService.setLti(true); + this.ltiService.setShownViaLti(true); this.themeService.applyThemeExplicitly(Theme.LIGHT); const path = new URL(url).pathname; diff --git a/src/main/webapp/app/overview/course-exercises/course-exercises.component.html b/src/main/webapp/app/overview/course-exercises/course-exercises.component.html index 9ff43b3e4857..bd8e5fceab3b 100644 --- a/src/main/webapp/app/overview/course-exercises/course-exercises.component.html +++ b/src/main/webapp/app/overview/course-exercises/course-exercises.component.html @@ -1,6 +1,6 @@
@if (course) { - @if (!isLti) { + @if (!isShownViaLti) {
+
} @else { diff --git a/src/main/webapp/app/overview/course-exercises/course-exercises.component.ts b/src/main/webapp/app/overview/course-exercises/course-exercises.component.ts index 36366be86ff6..5f0adeed54b5 100644 --- a/src/main/webapp/app/overview/course-exercises/course-exercises.component.ts +++ b/src/main/webapp/app/overview/course-exercises/course-exercises.component.ts @@ -55,7 +55,7 @@ export class CourseExercisesComponent implements OnInit, OnDestroy { sidebarData: SidebarData; sidebarExercises: SidebarCardElement[] = []; isCollapsed = false; - isLti = false; + isShownViaLti = false; protected readonly DEFAULT_COLLAPSE_STATE = DEFAULT_COLLAPSE_STATE; protected readonly DEFAULT_SHOW_ALWAYS = DEFAULT_SHOW_ALWAYS; @@ -88,8 +88,8 @@ export class CourseExercisesComponent implements OnInit, OnDestroy { this.exerciseForGuidedTour = this.guidedTourService.enableTourForCourseExerciseComponent(this.course, courseExerciseOverviewTour, true); - this.ltiSubscription = this.ltiService.isLti$.subscribe((isLti) => { - this.isLti = isLti; + this.ltiSubscription = this.ltiService.isShownViaLti$.subscribe((isShownViaLti) => { + this.isShownViaLti = isShownViaLti; }); // If no exercise is selected navigate to the lastSelected or upcoming exercise diff --git a/src/main/webapp/app/overview/course-overview.component.html b/src/main/webapp/app/overview/course-overview.component.html index 05ff39d44a36..2cd6c2c5c4ee 100644 --- a/src/main/webapp/app/overview/course-overview.component.html +++ b/src/main/webapp/app/overview/course-overview.component.html @@ -1,215 +1,221 @@ -