Skip to content

Commit

Permalink
re-render alerts table on comment setting update (#1085) (#1087)
Browse files Browse the repository at this point in the history
(cherry picked from commit 98fa437)

Signed-off-by: Amardeepsingh Siglani <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 84722bc commit 3edb13d
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 3edb13d

Please sign in to comment.