-
-
Notifications
You must be signed in to change notification settings - Fork 73
Issue 370 - Clearing filtering_settings
clears the by-column filter UI
#372
Conversation
- update column filter validation / logic to handle empty query
}} | ||
>Clear Filter</button>); | ||
} | ||
} |
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.
For this new case, need an additional button to trigger the filter reset -- either that or make this a full on e2e test, which I think is pointless.
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.
Mode based conditional additional comps
{...this.state.tableProps} | ||
/>); | ||
return (<div> | ||
{this.renderMode()} |
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.
Conditionals added with the table
export const BasicModes = [ | ||
...ReadWriteModes, | ||
AppMode.ReadOnly | ||
]; |
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.
Each time we added a mode we were running the standalone tests against an additional mode. In most cases, we want a new mode to test specific aspects of the table not all cases.
}); | ||
} | ||
} | ||
|
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.
The input needs to update its internal state when the value/prop updates. That prevented the UI from updating to match the filter.
false; | ||
return this.tree && this.tree.lexeme && this.tree.lexeme.evaluate ? | ||
this.tree.lexeme.evaluate(target, this.tree) : | ||
true; |
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 valid null tree (no query string) now evaluates to true (the target matches the criteria)
@@ -64,6 +64,10 @@ export default (lexerResult: ILexerResult): ISyntaxerResult => { | |||
return { valid: false, error: `lexer -- ${lexerResult.error}` }; | |||
} | |||
|
|||
if (lexerResult.lexemes.length === 0) { | |||
return { valid: true }; | |||
} |
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.
Having no query string is now a valid / null tree case instead of an invalid case
}); | ||
} | ||
} | ||
|
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.
This was dead code -- dating back to before the IsolatedInput was added - nothing depends on the state here, removing.
if (!tree) { | ||
this.ops.clear(); | ||
return; | ||
} |
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.
When rebuilding the fragments, clear all fragments if there's no query
|
||
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.
Weird diff here but nothing changed
DashTable.getCellById(1, 'rows').should('not.exist'); | ||
DashTable.getCellById(0, 'ccc').within(() => cy.get('.dash-cell-value').should('have.html', cell_0)); | ||
DashTable.getCellById(1, 'ccc').within(() => cy.get('.dash-cell-value').should('have.html', cell_1)); | ||
}); |
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.
Apply a filter column by column, see that it's applied, clear it, see that it's not applied anymore!
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.
And make sure the fields are empty -- as per described issue
Need to do changelog! |
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.
Apologies for the delay reviewing, looks great! 💃
Fixes #370.
Relates to https://community.plot.ly/t/clearing-filters-in-a-datatable/19381/2
Two problems here: