Skip to content

Commit

Permalink
signals input course card fix
Browse files Browse the repository at this point in the history
  • Loading branch information
raffifasaro committed Dec 1, 2024
1 parent 161ec3c commit c752611
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
14 changes: 7 additions & 7 deletions src/main/webapp/app/lti/lti-course-card.component.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<div class="card" style="min-height: 80px !important">
<div
id="course-{{ course().id }}-header"
id="course-{{ course()?.id }}-header"
class="card-header text-white"
[routerLink]="['/lti/exercises', this.course.id]"
[routerLink]="['/lti/exercises', course()?.id]"
[ngStyle]="{ '--background-color-for-hover': courseColor }"
>
<a class="stretched-link" [routerLink]="['/lti/exercises', this.course.id]"></a>
<a class="stretched-link" [routerLink]="['/lti/exercises', course()?.id]"></a>
<div class="container">
<div class="row d-flex">
<div class="col-2 header-col image-col">
@if (course().courseIcon) {
<jhi-secured-image [cachingStrategy]="CachingStrategy.LOCAL_STORAGE" [src]="course().courseIcon" />
}
<ng-container *ngIf="course()?.courseIcon">
<jhi-secured-image [cachingStrategy]="CachingStrategy.LOCAL_STORAGE" [src]="course()?.courseIcon || ''"></jhi-secured-image>
</ng-container>
</div>
<div class="col-7 header-col title-col px-3">
<h5 class="card-title text-center">
{{ course().title + ' (' + course().shortName + ')' }}
{{ course()?.title + ' (' + course()?.shortName + ')' }}
</h5>
</div>
<div class="col-2 header-col course-info-col"></div>
Expand Down
5 changes: 3 additions & 2 deletions src/main/webapp/app/lti/lti-course-card.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ import { ArtemisSharedModule } from 'app/shared/shared.module';
})
export class LtiCourseCardComponent implements OnChanges {
readonly ARTEMIS_DEFAULT_COLOR = ARTEMIS_DEFAULT_COLOR;
readonly course = input.required<Course>();
course = input<Course>();
CachingStrategy = CachingStrategy;
courseColor: string;

ngOnChanges() {
this.courseColor = this.course().color || this.ARTEMIS_DEFAULT_COLOR;
const courseValue = this.course();
this.courseColor = courseValue?.color || this.ARTEMIS_DEFAULT_COLOR;
}
}

0 comments on commit c752611

Please sign in to comment.