Skip to content
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

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from
Open

Conversation

calypsomatic
Copy link
Contributor

@calypsomatic calypsomatic commented Aug 19, 2024

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.

@calypsomatic calypsomatic changed the title first pass filter for wds AJ-1953 Allow filtering columns for WDS Aug 20, 2024
@calypsomatic calypsomatic marked this pull request as ready for review August 20, 2024 14:19
@calypsomatic calypsomatic requested a review from a team as a code owner August 20, 2024 14:19
Copy link
Contributor

@davidangb davidangb left a 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
Copy link
Contributor

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('=', ':');
};
Copy link
Contributor

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!

Copy link
Contributor Author

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.

Copy link
Contributor

@davidangb davidangb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you!

Copy link
Contributor

@davidangb davidangb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ty!

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants