Skip to content

Commit

Permalink
(#201) Fix for column tests not rendering on quoted columns
Browse files Browse the repository at this point in the history
  • Loading branch information
drewbanin committed May 31, 2023
1 parent deb8cfa commit 2f09d3a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .changes/unreleased/Docs-20230531-115419.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Docs
body: Fix for column tests not rendering on quoted columns
time: 2023-05-31T11:54:19.687363-04:00
custom:
Author: drewbanin
Issue: "201"
8 changes: 7 additions & 1 deletion src/app/services/project_service.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,13 @@ angular
}
var node = project.nodes[model];
var column = _.find(node.columns, function(col, col_name) {
return col_name.toLowerCase() == test_column.toLowerCase();
// strip quotes from start and end of test column if present in both locations
// this is necessary to attach a test to a column when `quote: true` is set for a column
let test_column_name = test_column;
if (test_column.startsWith('"') && test_column.endsWith('"')) {
test_column_name = test_column.substring(1, test_column.length-1);
}
return col_name.toLowerCase() == test_column_name.toLowerCase();
});

if (column) {
Expand Down

0 comments on commit 2f09d3a

Please sign in to comment.