Skip to content

Commit

Permalink
re-render alerts table on comment setting update (#1085)
Browse files Browse the repository at this point in the history
Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
(cherry picked from commit 98fa437)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Sep 10, 2024
1 parent 84722bc commit 4979885
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 4979885

Please sign in to comment.