Skip to content
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 Table continuously re-sorts when hovering over Num Alerts #416

Merged
merged 2 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cd-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
VITE_PD_SUBDOMAIN_ALLOW_LIST: '*'
VITE_PD_OAUTH_CLIENT_ID: ${{ secrets.PD_OAUTH_CLIENT_ID }}
VITE_PD_OAUTH_CLIENT_SECRET: ${{ secrets.PD_OAUTH_CLIENT_SECRET }}
VITE_PD_REQUIRED_ABILITY: ${{ secrets.PD_REQUIRED_ABILITY }}
VITE_PD_REQUIRED_ABILITY: 'teams'
VITE_DD_APPLICATION_ID: ${{ secrets.DD_APPLICATION_ID }}
VITE_DD_CLIENT_TOKEN: ${{ secrets.DD_CLIENT_TOKEN }}
VITE_DD_SITE: ${{ secrets.DD_SITE }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const NumAlertsComponent = ({
};
const getAlertsForIncidents = useCallback(
(ids) => {
dispatch(getAlertsForIncidentsAsyncConnected(ids));
dispatch(getAlertsForIncidentsAsyncConnected(ids, true));
},
[dispatch],
);
Expand Down
3 changes: 2 additions & 1 deletion src/redux/incidents/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ export const getIncidentsAsync = () => ({
type: FETCH_INCIDENTS_REQUESTED,
});

export const getAlertsForIncidentsAsync = (incidentIds) => ({
export const getAlertsForIncidentsAsync = (incidentIds, isRefetch = false) => ({
type: FETCH_ALERTS_FOR_INCIDENTS_REQUESTED,
incidentIds,
isRefetch,
});

export const getNotesForIncidentsAsync = (incidentIds) => ({
Expand Down
24 changes: 13 additions & 11 deletions src/redux/incidents/reducers.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,19 @@ const incidents = produce(
break;

case FETCH_ALERTS_FOR_INCIDENTS_REQUESTED:
draft.incidentAlerts = {
...draft.incidentAlerts,
// dict with keys as the strings of incident ids array and values as { status: 'fetching' }
...action.incidentIds.reduce((acc, incidentId) => {
// eslint-disable-next-line no-param-reassign
acc[incidentId] = {
status: 'fetching',
};
return acc;
}, {}),
};
if (!(action.isRefetch)) {
draft.incidentAlerts = {
...draft.incidentAlerts,
// dict with keys as the strings of incident ids array and values as { status: 'fetching' }
...action.incidentIds.reduce((acc, incidentId) => {
// eslint-disable-next-line no-param-reassign
acc[incidentId] = {
status: 'fetching',
};
return acc;
}, {}),
};
}
draft.status = FETCH_ALERTS_FOR_INCIDENTS_REQUESTED;
break;

Expand Down
Loading