@adaptabletools/adaptable-cjs 17.0.0-canary.4 → 18.0.0-canary.0

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 (285) hide show
  1. package/base.css +62 -14
  2. package/base.css.map +1 -1
  3. package/index.css +267 -165
  4. package/index.css.map +1 -1
  5. package/package.json +5 -4
  6. package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -0
  7. package/src/AdaptableOptions/AdaptableOptions.d.ts +5 -0
  8. package/src/AdaptableOptions/AlertOptions.d.ts +7 -7
  9. package/src/AdaptableOptions/ColumnFilterOptions.d.ts +9 -9
  10. package/src/AdaptableOptions/CommentsOptions.d.ts +28 -0
  11. package/src/AdaptableOptions/EditOptions.d.ts +6 -6
  12. package/src/AdaptableOptions/GridFilterOptions.d.ts +13 -8
  13. package/src/AdaptableOptions/GroupingOptions.d.ts +9 -9
  14. package/src/AdaptableOptions/InteropioPluginOptions.d.ts +10 -0
  15. package/src/AdaptableOptions/MenuOptions.d.ts +18 -4
  16. package/src/AdaptableOptions/MenuOptions.js +14 -6
  17. package/src/AdaptableOptions/NotesOptions.d.ts +2 -9
  18. package/src/Api/AdaptableApi.d.ts +6 -1
  19. package/src/Api/CommentApi.d.ts +58 -0
  20. package/src/Api/EventApi.d.ts +48 -12
  21. package/src/Api/Events/CalculatedColumnChanged.d.ts +19 -0
  22. package/src/Api/Events/CellSelectionChanged.d.ts +11 -0
  23. package/src/Api/Events/CommentsChangedInfo.d.ts +5 -0
  24. package/src/Api/Events/LiveDataChanged.d.ts +3 -3
  25. package/src/Api/Events/RowSelectionChanged.d.ts +11 -0
  26. package/src/Api/GridApi.d.ts +0 -6
  27. package/src/Api/GridFilterApi.d.ts +2 -2
  28. package/src/Api/Implementation/AdaptableApiImpl.d.ts +6 -6
  29. package/src/Api/Implementation/AdaptableApiImpl.js +2 -0
  30. package/src/Api/Implementation/CommentsApiImpl.d.ts +15 -0
  31. package/src/Api/Implementation/CommentsApiImpl.js +46 -0
  32. package/src/Api/Implementation/ExpressionApiImpl.d.ts +1 -1
  33. package/src/Api/Implementation/ExpressionApiImpl.js +3 -4
  34. package/src/Api/Implementation/GridApiImpl.d.ts +0 -1
  35. package/src/Api/Implementation/GridApiImpl.js +0 -4
  36. package/src/Api/Implementation/GridFilterApiImpl.d.ts +1 -1
  37. package/src/Api/Implementation/GridFilterApiImpl.js +1 -1
  38. package/src/Api/Implementation/NotesApiImpl.d.ts +2 -6
  39. package/src/Api/Implementation/NotesApiImpl.js +1 -15
  40. package/src/Api/Implementation/OptionsApiImpl.d.ts +2 -0
  41. package/src/Api/Implementation/OptionsApiImpl.js +3 -0
  42. package/src/Api/Implementation/PluginsApiImpl.d.ts +2 -6
  43. package/src/Api/Implementation/PluginsApiImpl.js +3 -15
  44. package/src/Api/Implementation/ScheduleApiImpl.d.ts +1 -12
  45. package/src/Api/Implementation/ScheduleApiImpl.js +0 -36
  46. package/src/Api/Implementation/ThemeApiImpl.d.ts +1 -0
  47. package/src/Api/Implementation/ThemeApiImpl.js +3 -0
  48. package/src/Api/Internal/ActionRowInternalApi.js +1 -1
  49. package/src/Api/Internal/AdaptableInternalApi.d.ts +2 -0
  50. package/src/Api/Internal/AdaptableInternalApi.js +3 -0
  51. package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
  52. package/src/Api/Internal/CalculatedColumnInternalApi.js +16 -0
  53. package/src/Api/Internal/DashboardInternalApi.d.ts +1 -0
  54. package/src/Api/Internal/DashboardInternalApi.js +5 -0
  55. package/src/Api/Internal/DataImportInternalApi.js +2 -0
  56. package/src/Api/Internal/DataSetInternalApi.js +2 -1
  57. package/src/Api/Internal/GridInternalApi.d.ts +3 -1
  58. package/src/Api/Internal/GridInternalApi.js +32 -9
  59. package/src/Api/Internal/LayoutInternalApi.d.ts +2 -2
  60. package/src/Api/Internal/LayoutInternalApi.js +11 -11
  61. package/src/Api/InteropioPluginApi.d.ts +10 -0
  62. package/src/Api/{NotesAPi.d.ts → NotesApi.d.ts} +19 -21
  63. package/src/Api/OptionsApi.d.ts +5 -0
  64. package/src/Api/PluginsApi.d.ts +3 -13
  65. package/src/Api/ScheduleApi.d.ts +1 -48
  66. package/src/Api/ThemeApi.d.ts +5 -0
  67. package/src/PredefinedConfig/AdaptableState.d.ts +4 -2
  68. package/src/PredefinedConfig/CellAddress.d.ts +13 -0
  69. package/src/PredefinedConfig/CellAddress.js +5 -0
  70. package/src/PredefinedConfig/CommentState.d.ts +48 -0
  71. package/src/PredefinedConfig/CommentState.js +2 -0
  72. package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
  73. package/src/PredefinedConfig/Common/AdaptablePredicate.js +2 -1
  74. package/src/PredefinedConfig/Common/Enums.d.ts +0 -1
  75. package/src/PredefinedConfig/Common/Enums.js +0 -1
  76. package/src/PredefinedConfig/Common/Schedule.d.ts +1 -1
  77. package/src/PredefinedConfig/Common/Types.d.ts +5 -5
  78. package/src/PredefinedConfig/Common/Types.js +0 -2
  79. package/src/PredefinedConfig/NotesState.d.ts +0 -13
  80. package/src/PredefinedConfig/PredefinedConfig.d.ts +3 -0
  81. package/src/PredefinedConfig/ScheduleState.d.ts +0 -5
  82. package/src/PredefinedConfig/SystemState.d.ts +5 -6
  83. package/src/PredefinedConfig/ThemeState.d.ts +1 -1
  84. package/src/Redux/ActionsReducers/CommentsRedux.d.ts +79 -0
  85. package/src/Redux/ActionsReducers/CommentsRedux.js +189 -0
  86. package/src/Redux/ActionsReducers/NotesRedux.js +1 -2
  87. package/src/Redux/ActionsReducers/PluginsRedux.d.ts +0 -48
  88. package/src/Redux/ActionsReducers/PluginsRedux.js +1 -49
  89. package/src/Redux/ActionsReducers/PlusMinusRedux.d.ts +16 -0
  90. package/src/Redux/ActionsReducers/PlusMinusRedux.js +47 -1
  91. package/src/Redux/ActionsReducers/ScheduleRedux.d.ts +0 -53
  92. package/src/Redux/ActionsReducers/ScheduleRedux.js +2 -90
  93. package/src/Redux/ActionsReducers/SystemRedux.d.ts +23 -12
  94. package/src/Redux/ActionsReducers/SystemRedux.js +55 -23
  95. package/src/Redux/Store/AdaptableStore.d.ts +2 -2
  96. package/src/Redux/Store/AdaptableStore.js +107 -46
  97. package/src/Strategy/CommentsModule.d.ts +16 -0
  98. package/src/Strategy/CommentsModule.js +82 -0
  99. package/src/Strategy/LayoutModule.d.ts +12 -4
  100. package/src/Strategy/LayoutModule.js +19 -14
  101. package/src/Strategy/NotesModule.d.ts +0 -13
  102. package/src/Strategy/NotesModule.js +9 -88
  103. package/src/Strategy/PlusMinusModule.js +2 -0
  104. package/src/Strategy/ScheduleModule.js +0 -23
  105. package/src/Strategy/Utilities/Export/getExportRowsViewItems.d.ts +2 -1
  106. package/src/Strategy/Utilities/Export/getExportRowsViewItems.js +14 -5
  107. package/src/Strategy/Utilities/getExpressionViewItems.js +8 -2
  108. package/src/Utilities/Constants/ConfigConstants.d.ts +1 -0
  109. package/src/Utilities/Constants/ConfigConstants.js +2 -1
  110. package/src/Utilities/Constants/GeneralConstants.d.ts +1 -0
  111. package/src/Utilities/Constants/GeneralConstants.js +8 -3
  112. package/src/Utilities/Constants/ModuleConstants.d.ts +3 -3
  113. package/src/Utilities/Constants/ModuleConstants.js +4 -4
  114. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +3 -3
  115. package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -0
  116. package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +7 -1
  117. package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +6 -0
  118. package/src/Utilities/ExpressionFunctions/dateUtils.d.ts +1 -0
  119. package/src/Utilities/ExpressionFunctions/dateUtils.js +18 -1
  120. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.d.ts +1 -1
  121. package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +12 -12
  122. package/src/Utilities/Extensions/ArrayExtensions.d.ts +2 -0
  123. package/src/Utilities/Extensions/ArrayExtensions.js +8 -1
  124. package/src/Utilities/Helpers/PreviewHelper.js +5 -2
  125. package/src/Utilities/ObjectFactory.d.ts +19 -22
  126. package/src/Utilities/ObjectFactory.js +51 -60
  127. package/src/Utilities/Services/CellPopupService.d.ts +23 -0
  128. package/src/Utilities/Services/CellPopupService.js +138 -0
  129. package/src/Utilities/Services/Interface/IReportService.d.ts +1 -1
  130. package/src/Utilities/Services/Interface/IThemeService.d.ts +8 -0
  131. package/src/Utilities/Services/ModuleService.js +1 -3
  132. package/src/Utilities/Services/ReportService.d.ts +1 -1
  133. package/src/Utilities/Services/ThemeService.d.ts +3 -0
  134. package/src/Utilities/Services/ThemeService.js +33 -1
  135. package/src/Utilities/Services/ValidationService.js +11 -11
  136. package/src/View/AdaptableView.js +3 -3
  137. package/src/View/AdaptableViewFactory.js +4 -2
  138. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ColumnsList.js +2 -2
  139. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/EntitlementsForm.js +1 -1
  140. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.js +1 -1
  141. package/src/View/Alert/Wizard/AlertButtonsEditor.js +2 -2
  142. package/src/View/Alert/Wizard/AlertRulesWizardSection.d.ts +1 -1
  143. package/src/View/Alert/Wizard/AlertRulesWizardSection.js +4 -3
  144. package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +1 -1
  145. package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +1 -1
  146. package/src/View/Charting/useChartingElements.js +8 -3
  147. package/src/View/Comments/CommentsEditor.d.ts +7 -0
  148. package/src/View/Comments/CommentsEditor.js +100 -0
  149. package/src/View/Comments/CommentsPopup.d.ts +2 -0
  150. package/src/View/Comments/CommentsPopup.js +87 -0
  151. package/src/View/Components/AdaptableObjectList/AdaptableObjectList.js +2 -1
  152. package/src/View/Components/CellPopup/index.js +1 -1
  153. package/src/View/Components/FilterForm/FilterForm.js +8 -2
  154. package/src/View/Components/FilterForm/ListBoxFilterForm.js +1 -3
  155. package/src/View/Components/FilterForm/QuickFilterForm.js +5 -4
  156. package/src/View/Components/FilterForm/QuickFilterValues.d.ts +2 -2
  157. package/src/View/Components/FilterForm/QuickFilterValues.js +4 -3
  158. package/src/View/Components/Popups/GridCellPopup/GridCellPopup.d.ts +5 -0
  159. package/src/View/Components/Popups/GridCellPopup/GridCellPopup.js +67 -0
  160. package/src/View/Components/Popups/GridCellPopup/index.d.ts +1 -0
  161. package/src/View/Components/Popups/GridCellPopup/index.js +5 -0
  162. package/src/View/Components/Selectors/ColumnSelector.d.ts +1 -0
  163. package/src/View/Components/Selectors/ColumnSelector.js +2 -1
  164. package/src/View/Components/Selectors/PermittedValuesSelector.d.ts +5 -4
  165. package/src/View/Components/Selectors/PermittedValuesSelector.js +25 -3
  166. package/src/View/Components/ToolPanel/ToolPanelWrapper.js +1 -4
  167. package/src/View/Dashboard/ModuleToolbarWrapper.js +1 -1
  168. package/src/View/Dashboard/PinnedDashboard.js +2 -1
  169. package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +2 -2
  170. package/src/View/Export/Wizard/ReportRowsWizardSection.js +3 -1
  171. package/src/View/GridFilter/GridFilterExpressionEditor.js +1 -1
  172. package/src/View/GridFilter/GridFilterPopup.js +10 -8
  173. package/src/View/GridFilter/GridFilterViewPanel.js +14 -11
  174. package/src/View/GridFilter/NamedQuerySelector.js +1 -1
  175. package/src/View/GridFilter/useGridFilterExpressionEditor.d.ts +3 -0
  176. package/src/View/GridFilter/useGridFilterExpressionEditor.js +17 -6
  177. package/src/View/GridFilter/useGridFilterOptionsForExpressionEditor.js +5 -23
  178. package/src/View/GridInfo/GridInfoPopup/GridInfoPopup.js +3 -2
  179. package/src/View/Layout/Wizard/getGridFilterPreview.d.ts +6 -0
  180. package/src/View/Layout/Wizard/getGridFilterPreview.js +16 -0
  181. package/src/View/Layout/Wizard/sections/FilterSection.js +1 -1
  182. package/src/View/Layout/Wizard/sections/GridFilterSection.js +4 -4
  183. package/src/View/NamedQuery/EditCurrentQueryButton.js +1 -1
  184. package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
  185. package/src/View/Notes/NoteEditor.d.ts +8 -0
  186. package/src/View/Notes/NoteEditor.js +33 -0
  187. package/src/View/Notes/NotesPopup.d.ts +2 -2
  188. package/src/View/Notes/NotesPopup.js +78 -55
  189. package/src/View/PlusMinus/MovePlusMinus.d.ts +7 -0
  190. package/src/View/PlusMinus/MovePlusMinus.js +27 -0
  191. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsSummary.js +0 -9
  192. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsWizard.js +0 -4
  193. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/isSettingsValid.js +2 -8
  194. package/src/View/Schedule/Wizard/ScheduleWizard.js +0 -8
  195. package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +3 -1
  196. package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +1 -2
  197. package/src/agGrid/Adaptable.d.ts +7 -0
  198. package/src/agGrid/Adaptable.js +49 -35
  199. package/src/agGrid/BadgeRenderer.js +9 -5
  200. package/src/agGrid/agGridHelper.d.ts +2 -1
  201. package/src/agGrid/agGridHelper.js +15 -3
  202. package/src/agGrid/agGridMenuHelper.d.ts +2 -0
  203. package/src/agGrid/agGridMenuHelper.js +73 -25
  204. package/src/components/Datepicker/index.js +4 -4
  205. package/src/components/ExpressionEditor/ExpressionPreview.d.ts +7 -0
  206. package/src/components/ExpressionEditor/ExpressionPreview.js +25 -0
  207. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilder.js +2 -2
  208. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.d.ts +6 -0
  209. package/src/components/ExpressionEditor/QueryBuilder/QueryBuilderInputs.js +40 -11
  210. package/src/components/ExpressionEditor/QueryBuilder/QueryPredicateBuilder.js +14 -2
  211. package/src/components/ExpressionEditor/QueryBuilder/booleanExpressions.js +1 -0
  212. package/src/components/ExpressionEditor/QueryBuilder/utils.js +1 -1
  213. package/src/components/ExpressionEditor/index.js +4 -7
  214. package/src/components/InputGroup/InputGroup.d.ts +7 -0
  215. package/src/components/InputGroup/InputGroup.js +12 -0
  216. package/src/components/InputGroup/index.d.ts +1 -0
  217. package/src/components/InputGroup/index.js +4 -0
  218. package/src/components/OverlayTrigger/index.js +7 -2
  219. package/src/components/Select/Select.d.ts +1 -2
  220. package/src/components/Select/Select.js +63 -23
  221. package/src/components/Toastify/index.d.ts +2 -2
  222. package/src/components/Toastify/index.js +1 -1
  223. package/src/components/icons/comments.d.ts +3 -0
  224. package/src/components/icons/comments.js +7 -0
  225. package/src/components/icons/index.js +3 -1
  226. package/src/env.d.ts +3 -1
  227. package/src/env.js +3 -1
  228. package/src/metamodel/adaptable.metamodel.d.ts +72 -158
  229. package/src/metamodel/adaptable.metamodel.js +128 -260
  230. package/src/parser/src/parser.d.ts +2 -0
  231. package/src/parser/src/parser.js +1880 -705
  232. package/src/parser/src/predicate/mapQlPredicateToExpression.js +5 -2
  233. package/src/parser/src/predicate/types.d.ts +1 -1
  234. package/src/parser/src/types.d.ts +1 -1
  235. package/src/renderReactRoot.js +15 -0
  236. package/src/themes/index.js +4 -0
  237. package/src/types.d.ts +10 -13
  238. package/themes/dark.css +3 -3
  239. package/tsconfig.cjs.tsbuildinfo +1 -1
  240. package/src/AdaptableOptions/FinsemblePluginOptions.d.ts +0 -35
  241. package/src/AdaptableOptions/Glue42PluginOptions.d.ts +0 -25
  242. package/src/AdaptableOptions/Glue42WebPluginOptions.d.ts +0 -10
  243. package/src/Api/Events/SelectionChanged.d.ts +0 -16
  244. package/src/Api/FinsembleApi.d.ts +0 -10
  245. package/src/Api/Glue42Api.d.ts +0 -75
  246. package/src/Api/Glue42WebApi.d.ts +0 -10
  247. package/src/PredefinedConfig/Glue42State.d.ts +0 -46
  248. package/src/View/Notes/NotesListing.d.ts +0 -2
  249. package/src/View/Notes/NotesListing.js +0 -88
  250. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsGlue42.d.ts +0 -9
  251. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsGlue42.js +0 -25
  252. package/src/bundle-dependencies/bundles/react-toastify/components/CloseButton.d.ts +0 -9
  253. package/src/bundle-dependencies/bundles/react-toastify/components/Icons.d.ts +0 -24
  254. package/src/bundle-dependencies/bundles/react-toastify/components/ProgressBar.d.ts +0 -59
  255. package/src/bundle-dependencies/bundles/react-toastify/components/Toast.d.ts +0 -3
  256. package/src/bundle-dependencies/bundles/react-toastify/components/ToastContainer.d.ts +0 -3
  257. package/src/bundle-dependencies/bundles/react-toastify/components/Transitions.d.ts +0 -6
  258. package/src/bundle-dependencies/bundles/react-toastify/components/index.d.ts +0 -6
  259. package/src/bundle-dependencies/bundles/react-toastify/core/eventManager.d.ts +0 -39
  260. package/src/bundle-dependencies/bundles/react-toastify/core/index.d.ts +0 -2
  261. package/src/bundle-dependencies/bundles/react-toastify/core/toast.d.ts +0 -41
  262. package/src/bundle-dependencies/bundles/react-toastify/hooks/index.d.ts +0 -2
  263. package/src/bundle-dependencies/bundles/react-toastify/hooks/useToast.d.ts +0 -10
  264. package/src/bundle-dependencies/bundles/react-toastify/hooks/useToastContainer.d.ts +0 -23
  265. package/src/bundle-dependencies/bundles/react-toastify/index.d.ts +0 -5
  266. package/src/bundle-dependencies/bundles/react-toastify/index.js +0 -1
  267. package/src/bundle-dependencies/bundles/react-toastify/inject-style.d.ts +0 -8
  268. package/src/bundle-dependencies/bundles/react-toastify/types/index.d.ts +0 -269
  269. package/src/bundle-dependencies/bundles/react-toastify/utils/collapseToast.d.ts +0 -5
  270. package/src/bundle-dependencies/bundles/react-toastify/utils/constant.d.ts +0 -23
  271. package/src/bundle-dependencies/bundles/react-toastify/utils/cssTransition.d.ts +0 -43
  272. package/src/bundle-dependencies/bundles/react-toastify/utils/index.d.ts +0 -5
  273. package/src/bundle-dependencies/bundles/react-toastify/utils/mapper.d.ts +0 -2
  274. package/src/bundle-dependencies/bundles/react-toastify/utils/propValidator.d.ts +0 -9
  275. /package/src/AdaptableOptions/{FinsemblePluginOptions.js → CommentsOptions.js} +0 -0
  276. /package/src/AdaptableOptions/{Glue42PluginOptions.js → InteropioPluginOptions.js} +0 -0
  277. /package/src/{AdaptableOptions/Glue42WebPluginOptions.js → Api/CommentApi.js} +0 -0
  278. /package/src/Api/Events/{SelectionChanged.js → CalculatedColumnChanged.js} +0 -0
  279. /package/src/Api/{FinsembleApi.js → Events/CellSelectionChanged.js} +0 -0
  280. /package/src/Api/{Glue42Api.js → Events/CommentsChangedInfo.js} +0 -0
  281. /package/src/Api/{Glue42WebApi.js → Events/RowSelectionChanged.js} +0 -0
  282. /package/src/Api/Internal/{ExpressionnternalApi.d.ts → ExpressionInternalApi.d.ts} +0 -0
  283. /package/src/Api/Internal/{ExpressionnternalApi.js → ExpressionInternalApi.js} +0 -0
  284. /package/src/Api/{NotesAPi.js → InteropioPluginApi.js} +0 -0
  285. /package/src/{PredefinedConfig/Glue42State.js → Api/NotesApi.js} +0 -0
