Refactor toast pattern into behaviour
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:
- Admin -> Topics -> Merge
- (create 2 topics, click Merge at top of page and merge one into the other)
- 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)
- Project -> Wiki (add/edit/delete page)
- 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)
- 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.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #419999 (closed)
Edited by Elwyn Benson