-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AJ-1953 Allow filtering columns for WDS #5024
base: dev
Are you sure you want to change the base?
Conversation
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.
one comment inline about filter terms containing spaces, else looks good to me! I tried running it locally and it was working for me.
@@ -176,7 +177,7 @@ export class WdsDataTableProvider implements DataTableProvider { | |||
supportsAttributeClearing: false, | |||
supportsExport: false, | |||
supportsPointCorrection: false, | |||
supportsFiltering: false, | |||
supportsFiltering: this.isCapabilityEnabled('search.filter.query.column.exact'), // TODO: check if we care about search.filter.query and/or search.filter.ids instead/as well |
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.
search.filter.query.column.exact
is the right capability to check … and in hindsight, I regret adding that capability before it was supported for all datatypes; my bad on that!
protected transformQuery = (query: string): string => { | ||
const specialCharactersRegex = /([+\-&|!(){}[\]^"~*?:\\])/g; | ||
return query.replace(specialCharactersRegex, '\\$1').replace('=', ':'); | ||
}; |
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 filter term containing spaces also causes query-parsing problems. That is solvable by double-quoting the entire search term … but then I fear that some of the escaping will be interpreted literally instead of as an escape sequence - we'll have to give it a try.
And, if there are backend changes we need to support the front end, let's do that!
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.
Ok I think including whitespace in the characters to escape works, with the exception of return lines (\n
) not working if copied from the UI - I can see that the value returned from the database "test\nFoo\nBar", in the UI it looks like a space instead of a return, unless you inspect the element and can see the words on different lines - but if you then copy that value and search for it, nothing is returned - although there's at least no error. Not sure if this is a problem with the copy or what.
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.
thank you!
5cbfbd4
to
1370a32
Compare
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.
ty!
Quality Gate passedIssues Measures |
Jira Ticket: https://broadworkbench.atlassian.net/browse/AJ-1953
Allows exact match filtering for WDS data tables if the feature is supported. Requires massaging the filter into the correct format for WDS.
Note that we should upgrade WDS apps to 0.18.0 before releasing this PR.