@@ -2,50 +2,51 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AdaptableStore = exports.LoadState = exports.InitState = exports.LOAD_STATE = exports.INIT_STATE = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const Enums_1 = require("../../PredefinedConfig/Common/Enums");
6
5
  const Redux = tslib_1.__importStar(require("redux"));
7
- const AdaptableReduxLocalStorageEngine_1 = require("./AdaptableReduxLocalStorageEngine");
8
- const AdaptableReduxMerger_1 = require("./AdaptableReduxMerger");
6
+ const Enums_1 = require("../../PredefinedConfig/Common/Enums");
7
+ const PluginsRedux = tslib_1.__importStar(require("../ActionsReducers/PluginsRedux"));
9
8
  const PopupRedux = tslib_1.__importStar(require("../ActionsReducers/PopupRedux"));
10
9
  const PopupRedux_1 = require("../ActionsReducers/PopupRedux");
11
- const PluginsRedux = tslib_1.__importStar(require("../ActionsReducers/PluginsRedux"));
10
+ const AdaptableReduxLocalStorageEngine_1 = require("./AdaptableReduxLocalStorageEngine");
11
+ const AdaptableReduxMerger_1 = require("./AdaptableReduxMerger");
12
+ const AdaptableAlert_1 = require("../../PredefinedConfig/Common/AdaptableAlert");
13
+ const ConfigConstants = tslib_1.__importStar(require("../../Utilities/Constants/ConfigConstants"));
14
+ const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
15
+ const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
16
+ const Emitter_1 = tslib_1.__importDefault(require("../../Utilities/Emitter"));
17
+ const StringExtensions_1 = require("../../Utilities/Extensions/StringExtensions");
18
+ const PreviewHelper_1 = require("../../Utilities/Helpers/PreviewHelper");
19
+ const ObjectFactory_1 = require("../../Utilities/ObjectFactory");
20
+ const AdaptableToaster_1 = require("../../View/Components/Popups/AdaptableToaster");
12
21
  const AlertRedux = tslib_1.__importStar(require("../ActionsReducers/AlertRedux"));
