mirror of
				https://github.com/inventree/InvenTree.git
				synced 2025-11-04 07:05:41 +00:00 
			
		
		
		
	Merge pull request #1719 from SchrodingersGat/test-results-fix
Fixes table data nesting
This commit is contained in:
		@@ -179,27 +179,32 @@ function loadStockTestResultsTable(table, options) {
 | 
				
			|||||||
                            var match = false;
 | 
					                            var match = false;
 | 
				
			||||||
                            var override = false;
 | 
					                            var override = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                            // Extract the simplified test key
 | 
				
			||||||
                            var key = item.key;
 | 
					                            var key = item.key;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            // Attempt to associate this result with an existing test
 | 
					                            // 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) {
 | 
					                                if (key == row.key) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                    item.test_name = row.test_name;
 | 
					                                    item.test_name = row.test_name;
 | 
				
			||||||
                                    item.required = row.required;
 | 
					                                    item.required = row.required;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                                    match = true;
 | 
					 | 
				
			||||||
                                    
 | 
					 | 
				
			||||||
                                    if (row.result == null) {
 | 
					                                    if (row.result == null) {
 | 
				
			||||||
                                        item.parent = parent_node;
 | 
					                                        item.parent = parent_node;
 | 
				
			||||||
                                        tableData[index] = item;
 | 
					                                        tableData[idx] = item;
 | 
				
			||||||
                                        override = true;
 | 
					                                        override = true;
 | 
				
			||||||
                                    } else {
 | 
					                                    } else {
 | 
				
			||||||
                                        item.parent = row.pk;
 | 
					                                        item.parent = row.pk;
 | 
				
			||||||
                                    }
 | 
					                                    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                    match = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                                    break;
 | 
				
			||||||
 | 
					                                }
 | 
				
			||||||
                            }
 | 
					                            }
 | 
				
			||||||
                            });
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
                            // No match could be found
 | 
					                            // No match could be found
 | 
				
			||||||
                            if (!match) {
 | 
					                            if (!match) {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user