@zeniai/client-epic-state 5.1.73 → 5.1.75-betaAK0

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, isZeniSignedInUser, } from '../../entity/userRole/userRoleType';
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, (_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) => {
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,21 @@ 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
- // Filter out task card if tenant is Expense Automation and there are no tasks other than Expense
79
- const isZeniUser = isZeniSignedInUser(signedInUser);
80
- const isExpenseAutomationEnabledForUser = isExpenseAutomationFeatureEnabledV2 ||
81
- (isExpenseAutomationFeatureEnabled && isZeniUser);
82
- const isEmptyTaskCardForExpenseAutomation = showUncategorizedAccountMapping !== true &&
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
+ const isTaskCardEmpty = showUncategorizedAccountMapping === false &&
83
83
  numOfBillsPendingApproval === 0 &&
84
84
  numOfReimbursementsPendingApproval === 0 &&
85
- isExpenseAutomationEnabledForUser;
85
+ isUncategorizedExpensesTransactionsExist === false &&
86
+ isUncategorizedIncomeTransactionsExist === false;
86
87
  if (tasksCard.showCard === false ||
87
88
  hasTasksCardAccess === false ||
88
- isEmptyTaskCardForExpenseAutomation) {
89
+ isTaskCardEmpty) {
89
90
  cardsToRemove.add('task_card');
90
91
  }
91
92
  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 { LoggedInUser, Tenant } from '../../entity/tenant/tenantState';
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[], // used when reports are excluded through statsig
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, (_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) => {
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,21 @@ 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
- // Filter out task card if tenant is Expense Automation and there are no tasks other than Expense
82
- const isZeniUser = (0, userRoleType_1.isZeniSignedInUser)(signedInUser);
83
- const isExpenseAutomationEnabledForUser = isExpenseAutomationFeatureEnabledV2 ||
84
- (isExpenseAutomationFeatureEnabled && isZeniUser);
85
- const isEmptyTaskCardForExpenseAutomation = showUncategorizedAccountMapping !== true &&
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
+ const isTaskCardEmpty = showUncategorizedAccountMapping === false &&
86
86
  numOfBillsPendingApproval === 0 &&
87
87
  numOfReimbursementsPendingApproval === 0 &&
88
- isExpenseAutomationEnabledForUser;
88
+ isUncategorizedExpensesTransactionsExist === false &&
89
+ isUncategorizedIncomeTransactionsExist === false;
89
90
  if (tasksCard.showCard === false ||
90
91
  hasTasksCardAccess === false ||
91
- isEmptyTaskCardForExpenseAutomation) {
92
+ isTaskCardEmpty) {
92
93
  cardsToRemove.add('task_card');
93
94
  }
94
95
  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.73",
3
+ "version": "5.1.75-betaAK0",
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",