@zeniai/client-epic-state 5.1.37-betaRD3 → 5.1.37
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/transactionCategorization/fetchTransactionCategorizationViewEpic.js +2 -3
- package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +5 -24
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +2 -3
- package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +5 -24
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ export const fetchTransactionCategorizationViewEpic = (actions$, state$) => acti
|
|
|
12
12
|
const { selectedTab, cacheOverride, keepExistingListItems, pageToken, period, refreshViewInBackground, searchString, resetListItems, isUncategorizedExpenseCategoryEnabled, } = action.payload;
|
|
13
13
|
const updateActions = [];
|
|
14
14
|
const { expenseAutomationTransactionsViewState } = state$.value;
|
|
15
|
-
const { fetchState, transactionIdsBySelectedPeriod
|
|
15
|
+
const { fetchState, transactionIdsBySelectedPeriod } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTab];
|
|
16
16
|
const monthYearPeriod = {
|
|
17
17
|
month: period.start.month,
|
|
18
18
|
year: period.start.year,
|
|
@@ -43,8 +43,7 @@ export const fetchTransactionCategorizationViewEpic = (actions$, state$) => acti
|
|
|
43
43
|
if (searchString === '' ||
|
|
44
44
|
cacheOverride === true ||
|
|
45
45
|
fetchState === 'Not-Started' ||
|
|
46
|
-
transactionIds.length === 0
|
|
47
|
-
uiState.searchString !== '') {
|
|
46
|
+
transactionIds.length === 0) {
|
|
48
47
|
updateActions.push(fetchTransactionCategorization(selectedTab, period, cacheOverride, keepExistingListItems, searchString, pageToken, refreshViewInBackground, resetListItems, isUncategorizedExpenseCategoryEnabled));
|
|
49
48
|
}
|
|
50
49
|
// On the initial load of a tab (searchString undefined = non-search fetch),
|
|
@@ -188,28 +188,15 @@ export function getExpenseAutomationTransactionView(state) {
|
|
|
188
188
|
};
|
|
189
189
|
// Parent-tab badge counts. Sourced from `parent_tab_total_count` in the
|
|
190
190
|
// listing response and used exclusively by the navbar / tab strip badges.
|
|
191
|
-
//
|
|
192
|
-
//
|
|
193
|
-
const autoCatTabView = expenseAutomationTransactionsViewState.transactionCategorizationView
|
|
194
|
-
.autoCategorized;
|
|
195
|
-
const reviewTabView = expenseAutomationTransactionsViewState.transactionCategorizationView.review;
|
|
196
|
-
const autoCatSubTabCache = expenseAutomationTransactionsViewState.autoCategorizedSubTabCache;
|
|
197
|
-
const autoCatFilterActive = autoCatTabView.uiState.searchString !== '' ||
|
|
198
|
-
autoCatTabView.filters.categories.length > 0;
|
|
199
|
-
const reviewFilterActive = reviewTabView.uiState.searchString !== '' ||
|
|
200
|
-
reviewTabView.filters.categories.length > 0;
|
|
191
|
+
// Independent of which Completed sub-tab is active so the badge stays
|
|
192
|
+
// stable across sub-tab switches.
|
|
201
193
|
const parentTotalCountByTab = expenseAutomationTransactionsViewState.parentTotalCountByTab;
|
|
202
194
|
const parentTabTotalCountByTab = {
|
|
203
195
|
review: monthYearPeriodId != null
|
|
204
|
-
?
|
|
205
|
-
? totalCountByReview[monthYearPeriodId]
|
|
206
|
-
: (parentTotalCountByTab.review[monthYearPeriodId] ?? 0)
|
|
196
|
+
? (parentTotalCountByTab.review[monthYearPeriodId] ?? 0)
|
|
207
197
|
: 0,
|
|
208
198
|
autoCategorized: monthYearPeriodId != null
|
|
209
|
-
?
|
|
210
|
-
? (autoCatSubTabCache['all']?.totalCount[monthYearPeriodId] ??
|
|
211
|
-
totalCountByAutoCat[monthYearPeriodId])
|
|
212
|
-
: (parentTotalCountByTab.autoCategorized[monthYearPeriodId] ?? 0)
|
|
199
|
+
? (parentTotalCountByTab.autoCategorized[monthYearPeriodId] ?? 0)
|
|
213
200
|
: 0,
|
|
214
201
|
};
|
|
215
202
|
const fetchStateByTab = {
|
|
@@ -252,13 +239,7 @@ export function getExpenseAutomationTransactionView(state) {
|
|
|
252
239
|
isAccountingProjectsEnabled,
|
|
253
240
|
projectList,
|
|
254
241
|
transactionLocalData: filteredTransactionLocalData,
|
|
255
|
-
|
|
256
|
-
// misleading — the server has more pages but the filter already reduces
|
|
257
|
-
// what's visible. Masking pageToken here prevents the skeleton "loading"
|
|
258
|
-
// row from appearing when the user is looking at a filtered result set.
|
|
259
|
-
uiState: filters.categories.length > 0
|
|
260
|
-
? { ...uiState, pageToken: null }
|
|
261
|
-
: uiState,
|
|
242
|
+
uiState,
|
|
262
243
|
refreshStatus,
|
|
263
244
|
saveStatus,
|
|
264
245
|
markAsNotMiscategorizedStatus,
|
|
@@ -15,7 +15,7 @@ const fetchTransactionCategorizationViewEpic = (actions$, state$) => actions$.pi
|
|
|
15
15
|
const { selectedTab, cacheOverride, keepExistingListItems, pageToken, period, refreshViewInBackground, searchString, resetListItems, isUncategorizedExpenseCategoryEnabled, } = action.payload;
|
|
16
16
|
const updateActions = [];
|
|
17
17
|
const { expenseAutomationTransactionsViewState } = state$.value;
|
|
18
|
-
const { fetchState, transactionIdsBySelectedPeriod
|
|
18
|
+
const { fetchState, transactionIdsBySelectedPeriod } = expenseAutomationTransactionsViewState.transactionCategorizationView[selectedTab];
|
|
19
19
|
const monthYearPeriod = {
|
|
20
20
|
month: period.start.month,
|
|
21
21
|
year: period.start.year,
|
|
@@ -46,8 +46,7 @@ const fetchTransactionCategorizationViewEpic = (actions$, state$) => actions$.pi
|
|
|
46
46
|
if (searchString === '' ||
|
|
47
47
|
cacheOverride === true ||
|
|
48
48
|
fetchState === 'Not-Started' ||
|
|
49
|
-
transactionIds.length === 0
|
|
50
|
-
uiState.searchString !== '') {
|
|
49
|
+
transactionIds.length === 0) {
|
|
51
50
|
updateActions.push((0, transactionsViewReducer_1.fetchTransactionCategorization)(selectedTab, period, cacheOverride, keepExistingListItems, searchString, pageToken, refreshViewInBackground, resetListItems, isUncategorizedExpenseCategoryEnabled));
|
|
52
51
|
}
|
|
53
52
|
// On the initial load of a tab (searchString undefined = non-search fetch),
|
|
@@ -198,28 +198,15 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
198
198
|
};
|
|
199
199
|
// Parent-tab badge counts. Sourced from `parent_tab_total_count` in the
|
|
200
200
|
// listing response and used exclusively by the navbar / tab strip badges.
|
|
201
|
-
//
|
|
202
|
-
//
|
|
203
|
-
const autoCatTabView = expenseAutomationTransactionsViewState.transactionCategorizationView
|
|
204
|
-
.autoCategorized;
|
|
205
|
-
const reviewTabView = expenseAutomationTransactionsViewState.transactionCategorizationView.review;
|
|
206
|
-
const autoCatSubTabCache = expenseAutomationTransactionsViewState.autoCategorizedSubTabCache;
|
|
207
|
-
const autoCatFilterActive = autoCatTabView.uiState.searchString !== '' ||
|
|
208
|
-
autoCatTabView.filters.categories.length > 0;
|
|
209
|
-
const reviewFilterActive = reviewTabView.uiState.searchString !== '' ||
|
|
210
|
-
reviewTabView.filters.categories.length > 0;
|
|
201
|
+
// Independent of which Completed sub-tab is active so the badge stays
|
|
202
|
+
// stable across sub-tab switches.
|
|
211
203
|
const parentTotalCountByTab = expenseAutomationTransactionsViewState.parentTotalCountByTab;
|
|
212
204
|
const parentTabTotalCountByTab = {
|
|
213
205
|
review: monthYearPeriodId != null
|
|
214
|
-
?
|
|
215
|
-
? totalCountByReview[monthYearPeriodId]
|
|
216
|
-
: (parentTotalCountByTab.review[monthYearPeriodId] ?? 0)
|
|
206
|
+
? (parentTotalCountByTab.review[monthYearPeriodId] ?? 0)
|
|
217
207
|
: 0,
|
|
218
208
|
autoCategorized: monthYearPeriodId != null
|
|
219
|
-
?
|
|
220
|
-
? (autoCatSubTabCache['all']?.totalCount[monthYearPeriodId] ??
|
|
221
|
-
totalCountByAutoCat[monthYearPeriodId])
|
|
222
|
-
: (parentTotalCountByTab.autoCategorized[monthYearPeriodId] ?? 0)
|
|
209
|
+
? (parentTotalCountByTab.autoCategorized[monthYearPeriodId] ?? 0)
|
|
223
210
|
: 0,
|
|
224
211
|
};
|
|
225
212
|
const fetchStateByTab = {
|
|
@@ -262,13 +249,7 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
262
249
|
isAccountingProjectsEnabled,
|
|
263
250
|
projectList,
|
|
264
251
|
transactionLocalData: filteredTransactionLocalData,
|
|
265
|
-
|
|
266
|
-
// misleading — the server has more pages but the filter already reduces
|
|
267
|
-
// what's visible. Masking pageToken here prevents the skeleton "loading"
|
|
268
|
-
// row from appearing when the user is looking at a filtered result set.
|
|
269
|
-
uiState: filters.categories.length > 0
|
|
270
|
-
? { ...uiState, pageToken: null }
|
|
271
|
-
: uiState,
|
|
252
|
+
uiState,
|
|
272
253
|
refreshStatus,
|
|
273
254
|
saveStatus,
|
|
274
255
|
markAsNotMiscategorizedStatus,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.37
|
|
3
|
+
"version": "5.1.37",
|
|
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",
|