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

GridField. Create Unique URLs for Gridfield state. #1314

Closed
7 tasks done
sabina-talipova opened this issue Jun 30, 2022 · 2 comments
Closed
7 tasks done

GridField. Create Unique URLs for Gridfield state. #1314

sabina-talipova opened this issue Jun 30, 2022 · 2 comments

Comments

@sabina-talipova
Copy link
Contributor

sabina-talipova commented Jun 30, 2022

Description

At the moment, there are few issues with navigation in the GridField.

  • There is a problem with the "Back" button on the GridField child page in the header. When working with children of a filtered, sorted GridField, or when you are on a specific page, the back control button in the child's header navigates to the first page of an unfiltered, unsorted GridField.

  • There is also a problem that it is not possible to create a link to the results of a filtered and sorted GridField list, as well as use the "Back" / "Forward" button in the browser.

SPIKE

AC's

  • Keep all state in URL via an hash reference that maps to a state store either in the session or local storage.
  • URL keeps user's search / sort / pagination parameters.
  • Search parameters are stored either an hash mapping to a server side grid state or in session storage.
  • Optimise URL to keep long search parameters as well as work with many tabs with different GridFields.
  • When you perform an action in the gridfield, it updates the URL.
  • The browser history is hijacked so that the back/next button can be use to navigate your gridfield state.
  • Directly accessing a gridfield URL with a state hash restore hydrates that gridfield with that state for the user with a given session.

Notes

  • Need to validate if it's OK to change the URL on every state change and if changing the URL should affect the back button behaviour.
    • e.g.: If you change the sort order 15 times, should it create 15 entries in your history anh require you to click the back button 15 times to get back to your original state.

PR's

@sabina-talipova
Copy link
Contributor Author

How deep can a parent-child tree be? I mean how deep we can go down from parent to last grandchild?
Ex. Company > Department > Employee > ... > ... > ... > Month salary.
There is potential problem with URL length (2048 char.) and long Class names.
2. Does Silverstripe CMS have any functionality to cline up Session after some time or anyhow?
There is potential problem with performance if we will keep many elements in session and keep them to provide ability to navigate back / forward by using Browser's back / forward buttons.

@GuySartorelli
Copy link
Member

PRs merged, no outstanding tasks. Closing.

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

No branches or pull requests

3 participants