Skip to content

Commit

Permalink
re-render alerts table on comment setting update (opensearch-project#…
Browse files Browse the repository at this point in the history
…1085)

Signed-off-by: Amardeepsingh Siglani <[email protected]>
Signed-off-by: AWSHurneyt <[email protected]>
  • Loading branch information
amsiglan authored and AWSHurneyt committed Sep 19, 2024
1 parent 2cc8984 commit fe6d94b
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default class AlertsDashboardFlyoutComponent extends Component {
});
}

componentDidUpdate(prevProps, prevState) {
componentDidUpdate(_prevProps, prevState) {
const prevQuery = getQueryObjectFromState(prevState);
const currQuery = getQueryObjectFromState(this.state);
if (!_.isEqual(prevQuery, currQuery)) {
Expand All @@ -146,10 +146,11 @@ export default class AlertsDashboardFlyoutComponent extends Component {
monitorIds
);
}
const { monitorType } = this.state;
const { monitorType, commentsEnabled, tabId } = this.state;
if (
[MONITOR_TYPE.DOC_LEVEL, MONITOR_TYPE.COMPOSITE_LEVEL].includes(monitorType) &&
!_.isEqual(prevState.selectedItems, this.state.selectedItems)
([MONITOR_TYPE.DOC_LEVEL, MONITOR_TYPE.COMPOSITE_LEVEL].includes(monitorType) &&
!_.isEqual(prevState.selectedItems, this.state.selectedItems)) ||
(tabId === TABLE_TAB_IDS.ALERTS.id && commentsEnabled !== prevState.commentsEnabled)
)
this.setState({ tabContent: this.renderAlertsTable() });
}
Expand Down

0 comments on commit fe6d94b

Please sign in to comment.