@zeniai/client-epic-state 5.1.15-betaRD2 → 5.1.16
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/dashboard/dashboardSelector.js +4 -17
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +0 -1
- package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +0 -11
- package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +4 -6
- package/lib/view/dashboard/dashboardSelector.d.ts +1 -1
- package/lib/view/dashboard/dashboardSelector.js +4 -17
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationEpic.js +0 -1
- package/lib/view/expenseAutomationView/epics/transactionCategorization/fetchTransactionCategorizationViewEpic.js +0 -11
- package/lib/view/expenseAutomationView/payload/transactionCategorizationPayload.d.ts +0 -7
- package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +4 -6
- package/package.json +1 -1
|
@@ -42,7 +42,7 @@ const tenantSelector = createSelector(getTenantsByCheckInDateSelector, getCurren
|
|
|
42
42
|
export const getDashboard = createSelector(tenantSelector, getCardBalance, getCashBalance, getOperatingExpensesForLast5Periods, getRevenueForLast4Periods, getTop6Expenses, getNetBurnOrIncomeForLast4Periods, getNetBurnOrIncomeStoryCard, getCashPositionLast5Periods, getCashInCashOutLast4Periods, getInsights, getCompanyPassportView, getTasksCardReport, getBillPayCardReport, getReimbursementCardReport, apAgingSelector, arAgingSelector, getZeniAccountsPromoCard, getRewardsPlanCard, getDashboardCardsOrdered, (state) => {
|
|
43
43
|
const currentTenant = getCurrentTenant(state);
|
|
44
44
|
return getMonthEndCloseChecksViewByTenantId(state, currentTenant.tenantId);
|
|
45
|
-
}, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (_state, _additionalExcludedReports, signedInUser) => signedInUser, (_state, _excluded, _signedInUser, isExpenseAutomationFeatureEnabledV2) => isExpenseAutomationFeatureEnabledV2, (_state, _excluded, _signedInUser, _enabledV2, isExpenseAutomationFeatureEnabled) => isExpenseAutomationFeatureEnabled, (
|
|
45
|
+
}, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (_state, _additionalExcludedReports, signedInUser) => signedInUser, (_state, _excluded, _signedInUser, isExpenseAutomationFeatureEnabledV2) => isExpenseAutomationFeatureEnabledV2, (_state, _excluded, _signedInUser, _enabledV2, isExpenseAutomationFeatureEnabled) => isExpenseAutomationFeatureEnabled, (state) => state.dashboardState.isTreasuryVideoClosed, (tenants, cardBalance, cashBalance, opEx, revenue, topEx, netBurnOrIncome, netBurnOrIncomeStoryCard, cashPosition, cashInCashOut, insightsView, companyPassportView, tasksCard, billPayCard, reimbursementCard, apAgingReport, arAgingReport, zeniAccountsPromoCard, rewardsPlanCard, cards, monthEndCloseChecksView, tenantState, additionalExcludedReports, signedInUser, isExpenseAutomationFeatureEnabledV2, isExpenseAutomationFeatureEnabled, isTreasuryVideoClosed) => {
|
|
46
46
|
const isReimbursementFeatureEnabled = tenants.currentTenant.company?.featuresActivationInfo
|
|
47
47
|
.isReimbursementFeatureEnabled;
|
|
48
48
|
const isBillPayFeatureEnabled = tenants.currentTenant.company?.featuresActivationInfo
|
|
@@ -153,23 +153,10 @@ export const getDashboard = createSelector(tenantSelector, getCardBalance, getCa
|
|
|
153
153
|
cardsToRemove.add('bill_pay_card');
|
|
154
154
|
cardsToRemove.add('reimbursement_card');
|
|
155
155
|
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
cardsToRemove.add('reimbursement_promo_card');
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
cardsToRemove.add('zeni_accounts_promo_card');
|
|
163
|
-
}
|
|
164
|
-
// remove treasury promo card if its already enabled
|
|
165
|
-
const isTreasuryTOSAccepted = tenants.currentTenant.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;
|
|
166
|
-
if (isTreasuryTOSAccepted === true || isTreasuryFeatureEnabled === false) {
|
|
167
|
-
cardsToRemove.add('treasury_promo_card');
|
|
168
|
-
}
|
|
169
|
-
// More than one promo card can't be shown on the dashboard (priority: Treasury > Accounts > Bill > Remi).
|
|
156
|
+
cardsToRemove.add('zeni_accounts_promo_card');
|
|
157
|
+
cardsToRemove.add('treasury_promo_card');
|
|
158
|
+
// More than one promo card can't be shown on the dashboard (priority: Bill > Remi).
|
|
170
159
|
const PROMO_CARD_PRIORITY_ORDER = [
|
|
171
|
-
'treasury_promo_card',
|
|
172
|
-
'zeni_accounts_promo_card',
|
|
173
160
|
'bill_pay_promo_card',
|
|
174
161
|
'reimbursement_promo_card',
|
|
175
162
|
];
|
|
@@ -24,7 +24,6 @@ export const fetchTransactionCategorizationEpic = (actions$, state$, zeniAPI) =>
|
|
|
24
24
|
page_token: pageToken,
|
|
25
25
|
page_size: 25,
|
|
26
26
|
search_text: uiState.searchString,
|
|
27
|
-
search_all_statuses: false,
|
|
28
27
|
sub_tab: selectedTab === 'autoCategorized'
|
|
29
28
|
? expenseAutomationTransactionsViewState.selectedTransactionCategorizationCompletedSubTab
|
|
30
29
|
: DEFAULT_COMPLETED_SUB_TAB,
|
|
@@ -7,7 +7,6 @@ import { fetchClassList } from '../../../classList/classListReducer';
|
|
|
7
7
|
import { fetchOwnerList } from '../../../ownerList/ownerListReducer';
|
|
8
8
|
import { fetchProjectList } from '../../../projectList/projectListReducer';
|
|
9
9
|
import { fetchTransactionCategorization, fetchTransactionCategorizationView, } from '../../reducers/transactionsViewReducer';
|
|
10
|
-
import { TRANSACTIONS_TABS } from '../../types/transactionsViewState';
|
|
11
10
|
export const fetchTransactionCategorizationViewEpic = (actions$, state$) => actions$.pipe(filter(fetchTransactionCategorizationView.match), mergeMap((action) => {
|
|
12
11
|
const { selectedTab, cacheOverride, keepExistingListItems, pageToken, period, refreshViewInBackground, searchString, resetListItems, isUncategorizedExpenseCategoryEnabled, } = action.payload;
|
|
13
12
|
const updateActions = [];
|
|
@@ -45,15 +44,5 @@ export const fetchTransactionCategorizationViewEpic = (actions$, state$) => acti
|
|
|
45
44
|
transactionIds.length === 0) {
|
|
46
45
|
updateActions.push(fetchTransactionCategorization(selectedTab, period, cacheOverride, keepExistingListItems, searchString, pageToken, refreshViewInBackground, resetListItems, isUncategorizedExpenseCategoryEnabled));
|
|
47
46
|
}
|
|
48
|
-
// When search changes (searchString defined, including empty string to
|
|
49
|
-
// clear), also fetch the other tab so both tabs always reflect the same
|
|
50
|
-
// search query. cacheOverride=true bypasses the cache check; pageToken
|
|
51
|
-
// is reset to undefined so the other tab starts from page 1.
|
|
52
|
-
if (searchString !== undefined) {
|
|
53
|
-
const otherTab = TRANSACTIONS_TABS.find((tab) => tab !== selectedTab);
|
|
54
|
-
if (otherTab != null) {
|
|
55
|
-
updateActions.push(fetchTransactionCategorization(otherTab, period, true, keepExistingListItems, searchString, undefined, refreshViewInBackground, true, isUncategorizedExpenseCategoryEnabled));
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
47
|
return from(updateActions);
|
|
59
48
|
}));
|
|
@@ -305,12 +305,10 @@ const expenseAutomationTransactionsView = createSlice({
|
|
|
305
305
|
}
|
|
306
306
|
},
|
|
307
307
|
updateTransactionFilters(draft, action) {
|
|
308
|
-
const { filters } = action.payload;
|
|
309
|
-
//
|
|
310
|
-
//
|
|
311
|
-
|
|
312
|
-
draft.transactionCategorizationView[tab].filters = filters;
|
|
313
|
-
});
|
|
308
|
+
const { selectedTab, filters } = action.payload;
|
|
309
|
+
// `filters` is non-nullable per the payload type, so no runtime
|
|
310
|
+
// null-check is needed — dropping it removes a dead defensive branch.
|
|
311
|
+
draft.transactionCategorizationView[selectedTab].filters = filters;
|
|
314
312
|
},
|
|
315
313
|
saveTransactionCategorization: {
|
|
316
314
|
prepare(selectedTab, transactionIds, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled) {
|
|
@@ -12,4 +12,4 @@ export interface DashboardReport extends SelectorReport {
|
|
|
12
12
|
currentTenant?: Tenant;
|
|
13
13
|
}
|
|
14
14
|
export declare const getDashboard: (state: RootState, additionalExcludedReports: ReportID[], // used when reports are excluded through statsig
|
|
15
|
-
signedInUser: LoggedInUser | undefined, isExpenseAutomationFeatureEnabledV2: boolean, isExpenseAutomationFeatureEnabled: boolean
|
|
15
|
+
signedInUser: LoggedInUser | undefined, isExpenseAutomationFeatureEnabledV2: boolean, isExpenseAutomationFeatureEnabled: boolean) => DashboardReport;
|
|
@@ -45,7 +45,7 @@ const tenantSelector = (0, toolkit_1.createSelector)(tenantSelector_1.getTenants
|
|
|
45
45
|
exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalanceSelector_1.getCardBalance, cashBalanceSelector_1.getCashBalance, getOperatingExpensesForLast5Periods, getRevenueForLast4Periods, topExSelector_1.getTop6Expenses, getNetBurnOrIncomeForLast4Periods, getNetBurnOrIncomeStoryCard, getCashPositionLast5Periods, getCashInCashOutLast4Periods, insightsCardSelector_1.getInsights, companyPassportViewSelector_1.getCompanyPassportView, tasksCardSelector_1.getTasksCardReport, billPayCardSelector_1.getBillPayCardReport, reimbursementCardSelector_1.getReimbursementCardReport, apAgingSelector, arAgingSelector, zeniAccountsPromoCardSelector_1.getZeniAccountsPromoCard, referralSelector_1.getRewardsPlanCard, dashboardLayoutSelector_1.getDashboardCardsOrdered, (state) => {
|
|
46
46
|
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(state);
|
|
47
47
|
return (0, monthEndCloseChecksViewSelector_1.getMonthEndCloseChecksViewByTenantId)(state, currentTenant.tenantId);
|
|
48
|
-
}, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (_state, _additionalExcludedReports, signedInUser) => signedInUser, (_state, _excluded, _signedInUser, isExpenseAutomationFeatureEnabledV2) => isExpenseAutomationFeatureEnabledV2, (_state, _excluded, _signedInUser, _enabledV2, isExpenseAutomationFeatureEnabled) => isExpenseAutomationFeatureEnabled, (
|
|
48
|
+
}, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (_state, _additionalExcludedReports, signedInUser) => signedInUser, (_state, _excluded, _signedInUser, isExpenseAutomationFeatureEnabledV2) => isExpenseAutomationFeatureEnabledV2, (_state, _excluded, _signedInUser, _enabledV2, isExpenseAutomationFeatureEnabled) => isExpenseAutomationFeatureEnabled, (state) => state.dashboardState.isTreasuryVideoClosed, (tenants, cardBalance, cashBalance, opEx, revenue, topEx, netBurnOrIncome, netBurnOrIncomeStoryCard, cashPosition, cashInCashOut, insightsView, companyPassportView, tasksCard, billPayCard, reimbursementCard, apAgingReport, arAgingReport, zeniAccountsPromoCard, rewardsPlanCard, cards, monthEndCloseChecksView, tenantState, additionalExcludedReports, signedInUser, isExpenseAutomationFeatureEnabledV2, isExpenseAutomationFeatureEnabled, isTreasuryVideoClosed) => {
|
|
49
49
|
const isReimbursementFeatureEnabled = tenants.currentTenant.company?.featuresActivationInfo
|
|
50
50
|
.isReimbursementFeatureEnabled;
|
|
51
51
|
const isBillPayFeatureEnabled = tenants.currentTenant.company?.featuresActivationInfo
|
|
@@ -156,23 +156,10 @@ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalance
|
|
|
156
156
|
cardsToRemove.add('bill_pay_card');
|
|
157
157
|
cardsToRemove.add('reimbursement_card');
|
|
158
158
|
}
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
cardsToRemove.add('reimbursement_promo_card');
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
cardsToRemove.add('zeni_accounts_promo_card');
|
|
166
|
-
}
|
|
167
|
-
// remove treasury promo card if its already enabled
|
|
168
|
-
const isTreasuryTOSAccepted = tenants.currentTenant.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;
|
|
169
|
-
if (isTreasuryTOSAccepted === true || isTreasuryFeatureEnabled === false) {
|
|
170
|
-
cardsToRemove.add('treasury_promo_card');
|
|
171
|
-
}
|
|
172
|
-
// More than one promo card can't be shown on the dashboard (priority: Treasury > Accounts > Bill > Remi).
|
|
159
|
+
cardsToRemove.add('zeni_accounts_promo_card');
|
|
160
|
+
cardsToRemove.add('treasury_promo_card');
|
|
161
|
+
// More than one promo card can't be shown on the dashboard (priority: Bill > Remi).
|
|
173
162
|
const PROMO_CARD_PRIORITY_ORDER = [
|
|
174
|
-
'treasury_promo_card',
|
|
175
|
-
'zeni_accounts_promo_card',
|
|
176
163
|
'bill_pay_promo_card',
|
|
177
164
|
'reimbursement_promo_card',
|
|
178
165
|
];
|
|
@@ -27,7 +27,6 @@ const fetchTransactionCategorizationEpic = (actions$, state$, zeniAPI) => action
|
|
|
27
27
|
page_token: pageToken,
|
|
28
28
|
page_size: 25,
|
|
29
29
|
search_text: uiState.searchString,
|
|
30
|
-
search_all_statuses: false,
|
|
31
30
|
sub_tab: selectedTab === 'autoCategorized'
|
|
32
31
|
? expenseAutomationTransactionsViewState.selectedTransactionCategorizationCompletedSubTab
|
|
33
32
|
: completedSubTab_1.DEFAULT_COMPLETED_SUB_TAB,
|
|
@@ -10,7 +10,6 @@ const classListReducer_1 = require("../../../classList/classListReducer");
|
|
|
10
10
|
const ownerListReducer_1 = require("../../../ownerList/ownerListReducer");
|
|
11
11
|
const projectListReducer_1 = require("../../../projectList/projectListReducer");
|
|
12
12
|
const transactionsViewReducer_1 = require("../../reducers/transactionsViewReducer");
|
|
13
|
-
const transactionsViewState_1 = require("../../types/transactionsViewState");
|
|
14
13
|
const fetchTransactionCategorizationViewEpic = (actions$, state$) => actions$.pipe((0, operators_1.filter)(transactionsViewReducer_1.fetchTransactionCategorizationView.match), (0, operators_1.mergeMap)((action) => {
|
|
15
14
|
const { selectedTab, cacheOverride, keepExistingListItems, pageToken, period, refreshViewInBackground, searchString, resetListItems, isUncategorizedExpenseCategoryEnabled, } = action.payload;
|
|
16
15
|
const updateActions = [];
|
|
@@ -48,16 +47,6 @@ const fetchTransactionCategorizationViewEpic = (actions$, state$) => actions$.pi
|
|
|
48
47
|
transactionIds.length === 0) {
|
|
49
48
|
updateActions.push((0, transactionsViewReducer_1.fetchTransactionCategorization)(selectedTab, period, cacheOverride, keepExistingListItems, searchString, pageToken, refreshViewInBackground, resetListItems, isUncategorizedExpenseCategoryEnabled));
|
|
50
49
|
}
|
|
51
|
-
// When search changes (searchString defined, including empty string to
|
|
52
|
-
// clear), also fetch the other tab so both tabs always reflect the same
|
|
53
|
-
// search query. cacheOverride=true bypasses the cache check; pageToken
|
|
54
|
-
// is reset to undefined so the other tab starts from page 1.
|
|
55
|
-
if (searchString !== undefined) {
|
|
56
|
-
const otherTab = transactionsViewState_1.TRANSACTIONS_TABS.find((tab) => tab !== selectedTab);
|
|
57
|
-
if (otherTab != null) {
|
|
58
|
-
updateActions.push((0, transactionsViewReducer_1.fetchTransactionCategorization)(otherTab, period, true, keepExistingListItems, searchString, undefined, refreshViewInBackground, true, isUncategorizedExpenseCategoryEnabled));
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
50
|
return (0, rxjs_1.from)(updateActions);
|
|
62
51
|
}));
|
|
63
52
|
exports.fetchTransactionCategorizationViewEpic = fetchTransactionCategorizationViewEpic;
|
|
@@ -19,13 +19,6 @@ export interface TransactionCategorizationQueryPayload {
|
|
|
19
19
|
* on the backend.
|
|
20
20
|
*/
|
|
21
21
|
sub_tab: CompletedSubTab;
|
|
22
|
-
/**
|
|
23
|
-
* When `false`, the backend scopes the search to the active tab's
|
|
24
|
-
* categorization status (respects `auto_categorized`). When `true` or
|
|
25
|
-
* omitted, the backend searches across all statuses — the legacy behaviour
|
|
26
|
-
* that the Receipts manual-match flow relies on.
|
|
27
|
-
*/
|
|
28
|
-
search_all_statuses?: boolean;
|
|
29
22
|
}
|
|
30
23
|
export interface TransactionCategorizationPayload {
|
|
31
24
|
next_page_token: string | null;
|
|
@@ -312,12 +312,10 @@ const expenseAutomationTransactionsView = (0, toolkit_1.createSlice)({
|
|
|
312
312
|
}
|
|
313
313
|
},
|
|
314
314
|
updateTransactionFilters(draft, action) {
|
|
315
|
-
const { filters } = action.payload;
|
|
316
|
-
//
|
|
317
|
-
//
|
|
318
|
-
|
|
319
|
-
draft.transactionCategorizationView[tab].filters = filters;
|
|
320
|
-
});
|
|
315
|
+
const { selectedTab, filters } = action.payload;
|
|
316
|
+
// `filters` is non-nullable per the payload type, so no runtime
|
|
317
|
+
// null-check is needed — dropping it removes a dead defensive branch.
|
|
318
|
+
draft.transactionCategorizationView[selectedTab].filters = filters;
|
|
321
319
|
},
|
|
322
320
|
saveTransactionCategorization: {
|
|
323
321
|
prepare(selectedTab, transactionIds, cotTrackingByTransactionId, isUncategorizedExpenseCategoryEnabled) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.16",
|
|
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",
|