Skip to content

Embed metrics undefined param fix

Tristan Read requested to merge tr-param-undefined-fix into master

What does this MR do?

Fixes a bug where a metrics dashboard clipboard link param could be undefined some of the time.

To reproduce:

  1. Set the following feature flag:
    • environment_metrics_show_multiple_dashboards = false
  2. Navigate to the metrics dashboard.
  3. Open the dropdown next to a chart.
  4. Select 'Generate link to chart' button.
  5. Inspect the clipboard.
Before fix After fix
http://localhost:3001/root/my-project/environments/1/metrics?group=Kubernetes&title=CPU%20usage&y_label=CPU&dashboard=undefined http://localhost:3001/root/my-project/environments/1/metrics?group=Kubernetes&title=CPU%20usage&y_label=CPU

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66177

Does this MR meet the acceptance criteria?

Conformity

Performance and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team
Edited by Clement Ho

Merge request reports