Skip to content

Refactor toast pattern into behaviour

Elwyn Benson requested to merge 419999-refactor-toast into master

What does this MR do and why?

Refactors the way we show global toast messages passed from the backend into a reusable behaviour.

Now each individual page bundle does not need to deal with importing the toast component, querying for messages in the DOM and showing them.

Async loading the toasts code as needed also reduces the initial page bundle size.

Screenshots or screen recordings

No visual changes.

How to set up and validate locally

Places pushing toasts with this mechanism:

  1. Admin -> Topics -> Merge
  • (create 2 topics, click Merge at top of page and merge one into the other)
  1. Admin -> Geo (this isn't working properly in my GDK so not fully tested :/ )
  • Nodes (create / update)
  • Projects (remove tracking entry, resync, resync-all, reverify, reverify-all)
  1. Project -> Wiki (add/edit/delete page)
  2. Project -> Settings -> Analytics -> Data Sources -> Product Analytics (make a change to a setting and hit save)
  • (you will need feature flags enabled as per these setup instructions, but should not need to run the full analytics devkit to test the settings page)
  1. Project -> Settings -> CI/CD
  • Runners -> Project runners - [...] - reset registration token
  • Also, when saving any general settings on this page

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #419999 (closed)

Edited by Elwyn Benson

Merge request reports