13
- const FlashingCellRedux = tslib_1.__importStar(require("../ActionsReducers/FlashingCellRedux"));
14
- const SmartEditRedux = tslib_1.__importStar(require("../ActionsReducers/SmartEditRedux"));
22
+ const ApplicationRedux = tslib_1.__importStar(require("../ActionsReducers/ApplicationRedux"));
15
23
  const BulkUpdateRedux = tslib_1.__importStar(require("../ActionsReducers/BulkUpdateRedux"));
16
- const CustomSortRedux = tslib_1.__importStar(require("../ActionsReducers/CustomSortRedux"));
17
24
  const CalculatedColumnRedux = tslib_1.__importStar(require("../ActionsReducers/CalculatedColumnRedux"));
18
- const ShortcutRedux = tslib_1.__importStar(require("../ActionsReducers/ShortcutRedux"));
19
- const GridRedux = tslib_1.__importStar(require("../ActionsReducers/GridRedux"));
20
- const SystemRedux = tslib_1.__importStar(require("../ActionsReducers/SystemRedux"));
21
- const SystemRedux_1 = require("../ActionsReducers/SystemRedux");
22
- const PlusMinusRedux = tslib_1.__importStar(require("../ActionsReducers/PlusMinusRedux"));
25
+ const ChartingRedux = tslib_1.__importStar(require("../ActionsReducers/ChartingRedux"));
26
+ const CommentsRedux = tslib_1.__importStar(require("../ActionsReducers/CommentsRedux"));
27
+ const CustomSortRedux = tslib_1.__importStar(require("../ActionsReducers/CustomSortRedux"));
28
+ const DashboardRedux = tslib_1.__importStar(require("../ActionsReducers/DashboardRedux"));
23
29
  const ExportRedux = tslib_1.__importStar(require("../ActionsReducers/ExportRedux"));
