Browse Source

Clarify comments and rename json version field.

Sebastian Hahner 4 years ago
parent
commit
72b759f794

+ 1 - 1
core/src/main/java/de/jplag/reporting/reportobject/ReportObjectFactory.java

@@ -43,7 +43,7 @@ public class ReportObjectFactory {
     public static final String OVERVIEW_FILE_NAME = "overview.json";
     public static final String SUBMISSIONS_FOLDER = "submissions";
 
-    // This shall be moved to a better visible and upgradable position. Shall be fixed in a future version.
+    // TODO: This shall be moved to a better visible and upgradable position. Shall be fixed in a future version.
     public static final Version REPORT_VIEWER_VERSION = new Version(4, 0, 0);
     private Map<String, String> submissionNameToIdMap;
     private Function<Submission, String> submissionToIdFunction;

+ 1 - 1
core/src/main/java/de/jplag/reporting/reportobject/model/OverviewReport.java

@@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
 
 public record OverviewReport(
 
-        @JsonProperty("version") Version version,
+        @JsonProperty("jplag_version") Version version,
 
         @JsonProperty("submission_folder_path") List<String> submissionFolderPath,
 

+ 1 - 1
report-viewer/src/model/factories/ComparisonFactory.ts

@@ -22,7 +22,7 @@ export class ComparisonFactory {
 
     const matches = json.matches as Array<Record<string, unknown>>;
     
-    // Quick fix for issue #658, requires deeper insights to be resolved completely
+    // TODO: Quick fix for issue #658, requires deeper insights to be resolved completely
     matches.forEach((match: Record<string, unknown>) => {
       match["file1"] = this.removePathFromFileName(match["file1"] as string ?? "");
       match["file2"] = this.removePathFromFileName(match["file2"] as string ?? "");

+ 7 - 7
report-viewer/src/model/factories/OverviewFactory.ts

@@ -7,18 +7,18 @@ import { Version } from "../Version";
 
 export class OverviewFactory {
 
-  // FIXME: Find a better more visible position to store this
+  // TODO: Find a better more visible position to store this
   static reportViewerVersion: Version = {major: 4, minor: 0, patch: 0};
 
   static getOverview(json: Record<string, unknown>): Overview {
-    const jsonVersion = json.version as Record<string, number>;
-    const version: Version = {
-      major: jsonVersion.major,
-      minor: jsonVersion.minor,
-      patch: jsonVersion.patch
+    const versionField = json.jplag_version as Record<string, number>;
+    const jplagVersion: Version = {
+      major: versionField.major,
+      minor: versionField.minor,
+      patch: versionField.patch
     }
 
-    OverviewFactory.compareVersions(version, this.reportViewerVersion);
+    OverviewFactory.compareVersions(jplagVersion, this.reportViewerVersion);
 
     const submissionFolder = json.submission_folder_path as Array<string>;
     const baseCodeFolder = "";