@zeniai/client-epic-state 5.3.23 → 5.3.24
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 +13 -10
- package/lib/esm/view/netBurnOrIncomeStoryCard/netBurnOrIncomeStoryCardSelector.js +1 -4
- package/lib/esm/view/opEx/opExSelector.js +7 -4
- package/lib/view/dashboard/dashboardSelector.js +12 -9
- package/lib/view/netBurnOrIncomeStoryCard/netBurnOrIncomeStoryCardSelector.js +1 -4
- package/lib/view/opEx/opExSelector.d.ts +4 -1
- package/lib/view/opEx/opExSelector.js +8 -5
- package/package.json +1 -1
|
@@ -16,21 +16,24 @@ import { getInsights } from '../insightsCard/insightsCardSelector';
|
|
|
16
16
|
import { getMonthEndCloseChecksViewByTenantId } from '../monthEndCloseChecksView/monthEndCloseChecksViewSelector';
|
|
17
17
|
import { getNetBurnOrIncomeReport } from '../netBurnOrIncome/netBurnOrIncomeSelector';
|
|
18
18
|
import { getNetBurnOrIncomeStoryCardReport } from '../netBurnOrIncomeStoryCard/netBurnOrIncomeStoryCardSelector';
|
|
19
|
-
import {
|
|
19
|
+
import { getOperatingExpensesReportForDashboard } from '../opEx/opExSelector';
|
|
20
20
|
import { getRewardsPlanCard } from '../referralView/referralSelector';
|
|
21
21
|
import { getReimbursementCardReport } from '../reimbursementCard/reimbursementCardSelector';
|
|
22
22
|
import { getRevenueReport } from '../revenue/revenueSelector';
|
|
23
23
|
import { getTasksCardReport } from '../tasksCard/tasksCardSelector';
|
|
24
24
|
import { getTop6Expenses } from '../topEx/topExSelector';
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
25
|
+
// Every input must return the same reference until the slices it reads change, or getDashboard
|
|
26
|
+
// rebuilds every card's balances on each dispatched action.
|
|
27
|
+
const getNetBurnOrIncomeFilter = createSelector((state) => state.netBurnOrIncomeState.netBurnOrIncome.firstMonthOfFY, (state) => state.netBurnOrIncomeState.uiState.timeframe, (state) => state.netBurnOrIncomeState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => newBalancesFilter(firstMonthOfFY, timeframe, 4, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
28
|
+
const getNetBurnOrIncomeForLast4Periods = createSelector((state) => state.accountState, (state) => state.accountGroupState, (state) => state.sectionAccountsViewState, (state) => state.netBurnOrIncomeState, (state) => state.forecastState, (state) => state.forecastListState, getNetBurnOrIncomeFilter, (accountState, accountGroupState, sectionAccountsViewState, netBurnOrIncomeState, forecastState, forecastListState, filter) => getNetBurnOrIncomeReport(accountState, accountGroupState, sectionAccountsViewState, netBurnOrIncomeState, forecastState, forecastListState, filter));
|
|
29
|
+
const getOperatingExpensesFilter = createSelector((state) => state.opExState.opEx.firstMonthOfFY, (state) => state.opExState.uiState.timeframe, (state) => state.opExState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => newBalancesFilter(firstMonthOfFY, timeframe, 5, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
30
|
+
const getOperatingExpensesForLast5Periods = (state) => getOperatingExpensesReportForDashboard(state, getOperatingExpensesFilter(state));
|
|
31
|
+
const getRevenueFilter = createSelector((state) => state.revenueState.revenue.firstMonthOfFY, (state) => state.revenueState.uiState.timeframe, (state) => state.revenueState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => newBalancesFilter(firstMonthOfFY, timeframe, 4, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
32
|
+
const getRevenueForLast4Periods = createSelector(getRevenueFilter, (state) => state.accountState, (state) => state.accountGroupState, (state) => state.sectionAccountsViewState, (state) => state.forecastListState, (state) => state.revenueState, (state) => state.forecastState, (filter, accountState, accountGroupState, sectionAccountsViewState, forecastListState, revenueState, forecastState) => getRevenueReport(filter, accountState, accountGroupState, sectionAccountsViewState, forecastListState, revenueState, forecastState));
|
|
33
|
+
const getCashPositionFilter = createSelector((state) => state.cashPositionState.firstMonthOfFY, (state) => state.cashPositionState.uiState.timeframe, (state) => state.cashPositionState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => newBalancesFilter(firstMonthOfFY, timeframe, 5, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
34
|
+
const getCashPositionLast5Periods = createSelector((state) => state.accountState, (state) => state.cashPositionState, getCashPositionFilter, (accountState, cashPositionState, filter) => getCashPosition(accountState, cashPositionState, filter));
|
|
35
|
+
const getCashInCashOutFilter = createSelector((state) => state.cashInCashOutState.firstMonthOfFY, (state) => state.cashInCashOutState.uiState.timeframe, (state) => state.cashInCashOutState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => newBalancesFilter(firstMonthOfFY, timeframe, 4, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
36
|
+
const getCashInCashOutLast4Periods = createSelector((state) => state.accountState, (state) => state.accountGroupState, (state) => state.cashInCashOutState, getCashInCashOutFilter, (accountState, accountGroupState, cashInCashOutState, filter) => getCashInCashOut(accountState, accountGroupState, cashInCashOutState, filter));
|
|
34
37
|
const getNetBurnOrIncomeStoryCard = (state) => getNetBurnOrIncomeStoryCardReport(state);
|
|
35
38
|
const apAgingSelector = (state) => getApAgingReport(state);
|
|
36
39
|
const arAgingSelector = (state) => getArAgingReport(state);
|
|
@@ -5,12 +5,9 @@ import { getCurrentTenant } from '../../entity/tenant/tenantSelector';
|
|
|
5
5
|
import { defaultPeriods } from '../netBurnOrIncome/netBurnOrIncomeReducer';
|
|
6
6
|
import { ALL_ACCOUNTING_METHODS, toAccountingMethod, } from './netBurnOrIncomeStoryCardSelectorTypes';
|
|
7
7
|
import { ALL_TIME_SPAN_IDS_FOR_AVERAGE, } from './netBurnOrIncomeStoryCardState';
|
|
8
|
-
export const getNetBurnOrIncomeStoryCardReport = createSelector((state) => state, (
|
|
9
|
-
const { netBurnOrIncomeStoryCardState, netBurnOrIncomeState } = rootState;
|
|
8
|
+
export const getNetBurnOrIncomeStoryCardReport = createSelector((state) => state.netBurnOrIncomeStoryCardState, (state) => state.netBurnOrIncomeState.netBurnOrIncome.firstMonthOfFY, getCurrentTenant, (netBurnOrIncomeStoryCardState, firstMonthOfFY, currentTenant) => {
|
|
10
9
|
const { opExCash, ebitda, netIncome, runwayCash, runwayEbitda, runwayNetIncome, reportId, reportTitle, version, status, fetchState, error, updateStatus, } = netBurnOrIncomeStoryCardState;
|
|
11
|
-
const { firstMonthOfFY } = netBurnOrIncomeState.netBurnOrIncome;
|
|
12
10
|
const filter = newBalancesFilter(firstMonthOfFY, 'month', defaultPeriods.numberOfPeriods, undefined, 'ascending_date');
|
|
13
|
-
const currentTenant = getCurrentTenant(rootState);
|
|
14
11
|
const selectedAccountingMethod = currentTenant?.netBurnSettings?.accountingMethod;
|
|
15
12
|
const timeSpanIdForAverage = currentTenant?.netBurnSettings?.timeSpanIdForAverage;
|
|
16
13
|
let netBurnOrIncomeBalances;
|
|
@@ -58,7 +58,7 @@ export const getOperatingExpensesUIState = createSelector((state) => state.opExS
|
|
|
58
58
|
reportFormat,
|
|
59
59
|
};
|
|
60
60
|
});
|
|
61
|
-
|
|
61
|
+
function getOpExBalancesInTimeFrame(opExState, sectionState, readCustomRangeSlot) {
|
|
62
62
|
// Custom detail reads its own section-accounts slot so a default fetch can't
|
|
63
63
|
// overwrite the partial-period data; the dashboard reads the default slot.
|
|
64
64
|
const reportId = reportIdUniqueKey(undefined, readCustomRangeSlot && opExState.uiState.customTimeframe != null);
|
|
@@ -73,8 +73,8 @@ const getOpExBalancesInTimeFrame = createSelector((state) => state.opExState, (s
|
|
|
73
73
|
return incomeOrExpenseBalances.balances;
|
|
74
74
|
}
|
|
75
75
|
return [];
|
|
76
|
-
}
|
|
77
|
-
|
|
76
|
+
}
|
|
77
|
+
const createOperatingExpensesReportSelector = () => createSelector((state) => state.accountState, (state) => state.accountGroupState, (state) => state.sectionAccountsViewState, (state) => state.opExState, (state) => state.forecastState, (state) => state.forecastListState, (_state, filter) => filter, (_state, _filter, forecastId) => forecastId, (_state, _filter, _forecastId, readCustomRangeSlot) => readCustomRangeSlot === true, (accountState, accountGroupState, sectionsState, opExState, forecastState, forecastListState, filter, forecastId, readCustomRangeSlot) => {
|
|
78
78
|
const opEx = getState(opExState, opExState.uiState.isForecastModeOn, forecastId);
|
|
79
79
|
// The detail screen opts into customFetchState so its Completed check fires
|
|
80
80
|
// off the custom fetch; the dashboard (no flag) reads the shared fetchState,
|
|
@@ -103,7 +103,7 @@ export const getOperatingExpensesReport = createSelector((state) => state, (stat
|
|
|
103
103
|
}, filter);
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
|
-
const balancesInTimeframe = getOpExBalancesInTimeFrame(
|
|
106
|
+
const balancesInTimeframe = getOpExBalancesInTimeFrame(opExState, sectionsState, useCustomRange);
|
|
107
107
|
const allTimeframeTicks = balancesInTimeframe.map((balance) => toTimeframeTick(balance));
|
|
108
108
|
const forecast = opEx.forecastId != null
|
|
109
109
|
? getForecast(forecastState, opEx.forecastId)
|
|
@@ -134,6 +134,9 @@ export const getOperatingExpensesReport = createSelector((state) => state, (stat
|
|
|
134
134
|
customTimeframe: opExState.uiState.customTimeframe,
|
|
135
135
|
};
|
|
136
136
|
});
|
|
137
|
+
export const getOperatingExpensesReport = createOperatingExpensesReportSelector();
|
|
138
|
+
// The dashboard card keeps its own cache so the detail page's calls with other filters can't evict it.
|
|
139
|
+
export const getOperatingExpensesReportForDashboard = createOperatingExpensesReportSelector();
|
|
137
140
|
export const getOperatingExpensesForSelectedRange = createSelector((state) => state, (state) => state.opExState, (state, opExWithForecastState) => {
|
|
138
141
|
const { timeframe, selectedCOABalancesRange, selectedAdditionalBalances, isForecastModeOn, selectedForecast, } = opExWithForecastState.uiState;
|
|
139
142
|
const noFilter = newBalancesFilter(opExWithForecastState.opEx.firstMonthOfFY, timeframe, selectedCOABalancesRange.numberOfPeriods, selectedCOABalancesRange.thisPeriod, 'ascending_date', selectedAdditionalBalances);
|
|
@@ -25,15 +25,18 @@ const reimbursementCardSelector_1 = require("../reimbursementCard/reimbursementC
|
|
|
25
25
|
const revenueSelector_1 = require("../revenue/revenueSelector");
|
|
26
26
|
const tasksCardSelector_1 = require("../tasksCard/tasksCardSelector");
|
|
27
27
|
const topExSelector_1 = require("../topEx/topExSelector");
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
28
|
+
// Every input must return the same reference until the slices it reads change, or getDashboard
|
|
29
|
+
// rebuilds every card's balances on each dispatched action.
|
|
30
|
+
const getNetBurnOrIncomeFilter = (0, toolkit_1.createSelector)((state) => state.netBurnOrIncomeState.netBurnOrIncome.firstMonthOfFY, (state) => state.netBurnOrIncomeState.uiState.timeframe, (state) => state.netBurnOrIncomeState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => (0, coaBalancesFilter_1.newBalancesFilter)(firstMonthOfFY, timeframe, 4, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
31
|
+
const getNetBurnOrIncomeForLast4Periods = (0, toolkit_1.createSelector)((state) => state.accountState, (state) => state.accountGroupState, (state) => state.sectionAccountsViewState, (state) => state.netBurnOrIncomeState, (state) => state.forecastState, (state) => state.forecastListState, getNetBurnOrIncomeFilter, (accountState, accountGroupState, sectionAccountsViewState, netBurnOrIncomeState, forecastState, forecastListState, filter) => (0, netBurnOrIncomeSelector_1.getNetBurnOrIncomeReport)(accountState, accountGroupState, sectionAccountsViewState, netBurnOrIncomeState, forecastState, forecastListState, filter));
|
|
32
|
+
const getOperatingExpensesFilter = (0, toolkit_1.createSelector)((state) => state.opExState.opEx.firstMonthOfFY, (state) => state.opExState.uiState.timeframe, (state) => state.opExState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => (0, coaBalancesFilter_1.newBalancesFilter)(firstMonthOfFY, timeframe, 5, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
33
|
+
const getOperatingExpensesForLast5Periods = (state) => (0, opExSelector_1.getOperatingExpensesReportForDashboard)(state, getOperatingExpensesFilter(state));
|
|
34
|
+
const getRevenueFilter = (0, toolkit_1.createSelector)((state) => state.revenueState.revenue.firstMonthOfFY, (state) => state.revenueState.uiState.timeframe, (state) => state.revenueState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => (0, coaBalancesFilter_1.newBalancesFilter)(firstMonthOfFY, timeframe, 4, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
35
|
+
const getRevenueForLast4Periods = (0, toolkit_1.createSelector)(getRevenueFilter, (state) => state.accountState, (state) => state.accountGroupState, (state) => state.sectionAccountsViewState, (state) => state.forecastListState, (state) => state.revenueState, (state) => state.forecastState, (filter, accountState, accountGroupState, sectionAccountsViewState, forecastListState, revenueState, forecastState) => (0, revenueSelector_1.getRevenueReport)(filter, accountState, accountGroupState, sectionAccountsViewState, forecastListState, revenueState, forecastState));
|
|
36
|
+
const getCashPositionFilter = (0, toolkit_1.createSelector)((state) => state.cashPositionState.firstMonthOfFY, (state) => state.cashPositionState.uiState.timeframe, (state) => state.cashPositionState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => (0, coaBalancesFilter_1.newBalancesFilter)(firstMonthOfFY, timeframe, 5, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
37
|
+
const getCashPositionLast5Periods = (0, toolkit_1.createSelector)((state) => state.accountState, (state) => state.cashPositionState, getCashPositionFilter, (accountState, cashPositionState, filter) => (0, cashPositionSelector_1.getCashPosition)(accountState, cashPositionState, filter));
|
|
38
|
+
const getCashInCashOutFilter = (0, toolkit_1.createSelector)((state) => state.cashInCashOutState.firstMonthOfFY, (state) => state.cashInCashOutState.uiState.timeframe, (state) => state.cashInCashOutState.uiState.selectedAdditionalBalances, (firstMonthOfFY, timeframe, selectedAdditionalBalances) => (0, coaBalancesFilter_1.newBalancesFilter)(firstMonthOfFY, timeframe, 4, undefined, 'ascending_date', selectedAdditionalBalances));
|
|
39
|
+
const getCashInCashOutLast4Periods = (0, toolkit_1.createSelector)((state) => state.accountState, (state) => state.accountGroupState, (state) => state.cashInCashOutState, getCashInCashOutFilter, (accountState, accountGroupState, cashInCashOutState, filter) => (0, cashInCashOutSelector_1.getCashInCashOut)(accountState, accountGroupState, cashInCashOutState, filter));
|
|
37
40
|
const getNetBurnOrIncomeStoryCard = (state) => (0, netBurnOrIncomeStoryCardSelector_1.getNetBurnOrIncomeStoryCardReport)(state);
|
|
38
41
|
const apAgingSelector = (state) => (0, apAgingSelector_1.getApAgingReport)(state);
|
|
39
42
|
const arAgingSelector = (state) => (0, arAgingSelector_1.getArAgingReport)(state);
|
|
@@ -8,12 +8,9 @@ const tenantSelector_1 = require("../../entity/tenant/tenantSelector");
|
|
|
8
8
|
const netBurnOrIncomeReducer_1 = require("../netBurnOrIncome/netBurnOrIncomeReducer");
|
|
9
9
|
const netBurnOrIncomeStoryCardSelectorTypes_1 = require("./netBurnOrIncomeStoryCardSelectorTypes");
|
|
10
10
|
const netBurnOrIncomeStoryCardState_1 = require("./netBurnOrIncomeStoryCardState");
|
|
11
|
-
exports.getNetBurnOrIncomeStoryCardReport = (0, toolkit_1.createSelector)((state) => state, (
|
|
12
|
-
const { netBurnOrIncomeStoryCardState, netBurnOrIncomeState } = rootState;
|
|
11
|
+
exports.getNetBurnOrIncomeStoryCardReport = (0, toolkit_1.createSelector)((state) => state.netBurnOrIncomeStoryCardState, (state) => state.netBurnOrIncomeState.netBurnOrIncome.firstMonthOfFY, tenantSelector_1.getCurrentTenant, (netBurnOrIncomeStoryCardState, firstMonthOfFY, currentTenant) => {
|
|
13
12
|
const { opExCash, ebitda, netIncome, runwayCash, runwayEbitda, runwayNetIncome, reportId, reportTitle, version, status, fetchState, error, updateStatus, } = netBurnOrIncomeStoryCardState;
|
|
14
|
-
const { firstMonthOfFY } = netBurnOrIncomeState.netBurnOrIncome;
|
|
15
13
|
const filter = (0, coaBalancesFilter_1.newBalancesFilter)(firstMonthOfFY, 'month', netBurnOrIncomeReducer_1.defaultPeriods.numberOfPeriods, undefined, 'ascending_date');
|
|
16
|
-
const currentTenant = (0, tenantSelector_1.getCurrentTenant)(rootState);
|
|
17
14
|
const selectedAccountingMethod = currentTenant?.netBurnSettings?.accountingMethod;
|
|
18
15
|
const timeSpanIdForAverage = currentTenant?.netBurnSettings?.timeSpanIdForAverage;
|
|
19
16
|
let netBurnOrIncomeBalances;
|
|
@@ -4,7 +4,10 @@ import { RootState } from '../../rootStateTypes';
|
|
|
4
4
|
import { OpExReport, OpExUIStateSelectorView } from './opExSelectorTypes';
|
|
5
5
|
import { OpExWithForecastState } from './opExState';
|
|
6
6
|
export declare const getOperatingExpensesUIState: (state: RootState) => OpExUIStateSelectorView;
|
|
7
|
-
|
|
7
|
+
type OperatingExpensesReportSelector = (state: RootState, filter: COABalancesFilter, forecastId?: ID, readCustomRangeSlot?: boolean) => OpExReport;
|
|
8
|
+
export declare const getOperatingExpensesReport: OperatingExpensesReportSelector;
|
|
9
|
+
export declare const getOperatingExpensesReportForDashboard: OperatingExpensesReportSelector;
|
|
8
10
|
export declare const getOperatingExpensesForSelectedRange: (state: RootState) => OpExReport;
|
|
9
11
|
export declare const getOperatingExpensesForHighlightedRange: (state: RootState) => OpExReport;
|
|
10
12
|
export declare const getOperatingExpensesReportFetchState: (forecastId: ID | undefined, opExState: OpExWithForecastState) => FetchStateAndError;
|
|
13
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOperatingExpensesReportFetchState = exports.getOperatingExpensesForHighlightedRange = exports.getOperatingExpensesForSelectedRange = exports.getOperatingExpensesReport = exports.getOperatingExpensesUIState = void 0;
|
|
3
|
+
exports.getOperatingExpensesReportFetchState = exports.getOperatingExpensesForHighlightedRange = exports.getOperatingExpensesForSelectedRange = exports.getOperatingExpensesReportForDashboard = exports.getOperatingExpensesReport = exports.getOperatingExpensesUIState = void 0;
|
|
4
4
|
const toolkit_1 = require("@reduxjs/toolkit");
|
|
5
5
|
const coaBalancesFilter_1 = require("../../commonStateTypes/coaBalance/coaBalancesFilter");
|
|
6
6
|
const getCOABalancesSlice_1 = require("../../commonStateTypes/coaBalance/getCOABalancesSlice");
|
|
@@ -61,7 +61,7 @@ exports.getOperatingExpensesUIState = (0, toolkit_1.createSelector)((state) => s
|
|
|
61
61
|
reportFormat,
|
|
62
62
|
};
|
|
63
63
|
});
|
|
64
|
-
|
|
64
|
+
function getOpExBalancesInTimeFrame(opExState, sectionState, readCustomRangeSlot) {
|
|
65
65
|
// Custom detail reads its own section-accounts slot so a default fetch can't
|
|
66
66
|
// overwrite the partial-period data; the dashboard reads the default slot.
|
|
67
67
|
const reportId = (0, opExForTimeFrameEpic_1.reportIdUniqueKey)(undefined, readCustomRangeSlot && opExState.uiState.customTimeframe != null);
|
|
@@ -76,8 +76,8 @@ const getOpExBalancesInTimeFrame = (0, toolkit_1.createSelector)((state) => stat
|
|
|
76
76
|
return incomeOrExpenseBalances.balances;
|
|
77
77
|
}
|
|
78
78
|
return [];
|
|
79
|
-
}
|
|
80
|
-
|
|
79
|
+
}
|
|
80
|
+
const createOperatingExpensesReportSelector = () => (0, toolkit_1.createSelector)((state) => state.accountState, (state) => state.accountGroupState, (state) => state.sectionAccountsViewState, (state) => state.opExState, (state) => state.forecastState, (state) => state.forecastListState, (_state, filter) => filter, (_state, _filter, forecastId) => forecastId, (_state, _filter, _forecastId, readCustomRangeSlot) => readCustomRangeSlot === true, (accountState, accountGroupState, sectionsState, opExState, forecastState, forecastListState, filter, forecastId, readCustomRangeSlot) => {
|
|
81
81
|
const opEx = (0, opExReducer_1.getState)(opExState, opExState.uiState.isForecastModeOn, forecastId);
|
|
82
82
|
// The detail screen opts into customFetchState so its Completed check fires
|
|
83
83
|
// off the custom fetch; the dashboard (no flag) reads the shared fetchState,
|
|
@@ -106,7 +106,7 @@ exports.getOperatingExpensesReport = (0, toolkit_1.createSelector)((state) => st
|
|
|
106
106
|
}, filter);
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
-
const balancesInTimeframe = getOpExBalancesInTimeFrame(
|
|
109
|
+
const balancesInTimeframe = getOpExBalancesInTimeFrame(opExState, sectionsState, useCustomRange);
|
|
110
110
|
const allTimeframeTicks = balancesInTimeframe.map((balance) => (0, timeframeTick_1.toTimeframeTick)(balance));
|
|
111
111
|
const forecast = opEx.forecastId != null
|
|
112
112
|
? (0, forecastSelector_1.getForecast)(forecastState, opEx.forecastId)
|
|
@@ -137,6 +137,9 @@ exports.getOperatingExpensesReport = (0, toolkit_1.createSelector)((state) => st
|
|
|
137
137
|
customTimeframe: opExState.uiState.customTimeframe,
|
|
138
138
|
};
|
|
139
139
|
});
|
|
140
|
+
exports.getOperatingExpensesReport = createOperatingExpensesReportSelector();
|
|
141
|
+
// The dashboard card keeps its own cache so the detail page's calls with other filters can't evict it.
|
|
142
|
+
exports.getOperatingExpensesReportForDashboard = createOperatingExpensesReportSelector();
|
|
140
143
|
exports.getOperatingExpensesForSelectedRange = (0, toolkit_1.createSelector)((state) => state, (state) => state.opExState, (state, opExWithForecastState) => {
|
|
141
144
|
const { timeframe, selectedCOABalancesRange, selectedAdditionalBalances, isForecastModeOn, selectedForecast, } = opExWithForecastState.uiState;
|
|
142
145
|
const noFilter = (0, coaBalancesFilter_1.newBalancesFilter)(opExWithForecastState.opEx.firstMonthOfFY, timeframe, selectedCOABalancesRange.numberOfPeriods, selectedCOABalancesRange.thisPeriod, 'ascending_date', selectedAdditionalBalances);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.24",
|
|
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",
|