24
- const QuickSearchRedux = tslib_1.__importStar(require("../ActionsReducers/QuickSearchRedux"));
25
- const ThemeRedux = tslib_1.__importStar(require("../ActionsReducers/ThemeRedux"));
30
+ const FlashingCellRedux = tslib_1.__importStar(require("../ActionsReducers/FlashingCellRedux"));
26
31
  const FormatColumnRedux = tslib_1.__importStar(require("../ActionsReducers/FormatColumnRedux"));
27
- const StyledColumnRedux = tslib_1.__importStar(require("../ActionsReducers/StyledColumnRedux"));
28
- const NotesRedux = tslib_1.__importStar(require("../ActionsReducers/NotesRedux"));
29
- const ApplicationRedux = tslib_1.__importStar(require("../ActionsReducers/ApplicationRedux"));
30
32
  const FreeTextColumnRedux = tslib_1.__importStar(require("../ActionsReducers/FreeTextColumnRedux"));
33
+ const GridRedux = tslib_1.__importStar(require("../ActionsReducers/GridRedux"));
31
34
  const LayoutRedux = tslib_1.__importStar(require("../ActionsReducers/LayoutRedux"));
32
- const DashboardRedux = tslib_1.__importStar(require("../ActionsReducers/DashboardRedux"));
33
- const ToolPanelRedux = tslib_1.__importStar(require("../ActionsReducers/ToolPanelRedux"));
34
- const ScheduleRedux = tslib_1.__importStar(require("../ActionsReducers/ScheduleRedux"));
35
- const TeamSharingRedux = tslib_1.__importStar(require("../ActionsReducers/TeamSharingRedux"));
36
35
  const NamedQueryRedux = tslib_1.__importStar(require("../ActionsReducers/NamedQueryRedux"));
36
+ const NotesRedux = tslib_1.__importStar(require("../ActionsReducers/NotesRedux"));
37
+ const PlusMinusRedux = tslib_1.__importStar(require("../ActionsReducers/PlusMinusRedux"));
37
38
  const QueryRedux = tslib_1.__importStar(require("../ActionsReducers/QueryRedux"));
39
+ const QuickSearchRedux = tslib_1.__importStar(require("../ActionsReducers/QuickSearchRedux"));
40
+ const ScheduleRedux = tslib_1.__importStar(require("../ActionsReducers/ScheduleRedux"));
41
+ const ShortcutRedux = tslib_1.__importStar(require("../ActionsReducers/ShortcutRedux"));
42
+ const SmartEditRedux = tslib_1.__importStar(require("../ActionsReducers/SmartEditRedux"));
38
43
  const StatusBarRedux = tslib_1.__importStar(require("../ActionsReducers/StatusBarRedux"));
39
- const ChartingRedux = tslib_1.__importStar(require("../ActionsReducers/ChartingRedux"));
40
- const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
41
- const ConfigConstants = tslib_1.__importStar(require("../../Utilities/Constants/ConfigConstants"));
42
- const ObjectFactory_1 = require("../../Utilities/ObjectFactory");
43
- const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
44
- const PreviewHelper_1 = require("../../Utilities/Helpers/PreviewHelper");
45
- const StringExtensions_1 = require("../../Utilities/Extensions/StringExtensions");
46
- const Emitter_1 = tslib_1.__importDefault(require("../../Utilities/Emitter"));
47
- const AdaptableAlert_1 = require("../../PredefinedConfig/Common/AdaptableAlert");
48
- const AdaptableToaster_1 = require("../../View/Components/Popups/AdaptableToaster");
44
+ const StyledColumnRedux = tslib_1.__importStar(require("../ActionsReducers/StyledColumnRedux"));
45
+ const SystemRedux = tslib_1.__importStar(require("../ActionsReducers/SystemRedux"));
46
+ const SystemRedux_1 = require("../ActionsReducers/SystemRedux");
47
+ const TeamSharingRedux = tslib_1.__importStar(require("../ActionsReducers/TeamSharingRedux"));
48
+ const ThemeRedux = tslib_1.__importStar(require("../ActionsReducers/ThemeRedux"));
49
+ const ToolPanelRedux = tslib_1.__importStar(require("../ActionsReducers/ToolPanelRedux"));
49
50
  const TeamSharingState_1 = require("../../PredefinedConfig/TeamSharingState");
50
51
  exports.INIT_STATE = 'INIT_STATE';
51
52
  exports.LOAD_STATE = 'LOAD_STATE';
@@ -149,6 +150,7 @@ class AdaptableStore {
149
150
  Charting: ChartingRedux.ChartingReducer,
150
151
  StyledColumn: StyledColumnRedux.StyledColumnReducer,
151
152
  Notes: NotesRedux.NotesReducer,
153
+ Comment: CommentsRedux.CommentsReducer,
152
154
  Query: QueryRedux.QueryReducer,
153
155
  NamedQuery: NamedQueryRedux.NamedQueryReducer,
154
156
  };
@@ -201,6 +203,7 @@ class AdaptableStore {
201
203
  ConfigConstants.GRID,
202
204
  ConfigConstants.POPUP,
203
205
  ConfigConstants.PLUGINS,
206
+ ConfigConstants.COMMENT,
204
207
  ];
