Commit 9ea66f8d authored by Matthew Smith's avatar Matthew Smith
Browse files

Fix bug in view for dashboard json configs without variables key at all

parent 3761c422
Pipeline #1256 failed with stages
in 6 minutes and 11 seconds
......@@ -465,13 +465,15 @@ export function linkHelper(element, ele, dashboard){
target = 'blank';
}
for (const [key, property] of Object.entries(dashboard.variables)) {
if (element.options.hasOwnProperty('linkURL') && element.options.linkURL.includes(`~${key}~`)) {
let reg = new RegExp('~(' + key + ')~', 'g');
link = link.replaceAll(reg, encodeURIComponent(property));
if (dashboard.hasOwnProperty('variables')) {
for (const [key, property] of Object.entries(dashboard.variables)) {
if (element.options.hasOwnProperty('linkURL') && element.options.linkURL.includes(`~${key}~`)) {
let reg = new RegExp('~(' + key + ')~', 'g');
link = link.replaceAll(reg, encodeURIComponent(property));
}
}
}
if (element.options.linkURL && element.type === 'static-text') {
if (element.options.linkURL.includes('http') ) {
ele = <a id="text-link" href={link} target={target}>{ele}</a>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment