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

Tabulator 'Set' Headerfilter - no data from distinct query #1237

Merged

Conversation

AlexanderGeere
Copy link
Contributor

@AlexanderGeere AlexanderGeere commented Apr 29, 2024

What

Using the set headerfilter and distinct in the headerFilterParams would create an error, as the dropdown would attempt to iterate an empty list .

This PR should correct that by making a dropdown that has a no data message.

Test Space

bugs_testing/dataviews_filter/workspace.json


@dbauszus-glx
Copy link
Member

@AlexanderGeere can you add this to the tabulator plugin? ui.utils.tabulator will be removed from the mapp library as soon as the plugin is reviewed.

@AlexanderGeere
Copy link
Contributor Author

@dbauszus-glx Will do.

Changed it slightly so the dropdown works but just says no options.

Copy link
Contributor

@simon-leech simon-leech left a comment

Choose a reason for hiding this comment

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

All working well for me 👍

@dbauszus-glx dbauszus-glx self-requested a review April 30, 2024 10:43
Copy link
Member

@dbauszus-glx dbauszus-glx left a comment

Choose a reason for hiding this comment

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

The method should not be dependent on the distinct flag but whether an options array is provided.

See filters for reference. https://github.com/GEOLYTIX/xyz/blob/main/lib/ui/layers/filters.mjs

If an array of options is defined than this should be used. If not, a query should be attempted to populate the options for the filter.

Copy link

sonarcloud bot commented May 2, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@AlexanderGeere AlexanderGeere changed the title Tabulaor 'Set' Headerfilter - no data from distinct query Tabulator 'Set' Headerfilter - no data from distinct query May 2, 2024
@AlexanderGeere
Copy link
Contributor Author

@dbauszus-glx It now checks whether options exists or has a length of 0 and then does the distinct query.

@dbauszus-glx dbauszus-glx merged commit 2ca5aa9 into GEOLYTIX:main May 2, 2024
5 checks passed
@RobAndrewHurst RobAndrewHurst added the Bug A genuine bug. There must be some form of error exception to work with. label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A genuine bug. There must be some form of error exception to work with.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants