Fix Grafana chart label templates
What does this MR do?
In some parts of the app we render chart labels that are sourced from Grafana. These labels may contain templates in Moustache style format.
Previously the underscore template
function was used to replace these. Unfortunately it does not handle hyphenated variables well: https://stackoverflow.com/questions/16971282/backbone-underscore-template-not-working-dash-in-variable-name.
This MR fixes the issue by removing underscore and replacing with native JS.
Issue: #31376 (closed)
Does this MR meet the acceptance criteria?
Conformity
- [n/a] Changelog entry feature still behind feature flag
- [n/a] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [n/a] Database guides
- [n/a] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers
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:
- [n/a] Label as security and @ mention
@gitlab-com/gl-security/appsec
- [n/a] The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
- [n/a] Security reports checked/validated by a reviewer from the AppSec team
Edited by Tristan Read