-
-
Notifications
You must be signed in to change notification settings - Fork 72
Issue 224 - Improve column id support for filtering #359
Conversation
- clean up lexicon selector - arbitrary id test
@@ -202,6 +212,8 @@ function getState() { | |||
return getFixedVirtualizedState(); | |||
case AppMode.ReadOnly: | |||
return getReadonlyState(); | |||
case AppMode.ColumnsInSpace: | |||
return getSpaceInColumn(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A new mock/mode with specially named columns
@@ -55,7 +55,7 @@ export default class FilterFactory { | |||
} | |||
|
|||
setFilter(R.map( | |||
([cId, filter]) => `${cId} ${filter}`, | |||
([cId, filter]) => `"${cId}" ${filter}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auto-quote the column id when generating the filter fragments from column filters
|
||
static getFilterById(column: number | string) { | ||
return cy.get(`#table tbody tr th.dash-filter[data-dash-column="${column}"]`); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New selectors for getting the filter cells
|
||
DashTable.getCellById(0, 'rows').within(() => cy.get('.dash-cell-value').should('have.html', '101')); | ||
DashTable.getCellById(1, 'rows').should('not.exist'); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test that the filters are working fine for various special cases
- test nested quotes - add `` to '' and "" support
- add tests for badly formed operands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! 💃
Fixes #224.
Many normal usage scenarios are calling for column ids with non-word [^a-zA-Z0-9_] characters.
This PR adds the needed support for a subset of special characters [-+.:] without quotes, and for the full set of characters when single or double quoted.
Adds a few unit tests for the syntactic tree and a standalone/integration test for real-world usage validation.
Tests are passing against dash/dash-renderer latest release