Display current line value for non-empty field in case of dependency

issues
This commit is contained in:
2023-05-07 02:03:02 +02:00
parent 50f682dbc2
commit 65fa859490
3 changed files with 8 additions and 4 deletions

View File

@ -122,6 +122,8 @@ class CsvxmlValidator {
let dependencies = this.fieldList[header].dependsOn;
for (let dep of dependencies) {
if (headers.includes(dep) === false) {
console.error("Dependency issue at column " + header + ": Corresponding column " + dep + " is missing");
console.log(headers);
this.errors.dependentColumns.push("Dependency issue at column " + header + ": Corresponding column " + dep + " is missing");
}
}
@ -139,7 +141,9 @@ class CsvxmlValidator {
for (let dependency of dependencies) {
if (line[dependency] === '') {
this.errors.dependentColumns.push("Dependency issue at column " + fieldName + ": Corresponding column " + dependency + " is empty");
console.error("Dependency issue at column " + fieldName + ": Corresponding column " + dependency + " is missing");
console.log(line);
this.errors.dependentColumns.push("Dependency issue at column " + fieldName + " (current value: " + line[fieldName] + "): Corresponding column " + dependency + " is empty");
}
}
}

File diff suppressed because one or more lines are too long