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

history.js: Properly handle data attributes upon navigation #4752

Merged
merged 1 commit into from
Jun 14, 2022

Conversation

nilmerg
Copy link
Member

@nilmerg nilmerg commented Apr 21, 2022

This is required so that attributes like data-icinga-container-id are properly managed if the user navigates using the history buttons. Previously these were not managed at all as applyLocationBar didn't made use of ui.js' capabilities to paste/cut/move contents.

I've rewritten applyLocationBar basically. It now also just moves a column if only the location has changed, not the url.

I will add a comment with test-cases the next days.

@nilmerg nilmerg added enhancement New feature or improvement area/javascript Affects the javascript framework labels Apr 21, 2022
@nilmerg nilmerg self-assigned this Apr 21, 2022
@cla-bot cla-bot bot added the cla/signed label Apr 21, 2022
I've rewritten `applyLocationBar` basically. It now also just
moves a column if only the location has changed, not the url.
@nilmerg nilmerg force-pushed the fix/data-attr-persistence-on-history-change branch from ea45933 to 0fb0b8d Compare April 22, 2022 08:47
nilmerg added a commit that referenced this pull request Apr 25, 2022
@nilmerg nilmerg added this to the 2.11.0 milestone Jun 14, 2022
@nilmerg
Copy link
Member Author

nilmerg commented Jun 14, 2022

landing page tests

✔️ redirect to login, col2 state must be preserved and shown after login
✔️ already logged in, only col2 state must be loaded, col1 must be left alone

navigation tests

✔️ on the dashboard, click on three menu items in a row, navigate back three times and check if the order is the same but reversed and the result is the dashboard again

✔️ on the dashboard, directly go to the hosts list and choose a host, navigate back two times and notice the following:

  1. the right column closes, the left column is left alone
  2. the left column is replaced

✔️ Repeat the same test again, but by navigating forward and notice the following:

  1. the left column is replaced
  2. the right column is opened

✔️ Stay on the host detail and click on the services tab, navigate back and notice:

  1. the left column is replaced

✔️ Now click on the services tab again and choose one, navigate back two times and notice:

  1. the left column moves to the right, the left column is loaded
  2. the right colum is replaced

✔️ Navigate forward two times now and notice:

  1. the left column is replaced by the services tab
  2. the right column moves to the left and the service appears in the left column

@nilmerg nilmerg marked this pull request as ready for review June 14, 2022 14:14
@nilmerg nilmerg merged commit 96460a2 into master Jun 14, 2022
@nilmerg nilmerg deleted the fix/data-attr-persistence-on-history-change branch June 14, 2022 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/javascript Affects the javascript framework cla/signed enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant