Skip to content

Commit

Permalink
Merge pull request #416 from PagerDuty/issue-415
Browse files Browse the repository at this point in the history
  • Loading branch information
gsreynolds authored Mar 1, 2024
2 parents 43ec762 + 59fdcbe commit 72fa1f6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
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

0 comments on commit 72fa1f6

Please sign in to comment.