Fix error when opening problem details, #1357

This commit is contained in:
Alexander Zobnin
2022-01-27 13:56:51 +03:00
parent 0411c0a24c
commit edde2bdf33
5 changed files with 25 additions and 12 deletions

View File

@@ -267,7 +267,7 @@ export class TriggerPanelCtrl extends MetricsPanelCtrl {
addTagFilter(tag, datasource) {
for (const target of this.panel.targets) {
if (target.datasource === datasource || this.panel.datasource === datasource) {
if (target.datasource?.uid === datasource?.uid || target.datasource === datasource || this.panel.datasource === datasource) {
const tagFilter = target.tags.filter;
let targetTags = this.parseTags(tagFilter);
const newTag = { tag: tag.tag, value: tag.value };
@@ -283,7 +283,7 @@ export class TriggerPanelCtrl extends MetricsPanelCtrl {
removeTagFilter(tag, datasource) {
const matchTag = t => t.tag === tag.tag && t.value === tag.value;
for (const target of this.panel.targets) {
if (target.datasource === datasource || this.panel.datasource === datasource) {
if (target.datasource?.uid === datasource?.uid || target.datasource === datasource || this.panel.datasource === datasource) {
const tagFilter = target.tags.filter;
let targetTags = this.parseTags(tagFilter);
_.remove(targetTags, matchTag);