@zeniai/client-epic-state 5.1.75 → 5.1.76
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.
|
@@ -2,7 +2,7 @@ import { createSelector } from '@reduxjs/toolkit';
|
|
|
2
2
|
import { newBalancesFilter } from '../../commonStateTypes/coaBalance/coaBalancesFilter';
|
|
3
3
|
import { reduceFetchState } from '../../commonStateTypes/reduceFetchState';
|
|
4
4
|
import { getCurrentTenant, getTenantsByCheckInDateSelector, } from '../../entity/tenant/tenantSelector';
|
|
5
|
-
import { hasAdminLevelAccess, hasInvestorBankerLevelAccess,
|
|
5
|
+
import { hasAdminLevelAccess, hasInvestorBankerLevelAccess, } from '../../entity/userRole/userRoleType';
|
|
6
6
|
import { getApAgingReport } from '../apAgingView/apAgingReport/apAgingSelector';
|
|
7
7
|
import { getArAgingReport } from '../arAgingView/arAgingReport/arAgingSelector';
|
|
8
8
|
import { getBillPayCardReport } from '../billPayCard/billPayCardSelector';
|
|
@@ -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, (
|
|
45
|
+
}, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (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, isTreasuryVideoClosed) => {
|
|
46
46
|
const isReimbursementFeatureEnabled = tenants.currentTenant.company?.featuresActivationInfo
|
|
47
47
|
.isReimbursementFeatureEnabled;
|
|
48
48
|
const isBillPayFeatureEnabled = tenants.currentTenant.company?.featuresActivationInfo
|
|
@@ -72,20 +72,24 @@ export const getDashboard = createSelector(tenantSelector, getCardBalance, getCa
|
|
|
72
72
|
if (connectionName === 'netsuite') {
|
|
73
73
|
cardsToRemove.add('cash_in_cash_out');
|
|
74
74
|
}
|
|
75
|
-
const { isUncategorizedExpenseAccountIdentified, isUncategorizedIncomeAccountIdentified, numOfBillsPendingApproval, numOfReimbursementsPendingApproval, } = tasksCard.tasks;
|
|
75
|
+
const { isUncategorizedExpenseAccountIdentified, isUncategorizedIncomeAccountIdentified, isUncategorizedExpensesTransactionsExist, isUncategorizedIncomeTransactionsExist, numOfBillsPendingApproval, numOfReimbursementsPendingApproval, } = tasksCard.tasks;
|
|
76
76
|
const showUncategorizedAccountMapping = isUncategorizedExpenseAccountIdentified === false ||
|
|
77
77
|
isUncategorizedIncomeAccountIdentified === false;
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
78
|
+
// Drop the card only when it would render no rows at all. This mirrors every
|
|
79
|
+
// row TasksCard can show; keep the two lists in step. Expense Automation
|
|
80
|
+
// tenants are no longer a special case — they see the uncategorized expense
|
|
81
|
+
// and income rows like everyone else, so those rows count towards emptiness.
|
|
82
|
+
// Only judge emptiness once the payload has arrived, so a pending fetch
|
|
83
|
+
// never hides the card.
|
|
84
|
+
const isTaskCardEmpty = tasksCard.fetchState === 'Completed' &&
|
|
85
|
+
showUncategorizedAccountMapping === false &&
|
|
83
86
|
numOfBillsPendingApproval === 0 &&
|
|
84
87
|
numOfReimbursementsPendingApproval === 0 &&
|
|
85
|
-
|
|
88
|
+
isUncategorizedExpensesTransactionsExist === false &&
|
|
89
|
+
isUncategorizedIncomeTransactionsExist === false;
|
|
86
90
|
if (tasksCard.showCard === false ||
|
|
87
91
|
hasTasksCardAccess === false ||
|
|
88
|
-
|
|
92
|
+
isTaskCardEmpty) {
|
|
89
93
|
cardsToRemove.add('task_card');
|
|
90
94
|
}
|
|
91
95
|
const isBankerOrInvestor = tenants.currentTenant?.userRole != null &&
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReportID, SelectorReport, SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
|
|
2
2
|
import { TenantsOrdered } from '../../entity/tenant/tenantSelector';
|
|
3
|
-
import {
|
|
3
|
+
import { Tenant } from '../../entity/tenant/tenantState';
|
|
4
4
|
import { RootState } from '../../reducer';
|
|
5
5
|
import { CardType } from './dashboardState';
|
|
6
6
|
export interface DashboardReport extends SelectorReport {
|
|
@@ -11,5 +11,4 @@ export interface DashboardReport extends SelectorReport {
|
|
|
11
11
|
tenantsOrdered: TenantsOrdered;
|
|
12
12
|
currentTenant?: Tenant;
|
|
13
13
|
}
|
|
14
|
-
export declare const getDashboard: (state: RootState, additionalExcludedReports: ReportID[]
|
|
15
|
-
signedInUser: LoggedInUser | undefined, isExpenseAutomationFeatureEnabledV2: boolean, isExpenseAutomationFeatureEnabled: boolean) => DashboardReport;
|
|
14
|
+
export declare const getDashboard: (state: RootState, additionalExcludedReports: ReportID[]) => 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, (
|
|
48
|
+
}, (state) => state.tenantState, (_state, additionalExcludedReports) => additionalExcludedReports, (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, isTreasuryVideoClosed) => {
|
|
49
49
|
const isReimbursementFeatureEnabled = tenants.currentTenant.company?.featuresActivationInfo
|
|
50
50
|
.isReimbursementFeatureEnabled;
|
|
51
51
|
const isBillPayFeatureEnabled = tenants.currentTenant.company?.featuresActivationInfo
|
|
@@ -75,20 +75,24 @@ exports.getDashboard = (0, toolkit_1.createSelector)(tenantSelector, cardBalance
|
|
|
75
75
|
if (connectionName === 'netsuite') {
|
|
76
76
|
cardsToRemove.add('cash_in_cash_out');
|
|
77
77
|
}
|
|
78
|
-
const { isUncategorizedExpenseAccountIdentified, isUncategorizedIncomeAccountIdentified, numOfBillsPendingApproval, numOfReimbursementsPendingApproval, } = tasksCard.tasks;
|
|
78
|
+
const { isUncategorizedExpenseAccountIdentified, isUncategorizedIncomeAccountIdentified, isUncategorizedExpensesTransactionsExist, isUncategorizedIncomeTransactionsExist, numOfBillsPendingApproval, numOfReimbursementsPendingApproval, } = tasksCard.tasks;
|
|
79
79
|
const showUncategorizedAccountMapping = isUncategorizedExpenseAccountIdentified === false ||
|
|
80
80
|
isUncategorizedIncomeAccountIdentified === false;
|
|
81
|
-
//
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
81
|
+
// Drop the card only when it would render no rows at all. This mirrors every
|
|
82
|
+
// row TasksCard can show; keep the two lists in step. Expense Automation
|
|
83
|
+
// tenants are no longer a special case — they see the uncategorized expense
|
|
84
|
+
// and income rows like everyone else, so those rows count towards emptiness.
|
|
85
|
+
// Only judge emptiness once the payload has arrived, so a pending fetch
|
|
86
|
+
// never hides the card.
|
|
87
|
+
const isTaskCardEmpty = tasksCard.fetchState === 'Completed' &&
|
|
88
|
+
showUncategorizedAccountMapping === false &&
|
|
86
89
|
numOfBillsPendingApproval === 0 &&
|
|
87
90
|
numOfReimbursementsPendingApproval === 0 &&
|
|
88
|
-
|
|
91
|
+
isUncategorizedExpensesTransactionsExist === false &&
|
|
92
|
+
isUncategorizedIncomeTransactionsExist === false;
|
|
89
93
|
if (tasksCard.showCard === false ||
|
|
90
94
|
hasTasksCardAccess === false ||
|
|
91
|
-
|
|
95
|
+
isTaskCardEmpty) {
|
|
92
96
|
cardsToRemove.add('task_card');
|
|
93
97
|
}
|
|
94
98
|
const isBankerOrInvestor = tenants.currentTenant?.userRole != null &&
|
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.76",
|
|
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",
|