@zeniai/client-epic-state 4.19.99 → 4.19.100

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.
Files changed (165) hide show
  1. package/lib/commonStateTypes/coaBalance/coaBalanceType.d.ts +0 -2
  2. package/lib/commonStateTypes/coaBalance/coaBalanceType.js +0 -6
  3. package/lib/commonStateTypes/currencyHelper.d.ts +0 -3
  4. package/lib/commonStateTypes/currencyHelper.js +1 -6
  5. package/lib/commonStateTypes/reduceFetchState.d.ts +0 -9
  6. package/lib/commonStateTypes/reduceFetchState.js +0 -26
  7. package/lib/entity/account/accountPayload.d.ts +0 -2
  8. package/lib/entity/account/accountPayload.js +0 -2
  9. package/lib/entity/account/accountState.d.ts +0 -2
  10. package/lib/entity/customer/customerState.d.ts +2 -0
  11. package/lib/entity/customer/customerState.js +5 -0
  12. package/lib/entity/depositAccount/depositAccount.d.ts +1 -1
  13. package/lib/entity/depositAccount/depositAccount.js +1 -8
  14. package/lib/entity/reimbursement/reimbursementPayload.d.ts +0 -2
  15. package/lib/entity/reimbursement/reimbursementPayload.js +0 -7
  16. package/lib/entity/reimbursement/reimbursementState.d.ts +0 -2
  17. package/lib/entity/snackbar/snackbarTypes.d.ts +1 -1
  18. package/lib/entity/snackbar/snackbarTypes.js +0 -1
  19. package/lib/entity/task/taskPayload.d.ts +0 -1
  20. package/lib/entity/task/taskPayload.js +0 -1
  21. package/lib/entity/task/taskState.d.ts +0 -1
  22. package/lib/epic.d.ts +1 -12
  23. package/lib/epic.js +1 -12
  24. package/lib/esm/commonStateTypes/coaBalance/coaBalanceType.js +0 -5
  25. package/lib/esm/commonStateTypes/currencyHelper.js +0 -5
  26. package/lib/esm/commonStateTypes/reduceFetchState.js +0 -25
  27. package/lib/esm/entity/account/accountPayload.js +0 -2
  28. package/lib/esm/entity/customer/customerState.js +4 -1
  29. package/lib/esm/entity/depositAccount/depositAccount.js +1 -8
  30. package/lib/esm/entity/reimbursement/reimbursementPayload.js +0 -7
  31. package/lib/esm/entity/snackbar/snackbarTypes.js +0 -1
  32. package/lib/esm/entity/task/taskPayload.js +0 -1
  33. package/lib/esm/epic.js +1 -12
  34. package/lib/esm/index.js +10 -18
  35. package/lib/esm/reducer.js +0 -6
  36. package/lib/esm/view/arAgingView/arAgingReport/arAgingReducer.js +1 -1
  37. package/lib/esm/view/arAgingView/arAgingReport/arAgingSelector.js +1 -1
  38. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +5 -7
  39. package/lib/esm/view/expenseAutomationView/payload/missingReceiptsPayload.js +1 -189
  40. package/lib/esm/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -433
  41. package/lib/esm/view/expenseAutomationView/reducers/transactionsViewReducer.js +1 -23
  42. package/lib/esm/view/expenseAutomationView/selectors/missingReceiptsSelector.js +1 -244
  43. package/lib/esm/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -2
  44. package/lib/esm/view/expenseAutomationView/types/missingReceiptsViewState.js +0 -44
  45. package/lib/esm/view/expenseAutomationView/types/transactionsViewState.js +1 -2
  46. package/lib/esm/view/financeStatement/financeStatementReducer.js +8 -11
  47. package/lib/esm/view/financeStatement/financeStatementSelector.js +9 -24
  48. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +1 -6
  49. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +29 -2
  50. package/lib/esm/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +5 -7
  51. package/lib/esm/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +7 -9
  52. package/lib/esm/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
  53. package/lib/esm/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +0 -1
  54. package/lib/esm/view/taskManager/taskListView/taskListSelector.js +1 -3
  55. package/lib/esm/view/twoFactorAuthentication/resendOtpEpic.js +16 -2
  56. package/lib/esm/view/userListView/fetchUserListByTypeEpic.js +0 -11
  57. package/lib/esm/zeniAPI.js +2 -0
  58. package/lib/index.d.ts +12 -19
  59. package/lib/index.js +23 -81
  60. package/lib/reducer.d.ts +0 -6
  61. package/lib/reducer.js +0 -6
  62. package/lib/view/arAgingView/arAgingReport/arAgingReducer.js +2 -2
  63. package/lib/view/arAgingView/arAgingReport/arAgingSelector.js +5 -5
  64. package/lib/view/expenseAutomationView/epics/missingReceipts/uploadMissingReceiptSuccessEpic.js +5 -7
  65. package/lib/view/expenseAutomationView/helpers/transactionCategorizationLocalDataHelper.d.ts +1 -1
  66. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.d.ts +0 -118
  67. package/lib/view/expenseAutomationView/payload/missingReceiptsPayload.js +0 -201
  68. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.d.ts +3 -76
  69. package/lib/view/expenseAutomationView/reducers/missingReceiptsViewReducer.js +2 -434
  70. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.d.ts +3 -11
  71. package/lib/view/expenseAutomationView/reducers/transactionsViewReducer.js +2 -24
  72. package/lib/view/expenseAutomationView/selectorTypes/missingReceiptsSelectorTypes.d.ts +1 -69
  73. package/lib/view/expenseAutomationView/selectorTypes/transactionsViewSelectorTypes.d.ts +0 -1
  74. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.d.ts +1 -1
  75. package/lib/view/expenseAutomationView/selectors/missingReceiptsSelector.js +0 -243
  76. package/lib/view/expenseAutomationView/selectors/transactionCategorizationSelector.js +1 -2
  77. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.d.ts +0 -142
  78. package/lib/view/expenseAutomationView/types/missingReceiptsViewState.js +1 -54
  79. package/lib/view/expenseAutomationView/types/transactionsViewState.d.ts +1 -2
  80. package/lib/view/expenseAutomationView/types/transactionsViewState.js +1 -2
  81. package/lib/view/financeStatement/financeStatementReducer.js +8 -11
  82. package/lib/view/financeStatement/financeStatementSelector.d.ts +0 -2
  83. package/lib/view/financeStatement/financeStatementSelector.js +9 -24
  84. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.d.ts +2 -4
  85. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewReducer.js +2 -7
  86. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewSelector.js +29 -2
  87. package/lib/view/profitAndLossClassesView/profitAndLossClassesViewState.d.ts +0 -4
  88. package/lib/view/profitAndLossClassesView/profitAndLossForTimeframeClassesViewEpic.js +5 -7
  89. package/lib/view/reportUIOptions/updateReportUIOptionCOABalancesRangeEpic.js +6 -8
  90. package/lib/view/taskManager/taskDetailView/taskDetailSelector.js +1 -1
  91. package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.d.ts +0 -1
  92. package/lib/view/taskManager/taskListView/epics/bulkUpdateTaskListEpic.js +0 -1
  93. package/lib/view/taskManager/taskListView/taskListSelector.d.ts +0 -2
  94. package/lib/view/taskManager/taskListView/taskListSelector.js +1 -3
  95. package/lib/view/twoFactorAuthentication/resendOtpEpic.d.ts +1 -1
  96. package/lib/view/twoFactorAuthentication/resendOtpEpic.js +15 -1
  97. package/lib/view/userListView/fetchUserListByTypeEpic.d.ts +1 -3
  98. package/lib/view/userListView/fetchUserListByTypeEpic.js +0 -11
  99. package/lib/view/userListView/userListViewPayload.d.ts +0 -2
  100. package/lib/zeniAPI.js +2 -0
  101. package/package.json +2 -2
  102. package/lib/entity/userGroups/userGroupsPayload.d.ts +0 -7
  103. package/lib/entity/userGroups/userGroupsPayload.js +0 -10
  104. package/lib/entity/userGroups/userGroupsReducer.d.ts +0 -8
  105. package/lib/entity/userGroups/userGroupsReducer.js +0 -29
  106. package/lib/entity/userGroups/userGroupsSelector.d.ts +0 -4
  107. package/lib/entity/userGroups/userGroupsSelector.js +0 -12
  108. package/lib/entity/userGroups/userGroupsState.d.ts +0 -9
  109. package/lib/entity/userGroups/userGroupsState.js +0 -2
  110. package/lib/esm/entity/userGroups/userGroupsPayload.js +0 -7
  111. package/lib/esm/entity/userGroups/userGroupsReducer.js +0 -25
  112. package/lib/esm/entity/userGroups/userGroupsSelector.js +0 -8
  113. package/lib/esm/entity/userGroups/userGroupsState.js +0 -1
  114. package/lib/esm/view/expenseAutomationView/bulkUploadTiming.js +0 -10
  115. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +0 -29
  116. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +0 -49
  117. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +0 -40
  118. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +0 -47
  119. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +0 -61
  120. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +0 -33
  121. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +0 -56
  122. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -77
  123. package/lib/esm/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +0 -79
  124. package/lib/esm/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +0 -24
  125. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +0 -322
  126. package/lib/esm/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +0 -9
  127. package/lib/esm/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +0 -201
  128. package/lib/esm/view/userGroupListView/userGroupListViewReducer.js +0 -65
  129. package/lib/esm/view/userGroupListView/userGroupListViewSelector.js +0 -16
  130. package/lib/esm/view/userGroupListView/userGroupListViewState.js +0 -1
  131. package/lib/tsconfig.typecheck.tsbuildinfo +0 -1
  132. package/lib/view/expenseAutomationView/bulkUploadTiming.d.ts +0 -10
  133. package/lib/view/expenseAutomationView/bulkUploadTiming.js +0 -13
  134. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.d.ts +0 -18
  135. package/lib/view/expenseAutomationView/epics/missingReceipts/bulkUploadReceiptsEpic.js +0 -33
  136. package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.d.ts +0 -7
  137. package/lib/view/expenseAutomationView/epics/missingReceipts/confirmBulkUploadMatchEpic.js +0 -53
  138. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.d.ts +0 -8
  139. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchDetailsEpic.js +0 -44
  140. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.d.ts +0 -7
  141. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchBulkUploadBatchesEpic.js +0 -51
  142. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.d.ts +0 -8
  143. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchCompletedTransactionsEpic.js +0 -65
  144. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.d.ts +0 -8
  145. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMoreBatchDetailsEpic.js +0 -37
  146. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.d.ts +0 -9
  147. package/lib/view/expenseAutomationView/epics/missingReceipts/fetchMultipleBatchDetailsEpic.js +0 -61
  148. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.d.ts +0 -14
  149. package/lib/view/expenseAutomationView/epics/missingReceipts/searchTransactionsForManualMatchEpic.js +0 -81
  150. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.d.ts +0 -25
  151. package/lib/view/expenseAutomationView/epics/missingReceipts/watchBulkUploadBatchStatusEpic.js +0 -85
  152. package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.d.ts +0 -7
  153. package/lib/view/expenseAutomationView/epics/transactionCategorization/uploadTransactionReceiptSuccessEpic.js +0 -28
  154. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.d.ts +0 -13
  155. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelector.js +0 -326
  156. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.d.ts +0 -111
  157. package/lib/view/profitAndLossClassesView/profitAndLossClassesByClassHorizontalSelectorTypes.js +0 -13
  158. package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.d.ts +0 -6
  159. package/lib/view/profitAndLossClassesView/profitAndLossHorizontalEnrichment.js +0 -204
  160. package/lib/view/userGroupListView/userGroupListViewReducer.d.ts +0 -23
  161. package/lib/view/userGroupListView/userGroupListViewReducer.js +0 -69
  162. package/lib/view/userGroupListView/userGroupListViewSelector.d.ts +0 -7
  163. package/lib/view/userGroupListView/userGroupListViewSelector.js +0 -20
  164. package/lib/view/userGroupListView/userGroupListViewState.d.ts +0 -8
  165. package/lib/view/userGroupListView/userGroupListViewState.js +0 -2
