feature/IO-3026-Enhanced-Notifications - final revisions
Signed-off-by: Dave Richer <dave@imexsystems.ca>
This commit is contained in:
@@ -68,11 +68,6 @@ export const setUpdateAvailable = (isUpdateAvailable) => ({
|
||||
payload: isUpdateAvailable
|
||||
});
|
||||
|
||||
export const setAlerts = (alerts) => ({
|
||||
type: ApplicationActionTypes.SET_ALERTS,
|
||||
payload: alerts
|
||||
});
|
||||
|
||||
export const addAlerts = (alerts) => ({
|
||||
type: ApplicationActionTypes.ADD_ALERTS,
|
||||
payload: alerts
|
||||
|
||||
@@ -92,19 +92,11 @@ const applicationReducer = (state = INITIAL_STATE, action) => {
|
||||
case ApplicationActionTypes.SET_WSS_STATUS: {
|
||||
return { ...state, wssStatus: action.payload };
|
||||
}
|
||||
case ApplicationActionTypes.SET_ALERTS: {
|
||||
const alertsMap = {};
|
||||
action.payload.forEach((alert) => {
|
||||
alertsMap[alert.id] = alert;
|
||||
});
|
||||
return {
|
||||
...state,
|
||||
alerts: alertsMap
|
||||
};
|
||||
}
|
||||
|
||||
case ApplicationActionTypes.ADD_ALERTS: {
|
||||
const newAlertsMap = { ...state.alerts };
|
||||
action.payload.forEach((alert) => {
|
||||
|
||||
action.payload.alerts.forEach((alert) => {
|
||||
newAlertsMap[alert.id] = alert;
|
||||
});
|
||||
return {
|
||||
|
||||
@@ -14,7 +14,6 @@ const ApplicationActionTypes = {
|
||||
SET_PROBLEM_JOBS: "SET_PROBLEM_JOBS",
|
||||
SET_UPDATE_AVAILABLE: "SET_UPDATE_AVAILABLE",
|
||||
SET_WSS_STATUS: "SET_WSS_STATUS",
|
||||
SET_ALERTS: "SET_ALERTS",
|
||||
ADD_ALERTS: "ADD_ALERTS"
|
||||
};
|
||||
export default ApplicationActionTypes;
|
||||
|
||||
Reference in New Issue
Block a user