Skip to content

Extend `createAlert` utility to easily support links in the message

Elwyn Benson requested to merge 425228-createalert-with-links into master

What does this MR do and why?

Extends the createAlert utility function to allow passing an optional links object as a parameter. This is then be used with gl-sprintf and gl-link to render links as part of the given message. Also support passing a props object for the GlLink instead of a URL string, so that things like target="_blank" can be set.

This utility function is then used within the Analytics Dashboard component, replacing the inline alert component.

Note that product analytics is an experimental feature behind a default-off feature flag.

Screenshots or screen recordings

No visual difference.

How to set up and validate locally

  1. Follow these instructions to setup Product Analytics in GDK.
  2. Onboard Product Analytics by setting up the feature at Project > Analytics > Analytics dashboards.
  3. View the dashboard listing at Project > Analytics > Analytics dashboards.
  4. Disable your network within devtools to simulate a network error
  5. Click on a dashboard in the list to load it
  6. Verify that the dashboard displays a new top level error message

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 #425228 (closed)

Edited by Elwyn Benson

Merge request reports