mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[Lens] only reload embeddable when a new message was actually added (#149424)
This commit is contained in:
parent
4c9a76cabd
commit
ed51f0f1ef
1 changed files with 10 additions and 11 deletions
|
@ -552,10 +552,9 @@ export class Embeddable
|
|||
|
||||
if (addedMessageIds.length) {
|
||||
this.additionalUserMessages = newMessageMap;
|
||||
this.renderBadgeMessages();
|
||||
}
|
||||
|
||||
this.reload();
|
||||
|
||||
return () => {
|
||||
const withMessagesRemoved = {
|
||||
...this.additionalUserMessages,
|
||||
|
@ -712,15 +711,11 @@ export class Embeddable
|
|||
|
||||
const newActiveData = adapters?.tables?.tables;
|
||||
|
||||
if (!fastIsEqual(this.activeData, newActiveData)) {
|
||||
// we check equality because this.addUserMessage triggers a render, so we get an infinite loop
|
||||
// if we just execute without checking if the data has changed
|
||||
this.removeActiveDataWarningMessages();
|
||||
const searchWarningMessages = this.getSearchWarningMessages(adapters);
|
||||
this.removeActiveDataWarningMessages = this.addUserMessages(
|
||||
searchWarningMessages.filter(isMessageRemovable)
|
||||
);
|
||||
}
|
||||
this.removeActiveDataWarningMessages();
|
||||
const searchWarningMessages = this.getSearchWarningMessages(adapters);
|
||||
this.removeActiveDataWarningMessages = this.addUserMessages(
|
||||
searchWarningMessages.filter(isMessageRemovable)
|
||||
);
|
||||
|
||||
this.activeData = newActiveData;
|
||||
};
|
||||
|
@ -880,6 +875,10 @@ export class Embeddable
|
|||
domNode
|
||||
);
|
||||
|
||||
this.renderBadgeMessages();
|
||||
}
|
||||
|
||||
private renderBadgeMessages() {
|
||||
const warningsToDisplay = this.getUserMessages('embeddableBadge', {
|
||||
severity: 'warning',
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue