Skip to content

[#3503412] Ensure drupalSettings is updated with current homepage and UI improvements

#3503412

This MR fixes a bug where before we were always fetching the current homepage from the staged update auto save endpoint. But once we publish the staged update, then refresh the page, then that endpoint will return a 404. 404s were also getting logged since we fetch that endpoint on page load and if there isn't a homepage set within XB yet then it would return a 404.

So instead the solution is to store the current homepage in drupalSettings. And now we also only fetch from the staged update auto-save endpoint ONLY if we know it exists! And we can check it exists by first checking the pending changes endpoint and if we see it contains a staged update for the homepage then we can request it from the staged update auto-save. If it there is no staged update for homepage then the current page will fall back to the drupalSettings value.

Also contains 2 minor UI improvements: better icon and page name alignment in the top bar navigation for the page list and also use the home icon if the page a user is currently on is set as the homepage.

Edit: Will do below in a follow-up.

Remaining todos:

  • Update to use home icon in the Review changes window
  • Add cypress test
Edited by Harumi Jang

Merge request reports

Loading