-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix alert groups automatic refresh #4463
Conversation
@@ -48,7 +48,7 @@ interface RemoteFiltersProps extends WithStoreProps { | |||
grafanaTeamStore: GrafanaTeamStore; | |||
skipFilterOptionFn?: (filterOption: FilterOption) => boolean; | |||
} | |||
interface RemoteFiltersState { | |||
export interface RemoteFiltersState { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exporting these to have the typing needed in Incidents for now. This might need some additional work as we're missing a lot of typescript on the filters, but it's out of scope for this PR.
static async updateBulkActionAndRefresh( | ||
data: ApiSchemas['AlertGroupBulkActionRequest'], | ||
alertGroupStore: AlertGroupStore, | ||
onFinally?: () => void |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This made more sense to be here rather than in the component, it also accepts AutoLoadingState
@@ -79,7 +79,7 @@ export class AlertGroupStore { | |||
const newAlerts = new Map( | |||
results.map((alert: ApiSchemas['AlertGroup']) => { | |||
const oldAlert = this.alerts.get(alert.pk) || {}; | |||
const mergedAlertData = { ...oldAlert, ...alert, undoAction: alert.undoAction }; | |||
const mergedAlertData = { ...oldAlert, ...alert }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the undoAction
, it didn't seem to help in any way 🤔
this.setLiveUpdatesPaused(true); | ||
await actionToMethodMap[action](id, delay); | ||
} finally { | ||
this.setLiveUpdatesPaused(false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Centralizing these 2 calls here rather than in each method
const hasSelected = selectedIncidentIds.length > 0; | ||
const isLoading = LoaderHelper.isLoading(store.loaderStore, ActionKey.FETCH_INCIDENTS); | ||
const hasInvalidatedAlert = Boolean( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this didn't add any value whatsoever, due to this we were showing "Out of date results" which didn't make sense as we didn't invalidate any data whatsoever
Can we refetch stats whenever alert status is updated (either with bulk or single update)? Right now user needs to wait for the next polling tick: Screen.Recording.2024-06-05.at.14.24.16.mov |
# What this PR does - Fixes AG auto-refresh (every 15s) - Reflect correct data on the UI after doing a bulk update - Few tweaks regarding UX around bulk updates/loading - Added some missing typescript support ## Which issue(s) this PR closes Closes #4454
What this PR does
Which issue(s) this PR closes
Closes #4454