@zeniai/client-epic-state 4.20.3-betaVR3 → 4.20.3-betaVR5
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.
- package/lib/epic.d.ts +1 -1
- package/lib/epic.js +2 -2
- package/lib/esm/epic.js +2 -2
- package/lib/esm/index.js +2 -2
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +99 -0
- package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +8 -0
- package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +14 -1
- package/lib/index.d.ts +2 -2
- package/lib/index.js +34 -32
- package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.d.ts +18 -0
- package/lib/view/expenseAutomationView/epics/missingReceipts/restoreBulkUploadAutomatchingOnMountEpic.js +103 -0
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +4 -0
- package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +9 -0
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +7 -1
- package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +15 -2
- package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +2 -0
- package/package.json +1 -1
- package/lib/esm/view/expenseAutomationView/epics/missingReceipts/restoreAutomatchingOnBatchListLoadEpic.js +0 -33
- package/lib/view/expenseAutomationView/epics/missingReceipts/restoreAutomatchingOnBatchListLoadEpic.d.ts +0 -11
- package/lib/view/expenseAutomationView/epics/missingReceipts/restoreAutomatchingOnBatchListLoadEpic.js +0 -37
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.20.3-
|
|
3
|
+
"version": "4.20.3-betaVR5",
|
|
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",
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { EMPTY, of } from 'rxjs';
|
|
2
|
-
import { filter, mergeMap } from 'rxjs/operators';
|
|
3
|
-
import { fetchBulkUploadBatchesSuccess, restoreBulkUploadMatchingState, } from '../../reducers/missingReceiptsViewReducer';
|
|
4
|
-
/**
|
|
5
|
-
* After the batch list loads, check if any batch is still processing and belongs to the
|
|
6
|
-
* logged-in user. If so, restore the matching phase so the banner, polling, and Pusher
|
|
7
|
-
* subscription resume — covering hard refresh, page revisit, and navigation-away-and-back.
|
|
8
|
-
*/
|
|
9
|
-
export const restoreAutomatchingOnBatchListLoadEpic = (actions$, state$) => actions$.pipe(filter(fetchBulkUploadBatchesSuccess.match), mergeMap((action) => {
|
|
10
|
-
const state = state$.value;
|
|
11
|
-
const { bulkUpload } = state.expenseAutomationMissingReceiptsViewState;
|
|
12
|
-
if (bulkUpload.phase !== 'idle') {
|
|
13
|
-
return EMPTY;
|
|
14
|
-
}
|
|
15
|
-
const loggedInUserId = state.tenantState.loggedInUser?.userId;
|
|
16
|
-
const processingBatch = action.payload.batchList.find((b) => {
|
|
17
|
-
const status = b.status.toLowerCase();
|
|
18
|
-
if (status !== 'processing' && status !== 'pending') {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
if (loggedInUserId != null && b.userId !== loggedInUserId) {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
return true;
|
|
25
|
-
});
|
|
26
|
-
if (processingBatch == null) {
|
|
27
|
-
return EMPTY;
|
|
28
|
-
}
|
|
29
|
-
return of(restoreBulkUploadMatchingState({
|
|
30
|
-
batchId: processingBatch.batchId,
|
|
31
|
-
totalFiles: processingBatch.totalFiles,
|
|
32
|
-
}));
|
|
33
|
-
}));
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { RootState } from '../../../../reducer';
|
|
4
|
-
import { fetchBulkUploadBatchesSuccess, restoreBulkUploadMatchingState } from '../../reducers/missingReceiptsViewReducer';
|
|
5
|
-
export type ActionType = ReturnType<typeof fetchBulkUploadBatchesSuccess> | ReturnType<typeof restoreBulkUploadMatchingState>;
|
|
6
|
-
/**
|
|
7
|
-
* After the batch list loads, check if any batch is still processing and belongs to the
|
|
8
|
-
* logged-in user. If so, restore the matching phase so the banner, polling, and Pusher
|
|
9
|
-
* subscription resume — covering hard refresh, page revisit, and navigation-away-and-back.
|
|
10
|
-
*/
|
|
11
|
-
export declare const restoreAutomatchingOnBatchListLoadEpic: (actions$: ActionsObservable<ActionType>, state$: StateObservable<RootState>) => Observable<ActionType>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.restoreAutomatchingOnBatchListLoadEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const missingReceiptsViewReducer_1 = require("../../reducers/missingReceiptsViewReducer");
|
|
7
|
-
/**
|
|
8
|
-
* After the batch list loads, check if any batch is still processing and belongs to the
|
|
9
|
-
* logged-in user. If so, restore the matching phase so the banner, polling, and Pusher
|
|
10
|
-
* subscription resume — covering hard refresh, page revisit, and navigation-away-and-back.
|
|
11
|
-
*/
|
|
12
|
-
const restoreAutomatchingOnBatchListLoadEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(missingReceiptsViewReducer_1.fetchBulkUploadBatchesSuccess.match), (0, operators_1.mergeMap)((action) => {
|
|
13
|
-
const state = state$.value;
|
|
14
|
-
const { bulkUpload } = state.expenseAutomationMissingReceiptsViewState;
|
|
15
|
-
if (bulkUpload.phase !== 'idle') {
|
|
16
|
-
return rxjs_1.EMPTY;
|
|
17
|
-
}
|
|
18
|
-
const loggedInUserId = state.tenantState.loggedInUser?.userId;
|
|
19
|
-
const processingBatch = action.payload.batchList.find((b) => {
|
|
20
|
-
const status = b.status.toLowerCase();
|
|
21
|
-
if (status !== 'processing' && status !== 'pending') {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
if (loggedInUserId != null && b.userId !== loggedInUserId) {
|
|
25
|
-
return false;
|
|
26
|
-
}
|
|
27
|
-
return true;
|
|
28
|
-
});
|
|
29
|
-
if (processingBatch == null) {
|
|
30
|
-
return rxjs_1.EMPTY;
|
|
31
|
-
}
|
|
32
|
-
return (0, rxjs_1.of)((0, missingReceiptsViewReducer_1.restoreBulkUploadMatchingState)({
|
|
33
|
-
batchId: processingBatch.batchId,
|
|
34
|
-
totalFiles: processingBatch.totalFiles,
|
|
35
|
-
}));
|
|
36
|
-
}));
|
|
37
|
-
exports.restoreAutomatchingOnBatchListLoadEpic = restoreAutomatchingOnBatchListLoadEpic;
|