@zeniai/client-epic-state 5.0.85-betaAR1 → 5.0.85-betaAR2
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/entity/approvalRule/approvalRulePayload.d.ts +5 -34
- package/lib/entity/approvalRule/approvalRulePayload.js +10 -130
- package/lib/entity/approvalRule/approvalRuleSelector.d.ts +1 -25
- package/lib/entity/approvalRule/approvalRuleSelector.js +0 -40
- package/lib/entity/approvalRule/approvalRuleState.d.ts +7 -59
- package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
- package/lib/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/epic.d.ts +1 -3
- package/lib/epic.js +1 -3
- package/lib/esm/entity/approvalRule/approvalRulePayload.js +10 -130
- package/lib/esm/entity/approvalRule/approvalRuleSelector.js +0 -35
- package/lib/esm/entity/snackbar/snackbarTypes.js +0 -2
- package/lib/esm/epic.js +1 -3
- package/lib/esm/index.js +5 -7
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +12 -74
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +2 -10
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +4 -8
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +7 -11
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +4 -13
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +16 -122
- package/lib/esm/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -7
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +2 -10
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +2 -8
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +7 -11
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +4 -13
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +11 -63
- package/lib/index.d.ts +6 -8
- package/lib/index.js +16 -26
- package/lib/view/companyTaskManagerView/companyTaskManagerViewReducer.d.ts +2 -2
- package/lib/view/companyView/types/cockpitTypes.d.ts +1 -1
- package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
- package/lib/view/people/peopleTypes.d.ts +1 -1
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.d.ts +3 -14
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewReducer.js +13 -75
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/billPaySetupApproverViewState.d.ts +0 -8
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/deleteBillPayApprovalRuleEpic.js +2 -10
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/fetchBillPaySetupApproverViewEpic.js +4 -8
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/initializeBillPaySetupApproverViewUpdateDataEpic.js +6 -10
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/saveBillPaySetupApproverViewUpdatesEpic.js +3 -12
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.d.ts +1 -50
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonPayload.js +17 -124
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/types/commonState.d.ts +5 -31
- package/lib/view/spendManagement/billPay/editBillView/editBillViewSelector.js +2 -7
- package/lib/view/spendManagement/chargeCards/chargeCardList/chargeCardList.d.ts +1 -1
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/deleteRemiApprovalRuleEpic.js +2 -10
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/fetchRemiSetupApproverViewEpic.js +2 -8
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/initializeRemiSetupApproverViewUpdateDataEpic.js +6 -10
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/saveRemiSetupApproverViewUpdatesEpic.js +3 -12
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.d.ts +3 -14
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewReducer.js +12 -64
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/remiSetupApproverViewState.d.ts +0 -5
- package/lib/view/taskManager/taskListView/taskList.d.ts +3 -3
- package/package.json +1 -1
- package/lib/entity/approvalRule/approvalRuleConflict.d.ts +0 -56
- package/lib/entity/approvalRule/approvalRuleConflict.js +0 -77
- package/lib/esm/entity/approvalRule/approvalRuleConflict.js +0 -74
- package/lib/esm/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +0 -54
- package/lib/esm/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +0 -49
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.d.ts +0 -23
- package/lib/view/spendManagement/billPay/billPaySetupApproverView/epic/reorderBillPayApprovalRulesEpic.js +0 -58
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.d.ts +0 -14
- package/lib/view/spendManagement/reimbursement/remiSetupApproverView/epic/reorderRemiApprovalRulesEpic.js +0 -53
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reorderBillPayApprovalRulesEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const approvalRuleReducer_1 = require("../../../../../entity/approvalRule/approvalRuleReducer");
|
|
7
|
-
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
8
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
9
|
-
const billPaySetupApproverViewReducer_1 = require("../billPaySetupApproverViewReducer");
|
|
10
|
-
const reorderBillPayApprovalRulesEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(billPaySetupApproverViewReducer_1.reorderBillPayApprovalRules.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
-
const { approvalRuleIds, useV3 } = action.payload;
|
|
12
|
-
// Approval Rules 3.0 — flag-gated endpoint selection. Mirrors
|
|
13
|
-
// the pattern used by delete + fetch epics: the v3 dev host
|
|
14
|
-
// until the production base URL ships the v2 reorder route.
|
|
15
|
-
const endpoint = `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/bill-pay/approval-rules-v2/reorder`;
|
|
16
|
-
return zeniAPI
|
|
17
|
-
.putAndGetJSON(endpoint, {
|
|
18
|
-
rule_ids: approvalRuleIds,
|
|
19
|
-
})
|
|
20
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
21
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
22
|
-
const serverOrderedIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
|
|
23
|
-
const actions = [
|
|
24
|
-
(0, approvalRuleReducer_1.updateApprovalRules)(response.data.approval_rules),
|
|
25
|
-
(0, billPaySetupApproverViewReducer_1.reorderBillPayApprovalRulesSuccess)(serverOrderedIds),
|
|
26
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
27
|
-
messageSection: `bill_pay_approval_reorder`,
|
|
28
|
-
messageText: 'success',
|
|
29
|
-
type: 'success',
|
|
30
|
-
}),
|
|
31
|
-
];
|
|
32
|
-
return (0, rxjs_1.from)(actions);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
const recovery = [
|
|
36
|
-
(0, billPaySetupApproverViewReducer_1.reorderBillPayApprovalRulesFailure)(response.status),
|
|
37
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
38
|
-
messageSection: `bill_pay_approval_reorder`,
|
|
39
|
-
messageText: 'failed',
|
|
40
|
-
type: 'error',
|
|
41
|
-
}),
|
|
42
|
-
// Refetch to revert the optimistic order to server truth.
|
|
43
|
-
(0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true, true, useV3),
|
|
44
|
-
];
|
|
45
|
-
return (0, rxjs_1.from)(recovery);
|
|
46
|
-
}
|
|
47
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
48
|
-
(0, billPaySetupApproverViewReducer_1.reorderBillPayApprovalRulesFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Reorder Bill Pay Approval Rules errored out' +
|
|
49
|
-
JSON.stringify(error))),
|
|
50
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
51
|
-
messageSection: `bill_pay_approval_reorder`,
|
|
52
|
-
messageText: 'failed',
|
|
53
|
-
type: 'error',
|
|
54
|
-
}),
|
|
55
|
-
(0, billPaySetupApproverViewReducer_1.fetchBillPaySetupApproverView)(true, true, useV3),
|
|
56
|
-
])));
|
|
57
|
-
}));
|
|
58
|
-
exports.reorderBillPayApprovalRulesEpic = reorderBillPayApprovalRulesEpic;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ActionsObservable, StateObservable } from 'redux-observable';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { updateApprovalRules } from '../../../../../entity/approvalRule/approvalRuleReducer';
|
|
4
|
-
import { openSnackbar } from '../../../../../entity/snackbar/snackbarReducer';
|
|
5
|
-
import { RootState } from '../../../../../reducer';
|
|
6
|
-
import { ZeniAPI } from '../../../../../zeniAPI';
|
|
7
|
-
import { fetchRemiSetupApproverView, reorderRemiApprovalRules, reorderRemiApprovalRulesFailure, reorderRemiApprovalRulesSuccess } from '../remiSetupApproverViewReducer';
|
|
8
|
-
/**
|
|
9
|
-
* Approval Rules 3.0 — list-page drag-and-drop reorder for
|
|
10
|
-
* reimbursements. Mirrors the BillPay reorder epic — see that file
|
|
11
|
-
* for the longer rationale.
|
|
12
|
-
*/
|
|
13
|
-
export type ActionType = ReturnType<typeof reorderRemiApprovalRules> | ReturnType<typeof reorderRemiApprovalRulesSuccess> | ReturnType<typeof reorderRemiApprovalRulesFailure> | ReturnType<typeof updateApprovalRules> | ReturnType<typeof fetchRemiSetupApproverView> | ReturnType<typeof openSnackbar>;
|
|
14
|
-
export declare const reorderRemiApprovalRulesEpic: (actions$: ActionsObservable<ActionType>, _state$: StateObservable<RootState>, zeniAPI: ZeniAPI) => Observable<ActionType>;
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reorderRemiApprovalRulesEpic = void 0;
|
|
4
|
-
const rxjs_1 = require("rxjs");
|
|
5
|
-
const operators_1 = require("rxjs/operators");
|
|
6
|
-
const approvalRuleReducer_1 = require("../../../../../entity/approvalRule/approvalRuleReducer");
|
|
7
|
-
const snackbarReducer_1 = require("../../../../../entity/snackbar/snackbarReducer");
|
|
8
|
-
const responsePayload_1 = require("../../../../../responsePayload");
|
|
9
|
-
const remiSetupApproverViewReducer_1 = require("../remiSetupApproverViewReducer");
|
|
10
|
-
const reorderRemiApprovalRulesEpic = (actions$, _state$, zeniAPI) => actions$.pipe((0, operators_1.filter)(remiSetupApproverViewReducer_1.reorderRemiApprovalRules.match), (0, operators_1.switchMap)((action) => {
|
|
11
|
-
const { approvalRuleIds, useV3 } = action.payload;
|
|
12
|
-
const endpoint = `${zeniAPI.apiEndPoints.approvalMicroServiceBaseUrl}/1.0/reimbursements/approval-rules-v2/reorder`;
|
|
13
|
-
return zeniAPI
|
|
14
|
-
.putAndGetJSON(endpoint, {
|
|
15
|
-
rule_ids: approvalRuleIds,
|
|
16
|
-
})
|
|
17
|
-
.pipe((0, operators_1.mergeMap)((response) => {
|
|
18
|
-
if ((0, responsePayload_1.isSuccessResponse)(response) && response.data != null) {
|
|
19
|
-
const serverOrderedIds = response.data.approval_rules.map((approvalRule) => approvalRule.approval_rule_id);
|
|
20
|
-
const actions = [
|
|
21
|
-
(0, approvalRuleReducer_1.updateApprovalRules)(response.data.approval_rules),
|
|
22
|
-
(0, remiSetupApproverViewReducer_1.reorderRemiApprovalRulesSuccess)(serverOrderedIds),
|
|
23
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
24
|
-
messageSection: `reimbursement_approval_reorder`,
|
|
25
|
-
messageText: 'success',
|
|
26
|
-
type: 'success',
|
|
27
|
-
}),
|
|
28
|
-
];
|
|
29
|
-
return (0, rxjs_1.from)(actions);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
return (0, rxjs_1.from)([
|
|
33
|
-
(0, remiSetupApproverViewReducer_1.reorderRemiApprovalRulesFailure)(response.status),
|
|
34
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
35
|
-
messageSection: `reimbursement_approval_reorder`,
|
|
36
|
-
messageText: 'failed',
|
|
37
|
-
type: 'error',
|
|
38
|
-
}),
|
|
39
|
-
(0, remiSetupApproverViewReducer_1.fetchRemiSetupApproverView)(true, true, useV3),
|
|
40
|
-
]);
|
|
41
|
-
}
|
|
42
|
-
}), (0, operators_1.catchError)((error) => (0, rxjs_1.from)([
|
|
43
|
-
(0, remiSetupApproverViewReducer_1.reorderRemiApprovalRulesFailure)((0, responsePayload_1.createZeniAPIStatus)('Unexpected Error', 'Reorder Reimbursement Approval Rules errored out' +
|
|
44
|
-
JSON.stringify(error))),
|
|
45
|
-
(0, snackbarReducer_1.openSnackbar)({
|
|
46
|
-
messageSection: `reimbursement_approval_reorder`,
|
|
47
|
-
messageText: 'failed',
|
|
48
|
-
type: 'error',
|
|
49
|
-
}),
|
|
50
|
-
(0, remiSetupApproverViewReducer_1.fetchRemiSetupApproverView)(true, true, useV3),
|
|
51
|
-
])));
|
|
52
|
-
}));
|
|
53
|
-
exports.reorderRemiApprovalRulesEpic = reorderRemiApprovalRulesEpic;
|