@zeniai/client-epic-state 5.1.88-betaRD6 → 5.1.88-betaRD7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { from, of } from 'rxjs';
|
|
2
|
-
import { catchError, filter, mergeMap } from 'rxjs/operators';
|
|
2
|
+
import { catchError, filter, mergeMap, takeUntil } from 'rxjs/operators';
|
|
3
3
|
import { DEFAULT_DATE_FORMAT } from '../../../../commonStateTypes/fiscalYearHelpers/formatZeniDateFY';
|
|
4
4
|
import { toAbsoluteDay, toString } from '../../../../commonStateTypes/timePeriod';
|
|
5
5
|
import { updateAccruedJESchedules, updateAccruedJESchedulesDetails, updateJEOneTimeAccruals, updateJESchedules, updateJESchedulesDetails, } from '../../../../entity/jeSchedules/jeSchedulesReducer';
|
|
6
6
|
import { getCurrentTenant } from '../../../../entity/tenant/tenantSelector';
|
|
7
7
|
import { createZeniAPIStatus, isSuccessResponse, } from '../../../../responsePayload';
|
|
8
|
+
import { clearAll } from '../../../../rootActions';
|
|
8
9
|
import { date } from '../../../../zeniDayJS';
|
|
9
10
|
import { fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesSuccess, initializeJeScheduleLocalData, } from '../../reducers/jeSchedulesViewReducer';
|
|
10
11
|
export const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe(filter(fetchJeSchedules.match), mergeMap((action) => {
|
|
@@ -77,5 +78,9 @@ export const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe
|
|
|
77
78
|
JSON.stringify(error)),
|
|
78
79
|
selectedPeriod,
|
|
79
80
|
selectedPageTab,
|
|
80
|
-
})))
|
|
81
|
+
}))),
|
|
82
|
+
// A tenant switch clears the store while this request is still in flight. Without this
|
|
83
|
+
// the old tenant's rows are written back into the freshly cleared store and stay on
|
|
84
|
+
// screen under the new tenant until a manual refresh.
|
|
85
|
+
takeUntil(actions$.pipe(filter(clearAll.match))));
|
|
81
86
|
}));
|
|
@@ -2,7 +2,8 @@ import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { updateAccruedJESchedules, updateAccruedJESchedulesDetails, updateJEOneTimeAccruals, updateJESchedules, updateJESchedulesDetails } from '../../../../entity/jeSchedules/jeSchedulesReducer';
|
|
4
4
|
import { RootState } from '../../../../reducer';
|
|
5
|
+
import { clearAll } from '../../../../rootActions';
|
|
5
6
|
import { ZeniAPI } from '../../../../zeniAPI';
|
|
6
7
|
import { fetchJeSchedules, fetchJeSchedulesFailure, fetchJeSchedulesSuccess, initializeJeScheduleLocalData } from '../../reducers/jeSchedulesViewReducer';
|
|
7
|
-
export type ActionType = ReturnType<typeof fetchJeSchedules> | ReturnType<typeof fetchJeSchedulesFailure> | ReturnType<typeof fetchJeSchedulesSuccess> | ReturnType<typeof initializeJeScheduleLocalData> | ReturnType<typeof updateAccruedJESchedules> | ReturnType<typeof updateAccruedJESchedulesDetails> | ReturnType<typeof updateJEOneTimeAccruals> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails>;
|
|
8
|
+
export type ActionType = ReturnType<typeof clearAll> | ReturnType<typeof fetchJeSchedules> | ReturnType<typeof fetchJeSchedulesFailure> | ReturnType<typeof fetchJeSchedulesSuccess> | ReturnType<typeof initializeJeScheduleLocalData> | ReturnType<typeof updateAccruedJESchedules> | ReturnType<typeof updateAccruedJESchedulesDetails> | ReturnType<typeof updateJEOneTimeAccruals> | ReturnType<typeof updateJESchedules> | ReturnType<typeof updateJESchedulesDetails>;
|
|
8
9
|
export declare const fetchJeSchedulesEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -8,6 +8,7 @@ const timePeriod_1 = require("../../../../commonStateTypes/timePeriod");
|
|
|
8
8
|
const jeSchedulesReducer_1 = require("../../../../entity/jeSchedules/jeSchedulesReducer");
|
|
9
9
|
const tenantSelector_1 = require("../../../../entity/tenant/tenantSelector");
|
|
10
10
|
const responsePayload_1 = require("../../../../responsePayload");
|
|
11
|
+
const rootActions_1 = require("../../../../rootActions");
|
|
11
12
|
const zeniDayJS_1 = require("../../../../zeniDayJS");
|
|
12
13
|
const jeSchedulesViewReducer_1 = require("../../reducers/jeSchedulesViewReducer");
|
|
13
14
|
const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(jeSchedulesViewReducer_1.fetchJeSchedules.match), (0, operators_1.mergeMap)((action) => {
|
|
@@ -80,6 +81,10 @@ const fetchJeSchedulesEpic = (actions$, state$, zeniAPI) => actions$.pipe((0, op
|
|
|
80
81
|
JSON.stringify(error)),
|
|
81
82
|
selectedPeriod,
|
|
82
83
|
selectedPageTab,
|
|
83
|
-
})))
|
|
84
|
+
}))),
|
|
85
|
+
// A tenant switch clears the store while this request is still in flight. Without this
|
|
86
|
+
// the old tenant's rows are written back into the freshly cleared store and stay on
|
|
87
|
+
// screen under the new tenant until a manual refresh.
|
|
88
|
+
(0, operators_1.takeUntil)(actions$.pipe((0, operators_1.filter)(rootActions_1.clearAll.match))));
|
|
84
89
|
}));
|
|
85
90
|
exports.fetchJeSchedulesEpic = fetchJeSchedulesEpic;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.88-
|
|
3
|
+
"version": "5.1.88-betaRD7",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|