Merge pull request #1719 from SchrodingersGat/test-results-fix

Fixes table data nesting
This commit is contained in:
Oliver 2021-06-24 13:40:09 +10:00 committed by GitHub
commit be85de4a7b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,27 +179,32 @@ function loadStockTestResultsTable(table, options) {
var match = false;
var override = false;
// Extract the simplified test key
var key = item.key;
// Attempt to associate this result with an existing test
tableData.forEach(function(row, index) {
for (var idx = 0; idx < tableData.length; idx++) {
var row = tableData[idx];
if (key == row.key) {
item.test_name = row.test_name;
item.required = row.required;
match = true;
if (row.result == null) {
item.parent = parent_node;
tableData[index] = item;
tableData[idx] = item;
override = true;
} else {
item.parent = row.pk;
}
match = true;
break;
}
});
}
// No match could be found
if (!match) {