From 7538d1759e2433f827df51fb2f313aa099697c1b Mon Sep 17 00:00:00 2001 From: ajay_chauhan Date: Thu, 21 Nov 2024 19:27:09 +0100 Subject: [PATCH 01/12] replace separation operator --- .../plagiarism-cases-instructor-view.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts index 1b218cb534f5..350a13acd343 100644 --- a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts +++ b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts @@ -134,15 +134,15 @@ export class PlagiarismCasesInstructorViewComponent implements OnInit { * export the plagiarism cases in CSV format */ exportPlagiarismCases(): void { - const blobParts: string[] = ['Student Login,Exercise,Verdict, Verdict Date\n']; + const blobParts: string[] = ['Student Login;Matr. Nr.; Exercise;Verdict; Verdict Date\n']; this.plagiarismCases.forEach((plagiarismCase) => { const exerciseTitleCSVSanitized = plagiarismCase.exercise?.title?.replace(',', '","'); if (plagiarismCase.verdict) { blobParts.push( - `${plagiarismCase.student?.login},${exerciseTitleCSVSanitized},${plagiarismCase.verdict},${plagiarismCase.verdictDate},${plagiarismCase.verdictBy!.name}\n`, + `${plagiarismCase.student?.login};${plagiarismCase.student?.visibleRegistrationNumber || '-'};${exerciseTitleCSVSanitized};${plagiarismCase.verdict};${plagiarismCase.verdictDate};${plagiarismCase.verdictBy!.name}\n`, ); } else { - blobParts.push(`${plagiarismCase.student?.login},${exerciseTitleCSVSanitized}, No verdict yet, -, -\n`); + blobParts.push(`${plagiarismCase.student?.login};${plagiarismCase.student?.visibleRegistrationNumber || '-'};${exerciseTitleCSVSanitized}; No verdict yet; -; -\n`); } }); downloadFile(new Blob(blobParts, { type: 'text/csv' }), 'plagiarism-cases.csv'); From 00e76a836e8a69700fc066bedc6303551222fcf8 Mon Sep 17 00:00:00 2001 From: ajay_chauhan Date: Thu, 21 Nov 2024 19:28:53 +0100 Subject: [PATCH 02/12] adapt test --- .../plagiarism-cases-instructor-view.component.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/javascript/spec/component/plagiarism/plagiarism-cases-instructor-view.component.spec.ts b/src/test/javascript/spec/component/plagiarism/plagiarism-cases-instructor-view.component.spec.ts index 4a6bda12288c..45749bcbdf3a 100644 --- a/src/test/javascript/spec/component/plagiarism/plagiarism-cases-instructor-view.component.spec.ts +++ b/src/test/javascript/spec/component/plagiarism/plagiarism-cases-instructor-view.component.spec.ts @@ -190,9 +190,9 @@ describe('Plagiarism Cases Instructor View Component', () => { const downloadSpy = jest.spyOn(DownloadUtil, 'downloadFile'); component.plagiarismCases = [plagiarismCase1, plagiarismCase4]; const expectedBlob = [ - 'Student Login,Exercise,Verdict, Verdict Date\n', - `Student 1, Test Exercise 1, PLAGIARISM, ${date}, Test Instructor 1\n`, - 'Student 2, Test Exercise 2, No verdict yet, -, -\n', + 'Student Login; Matr. Nr.; Exercise;Verdict; Verdict Date\n', + `Student 1; -; Test Exercise 1; PLAGIARISM; ${date}; Test Instructor 1\n`, + 'Student 2; -; Test Exercise 2; No verdict yet; -; -\n', ]; component.exportPlagiarismCases(); expect(downloadSpy).toHaveBeenCalledOnce(); From f0fefd4142e1e47efcb4ca66918c81e2d17884f2 Mon Sep 17 00:00:00 2001 From: Ajayvir Singh <38434017+AjayvirS@users.noreply.github.com> Date: Thu, 21 Nov 2024 22:48:06 +0100 Subject: [PATCH 03/12] Update src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../plagiarism-cases-instructor-view.component.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts index 350a13acd343..fd1bc51845e6 100644 --- a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts +++ b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts @@ -134,7 +134,8 @@ export class PlagiarismCasesInstructorViewComponent implements OnInit { * export the plagiarism cases in CSV format */ exportPlagiarismCases(): void { - const blobParts: string[] = ['Student Login;Matr. Nr.; Exercise;Verdict; Verdict Date\n']; + const headers = ['Student Login', 'Matr. Nr.', 'Exercise', 'Verdict', 'Verdict Date'].map(header => header.replace(/;/g, '')); + const blobParts: string[] = [headers.join(';') + '\n']; this.plagiarismCases.forEach((plagiarismCase) => { const exerciseTitleCSVSanitized = plagiarismCase.exercise?.title?.replace(',', '","'); if (plagiarismCase.verdict) { From 273dcea35226f1ccb5eb73d85a9f20526b494748 Mon Sep 17 00:00:00 2001 From: ajay_chauhan Date: Thu, 21 Nov 2024 22:58:50 +0100 Subject: [PATCH 04/12] integrate coderabbit suggestions --- ...giarism-cases-instructor-view.component.ts | 71 +++++++++++++------ 1 file changed, 49 insertions(+), 22 deletions(-) diff --git a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts index fd1bc51845e6..726c12523264 100644 --- a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts +++ b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts @@ -37,23 +37,31 @@ export class PlagiarismCasesInstructorViewComponent implements OnInit { plagiarismCasesForInstructor$.subscribe({ next: (res: HttpResponse) => { this.plagiarismCases = res.body!; - this.groupedPlagiarismCases = this.plagiarismCases.reduce((acc: { [exerciseId: number]: PlagiarismCase[] }, plagiarismCase) => { - const caseExerciseId = plagiarismCase.exercise?.id; - if (caseExerciseId === undefined) { - return acc; - } - - // Group initialization - if (!acc[caseExerciseId]) { - acc[caseExerciseId] = []; - this.exercisesWithPlagiarismCases.push(plagiarismCase.exercise!); - } - - // Grouping - acc[caseExerciseId].push(plagiarismCase); + this.groupedPlagiarismCases = this.plagiarismCases.reduce( + ( + acc: { + [exerciseId: number]: PlagiarismCase[]; + }, + plagiarismCase, + ) => { + const caseExerciseId = plagiarismCase.exercise?.id; + if (caseExerciseId === undefined) { + return acc; + } + + // Group initialization + if (!acc[caseExerciseId]) { + acc[caseExerciseId] = []; + this.exercisesWithPlagiarismCases.push(plagiarismCase.exercise!); + } + + // Grouping + acc[caseExerciseId].push(plagiarismCase); - return acc; - }, {}); + return acc; + }, + {}, + ); }, }); } @@ -131,20 +139,39 @@ export class PlagiarismCasesInstructorViewComponent implements OnInit { } /** - * export the plagiarism cases in CSV format + * set placeholder for undefined values and sanitize the operators away + * @param value + * @private + */ + private sanitizeCSVField(value: any): string { + if (value === null || value === undefined) { + return '-'; + } + return String(value).replace(/;/g, '";"'); + } + + /** + * export the cases in CSV format */ exportPlagiarismCases(): void { - const headers = ['Student Login', 'Matr. Nr.', 'Exercise', 'Verdict', 'Verdict Date'].map(header => header.replace(/;/g, '')); + const headers = ['Student Login', 'Matr. Nr.', 'Exercise', 'Verdict', 'Verdict Date', 'Verdict By'].map((header) => this.sanitizeCSVField(header)); const blobParts: string[] = [headers.join(';') + '\n']; this.plagiarismCases.forEach((plagiarismCase) => { - const exerciseTitleCSVSanitized = plagiarismCase.exercise?.title?.replace(',', '","'); + const fields = [ + this.sanitizeCSVField(plagiarismCase.student?.login), + this.sanitizeCSVField(plagiarismCase.student?.visibleRegistrationNumber), + this.sanitizeCSVField(plagiarismCase.exercise?.title), + ]; if (plagiarismCase.verdict) { - blobParts.push( - `${plagiarismCase.student?.login};${plagiarismCase.student?.visibleRegistrationNumber || '-'};${exerciseTitleCSVSanitized};${plagiarismCase.verdict};${plagiarismCase.verdictDate};${plagiarismCase.verdictBy!.name}\n`, + fields.push( + this.sanitizeCSVField(plagiarismCase.verdict), + this.sanitizeCSVField(plagiarismCase.verdictDate), + this.sanitizeCSVField(plagiarismCase.verdictBy?.name), ); } else { - blobParts.push(`${plagiarismCase.student?.login};${plagiarismCase.student?.visibleRegistrationNumber || '-'};${exerciseTitleCSVSanitized}; No verdict yet; -; -\n`); + fields.push('No verdict yet', '-', '-'); } + blobParts.push(fields.join(';') + '\n'); }); downloadFile(new Blob(blobParts, { type: 'text/csv' }), 'plagiarism-cases.csv'); } From c8f53016f78fa01127f631339eb21a7c54db02b0 Mon Sep 17 00:00:00 2001 From: Ajayvir Singh <38434017+AjayvirS@users.noreply.github.com> Date: Fri, 22 Nov 2024 00:51:01 +0100 Subject: [PATCH 05/12] Update src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .../plagiarism-cases-instructor-view.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts index 726c12523264..1c1cde3a03ca 100644 --- a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts +++ b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts @@ -173,6 +173,11 @@ export class PlagiarismCasesInstructorViewComponent implements OnInit { } blobParts.push(fields.join(';') + '\n'); }); - downloadFile(new Blob(blobParts, { type: 'text/csv' }), 'plagiarism-cases.csv'); + try { + downloadFile(new Blob(blobParts, { type: 'text/csv' }), 'plagiarism-cases.csv'); + } catch (error) { + console.error('Failed to download plagiarism cases:', error); + this.jhiAlertService.error('plagiarismCases.export.error'); + } } } From eb2f00484d35fa63848b82702e18dab376235d73 Mon Sep 17 00:00:00 2001 From: Ajayvir Singh <38434017+AjayvirS@users.noreply.github.com> Date: Fri, 22 Nov 2024 12:26:23 +0100 Subject: [PATCH 06/12] Add error handling Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- ...giarism-cases-instructor-view.component.ts | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts index 1c1cde3a03ca..3351d133f156 100644 --- a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts +++ b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts @@ -173,11 +173,19 @@ export class PlagiarismCasesInstructorViewComponent implements OnInit { } blobParts.push(fields.join(';') + '\n'); }); - try { - downloadFile(new Blob(blobParts, { type: 'text/csv' }), 'plagiarism-cases.csv'); - } catch (error) { - console.error('Failed to download plagiarism cases:', error); - this.jhiAlertService.error('plagiarismCases.export.error'); - } +import { JhiAlertService } from 'ng-jhipster'; + + constructor( + private plagiarismCasesService: PlagiarismCasesService, + private route: ActivatedRoute, + private jhiAlertService: JhiAlertService, + ) {} + + try { + downloadFile(new Blob(blobParts, { type: 'text/csv' }), 'plagiarism-cases.csv'); + } catch (error) { + console.error('Failed to download plagiarism cases:', error); + this.jhiAlertService.error('plagiarismCases.export.error'); + } } } From b12a166af205910907ef9319b3df444210704159 Mon Sep 17 00:00:00 2001 From: ajay_chauhan Date: Fri, 22 Nov 2024 12:47:06 +0100 Subject: [PATCH 07/12] add translation of error handling --- ...giarism-cases-instructor-view.component.ts | 20 +++++++------------ src/main/webapp/i18n/de/plagiarism.json | 3 +++ src/main/webapp/i18n/en/plagiarism.json | 3 +++ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts index 3351d133f156..46d11377a64f 100644 --- a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts +++ b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts @@ -6,6 +6,7 @@ import { PlagiarismCase } from 'app/exercises/shared/plagiarism/types/Plagiarism import { Exercise, getIcon } from 'app/entities/exercise.model'; import { downloadFile } from 'app/shared/util/download.util'; import { DocumentationType } from 'app/shared/components/documentation-button/documentation-button.component'; +import { AlertService } from 'app/core/util/alert.service'; @Component({ selector: 'jhi-plagiarism-cases-instructor-view', @@ -24,6 +25,7 @@ export class PlagiarismCasesInstructorViewComponent implements OnInit { constructor( private plagiarismCasesService: PlagiarismCasesService, private route: ActivatedRoute, + private alertService: AlertService, ) {} ngOnInit(): void { @@ -173,19 +175,11 @@ export class PlagiarismCasesInstructorViewComponent implements OnInit { } blobParts.push(fields.join(';') + '\n'); }); -import { JhiAlertService } from 'ng-jhipster'; - constructor( - private plagiarismCasesService: PlagiarismCasesService, - private route: ActivatedRoute, - private jhiAlertService: JhiAlertService, - ) {} - - try { - downloadFile(new Blob(blobParts, { type: 'text/csv' }), 'plagiarism-cases.csv'); - } catch (error) { - console.error('Failed to download plagiarism cases:', error); - this.jhiAlertService.error('plagiarismCases.export.error'); - } + try { + downloadFile(new Blob(blobParts, { type: 'text/csv' }), 'plagiarism-cases.csv'); + } catch (error) { + this.alertService.error('plagiarismCases.export.error'); + } } } diff --git a/src/main/webapp/i18n/de/plagiarism.json b/src/main/webapp/i18n/de/plagiarism.json index 2e8f1d30798f..af76130c77cf 100644 --- a/src/main/webapp/i18n/de/plagiarism.json +++ b/src/main/webapp/i18n/de/plagiarism.json @@ -131,6 +131,9 @@ "confirm": "Fall bestätigen", "discard": "Fall verwerfen" } + }, + "export": { + "error": "Error exporting CSV." } } } diff --git a/src/main/webapp/i18n/en/plagiarism.json b/src/main/webapp/i18n/en/plagiarism.json index 8f071d94b798..ba73b67b9f37 100644 --- a/src/main/webapp/i18n/en/plagiarism.json +++ b/src/main/webapp/i18n/en/plagiarism.json @@ -130,6 +130,9 @@ "exportCsv": "Export CSV", "confirm": "Confirm case", "discard": "Discard case" + }, + "export": { + "error": "Error exporting CSV." } } } From 0ea7842c0311e2ca84dadce6fe4738f7fb7afd0a Mon Sep 17 00:00:00 2001 From: Ajayvir Singh <38434017+AjayvirS@users.noreply.github.com> Date: Fri, 22 Nov 2024 12:53:40 +0100 Subject: [PATCH 08/12] fix German translation Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- src/main/webapp/i18n/de/plagiarism.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/i18n/de/plagiarism.json b/src/main/webapp/i18n/de/plagiarism.json index af76130c77cf..6cac8635a129 100644 --- a/src/main/webapp/i18n/de/plagiarism.json +++ b/src/main/webapp/i18n/de/plagiarism.json @@ -133,7 +133,7 @@ } }, "export": { - "error": "Error exporting CSV." + "error": "Fehler beim Exportieren der CSV-Datei." } } } From b9fdb5bd1cb5dec1cd1f6aa0d40236a200324206 Mon Sep 17 00:00:00 2001 From: ajay_chauhan Date: Mon, 25 Nov 2024 23:45:09 +0100 Subject: [PATCH 09/12] adapt feedback --- .../plagiarism-cases-instructor-view.component.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts index 46d11377a64f..701a2af70d50 100644 --- a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts +++ b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts @@ -142,11 +142,12 @@ export class PlagiarismCasesInstructorViewComponent implements OnInit { /** * set placeholder for undefined values and sanitize the operators away - * @param value + * @param value to be sanitized or replaced with - * @private */ private sanitizeCSVField(value: any): string { if (value === null || value === undefined) { + // used as placeholder for null or if the passed value does not exist return '-'; } return String(value).replace(/;/g, '";"'); @@ -156,9 +157,9 @@ export class PlagiarismCasesInstructorViewComponent implements OnInit { * export the cases in CSV format */ exportPlagiarismCases(): void { - const headers = ['Student Login', 'Matr. Nr.', 'Exercise', 'Verdict', 'Verdict Date', 'Verdict By'].map((header) => this.sanitizeCSVField(header)); + const headers = ['Student Login', 'Matr. Nr.', 'Exercise', 'Verdict', 'Verdict Date', 'Verdict By']; const blobParts: string[] = [headers.join(';') + '\n']; - this.plagiarismCases.forEach((plagiarismCase) => { + this.plagiarismCases.reduce((acc, plagiarismCase) => { const fields = [ this.sanitizeCSVField(plagiarismCase.student?.login), this.sanitizeCSVField(plagiarismCase.student?.visibleRegistrationNumber), @@ -173,8 +174,9 @@ export class PlagiarismCasesInstructorViewComponent implements OnInit { } else { fields.push('No verdict yet', '-', '-'); } - blobParts.push(fields.join(';') + '\n'); - }); + acc.push(fields.join(';') + '\n'); + return acc; + }, blobParts); try { downloadFile(new Blob(blobParts, { type: 'text/csv' }), 'plagiarism-cases.csv'); From a4231e6f3c8354b794d785cf3e01ca48028e9372 Mon Sep 17 00:00:00 2001 From: ajay_chauhan Date: Thu, 28 Nov 2024 12:07:53 +0100 Subject: [PATCH 10/12] fix translation path wrong --- .../plagiarism-cases-instructor-view.component.ts | 2 +- src/main/webapp/i18n/de/plagiarism.json | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts index 701a2af70d50..dd6d3a118c19 100644 --- a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts +++ b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts @@ -181,7 +181,7 @@ export class PlagiarismCasesInstructorViewComponent implements OnInit { try { downloadFile(new Blob(blobParts, { type: 'text/csv' }), 'plagiarism-cases.csv'); } catch (error) { - this.alertService.error('plagiarismCases.export.error'); + this.alertService.error('artemisApp.plagiarism.plagiarismCases.export.error'); } } } diff --git a/src/main/webapp/i18n/de/plagiarism.json b/src/main/webapp/i18n/de/plagiarism.json index 6cac8635a129..becba41634fc 100644 --- a/src/main/webapp/i18n/de/plagiarism.json +++ b/src/main/webapp/i18n/de/plagiarism.json @@ -130,10 +130,10 @@ "exportCsv": "CSV exportieren", "confirm": "Fall bestätigen", "discard": "Fall verwerfen" + }, + "export": { + "error": "Fehler beim Exportieren der CSV-Datei." } - }, - "export": { - "error": "Fehler beim Exportieren der CSV-Datei." } } } From f4346b5c56d8456a44e693fd4fc82273f24f355b Mon Sep 17 00:00:00 2001 From: ajay_chauhan Date: Thu, 28 Nov 2024 16:59:24 +0100 Subject: [PATCH 11/12] add comment --- .../plagiarism-cases-instructor-view.component.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts index dd6d3a118c19..760d8e6567fb 100644 --- a/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts +++ b/src/main/webapp/app/course/plagiarism-cases/instructor-view/plagiarism-cases-instructor-view.component.ts @@ -150,6 +150,7 @@ export class PlagiarismCasesInstructorViewComponent implements OnInit { // used as placeholder for null or if the passed value does not exist return '-'; } + // sanitize the operators away in case they appear in the values return String(value).replace(/;/g, '";"'); } From 578ba2e9bd73168c029ea631cf8062e28166b6cc Mon Sep 17 00:00:00 2001 From: ajay_chauhan Date: Thu, 28 Nov 2024 18:43:00 +0100 Subject: [PATCH 12/12] fix a compltely unrelated test and cause potential merge conflicts --- .../student-exam-timeline.component.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/student-exam-timeline.component.ts b/src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/student-exam-timeline.component.ts index 1b54bd14ff8a..70f4cfe76710 100644 --- a/src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/student-exam-timeline.component.ts +++ b/src/main/webapp/app/exam/manage/student-exams/student-exam-timeline/student-exam-timeline.component.ts @@ -1,4 +1,4 @@ -import { AfterViewInit, Component, OnDestroy, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core'; +import { AfterViewInit, ChangeDetectorRef, Component, OnDestroy, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { StudentExam } from 'app/entities/student-exam.model'; import { Exercise, ExerciseType } from 'app/entities/exercise.model'; @@ -8,7 +8,7 @@ import { ExamNavigationBarComponent } from 'app/exam/participate/exam-navigation import { SubmissionService } from 'app/exercises/shared/submission/submission.service'; import dayjs from 'dayjs/esm'; import { SubmissionVersion } from 'app/entities/submission-version.model'; -import { Observable, Subscription, forkJoin, map, mergeMap, toArray } from 'rxjs'; +import { Observable, Subscription, forkJoin, map, mergeMap, tap, toArray } from 'rxjs'; import { ProgrammingSubmission } from 'app/entities/programming/programming-submission.model'; import { Submission } from 'app/entities/submission.model'; import { FileUploadSubmission } from 'app/entities/file-upload-submission.model'; @@ -57,6 +57,7 @@ export class StudentExamTimelineComponent implements OnInit, AfterViewInit, OnDe private submissionService: SubmissionService, private submissionVersionService: SubmissionVersionService, private programmingExerciseParticipationService: ProgrammingExerciseParticipationService, + private cdr: ChangeDetectorRef, ) {} ngOnInit(): void { @@ -203,7 +204,8 @@ export class StudentExamTimelineComponent implements OnInit, AfterViewInit, OnDe ); } }); - return forkJoin([...submissionObservables]); + + return forkJoin([...submissionObservables]).pipe(tap(() => this.cdr.detectChanges())); } /**