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

Datahub: Allow to set a feature limit for WFS #1085

Merged
merged 15 commits into from
Jan 27, 2025
Merged

Datahub: Allow to set a feature limit for WFS #1085

merged 15 commits into from
Jan 27, 2025

Conversation

tkohr
Copy link
Collaborator

@tkohr tkohr commented Jan 22, 2025

Description

This PR introduces a new max_feature_count configuration. This allows to set a limit of WFS features to be displayed on the map, table and chart preview. If a number is set here and a WFS resource exceeds it, the

  • map: will list the WFS in the available layers, but not try to load it and show a warning if it's selected
  • table: will not be displayed and show a warning instead
  • chart: will not be displayed and show a warning instead

The goal of the PR is to improve performance and display consistent results on big datasets, where the backend might only respond with a limited number of features.

To-dos for this PR:

  • add config param to doc
  • tests

To-do for a separate PR:

  • introduce pagination for table data

Architectural changes

The PR has refactored the record-metadata.component and extracted relevant code for the preview section into a record-data-preview.component.

Screenshots

image

image

Quality Assurance Checklist

  • Commit history is devoid of any merge commits and readable to facilitate reviews
  • If new logic ⚙️ is introduced: unit tests were added
  • If new user stories 🤏 are introduced: E2E tests were added
  • If new UI components 🕹️ are introduced: corresponding stories in Storybook were created
  • If breaking changes 🪚 are introduced: add the breaking change label
  • If bugs 🐞 are fixed: add the backport <release branch> label
  • The documentation website 📚 has received the love it deserves

Copy link
Contributor

github-actions bot commented Jan 22, 2025

Affected libs: feature-dataviz,
Affected apps: datahub,

  • 🚀 Build and deploy storybook and demo on GitHub Pages
  • 📦 Build and push affected docker images

Copy link
Contributor

github-actions bot commented Jan 22, 2025

📷 Screenshots are here!

@tkohr tkohr force-pushed the wfs-dataset-limit branch from f0d8182 to 07f3745 Compare January 22, 2025 16:01
@tkohr tkohr marked this pull request as ready for review January 23, 2025 15:49
@tkohr tkohr force-pushed the wfs-dataset-limit branch from ddbd47b to cbb883b Compare January 24, 2025 08:35
@tkohr tkohr force-pushed the wfs-dataset-limit branch from cbb883b to cf7697b Compare January 24, 2025 10:49
@coveralls
Copy link

coveralls commented Jan 24, 2025

Coverage Status

coverage: 85.592% (+1.4%) from 84.193%
when pulling c8bb819 on wfs-dataset-limit
into 435a18a on main.

Copy link
Collaborator

@jahow jahow 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! After testing this I was surprised to not see the WFS appear in the sources dropdown for the map preview.

image

I expected the WFS link to show up in the dropdown but when selecting it, that a warning appear telling me there's too many objects (like for chart and table).

and do not try to load it if excludeWfs is true
@tkohr
Copy link
Collaborator Author

tkohr commented Jan 24, 2025

Thank you! After testing this I was surprised to not see the WFS appear in the sources dropdown for the map preview.

I expected the WFS link to show up in the dropdown but when selecting it, that a warning appear telling me there's too many objects (like for chart and table).

Thanks for the review @jahow! You're right, that's what we said in the ticket. I've adapted the code accordingly.

Copy link
Collaborator

@jahow jahow left a comment

Choose a reason for hiding this comment

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

Looks and works well! Please take a look at my comments, there seems to be an issue with the i18n:extract task... we can fix that in another PR but you should at least make sure we're not losing any translation when mrging this PR. Thank you!

translations/en.json Outdated Show resolved Hide resolved
@tkohr tkohr force-pushed the wfs-dataset-limit branch from 0231621 to c8bb819 Compare January 27, 2025 16:17
@tkohr tkohr merged commit 8d1c028 into main Jan 27, 2025
14 checks passed
@tkohr tkohr deleted the wfs-dataset-limit branch January 27, 2025 16:34
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.

3 participants