@@ -1,204 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.enrichProfitAndLossByClassHorizontalReport = enrichProfitAndLossByClassHorizontalReport;
4
- const currencyHelper_1 = require("../../commonStateTypes/currencyHelper");
5
- const profitAndLossClassesByClassHorizontalSelectorTypes_1 = require("./profitAndLossClassesByClassHorizontalSelectorTypes");
6
- /**
7
- * Populates `sectionHeaderBalancesSlice`, and per-account `accountReportData`, so the
8
- * web layer only maps selector output to tree nodes.
9
- */
10
- function enrichProfitAndLossByClassHorizontalReport(report) {
11
- if (report.fetchState !== 'Completed' || report.selectedPeriod == null) {
12
- return;
13
- }
14
- for (const section of Object.values(report.sections)) {
15
- if (section != null) {
16
- enrichHorizontalSection(report, section);
17
- }
18
- }
19
- for (const calc of Object.values(report.calculatedSections)) {
20
- if (calc != null) {
21
- enrichHorizontalCalculatedSection(report, calc);
22
- }
23
- }
24
- }
25
- function enrichHorizontalSection(report, section) {
26
- const classAmounts = report.classColumns.map((col) => {
27
- const total = section.classTotals.find((ct) => ct.classId === col.classId);
28
- return total?.balance.amount ?? 0;
29
- });
30
- section.sectionHeaderBalancesSlice = buildHorizontalClassColumnBalancesSlice(report, classAmounts, section.sectionTotal.amount);
31
- const childrenRowIndicesByParent = buildHorizontalAccountChildIndicesByParent(section.accounts);
32
- const childrenRecord = {};
33
- childrenRowIndicesByParent.forEach((childIndices, parentIndex) => {
34
- childrenRecord[parentIndex] = childIndices;
35
- });
36
- section.treeLayout = {
37
- rootAccountRowIndices: section.accounts
38
- .map((_, i) => findHorizontalAccountParentIndex(section.accounts, i) === -1 ? i : -1)
39
- .filter((i) => i >= 0),
40
- childrenRowIndicesByParent: childrenRecord,
41
- };
42
- for (let i = 0; i < section.accounts.length; i++) {
43
- const row = section.accounts[i];
44
- const classRowAmounts = report.classColumns.map((col) => {
45
- const cb = row.classBalances.find((b) => b.classId === col.classId);
46
- return cb?.balance.amount ?? 0;
47
- });
48
- row.accountReportData = {
49
- accountId: row.accountId,
50
- accountName: row.accountName,
51
- accountType: row.accountType,
52
- depth: row.depth,
53
- balancesInTimeframe: buildHorizontalClassColumnBalancesSlice(report, classRowAmounts, row.rowTotal.amount),
54
- horizontalTreeView: buildHorizontalTreeView(section.accounts, i),
55
- };
56
- }
57
- }
58
- function enrichHorizontalCalculatedSection(report, calcSection) {
59
- const classAmounts = report.classColumns.map((col) => {
60
- const total = calcSection.classTotals.find((ct) => ct.classId === col.classId);
61
- return total?.balance.amount ?? 0;
62
- });
63
- calcSection.sectionHeaderBalancesSlice =
64
- buildHorizontalClassColumnBalancesSlice(report, classAmounts, calcSection.sectionTotal.amount);
65
- }
66
- function buildHorizontalClassColumnBalancesSlice(report, classAmounts, totalAmount) {
67
- const fallback = currencyHelper_1.defaultCustomerCurrency;
68
- const firstHeader = report.headerBalances[0];
69
- const currencyCode = firstHeader?.balance.currencyCode ?? fallback.currencyCode;
70
- const currencySymbol = firstHeader?.balance.currencySymbol ?? fallback.currencySymbol;
71
- const timeframe = firstHeader?.balanceTimeFrame ?? 'month';
72
- const emptySlice = {
73
- balances: [],
74
- additionalBalances: [],
75
- filter: {
76
- firstMonthOfFY: report.firstMonthOfFY,
77
- timeframe,
78
- balancesRange: { numberOfPeriods: 0, orderBy: 'ascending_date' },
79
- additionalBalances: [],
80
- },
81
- };
82
- if (report.selectedPeriod == null) {
83
- return emptySlice;
84
- }
85
- const { startDate, endDate } = report.selectedPeriod;
86
- const balances = report.classColumns.map((col, i) => ({
87
- balance: {
88
- amount: classAmounts[i] ?? 0,
89
- currencyCode,
90
- currencySymbol,
91
- },
92
- balanceTimeFrame: timeframe,
93
- startDate,
94
- endDate,
95
- type: 'default',
96
- id: col.classId,
97
- label: col.className,
98
- }));
99
- balances.push({
100
- balance: {
101
- amount: totalAmount,
102
- currencyCode,
103
- currencySymbol,
104
- },
105
- balanceTimeFrame: timeframe,
106
- startDate,
107
- endDate,
108
- type: 'default',
109
- id: profitAndLossClassesByClassHorizontalSelectorTypes_1.HORIZONTAL_CLASS_TOTAL_BALANCE_ID,
110
- label: 'Total',
111
- });
112
- return {
113
- balances,
114
- additionalBalances: [],
115
- filter: {
116
- firstMonthOfFY: report.firstMonthOfFY,
117
- timeframe,
118
- balancesRange: {
119
- numberOfPeriods: balances.length,
120
- orderBy: 'ascending_date',
121
- },
122
- additionalBalances: [],
123
- },
124
- };
125
- }
126
- function findHorizontalAccountParentIndex(dfsOrderedAccountRows, childRowIndex) {
127
- const childDepth = dfsOrderedAccountRows[childRowIndex].depth;
128
- if (childDepth <= 2) {
129
- return -1;
130
- }
131
- for (let earlierRowIndex = childRowIndex - 1; earlierRowIndex >= 0; earlierRowIndex--) {
132
- const earlierDepth = dfsOrderedAccountRows[earlierRowIndex].depth;
133
- if (earlierDepth < childDepth) {
134
- if (earlierDepth === childDepth - 1) {
135
- return earlierRowIndex;
136
- }
137
- return -1;
138
- }
139
- }
140
- return -1;
141
- }
142
- function getHorizontalAccountSiblingIndices(dfsOrderedAccountRows, rowIndex) {
143
- const parentRowIndex = findHorizontalAccountParentIndex(dfsOrderedAccountRows, rowIndex);
144
- const rowDepth = dfsOrderedAccountRows[rowIndex].depth;
145
- const siblings = [];
146
- for (let i = 0; i < dfsOrderedAccountRows.length; i++) {
147
- if (dfsOrderedAccountRows[i].depth === rowDepth &&
148
- findHorizontalAccountParentIndex(dfsOrderedAccountRows, i) ===
149
- parentRowIndex) {
150
- siblings.push(i);
151
- }
152
- }
153
- return siblings;
154
- }
155
- function horizontalAccountHasChildRows(dfsOrderedAccountRows, parentRowIndex) {
156
- return dfsOrderedAccountRows.some((_, rowIndex) => findHorizontalAccountParentIndex(dfsOrderedAccountRows, rowIndex) ===
157
- parentRowIndex);
158
- }
159
- function buildHorizontalSubAccountAncestorMetadata(dfsOrderedAccountRows, currentRowIndex) {
160
- const ancestorRowIndicesRootToLeaf = [];
161
- let walkRowIndex = currentRowIndex;
162
- while (walkRowIndex >= 0) {
163
- ancestorRowIndicesRootToLeaf.unshift(walkRowIndex);
164
- walkRowIndex = findHorizontalAccountParentIndex(dfsOrderedAccountRows, walkRowIndex);
165
- }
166
- return ancestorRowIndicesRootToLeaf.map((rowIndex) => {
167
- const siblingIndices = getHorizontalAccountSiblingIndices(dfsOrderedAccountRows, rowIndex);
168
- return {
169
- depth: dfsOrderedAccountRows[rowIndex].depth - 2,
170
- hasSibling: siblingIndices.length > 1,
171
- hasChildren: horizontalAccountHasChildRows(dfsOrderedAccountRows, rowIndex),
172
- isLastNode: rowIndex === siblingIndices[siblingIndices.length - 1],
173
- name: dfsOrderedAccountRows[rowIndex].accountName,
174
- };
175
- });
176
- }
177
- function buildHorizontalAccountChildIndicesByParent(dfsOrderedAccountRows) {
178
- const childIndicesByParentRowIndex = new Map();
179
- for (let rowIndex = 0; rowIndex < dfsOrderedAccountRows.length; rowIndex++) {
180
- const parentRowIndex = findHorizontalAccountParentIndex(dfsOrderedAccountRows, rowIndex);
181
- if (parentRowIndex >= 0) {
182
- let childRowIndices = childIndicesByParentRowIndex.get(parentRowIndex);
183
- if (childRowIndices === undefined) {
184
- childRowIndices = [];
185
- childIndicesByParentRowIndex.set(parentRowIndex, childRowIndices);
186
- }
187
- childRowIndices.push(rowIndex);
188
- }
189
- }
190
- return childIndicesByParentRowIndex;
191
- }
192
- function buildHorizontalTreeView(dfsOrderedAccountRows, currentRowIndex) {
193
- const treeDepth = Math.max(0, dfsOrderedAccountRows[currentRowIndex].depth - 2);
194
- const siblingIndices = getHorizontalAccountSiblingIndices(dfsOrderedAccountRows, currentRowIndex);
195
- const hasChildren = horizontalAccountHasChildRows(dfsOrderedAccountRows, currentRowIndex);
196
- return {
197
- subAccountAncestorMetadata: buildHorizontalSubAccountAncestorMetadata(dfsOrderedAccountRows, currentRowIndex),
198
- treeDepth,
199
- hasChildren,
200
- hasSiblings: siblingIndices.length > 1,
201
- isLeaf: !hasChildren,
202
- isLastNode: currentRowIndex === siblingIndices[siblingIndices.length - 1],
203
- };
204
- }
@@ -1,23 +0,0 @@
1
- import { ID } from '../../commonStateTypes/common';
2
- import { UserGroupPayload } from '../../entity/userGroups/userGroupsPayload';
3
- import { ZeniAPIStatus } from '../../responsePayload';
4
- import { UserGroupListType, UserGroupListViewState } from './userGroupListViewState';
5
- export declare const initialState: UserGroupListViewState;
6
- export declare const fetchUserGroupListByType: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[userGroupType: "taskManagerCandidate", cacheOverride?: any], {
7
- userGroupType: "taskManagerCandidate";
8
- cacheOverride: any;
9
- }, "userGroupListView/fetchUserGroupListByType", never, never>, updateUserGroupIds: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
10
- userGroupsPayload: UserGroupPayload[];
11
- userGroupType: UserGroupListType;
12
- }, "userGroupListView/updateUserGroupIds">, addUserGroupId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
13
- id: ID;
14
- userGroupType: UserGroupListType;
15
- }, "userGroupListView/addUserGroupId">, removeUserGroupId: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
16
- id: ID;
17
- userGroupType: UserGroupListType;
18
- }, "userGroupListView/removeUserGroupId">, updateUserGroupListFetchFailure: import("@reduxjs/toolkit").ActionCreatorWithPayload<{
19
- status: ZeniAPIStatus;
20
- userGroupType: UserGroupListType;
21
- }, "userGroupListView/updateUserGroupListFetchFailure">, clearUserGroupListView: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"userGroupListView/clearUserGroupListView">;
22
- declare const _default: import("redux").Reducer<UserGroupListViewState>;
23
- export default _default;
@@ -1,69 +0,0 @@
1
- "use strict";
2
- var _a;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.clearUserGroupListView = exports.updateUserGroupListFetchFailure = exports.removeUserGroupId = exports.addUserGroupId = exports.updateUserGroupIds = exports.fetchUserGroupListByType = exports.initialState = void 0;
5
- const toolkit_1 = require("@reduxjs/toolkit");
6
- const initialUserGroupList = {
7
- ids: [],
8
- fetchState: 'Not-Started',
9
- error: undefined,
10
- hasValidState() {
11
- return this.fetchState == 'Completed';
12
- },
13
- };
14
- exports.initialState = {
15
- userGroupListByType: {
16
- taskManagerCandidate: initialUserGroupList,
17
- },
18
- };
19
- const userGroupListView = (0, toolkit_1.createSlice)({
20
- name: 'userGroupListView',
21
- initialState: exports.initialState,
22
- reducers: {
23
- fetchUserGroupListByType: {
24
- reducer(draft, action) {
25
- const { userGroupType } = action.payload;
26
- draft.userGroupListByType[userGroupType].fetchState = 'In-Progress';
27
- draft.userGroupListByType[userGroupType].error = undefined;
28
- },
29
- prepare(userGroupType, cacheOverride = false) {
30
- return {
31
- payload: {
32
- userGroupType,
33
- cacheOverride,
34
- },
35
- };
36
- },
37
- },
38
- updateUserGroupIds(draft, action) {
39
- const { userGroupType, userGroupsPayload } = action.payload;
40
- draft.userGroupListByType[userGroupType].fetchState = 'Completed';
41
- draft.userGroupListByType[userGroupType].error = undefined;
42
- draft.userGroupListByType[userGroupType].ids = userGroupsPayload.map((userGroup) => userGroup.id);
43
- },
44
- addUserGroupId(draft, action) {
45
- const { userGroupType, id } = action.payload;
46
- const index = draft.userGroupListByType[userGroupType].ids.indexOf(id);
47
- if (index < 0) {
48
- draft.userGroupListByType[userGroupType].ids.push(id);
49
- }
50
- },
51
- removeUserGroupId(draft, action) {
52
- const { userGroupType, id } = action.payload;
53
- const index = draft.userGroupListByType[userGroupType].ids.indexOf(id);
54
- if (index > -1) {
55
- draft.userGroupListByType[userGroupType].ids.splice(index, 1);
56
- }
57
- },
58
- updateUserGroupListFetchFailure(draft, action) {
59
- const { userGroupType, status } = action.payload;
60
- draft.userGroupListByType[userGroupType].fetchState = 'Error';
61
- draft.userGroupListByType[userGroupType].error = status;
62
- },
63
- clearUserGroupListView(draft) {
64
- Object.assign(draft, exports.initialState);
65
- },
66
- },
67
- });
68
- _a = userGroupListView.actions, exports.fetchUserGroupListByType = _a.fetchUserGroupListByType, exports.updateUserGroupIds = _a.updateUserGroupIds, exports.addUserGroupId = _a.addUserGroupId, exports.removeUserGroupId = _a.removeUserGroupId, exports.updateUserGroupListFetchFailure = _a.updateUserGroupListFetchFailure, exports.clearUserGroupListView = _a.clearUserGroupListView;
69
- exports.default = userGroupListView.reducer;
@@ -1,7 +0,0 @@
1
- import { SelectorView } from '../../commonStateTypes/viewAndReport/viewAndReport';
2
- import { UserGroup, UserGroupsState } from '../../entity/userGroups/userGroupsState';
3
- import { UserGroupListType, UserGroupListViewState } from './userGroupListViewState';
4
- export interface UserGroupListSelectorView extends SelectorView {
5
- userGroups: UserGroup[];
6
- }
7
- export declare const getUserGroupList: (userGroupsState: UserGroupsState, userGroupListViewState: UserGroupListViewState, userGroupType: UserGroupListType) => UserGroupListSelectorView;
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getUserGroupList = void 0;
4
- const userGroupsSelector_1 = require("../../entity/userGroups/userGroupsSelector");
5
- const getUserGroupList = (userGroupsState, userGroupListViewState, userGroupType) => {
6
- const listState = userGroupListViewState.userGroupListByType[userGroupType];
7
- return {
8
- userGroups: getUserGroupListByIds(userGroupsState, userGroupListViewState, userGroupType),
9
- fetchState: listState?.fetchState,
10
- error: listState?.error,
11
- version: 0,
12
- };
13
- };
14
- exports.getUserGroupList = getUserGroupList;
15
- function getUserGroupListByIds(userGroupsState, userGroupListViewState, type) {
16
- const userGroupIds = userGroupListViewState.userGroupListByType[type].ids;
17
- return userGroupIds
18
- .map((id) => (0, userGroupsSelector_1.getUserGroupByUserGroupId)(userGroupsState, id))
19
- .filter((value) => value != null);
20
- }
@@ -1,8 +0,0 @@
1
- import { FetchedState, ID } from '../../commonStateTypes/common';
2
- export type UserGroupListType = 'taskManagerCandidate';
3
- export interface UserGroupIdsByType extends FetchedState {
4
- ids: ID[];
5
- }
6
- export interface UserGroupListViewState {
7
- userGroupListByType: Record<UserGroupListType, UserGroupIdsByType>;
8
- }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });