fix(mocks): search the physical columns only in the viewer
viewdata.sas drops the derived columns in the vwsearch data step that mp_searchdata then reads, so a search matches on the columns the grid shows. The mock handed the full column list, so a search could match a row on a derived column that is never displayed.
This commit is contained in:
1 parent
60ec470404
commit
293022d46b
1 file changed
+4
-1
@@ -134,7 +134,10 @@ if (tableData && tableData.columns) {
|
||||
|
||||
let rows
|
||||
if (searchType) {
|
||||
const matches = filteredRows.filter(row => rowMatchesSearch(row, tableData.columns, searchType, searchVal))
|
||||
// the derived columns are dropped before the search, so only the
|
||||
// physical columns are searched (viewdata.sas drops them in the
|
||||
// vwsearch data step mp_searchdata then reads)
|
||||
const matches = filteredRows.filter(row => rowMatchesSearch(row, physicalColumns, searchType, searchVal))
|
||||
// mp_searchdata caps its output at outobs=&DC_MAXOBS_WEBVIEW, and
|
||||
// viewdata.sas then keeps only `if _n_<&DC_MAXOBS_WEBVIEW` of them.
|
||||
nobs = Math.min(matches.length, maxObsWebView)
|
||||
|
||||
Reference in new issue
Block a user