From a89db19df2bc87ca42f0851d216da904c9e14166 Mon Sep 17 00:00:00 2001 From: Tobias Wasner Date: Tue, 17 Dec 2024 15:29:51 +0100 Subject: [PATCH] Show LLM cost info only if any LLM feature is enabled in course. --- ...ourse-detail-doughnut-chart.component.html | 23 ++++++++++--------- .../course-detail-doughnut-chart.component.ts | 10 ++++---- .../detail/course-detail.component.html | 16 +++++++------ 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/src/main/webapp/app/course/manage/detail/course-detail-doughnut-chart.component.html b/src/main/webapp/app/course/manage/detail/course-detail-doughnut-chart.component.html index 2f741fd5174d..936bf068fa84 100644 --- a/src/main/webapp/app/course/manage/detail/course-detail-doughnut-chart.component.html +++ b/src/main/webapp/app/course/manage/detail/course-detail-doughnut-chart.component.html @@ -9,17 +9,18 @@
{{ 'artemisApp.course.detail.' + doughnutChartTitle + 'T }
- @if (receivedStats && currentPercentage != undefined) { -
{{ currentPercentage }}%
- } @else if (receivedStats && showText) { -
{{ showText }}
- } - @if (receivedStats && !showText) { -
{{ currentAbsolute }} / {{ currentMax }}
- } @else if (receivedStats && currentPercentage != undefined) { -
{{ showText }}
- } - @if (!receivedStats) { + @if (receivedStats) { + @if (currentPercentage != undefined) { +
{{ currentPercentage }}%
+ } @else if (showText) { +
{{ showText }}
+ } + @if (!showText) { +
{{ currentAbsolute }} / {{ currentMax }}
+ } @else if (currentPercentage != undefined) { +
{{ showText }}
+ } + } @else {
diff --git a/src/main/webapp/app/course/manage/detail/course-detail-doughnut-chart.component.ts b/src/main/webapp/app/course/manage/detail/course-detail-doughnut-chart.component.ts index 3a56fd3fa046..6e842fdd4309 100644 --- a/src/main/webapp/app/course/manage/detail/course-detail-doughnut-chart.component.ts +++ b/src/main/webapp/app/course/manage/detail/course-detail-doughnut-chart.component.ts @@ -17,16 +17,16 @@ const PIE_CHART_NA_FALLBACK_VALUE = [0, 0, 1]; }) export class CourseDetailDoughnutChartComponent implements OnChanges, OnInit { @Input() contentType: DoughnutChartType; - @Input() currentPercentage: number | undefined; - @Input() currentAbsolute: number | undefined; - @Input() currentMax: number | undefined; + @Input() currentPercentage?: number; + @Input() currentAbsolute?: number; + @Input() currentMax?: number; @Input() course: Course; - @Input() showText: string | undefined; + @Input() showText?: string; receivedStats = false; doughnutChartTitle: string; stats: number[]; - titleLink: string | undefined; + titleLink?: string; // Icons faSpinner = faSpinner; diff --git a/src/main/webapp/app/course/manage/detail/course-detail.component.html b/src/main/webapp/app/course/manage/detail/course-detail.component.html index f7cc5b8cc2e1..f34e808d1c5a 100644 --- a/src/main/webapp/app/course/manage/detail/course-detail.component.html +++ b/src/main/webapp/app/course/manage/detail/course-detail.component.html @@ -40,13 +40,15 @@ [currentAbsolute]="courseDTO?.currentAbsoluteAverageScore" [currentMax]="courseDTO?.currentMaxAverageScore" /> - + @if (this.irisChatEnabled || this.isAthenaEnabled) { + + }