@zeniai/client-epic-state 5.2.39-betaRD0 → 5.2.39

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.
@@ -17,7 +17,6 @@ export const initialFinanceStatementState = {
17
17
  displayOrder: 'ascending_date',
18
18
  reportFormat: 'more_detailed',
19
19
  lastFetchRequestTime: undefined,
20
- isPeriodSelectionExplicit: false,
21
20
  };
22
21
  const financeStatement = createSlice({
23
22
  name: 'financeStatement',
@@ -34,26 +33,14 @@ const financeStatement = createSlice({
34
33
  },
35
34
  },
36
35
  updateFinanceStatementTimeframe(draft, action) {
37
- // A month anchor is meaningless once the timeframe becomes quarter/year, so
38
- // a real timeframe change has to drop it. Callers also re-dispatch the
39
- // *current* timeframe as a side effect of unrelated UI (report format, view
40
- // switches); dropping the anchor there silently resets the user's period to
41
- // the latest one, so leave the selection alone when nothing changed.
42
- if (draft.timeframe === action.payload) {
43
- return;
44
- }
45
36
  draft.timeframe = action.payload;
46
37
  draft.selectedCOABalancesRange = {
47
38
  numberOfPeriods: draft.selectedCOABalancesRange.numberOfPeriods,
48
39
  orderBy: draft.selectedCOABalancesRange.orderBy,
49
40
  };
50
- draft.isPeriodSelectionExplicit = false;
51
41
  },
52
42
  updateCOABalancesRange(draft, action) {
53
43
  draft.selectedCOABalancesRange = Object.assign({}, action.payload);
54
- // A range without an anchor is a programmatic reset to the default, not a
55
- // user pick (e.g. leaving the horizontal by-class layout).
56
- draft.isPeriodSelectionExplicit = action.payload.thisPeriod != null;
57
44
  },
58
45
  updateFinanceStatementThisPeriod(draft, action) {
59
46
  const { firstMonthOfFY, coaBalances, maxNumOfPeriodsToHighlight } = action.payload;
@@ -68,7 +55,6 @@ const financeStatement = createSlice({
68
55
  };
69
56
  const newThisPeriod = getMatchingThisPeriod(action.payload.firstMonthOfFY, timeframe, action.payload.thisPeriod, safeCoaBalances);
70
57
  if (newThisPeriod != null) {
71
- draft.isPeriodSelectionExplicit = true;
72
58
  const selectionRanges = getSelectedAndHighlightedRangesForThisPeriod({
73
59
  firstMonthOfFY,
74
60
  thisPeriod: newThisPeriod,
@@ -109,14 +95,6 @@ const financeStatement = createSlice({
109
95
  draft.isAdditionalBalancesShown =
110
96
  additionalBalances.length != 0 ? true : false;
111
97
  const { timeframe, selectedCOABalancesRange } = draft;
112
- // The reports page fires this on load, on window resize and on every
113
- // fetch-state transition (so also on report switch and on remount after a
114
- // drill-down), carrying a viewport-derived period count. Re-deriving the
115
- // range from that count silently discards a range the user chose, so only
116
- // the column metadata above is applied once the selection is theirs.
117
- if (draft.isPeriodSelectionExplicit) {
118
- return;
119
- }
120
98
  if (safeCoaBalances.length > 0) {
121
99
  const thisPeriod = extractThisPeriod(action.payload.firstMonthOfFY, timeframe, selectedCOABalancesRange, safeCoaBalances);
122
100
  if (thisPeriod != null) {
@@ -21,7 +21,6 @@ exports.initialFinanceStatementState = {
21
21
  displayOrder: 'ascending_date',
22
22
  reportFormat: 'more_detailed',
23
23
  lastFetchRequestTime: undefined,
24
- isPeriodSelectionExplicit: false,
25
24
  };
26
25
  const financeStatement = (0, toolkit_1.createSlice)({
27
26
  name: 'financeStatement',
@@ -38,26 +37,14 @@ const financeStatement = (0, toolkit_1.createSlice)({
38
37
  },
39
38
  },
40
39
  updateFinanceStatementTimeframe(draft, action) {
41
- // A month anchor is meaningless once the timeframe becomes quarter/year, so
42
- // a real timeframe change has to drop it. Callers also re-dispatch the
43
- // *current* timeframe as a side effect of unrelated UI (report format, view
44
- // switches); dropping the anchor there silently resets the user's period to
45
- // the latest one, so leave the selection alone when nothing changed.
46
- if (draft.timeframe === action.payload) {
47
- return;
48
- }
49
40
  draft.timeframe = action.payload;
50
41
  draft.selectedCOABalancesRange = {
51
42
  numberOfPeriods: draft.selectedCOABalancesRange.numberOfPeriods,
52
43
  orderBy: draft.selectedCOABalancesRange.orderBy,
53
44
  };
54
- draft.isPeriodSelectionExplicit = false;
55
45
  },
56
46
  updateCOABalancesRange(draft, action) {
57
47
  draft.selectedCOABalancesRange = Object.assign({}, action.payload);
58
- // A range without an anchor is a programmatic reset to the default, not a
59
- // user pick (e.g. leaving the horizontal by-class layout).
60
- draft.isPeriodSelectionExplicit = action.payload.thisPeriod != null;
61
48
  },
62
49
  updateFinanceStatementThisPeriod(draft, action) {
63
50
  const { firstMonthOfFY, coaBalances, maxNumOfPeriodsToHighlight } = action.payload;
@@ -72,7 +59,6 @@ const financeStatement = (0, toolkit_1.createSlice)({
72
59
  };
73
60
  const newThisPeriod = (0, thisPeriodHelpers_1.getMatchingThisPeriod)(action.payload.firstMonthOfFY, timeframe, action.payload.thisPeriod, safeCoaBalances);
74
61
  if (newThisPeriod != null) {
75
- draft.isPeriodSelectionExplicit = true;
76
62
  const selectionRanges = (0, getSelectedAndHighlightedRanges_1.getSelectedAndHighlightedRangesForThisPeriod)({
77
63
  firstMonthOfFY,
78
64
  thisPeriod: newThisPeriod,
@@ -113,14 +99,6 @@ const financeStatement = (0, toolkit_1.createSlice)({
113
99
  draft.isAdditionalBalancesShown =
114
100
  additionalBalances.length != 0 ? true : false;
115
101
  const { timeframe, selectedCOABalancesRange } = draft;
116
- // The reports page fires this on load, on window resize and on every
117
- // fetch-state transition (so also on report switch and on remount after a
118
- // drill-down), carrying a viewport-derived period count. Re-deriving the
119
- // range from that count silently discards a range the user chose, so only
120
- // the column metadata above is applied once the selection is theirs.
121
- if (draft.isPeriodSelectionExplicit) {
122
- return;
123
- }
124
102
  if (safeCoaBalances.length > 0) {
125
103
  const thisPeriod = (0, thisPeriodHelpers_1.extractThisPeriod)(action.payload.firstMonthOfFY, timeframe, selectedCOABalancesRange, safeCoaBalances);
126
104
  if (thisPeriod != null) {
@@ -2,13 +2,6 @@ import { ReportUIState } from '../../commonStateTypes/viewAndReport/reportUIStat
2
2
  import { ReportID } from '../../commonStateTypes/viewAndReport/viewAndReport';
3
3
  import { ZeniDate } from '../../zeniDayJS';
4
4
  export interface FinanceStatementState extends ReportUIState {
5
- /**
6
- * True once the user has picked a period range themselves (date-range picker or
7
- * a period column click), as opposed to the viewport-derived default the page
8
- * applies on load. While true, automatic column refits must not resize the
9
- * selection.
10
- */
11
- isPeriodSelectionExplicit: boolean;
12
5
  selectedReportId: ReportID;
13
6
  lastFetchRequestTime?: ZeniDate;
14
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeniai/client-epic-state",
3
- "version": "5.2.39-betaRD0",
3
+ "version": "5.2.39",
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",