@zeniai/client-epic-state 5.1.37-betaRD1 → 5.1.37-betaRD3
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.
|
@@ -188,15 +188,28 @@ 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
|
-
//
|
|
191
|
+
// When a search or filter is active the badge switches to the filtered count
|
|
192
|
+
// so the number tracks what the user is looking at.
|
|
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;
|
|
193
201
|
const parentTotalCountByTab = expenseAutomationTransactionsViewState.parentTotalCountByTab;
|
|
194
202
|
const parentTabTotalCountByTab = {
|
|
195
203
|
review: monthYearPeriodId != null
|
|
196
|
-
?
|
|
204
|
+
? reviewFilterActive
|
|
205
|
+
? totalCountByReview[monthYearPeriodId]
|
|
206
|
+
: (parentTotalCountByTab.review[monthYearPeriodId] ?? 0)
|
|
197
207
|
: 0,
|
|
198
208
|
autoCategorized: monthYearPeriodId != null
|
|
199
|
-
?
|
|
209
|
+
? autoCatFilterActive
|
|
210
|
+
? (autoCatSubTabCache['all']?.totalCount[monthYearPeriodId] ??
|
|
211
|
+
totalCountByAutoCat[monthYearPeriodId])
|
|
212
|
+
: (parentTotalCountByTab.autoCategorized[monthYearPeriodId] ?? 0)
|
|
200
213
|
: 0,
|
|
201
214
|
};
|
|
202
215
|
const fetchStateByTab = {
|
|
@@ -239,7 +252,13 @@ export function getExpenseAutomationTransactionView(state) {
|
|
|
239
252
|
isAccountingProjectsEnabled,
|
|
240
253
|
projectList,
|
|
241
254
|
transactionLocalData: filteredTransactionLocalData,
|
|
242
|
-
|
|
255
|
+
// When a client-side category filter is active the server pageToken is
|
|
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,
|
|
243
262
|
refreshStatus,
|
|
244
263
|
saveStatus,
|
|
245
264
|
markAsNotMiscategorizedStatus,
|
|
@@ -198,15 +198,28 @@ 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
|
-
//
|
|
201
|
+
// When a search or filter is active the badge switches to the filtered count
|
|
202
|
+
// so the number tracks what the user is looking at.
|
|
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;
|
|
203
211
|
const parentTotalCountByTab = expenseAutomationTransactionsViewState.parentTotalCountByTab;
|
|
204
212
|
const parentTabTotalCountByTab = {
|
|
205
213
|
review: monthYearPeriodId != null
|
|
206
|
-
?
|
|
214
|
+
? reviewFilterActive
|
|
215
|
+
? totalCountByReview[monthYearPeriodId]
|
|
216
|
+
: (parentTotalCountByTab.review[monthYearPeriodId] ?? 0)
|
|
207
217
|
: 0,
|
|
208
218
|
autoCategorized: monthYearPeriodId != null
|
|
209
|
-
?
|
|
219
|
+
? autoCatFilterActive
|
|
220
|
+
? (autoCatSubTabCache['all']?.totalCount[monthYearPeriodId] ??
|
|
221
|
+
totalCountByAutoCat[monthYearPeriodId])
|
|
222
|
+
: (parentTotalCountByTab.autoCategorized[monthYearPeriodId] ?? 0)
|
|
210
223
|
: 0,
|
|
211
224
|
};
|
|
212
225
|
const fetchStateByTab = {
|
|
@@ -249,7 +262,13 @@ function getExpenseAutomationTransactionView(state) {
|
|
|
249
262
|
isAccountingProjectsEnabled,
|
|
250
263
|
projectList,
|
|
251
264
|
transactionLocalData: filteredTransactionLocalData,
|
|
252
|
-
|
|
265
|
+
// When a client-side category filter is active the server pageToken is
|
|
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,
|
|
253
272
|
refreshStatus,
|
|
254
273
|
saveStatus,
|
|
255
274
|
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-betaRD3",
|
|
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",
|