diff --git a/src/main/webapp/app/exercises/shared/plagiarism/plagiarism-split-view/plagiarism-split-view.component.html b/src/main/webapp/app/exercises/shared/plagiarism/plagiarism-split-view/plagiarism-split-view.component.html
index 4c6052b563d4..603fae72e0a4 100644
--- a/src/main/webapp/app/exercises/shared/plagiarism/plagiarism-split-view/plagiarism-split-view.component.html
+++ b/src/main/webapp/app/exercises/shared/plagiarism/plagiarism-split-view/plagiarism-split-view.component.html
@@ -5,10 +5,24 @@
}
@if (isProgrammingOrTextExercise) {
-
+
}
}
+
@if (plagiarismComparison) {
@if (isModelingExercise) {
@@ -20,10 +34,14 @@
}
@if (isProgrammingOrTextExercise) {
}
}
diff --git a/src/main/webapp/app/exercises/shared/plagiarism/plagiarism-split-view/plagiarism-split-view.component.scss b/src/main/webapp/app/exercises/shared/plagiarism/plagiarism-split-view/plagiarism-split-view.component.scss
index 4956ee867320..12ac2a9ad4a2 100644
--- a/src/main/webapp/app/exercises/shared/plagiarism/plagiarism-split-view/plagiarism-split-view.component.scss
+++ b/src/main/webapp/app/exercises/shared/plagiarism/plagiarism-split-view/plagiarism-split-view.component.scss
@@ -19,3 +19,7 @@
position: relative;
}
}
+
+.split-pane-header-color {
+ background-color: var(--bs-body-bg);
+}
diff --git a/src/main/webapp/app/exercises/shared/plagiarism/plagiarism-split-view/plagiarism-split-view.component.ts b/src/main/webapp/app/exercises/shared/plagiarism/plagiarism-split-view/plagiarism-split-view.component.ts
index 340d72154ce6..c8e6fe103fa5 100644
--- a/src/main/webapp/app/exercises/shared/plagiarism/plagiarism-split-view/plagiarism-split-view.component.ts
+++ b/src/main/webapp/app/exercises/shared/plagiarism/plagiarism-split-view/plagiarism-split-view.component.ts
@@ -1,4 +1,4 @@
-import { AfterViewInit, Component, Directive, ElementRef, Input, OnChanges, OnInit, QueryList, SimpleChanges, ViewChildren } from '@angular/core';
+import { AfterViewInit, Component, Directive, ElementRef, Input, OnChanges, OnDestroy, OnInit, QueryList, SimpleChanges, ViewChildren } from '@angular/core';
import * as Split from 'split.js';
import { Subject } from 'rxjs';
import { PlagiarismComparison } from 'app/exercises/shared/plagiarism/types/PlagiarismComparison';
@@ -10,6 +10,8 @@ import { PlagiarismCasesService } from 'app/course/plagiarism-cases/shared/plagi
import { HttpResponse } from '@angular/common/http';
import { SimpleMatch } from 'app/exercises/shared/plagiarism/types/PlagiarismMatch';
import dayjs from 'dayjs/esm';
+import { TextPlagiarismFileElement } from 'app/exercises/shared/plagiarism/types/text/TextPlagiarismFileElement';
+import { IconDefinition, faLock, faUnlock } from '@fortawesome/free-solid-svg-icons';
@Directive({ selector: '[jhiPane]' })
export class SplitPaneDirective {
@@ -21,7 +23,7 @@ export class SplitPaneDirective {
styleUrls: ['./plagiarism-split-view.component.scss'],
templateUrl: './plagiarism-split-view.component.html',
})
-export class PlagiarismSplitViewComponent implements AfterViewInit, OnChanges, OnInit {
+export class PlagiarismSplitViewComponent implements AfterViewInit, OnChanges, OnInit, OnDestroy {
@Input() comparison: PlagiarismComparison;
@Input() exercise: Exercise;
@Input() splitControlSubject: Subject;
@@ -31,6 +33,9 @@ export class PlagiarismSplitViewComponent implements AfterViewInit, OnChanges, O
@ViewChildren(SplitPaneDirective) panes!: QueryList;
plagiarismComparison: PlagiarismComparison;
+ fileSelectedSubject = new Subject();
+ showFilesSubject = new Subject();
+ dropdownHoverSubject = new Subject();
public split: Split.Instance;
@@ -39,13 +44,16 @@ export class PlagiarismSplitViewComponent implements AfterViewInit, OnChanges, O
public matchesA: Map;
public matchesB: Map;
+ isLockFilesEnabled = false;
readonly dayjs = dayjs;
+ protected readonly faLock: IconDefinition = faLock;
+ protected readonly faUnlock: IconDefinition = faUnlock;
constructor(private plagiarismCasesService: PlagiarismCasesService) {}
/**
- * Initialize third party libs inside this lifecycle hook.
+ * Initialize third-party libraries inside this lifecycle hook.
*/
ngAfterViewInit(): void {
const paneElements = this.panes.map((pane: SplitPaneDirective) => pane.elementRef.nativeElement);
@@ -84,6 +92,12 @@ export class PlagiarismSplitViewComponent implements AfterViewInit, OnChanges, O
}
}
+ ngOnDestroy() {
+ this.fileSelectedSubject.complete();
+ this.showFilesSubject.complete();
+ this.dropdownHoverSubject.complete();
+ }
+
/**
* Swaps fields of A with fields of B in-place.
* More specifically, swaps submissionA with submissionB and startA with startB in matches.
@@ -177,4 +191,11 @@ export class PlagiarismSplitViewComponent implements AfterViewInit, OnChanges, O
}
}
}
+
+ /**
+ * Toggles the state of file locking and emits the new state to the parent component.
+ */
+ toggleLockFiles() {
+ this.isLockFilesEnabled = !this.isLockFilesEnabled;
+ }
}
diff --git a/src/main/webapp/app/exercises/shared/plagiarism/plagiarism-split-view/split-pane-header/split-pane-header.component.html b/src/main/webapp/app/exercises/shared/plagiarism/plagiarism-split-view/split-pane-header/split-pane-header.component.html
index 865d3dfe654c..556a5e8bf3bf 100644
--- a/src/main/webapp/app/exercises/shared/plagiarism/plagiarism-split-view/split-pane-header/split-pane-header.component.html
+++ b/src/main/webapp/app/exercises/shared/plagiarism/plagiarism-split-view/split-pane-header/split-pane-header.component.html
@@ -1,5 +1,5 @@