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

URL-oriented improvements #117

Merged
merged 3 commits into from
Jul 30, 2024
Merged

URL-oriented improvements #117

merged 3 commits into from
Jul 30, 2024

Conversation

Kreyu
Copy link
Owner

@Kreyu Kreyu commented Jul 29, 2024

What's changed?

  1. introduces url_query_parameters variable for the DataTableView
  2. replaces persistence Stimulus controller with new state controller

New variable

The base DataTableType class is adding filtration, pagination and sorting parameters to this variable inside its buildView method. This way we can reuse those parameters, and each data table type can even modify this array even further.

This variable is used in two ways:

  1. appends them to the URL via JavaScript, so the link is always easily shareable, as you can just copy paste it;
  2. merges them in links of the pagination controls, sorting header columns and filter clearing buttons;

New state controller

Name is TBD, but it simply merges the url_query_parameters of the data table with the current URLSearchParams on connect.


This will fix the issue described in the #107 and improve the overall experience by making the URLs shareable.

Copy link

Deploying data-table-bundle with  Cloudflare Pages  Cloudflare Pages

Latest commit: cb95bce
Status: ✅  Deploy successful!
Preview URL: https://026b077b.data-table-bundle.pages.dev
Branch Preview URL: https://feature-url-oriented-improve.data-table-bundle.pages.dev

View logs

@Kreyu Kreyu merged commit 7cadde7 into main Jul 30, 2024
16 checks passed
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.

1 participant