@zeniai/client-epic-state 5.1.92-betaRD11 → 5.1.92-betaRD12
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/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +6 -2
- package/lib/esm/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +3 -3
- package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js +6 -2
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.d.ts +2 -0
- package/lib/view/expenseAutomationView/reducers/jeSchedulesViewReducer.js +3 -3
- package/package.json +1 -1
package/lib/esm/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js
CHANGED
|
@@ -15,7 +15,11 @@ export const initializeNewScheduleEpic = (actions$, state$) => actions$.pipe(fil
|
|
|
15
15
|
if (classListState.fetchState === 'Not-Started') {
|
|
16
16
|
newScheduleActions.push(fetchClassList());
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
// The account and class fetches above are idempotent (both guard on 'Not-Started'), so they
|
|
19
|
+
// can run on every open. Clearing what the user entered cannot, so it is opt-in.
|
|
20
|
+
if (action.payload.shouldResetEnteredData) {
|
|
21
|
+
newScheduleActions.push(resetNewScheduleLocalData({ scheduleType: action.payload.scheduleType }));
|
|
22
|
+
newScheduleActions.push(clearSearchTransactionsForNewSchedule());
|
|
23
|
+
}
|
|
20
24
|
return from(newScheduleActions);
|
|
21
25
|
}));
|
|
@@ -460,12 +460,12 @@ const expenseAutomationJESchedulesView = createSlice({
|
|
|
460
460
|
draft.accountSettings.localData = accountSettingsInitialState.localData;
|
|
461
461
|
},
|
|
462
462
|
initializeNewSchedule: {
|
|
463
|
-
prepare({ scheduleType, }) {
|
|
464
|
-
return { payload: { scheduleType } };
|
|
463
|
+
prepare({ scheduleType, shouldResetEnteredData = true, }) {
|
|
464
|
+
return { payload: { scheduleType, shouldResetEnteredData } };
|
|
465
465
|
},
|
|
466
466
|
reducer() {
|
|
467
467
|
// Purely an epic-trigger action — the epic fans out the account/class
|
|
468
|
-
// list fetches
|
|
468
|
+
// list fetches, and clears entered data only when asked to.
|
|
469
469
|
},
|
|
470
470
|
},
|
|
471
471
|
resetNewScheduleLocalData: {
|
package/lib/view/expenseAutomationView/epics/jeSchedule/newSchedule/initializeNewScheduleEpic.js
CHANGED
|
@@ -18,8 +18,12 @@ const initializeNewScheduleEpic = (actions$, state$) => actions$.pipe((0, operat
|
|
|
18
18
|
if (classListState.fetchState === 'Not-Started') {
|
|
19
19
|
newScheduleActions.push((0, classListReducer_1.fetchClassList)());
|
|
20
20
|
}
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
// The account and class fetches above are idempotent (both guard on 'Not-Started'), so they
|
|
22
|
+
// can run on every open. Clearing what the user entered cannot, so it is opt-in.
|
|
23
|
+
if (action.payload.shouldResetEnteredData) {
|
|
24
|
+
newScheduleActions.push((0, jeSchedulesViewReducer_1.resetNewScheduleLocalData)({ scheduleType: action.payload.scheduleType }));
|
|
25
|
+
newScheduleActions.push((0, jeSchedulesViewReducer_1.clearSearchTransactionsForNewSchedule)());
|
|
26
|
+
}
|
|
23
27
|
return (0, rxjs_1.from)(newScheduleActions);
|
|
24
28
|
}));
|
|
25
29
|
exports.initializeNewScheduleEpic = initializeNewScheduleEpic;
|
|
@@ -81,8 +81,10 @@ export declare const clearExpenseAutomationJESchedulesView: import("@reduxjs/too
|
|
|
81
81
|
jeScheduleTransactionKeys: (`${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`)[];
|
|
82
82
|
}, "expenseAutomationJESchedulesView/initializeJeScheduleLocalData", never, never>, initializeNewSchedule: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[{
|
|
83
83
|
scheduleType: "fixed_assets" | "prepaid_expenses";
|
|
84
|
+
shouldResetEnteredData?: boolean;
|
|
84
85
|
}], {
|
|
85
86
|
scheduleType: "prepaid_expenses" | "fixed_assets";
|
|
87
|
+
shouldResetEnteredData: boolean;
|
|
86
88
|
}, "expenseAutomationJESchedulesView/initializeNewSchedule", never, never>, removeFailedJeScheduleTransactionKey: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[failedJeScheduleKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`, selectedPeriod: MonthYearPeriod], {
|
|
87
89
|
failedJeScheduleKey: `${string}_expense_${string}` | `${string}_check_${string}` | `${string}_refund_${string}` | `${string}_invoice_${string}` | `${string}_payment_${string}` | `${string}_credit_memo_${string}` | `${string}_sales_receipt_${string}` | `${string}_delayed_credit_${string}` | `${string}_delayed_charge_${string}` | `${string}_bill_${string}` | `${string}_bill_payment_${string}` | `${string}_bill_payment_check_${string}` | `${string}_bill_payment_credit_card_${string}` | `${string}_vendor_credit_${string}` | `${string}_credit_card_credit_${string}` | `${string}_transfer_${string}` | `${string}_credit_card_payment_${string}` | `${string}_deposit_${string}` | `${string}_journal_entry_${string}`;
|
|
88
90
|
selectedPeriod: MonthYearPeriod;
|
|
@@ -466,12 +466,12 @@ const expenseAutomationJESchedulesView = (0, toolkit_1.createSlice)({
|
|
|
466
466
|
draft.accountSettings.localData = exports.accountSettingsInitialState.localData;
|
|
467
467
|
},
|
|
468
468
|
initializeNewSchedule: {
|
|
469
|
-
prepare({ scheduleType, }) {
|
|
470
|
-
return { payload: { scheduleType } };
|
|
469
|
+
prepare({ scheduleType, shouldResetEnteredData = true, }) {
|
|
470
|
+
return { payload: { scheduleType, shouldResetEnteredData } };
|
|
471
471
|
},
|
|
472
472
|
reducer() {
|
|
473
473
|
// Purely an epic-trigger action — the epic fans out the account/class
|
|
474
|
-
// list fetches
|
|
474
|
+
// list fetches, and clears entered data only when asked to.
|
|
475
475
|
},
|
|
476
476
|
},
|
|
477
477
|
resetNewScheduleLocalData: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.92-
|
|
3
|
+
"version": "5.1.92-betaRD12",
|
|
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",
|