Graph: Fix annotation description not being shown on hover (#40581)

This commit is contained in:
Maria Alexandra 2021-10-19 11:41:24 +02:00 committed by GitHub
parent f4e78ea27b
commit 2ee0c73a8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,7 @@ export function annotationTooltipDirective(
let tooltip = '<div class="graph-annotation">';
let titleStateClass = '';
if (event.alertId !== undefined) {
if (event.alertId !== undefined && event.newState) {
const stateModel = alertDef.getStateDisplayModel(event.newState);
titleStateClass = stateModel.stateClass;
title = `<i class="${stateModel.iconClass}"></i> ${stateModel.text}`;
@ -50,7 +50,7 @@ export function annotationTooltipDirective(
}
let header = `<div class="graph-annotation__header">`;
if (event.login) {
if (event.login && event.avatarUrl) {
header += `<div class="graph-annotation__user" bs-tooltip="'Created by ${event.login}'"><img src="${event.avatarUrl}" /></div>`;
}
header += `