205
208
  const didPersistentStateChange = (state, newState) => {
206
209
  return Object.keys(newState).some((key) => {
@@ -279,7 +282,7 @@ exports.AdaptableStore = AdaptableStore;
279
282
  const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
280
283
  return function (next) {
281
284
  return function (action) {
282
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
285
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
283
286
  switch (action.type) {
284
287
  /*******************
285
288
  * NAMED QUERY ACTIONS
@@ -598,6 +601,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
598
601
  adaptable.api.internalApi
599
602
  .getCalculatedColumnExpressionService()
600
603
  .createAggregatedScalarLiveValue(returnAction.calculatedColumn);
604
+ adaptable.api.calculatedColumnApi.internalApi.fireCalculatedColumnChangedEvent(action.type, actionTyped.calculatedColumn);
601
605
  }
602
606
  adaptable.updateColDefsForSpecialColumns();
603
607
  return returnAction;
@@ -623,6 +627,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
623
627
  adaptable.api.internalApi
624
628
  .getCalculatedColumnExpressionService()
625
629
  .destroyAggregatedScalarLiveValue(returnAction.calculatedColumn);
630
+ adaptable.api.calculatedColumnApi.internalApi.fireCalculatedColumnChangedEvent(action.type, actionTyped.calculatedColumn);
626
631
  adaptable.updateColDefsForSpecialColumns();
627
632
  return returnAction;
628
633
  }
@@ -871,7 +876,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
871
876
  * Note ACTIONS
872
877
  *******************/
873
878
  /**
874
- * Use Case: Comments has been edited/deleted/added
879
+ * Use Case: Notes has been edited/deleted/added
875
880
  * Action: Triangle can be removed/added
876
881
  */
877
882
  case NotesRedux.NOTES_ADD:
@@ -880,9 +885,72 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
880
885
  let returnAction = next(action);
881
886
  const node = adaptable.api.gridApi.getRowNodeForPrimaryKey(returnAction.adaptableNote.PrimaryKeyValue);
882
887
  adaptable.refreshCells([node], [returnAction.adaptableNote.ColumnId], true);
883
- if (action.type == NotesRedux.NOTES_DELETE) {
884
- adaptable.api.notesApi.hideNote();
888
+ return returnAction;
889
+ }
890
+ /*******************
891
+ * Comment ACTIONS
892
+ *******************/
893
+ /**
894
+ * Use Case: Comments has been edited/deleted/added
895
+ * Action: Triangle can be removed/added
896
+ */
897
+ case CommentsRedux.COMMENTS_ADD:
898
+ case CommentsRedux.COMMENTS_EDIT:
899
+ case CommentsRedux.COMMENTS_DELETE:
900
+ case CommentsRedux.COMMENTS_CELL_DELETE:
901
+ case CommentsRedux.COMMENTS_CELL_ADD: {
902
+ let returnAction = next(action);
903
+ let node = null;
904
+ let columnId = null;
905
+ if ('cellAddress' in returnAction) {
906
+ node = adaptable.api.gridApi.getRowNodeForPrimaryKey(returnAction.cellAddress.PrimaryKeyValue);
907
+ columnId = returnAction.cellAddress.ColumnId;
885
908
  }
909
+ else if ('cellComments' in returnAction) {
910
+ node = adaptable.api.gridApi.getRowNodeForPrimaryKey(returnAction.cellComments.PrimaryKeyValue);
911
+ columnId = returnAction.cellComments.ColumnId;
912
+ }
913
+ if (node && columnId) {
914
+ adaptable.refreshCells([node], [columnId], true);
915
+ requestAnimationFrame(() => {
916
+ var _a, _b;
917
+ const commentThreads = adaptable.api.commentApi.getCommentThreads();
918
+ adaptable.api.eventApi.emit('CommentsChanged', adaptable.api.commentApi.getCommentThreads());
919
+ (_b = (_a = adaptable.api.optionsApi
920
+ .getCommentsOptions()) === null || _a === void 0 ? void 0 : _a.persistCommentThreads) === null || _b === void 0 ? void 0 : _b.call(_a, commentThreads);
921
+ });
922
+ }
923
+ return returnAction;
924
+ }
925
+ case CommentsRedux.COMMENTS_LOAD: {
926
+ const previousCommentThreads = adaptable.api.commentApi.getCommentThreads();
927
+ let returnAction = next(action);
928
+ const newCommentThreads = (_j = adaptable.api.commentApi.getCommentThreads()) !== null && _j !== void 0 ? _j : [];
929
+ requestAnimationFrame(() => {
930
+ let addedCommentThreads = [];
931
+ let deletedCommentThreads = [];
932
+ const prevCommentThreadsSet = new Set((previousCommentThreads !== null && previousCommentThreads !== void 0 ? previousCommentThreads : []).map((c) => c.Uuid));
933
+ const newCommentThreadsSet = new Set((newCommentThreads !== null && newCommentThreads !== void 0 ? newCommentThreads : []).map((c) => c.Uuid));
934
+ for (const commentThread of newCommentThreads) {
935
+ if (!prevCommentThreadsSet.has(commentThread.Uuid)) {
936
+ addedCommentThreads.push(commentThread);
937
+ }
938
+ }
939
+ for (const commentThread of previousCommentThreads) {
940
+ if (!newCommentThreadsSet.has(commentThread.Uuid)) {
941
+ deletedCommentThreads.push(commentThread);
942
+ }
943
+ }
944
+ // This cannot be called because it would trigger an infinite loop
945
+ // adaptable.api.eventApi.emit('CommentsChanged', commentThreads);
946
+ // refresh all comments cells to show or hide the triangle
947
+ [...addedCommentThreads, ...deletedCommentThreads].forEach((commentThread) => {
948
+ const node = adaptable.api.gridApi.getRowNodeForPrimaryKey(commentThread.PrimaryKeyValue);
949
+ if (node && commentThread.ColumnId) {
950
+ adaptable.refreshCells([node], [commentThread.ColumnId], true);
951
+ }
952
+ });
953
+ });
886
954
  return returnAction;
887
955
  }
888
956
  /*******************
@@ -913,13 +981,6 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
913
981
  case ScheduleRedux.IPUSHPULL_SCHEDULE_UNSUSPEND:
914
982
  case ScheduleRedux.IPUSHPULL_SCHEDULE_SUSPEND_ALL:
915
983
  case ScheduleRedux.IPUSHPULL_SCHEDULE_UNSUSPEND_ALL:
916
- case ScheduleRedux.GLUE42_SCHEDULE_ADD:
917
- case ScheduleRedux.GLUE42_SCHEDULE_EDIT:
918
- case ScheduleRedux.GLUE42_SCHEDULE_DELETE:
919
- case ScheduleRedux.GLUE42_SCHEDULE_SUSPEND:
920
- case ScheduleRedux.GLUE42_SCHEDULE_UNSUSPEND:
921
- case ScheduleRedux.GLUE42_SCHEDULE_SUSPEND_ALL:
922
- case ScheduleRedux.GLUE42_SCHEDULE_UNSUSPEND_ALL:
923
984
  case ScheduleRedux.OPENFIN_SCHEDULE_ADD:
924
985
  case ScheduleRedux.OPENFIN_SCHEDULE_EDIT:
925
986
  case ScheduleRedux.OPENFIN_SCHEDULE_DELETE:
@@ -965,8 +1026,8 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
965
1026
  let returnAction = next(action);
966
1027
  const newLayoutState = middlewareAPI.getState().Layout;
967
1028
  adaptable.api.layoutApi.internalApi.fireLayoutChangedEvent(action.type, oldLayoutState, newLayoutState);
968
- const oldFilters = (_j = oldLayoutState.Layouts.find((l) => l.Name == oldLayoutState.CurrentLayout)) === null || _j === void 0 ? void 0 : _j.ColumnFilters;
969
- const newFilters = (_k = newLayoutState.Layouts.find((l) => l.Name == newLayoutState.CurrentLayout)) === null || _k === void 0 ? void 0 : _k.ColumnFilters;
1029
+ const oldFilters = (_k = oldLayoutState.Layouts.find((l) => l.Name == oldLayoutState.CurrentLayout)) === null || _k === void 0 ? void 0 : _k.ColumnFilters;
1030
+ const newFilters = (_l = newLayoutState.Layouts.find((l) => l.Name == newLayoutState.CurrentLayout)) === null || _l === void 0 ? void 0 : _l.ColumnFilters;
970
1031
  // Tell Grid to apply filtering if filters have been changed in a loaded Layout
971
1032
  if (adaptable.api.columnFilterApi.internalApi.areColumnFiltersDifferent(oldFilters, newFilters)) {
972
1033
  adaptable.applyColumnFiltering();
@@ -983,7 +1044,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
983
1044
  // tell grid the layout has been selected
984
1045
  adaptable.setLayout(currentLayout);
985
1046
  }
986
- if (!((_l = adaptable.adaptableOptions.layoutOptions) === null || _l === void 0 ? void 0 : _l.autoSaveLayouts)) {
1047
+ if (!((_m = adaptable.adaptableOptions.layoutOptions) === null || _m === void 0 ? void 0 : _m.autoSaveLayouts)) {
987
1048
  middlewareAPI.dispatch(GridRedux.LayoutUpdateCurrentDraft(currentLayout));
988
1049
  }
989
1050
  }
@@ -991,7 +1052,7 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
991
1052
  returnAction.type == LayoutRedux.LAYOUT_SAVE) {
992
1053
  const actionTyped = action;
993
1054
  // if autosave is false
994
- if (!((_m = adaptable.adaptableOptions.layoutOptions) === null || _m === void 0 ? void 0 : _m.autoSaveLayouts)) {
1055
+ if (!((_o = adaptable.adaptableOptions.layoutOptions) === null || _o === void 0 ? void 0 : _o.autoSaveLayouts)) {
995
1056
  // and the current layout is saved, make sure we also update the draft
996
1057
  if (actionTyped.layout.Name === newLayoutState.CurrentLayout) {
997
1058
  middlewareAPI.dispatch(GridRedux.LayoutUpdateCurrentDraft(actionTyped.layout));
@@ -0,0 +1,16 @@
1
+ import { AdaptableApi } from '../Api/AdaptableApi';
2
+ import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
3
+ import { AdaptableModuleBase } from './AdaptableModuleBase';
4
+ import { IModule } from './Interface/IModule';
5
+ /**
6
+ * In the first iteration a cell can have only one note, the
7
+ * notes is a list to allow further development.
8
+ */
9
+ export declare class CommentsModule extends AdaptableModuleBase implements IModule {
10
+ private adaptable;
11
+ constructor(api: AdaptableApi);
12
+ isModuleAvailable(): boolean;
13
+ private loadComments;
14
+ addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
15
+ private getAddRemoveCommentsMenuItems;
16
+ }
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CommentsModule = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
6
+ const ObjectFactory_1 = require("../Utilities/ObjectFactory");
7
+ const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
8
+ /**
9
+ * In the first iteration a cell can have only one note, the
10
+ * notes is a list to allow further development.
11
+ */
12
+ class CommentsModule extends AdaptableModuleBase_1.AdaptableModuleBase {
13
+ constructor(api) {
14
+ super(ModuleConstants.CommentsModuleId, ModuleConstants.CommentsFriendlyName, 'comments', 'CommentsPopup', 'comments', api);
15
+ this.adaptable = api.internalApi.getAdaptableInstance();
16
+ this.adaptable.api.eventApi.on('AdaptableReady', () => this.handleAdaptableReady());
17
+ this.loadComments();
18
+ }
19
+ isModuleAvailable() {
20
+ const options = this.adaptable.api.optionsApi.getCommentsOptions();
21
+ if (!options || !options.persistCommentThreads || !options.loadCommentThreads) {
22
+ return false;
23
+ }
24
+ return super.isModuleAvailable();
25
+ }
26
+ async loadComments() {
27
+ var _a, _b;
28
+ const commentThreads = await ((_b = (_a = this.api.optionsApi
29
+ .getCommentsOptions()) === null || _a === void 0 ? void 0 : _a.loadCommentThreads) === null || _b === void 0 ? void 0 : _b.call(_a, (0, ObjectFactory_1.createBaseContext)(this.adaptable.api)));
30
+ this.api.commentApi.loadCommentThreads(commentThreads);
31
+ }
32
+ addContextMenuItems(menuContext) {
33
+ var _a, _b;
34
+ if (!this.isModuleAvailable()) {
35
+ return undefined;
36
+ }
37
+ const items = [];
38
+ const isCellCommentable = (_b = (_a = this.adaptable.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getCommentsOptions()) === null || _b === void 0 ? void 0 : _b.isCellCommentable;
39
+ if (!isCellCommentable ||
40
+ isCellCommentable({
41
+ adaptableApi: this.adaptable.api,
42
+ address: {
43
+ PrimaryKeyValue: menuContext.primaryKeyValue,
44
+ ColumnId: menuContext.adaptableColumn.columnId,
45
+ },
46
+ userName: this.adaptable.api.optionsApi.getUserName(),
47
+ adaptableId: this.adaptable.adaptableOptions.adaptableId,
48
+ })) {
49
+ items.push(...this.getAddRemoveCommentsMenuItems(menuContext));
50
+ }
51
+ return items;
52
+ }
53
+ getAddRemoveCommentsMenuItems(menuContext) {
54
+ const items = [];
55
+ // does not have note
56
+ const cellAddress = {
57
+ PrimaryKeyValue: menuContext.primaryKeyValue,
58
+ ColumnId: menuContext.adaptableColumn.columnId,
59
+ };
60
+ const comments = this.adaptable.api.commentApi.getComments(cellAddress);
61
+ if (comments) {
62
+ items.push(this.createColumnMenuItemClickFunction('Remove Comments', this.moduleInfo.Glyph, () => {
63
+ this.api.commentApi.deleteCommentThread(cellAddress);
64
+ }));
65
+ }
66
+ else {
67
+ items.push(this.createColumnMenuItemClickFunction('Add Comment', this.moduleInfo.Glyph, () => {
68
+ // add an empty one
69
+ this.api.commentApi.addCommentThread(Object.assign(Object.assign({}, cellAddress), { Comments: [] }));
70
+ requestAnimationFrame(() => {
71
+ this.api.internalApi.getCellPopupService().showPopup({
72
+ PrimaryKeyValue: menuContext.primaryKeyValue,
73
+ ColumnId: menuContext.adaptableColumn.columnId,
74
+ }, true);
75
+ this.api.internalApi.getCellPopupService().editFocusedEntity('Comment');
76
+ });
77
+ }));
78
+ }
79
+ return items;
80
+ }
81
+ }
82
+ exports.CommentsModule = CommentsModule;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { AdaptableModuleBase } from './AdaptableModuleBase';
2
3
  import { LayoutState, Layout } from '../PredefinedConfig/LayoutState';
3
4
  import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
@@ -21,19 +22,26 @@ export declare class LayoutModule extends AdaptableModuleBase implements IModule
21
22
  private createViewPivotItemsMenuItem;
22
23
  getTeamSharingAction(): TeamSharingImportInfo<Layout>;
23
24
  toViewAll(): {
24
- items: {
25
+ items: ({
25
26
  name: string;
26
27
  values: string[];
27
- }[];
28
+ } | {
29
+ name: string;
30
+ view: JSX.Element;
31
+ })[];
28
32
  abObject: Layout;
29
33
  }[];
30
34
  toView(layout: Layout): {
31
- items: {
35
+ items: ({
32
36
  name: string;
33
37
  values: string[];
34
- }[];
38
+ } | {
39
+ name: string;
40
+ view: JSX.Element;
41
+ })[];
35
42
  abObject: Layout;
36
43
  };
37
44
  getViewProperties(): AdaptableModuleView;
38
45
  handleLayoutChange(): void;
46
+ getReferencedNamedQueryNames(layout: Layout): string[];
39
47
  }
@@ -18,6 +18,7 @@ const AggregationColumns_1 = require("../PredefinedConfig/Common/AggregationColu
18
18
  const windowFactory_1 = require("../View/Components/Popups/WindowPopups/windowFactory");
19
19
  const flattenDeep_1 = tslib_1.__importDefault(require("lodash/flattenDeep"));
20
20
  const StringExtensions_1 = tslib_1.__importDefault(require("../Utilities/Extensions/StringExtensions"));
21
+ const getGridFilterPreview_1 = require("../View/Layout/Wizard/getGridFilterPreview");
21
22
  class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
22
23
  constructor(api) {
23
24
  super(ModuleConstants.LayoutModuleId, ModuleConstants.LayoutFriendlyName, 'grid', 'LayoutPopup', 'Named sets of column visibility, order, groupings, aggregation, pivots etc.', api);
@@ -127,7 +128,6 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
127
128
  [
128
129
  ...this.api.scheduleApi.getReportSchedules(loadConfig),
129
130
  ...this.api.scheduleApi.getReminderSchedules(loadConfig),
130
- ...this.api.scheduleApi.getGlue42Schedules(loadConfig),
131
131
  ...this.api.scheduleApi.getIPushPullSchedules(loadConfig),
132
132
  ...this.api.scheduleApi.getOpenFinSchedules(loadConfig),
133
133
  ].forEach((schedule) => layoutAssociatedObjectReferences.push({
@@ -139,7 +139,7 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
139
139
  return teamSharingReferences;
140
140
  }
141
141
  hasNamedQueryReferences() {
142
- return false;
142
+ return true;
143
143
  }
144
144
  handleAdaptableReady() {
145
145
  requestAnimationFrame(() => {
@@ -242,11 +242,13 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
242
242
  return returnColumnMenuItems;
243
243
  }
244
244
  createViewPivotItemsMenuItem(menuContext) {
245
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
246
245
  // current group => menuContext.rowNode.field;
247
- if (((_b = (_a = menuContext.selectedCellInfo) === null || _a === void 0 ? void 0 : _a.gridCells) === null || _b === void 0 ? void 0 : _b.length) !== 1) {
246
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
247
+ const selectedCellInfo = (_a = menuContext.selectedCellInfo) !== null && _a !== void 0 ? _a : this.api.gridApi.getSelectedCellInfo();
248
+ if (((_b = selectedCellInfo === null || selectedCellInfo === void 0 ? void 0 : selectedCellInfo.gridCells) === null || _b === void 0 ? void 0 : _b.length) !== 1) {
248
249
  return;
249
250
  }
251
+ const gridCell = (_c = menuContext.gridCell) !== null && _c !== void 0 ? _c : selectedCellInfo.gridCells[0];
250
252
  const currentLayout = this.api.layoutApi.getCurrentLayout();
251
253
  if (!currentLayout.EnablePivot) {
252
254
  return;
@@ -265,11 +267,11 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
265
267
  */
266
268
  // pivot_status_Booked_price
267
269
  // price
268
- const aggColumn = (_f = (_e = (_d = (_c = agGridColumn === null || agGridColumn === void 0 ? void 0 : agGridColumn.getColDef) === null || _c === void 0 ? void 0 : _c.call(agGridColumn).pivotValueColumn) === null || _d === void 0 ? void 0 : _d.getColDef) === null || _e === void 0 ? void 0 : _e.call(_d)) === null || _f === void 0 ? void 0 : _f.field;
270
+ const aggColumn = (_g = (_f = (_e = (_d = agGridColumn === null || agGridColumn === void 0 ? void 0 : agGridColumn.getColDef) === null || _d === void 0 ? void 0 : _d.call(agGridColumn).pivotValueColumn) === null || _e === void 0 ? void 0 : _e.getColDef) === null || _f === void 0 ? void 0 : _f.call(_e)) === null || _g === void 0 ? void 0 : _g.field;
269
271
  // Booked
270
- const pivotValue = (_j = (_h = (_g = agGridColumn === null || agGridColumn === void 0 ? void 0 : agGridColumn.getColDef) === null || _g === void 0 ? void 0 : _g.call(agGridColumn)) === null || _h === void 0 ? void 0 : _h.pivotKeys) === null || _j === void 0 ? void 0 : _j[0];
272
+ const pivotValue = (_k = (_j = (_h = agGridColumn === null || agGridColumn === void 0 ? void 0 : agGridColumn.getColDef) === null || _h === void 0 ? void 0 : _h.call(agGridColumn)) === null || _j === void 0 ? void 0 : _j.pivotKeys) === null || _k === void 0 ? void 0 : _k[0];
271
273
  // status - the preview works only with one column
272
- const pivotColumnId = (_k = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.PivotColumns) === null || _k === void 0 ? void 0 : _k[0];
274
+ const pivotColumnId = (_l = currentLayout === null || currentLayout === void 0 ? void 0 : currentLayout.PivotColumns) === null || _l === void 0 ? void 0 : _l[0];
273
275
  function getData(rows) {
274
276
  return [
275
277
  ...rows.map((row) => {
@@ -282,9 +284,7 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
282
284
  }
283
285
  const data = (0, flattenDeep_1.default)(getData(menuContext.rowNode.childrenAfterFilter));
284
286
  const rowGroups = currentLayout.RowGroupedColumns;
285
- const cellValue = isPivotColumn
286
- ? menuContext.rowNode.aggData[columnId]
287
- : menuContext.gridCell.displayValue;
287
+ const cellValue = isPivotColumn ? menuContext.rowNode.aggData[columnId] : gridCell.displayValue;
288
288
  const popupProps = {
289
289
  hasPivotValue: isPivotColumn,
290
290
  columnId,
@@ -392,10 +392,8 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
392
392
  .filter(Boolean),
393
393
  },
394
394
  (layout === null || layout === void 0 ? void 0 : layout.GridFilter) &&
395
- StringExtensions_1.default.IsNotNullOrEmpty(layout.GridFilter.Expression) && {
396
- name: 'Grid Filter',
397
- values: [layout.GridFilter.Expression],
398
- },
395
+ StringExtensions_1.default.IsNotNullOrEmpty(layout.GridFilter.Expression) &&
396
+ (0, getGridFilterPreview_1.getGridFilterViewItems)(layout),
399
397
  ].filter(Boolean),
400
398
  abObject: layout,
401
399
  };
@@ -443,5 +441,12 @@ class LayoutModule extends AdaptableModuleBase_1.AdaptableModuleBase {
443
441
  // we need to refresh the column defs, as some configs may have changed
444
442
  this.api.internalApi.getAdaptableInstance().setupColumns();
445
443
  }
444
+ getReferencedNamedQueryNames(layout) {
445
+ var _a;
446
+ if (!((_a = layout.GridFilter) === null || _a === void 0 ? void 0 : _a.Expression)) {
447
+ return [];
448
+ }
449
+ return this.api.namedQueryApi.internalApi.getReferencedNamedQueryNames(layout.GridFilter.Expression);
450
+ }
446
451
  }
447
452
  exports.LayoutModule = LayoutModule;
@@ -1,23 +1,10 @@
1
1
  import { AdaptableApi } from '../Api/AdaptableApi';
2
2
  import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
3
- import { NoteGridCell } from '../types';
4
3
  import { AdaptableModuleBase } from './AdaptableModuleBase';
5
4
  import { IModule } from './Interface/IModule';
6
- /**
7
- * In the first iteration a cell can have only one note, the
8
- * notes is a list to allow further development.
9
- */
10
5
  export declare class NotesModule extends AdaptableModuleBase implements IModule {
11
6
  private adaptable;
12
7
  constructor(api: AdaptableApi);
13
- isModuleAvailable(): boolean;
14
- handleAdaptableReady(): void;
15
8
  addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
16
9
  private getAddRemoveNoteMenuItems;
17
- getCellPositionFromEvent(event: MouseEvent): null | {
18
- PrimaryKeyValue: string | number;
19
- ColumnId: string;
20
- };
21
- handleMouseEnter(event: MouseEvent): void;
22
- handleCellSelected(noteGridCell: NoteGridCell): void;
23
10
  }
@@ -4,37 +4,15 @@ exports.NotesModule = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
6
6
  const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
7
- /**
8
- * In the first iteration a cell can have only one note, the
9
- * notes is a list to allow further development.
10
- */
11
7
  class NotesModule extends AdaptableModuleBase_1.AdaptableModuleBase {
12
8
  constructor(api) {
13
9
  super(ModuleConstants.NotesModuleId, ModuleConstants.NotesFriendlyName, 'note', 'NotesPopup', 'Notes', api);
14
10
  this.adaptable = api.internalApi.getAdaptableInstance();
15
- this.adaptable.api.eventApi.on('AdaptableReady', () => this.handleAdaptableReady());
16
- }
17
- isModuleAvailable() {
18
- // FIXME remove this once Notes feature is public
19
- return false;
20
- }
21
- handleAdaptableReady() {
22
- if (!this.isModuleAvailable()) {
23
- return;
24
- }
25
- this.adaptable._on('MouseEnter', (event) => this.handleMouseEnter(event));
26
- this.api.eventApi.on('SelectionChanged', (params) => {
27
- const cells = params.selectedCellInfo.gridCells;
28
- if ((cells === null || cells === void 0 ? void 0 : cells.length) === 1) {
29
- const selectedCell = cells[0];
30
- const cellSelected = {
31
- PrimaryKeyValue: selectedCell.primaryKeyValue,
32
- ColumnId: selectedCell.column.columnId,
33
- };
34
- this.handleCellSelected(cellSelected);
35
- }
36
- });
37
11
  }
12
+ // isModuleAvailable(): boolean {
13
+ // // FIXME remove this once Notes feature is public
14
+ // return true;
15
+ // }
38
16
  addContextMenuItems(menuContext) {
39
17
  var _a, _b;
40
18
  if (!this.isModuleAvailable()) {
@@ -45,8 +23,10 @@ class NotesModule extends AdaptableModuleBase_1.AdaptableModuleBase {
45
23
  if (!isCellNotable ||
46
24
  isCellNotable({
47
25
  adaptableApi: this.adaptable.api,
48
- primaryKeyValue: menuContext.primaryKeyValue,
49
- columnId: menuContext.adaptableColumn.columnId,
26
+ address: {
27
+ PrimaryKeyValue: menuContext.primaryKeyValue,
28
+ ColumnId: menuContext.adaptableColumn.columnId,
29
+ },
50
30
  userName: this.adaptable.api.optionsApi.getUserName(),
51
31
  adaptableId: this.adaptable.adaptableOptions.adaptableId,
52
32
  }))
@@ -70,7 +50,7 @@ class NotesModule extends AdaptableModuleBase_1.AdaptableModuleBase {
70
50
  items.push(this.createColumnMenuItemClickFunction('Add Note', this.moduleInfo.Glyph, () => {
71
51
  // add an empty one
72
52
  this.api.notesApi.addNote('', menuContext.primaryKeyValue, menuContext.adaptableColumn.columnId);
73
- this.api.notesApi.showNotes({
53
+ this.api.internalApi.getCellPopupService().showPopup({
74
54
  PrimaryKeyValue: menuContext.primaryKeyValue,
75
55
  ColumnId: menuContext.adaptableColumn.columnId,
76
56
  }, true);
@@ -78,64 +58,5 @@ class NotesModule extends AdaptableModuleBase_1.AdaptableModuleBase {
78
58
  }
79
59
  return items;
80
60
  }
81
- getCellPositionFromEvent(event) {
82
- var _a, _b;
83
- const target = event.target;
84
- if (!((_b = (_a = target === null || target === void 0 ? void 0 : target.classList) === null || _a === void 0 ? void 0 : _a.contains) === null || _b === void 0 ? void 0 : _b.call(_a, 'ag-cell'))) {
85
- return null;
86
- }
87
- try {
88
- return {
89
- PrimaryKeyValue: target.parentElement.getAttribute('row-id'),
90
- ColumnId: target.getAttribute('col-id'),
91
- };
92
- }
93
- catch (e) {
94
- return null;
95
- }
96
- }
97
- handleMouseEnter(event) {
98
- var _a;
99
- const editMode = this.adaptable.api.notesApi.getNotePopupEditMode();
100
- if (editMode) {
101
- // ignore
102
- return;
103
- }
104
- const cellPosition = this.getCellPositionFromEvent(event);
105
- const openNoteGridCell = this.adaptable.api.notesApi.getOpenNoteGridCell();
106
- // Hovering over someting that is not a cell and there is no open note
107
- if (!cellPosition && openNoteGridCell) {
108
- // need to close if the new cell does not have a note
109
- this.adaptable.api.notesApi.hideNote();
110
- }
111
- else if ((_a = this.adaptable.api.notesApi.getCellNotes(cellPosition)) === null || _a === void 0 ? void 0 : _a.length) {
112
- this.adaptable.api.notesApi.showNotes(cellPosition, false);
113
- }
114
- }
115
- handleCellSelected(noteGridCell) {
116
- // if already opened - do nothing
117
- const openNoteGridCell = this.adaptable.api.notesApi.getOpenNoteGridCell();
118
- if ((openNoteGridCell === null || openNoteGridCell === void 0 ? void 0 : openNoteGridCell.PrimaryKeyValue) === noteGridCell.PrimaryKeyValue &&
119
- (openNoteGridCell === null || openNoteGridCell === void 0 ? void 0 : openNoteGridCell.ColumnId) === noteGridCell.ColumnId) {
120
- return;
121
- }
122
- // if open but this has no note, close
123
- const cellNotes = this.adaptable.api.notesApi.getCellNotes(noteGridCell);
124
- if (openNoteGridCell && !(cellNotes === null || cellNotes === void 0 ? void 0 : cellNotes.length)) {
125
- // hide only if in edit mode
126
- // because if you select a cell and move the mouse fast over another cell
127
- // with a note, you do not want to close that note
128
- // the selection is debounced, so the moment goes over the new cell this event is triggered
129
- if (this.adaptable.api.notesApi.getNotePopupEditMode()) {
130
- this.adaptable.api.notesApi.hideNote();
131
- }
132
- return;
133
- }
134
- // if open but the new selection has a note open that one in edit mode (because of click)
135
- if (openNoteGridCell && (cellNotes === null || cellNotes === void 0 ? void 0 : cellNotes.length)) {
136
- this.adaptable.api.notesApi.showNotes(noteGridCell, true);
137
- return;
138
- }
139
- }
140
61
  }
141
62
  exports.NotesModule = NotesModule;
@@ -12,6 +12,7 @@ const getScopeViewItems_1 = require("./Utilities/getScopeViewItems");
12
12
  const PlusMinusWizard_1 = require("../View/PlusMinus/Wizard/PlusMinusWizard");
13
13
  const getRuleViewItems_1 = require("./Utilities/getRuleViewItems");
14
14
  const getObjectTagsViewItems_1 = require("./Utilities/getObjectTagsViewItems");
15
+ const MovePlusMinus_1 = require("../View/PlusMinus/MovePlusMinus");
15
16
  class PlusMinusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
16
17
  constructor(api) {
17
18
  super(ModuleConstants.PlusMinusModuleId, ModuleConstants.PlusMinusFriendlyName, 'add-circle', 'PlusMinusPopup', 'Configure how a cell value will edit when the + or - keys are pressed', api);
@@ -218,6 +219,7 @@ class PlusMinusModule extends AdaptableModuleBase_1.AdaptableModuleBase {
218
219
  }
219
220
  getViewProperties() {
220
221
  return {
222
+ actions: [MovePlusMinus_1.MovePlusMinus],
221
223
  getEditAction: PlusMinusRedux.PlusMinusNudgeEdit,
222
224
  getDeleteAction: PlusMinusRedux.PlusMinusNudgeDelete,
223
225
  getSuspendAction: PlusMinusRedux.PlusMinusNudgeSuspend,