@adaptabletools/adaptable 16.1.1-canary.2 → 16.2.0-canary.1

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 (81) hide show
  1. package/base.css +6 -1
  2. package/base.css.map +1 -1
  3. package/bundle.cjs.js +195 -197
  4. package/index.css +10 -1
  5. package/index.css.map +1 -1
  6. package/package.json +2 -2
  7. package/publishTimestamp.d.ts +1 -1
  8. package/publishTimestamp.js +1 -1
  9. package/src/AdaptableOptions/AdaptableOptions.d.ts +1 -1
  10. package/src/AdaptableOptions/DataImportOptions.d.ts +17 -5
  11. package/src/AdaptableOptions/GroupingOptions.d.ts +1 -1
  12. package/src/AdaptableOptions/MenuOptions.d.ts +1 -1
  13. package/src/Api/ColumnApi.d.ts +3 -3
  14. package/src/Api/EventApi.d.ts +13 -2
  15. package/src/Api/Events/DataImported.d.ts +22 -0
  16. package/src/Api/Events/DataImported.js +2 -0
  17. package/src/Api/Internal/AlertInternalApi.d.ts +3 -2
  18. package/src/Api/Internal/AlertInternalApi.js +35 -5
  19. package/src/Api/Internal/DataImportInternalApi.d.ts +5 -0
  20. package/src/Api/Internal/DataImportInternalApi.js +28 -10
  21. package/src/Api/Internal/FilterInternalApi.d.ts +1 -1
  22. package/src/Api/Internal/FilterInternalApi.js +1 -1
  23. package/src/Api/Internal/GridInternalApi.js +1 -0
  24. package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +3 -3
  25. package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +1 -1
  26. package/src/PredefinedConfig/Common/Fdc3Intent.d.ts +4 -4
  27. package/src/PredefinedConfig/Common/Fdc3Intent.js +4 -19
  28. package/src/PredefinedConfig/Common/Menu.d.ts +2 -2
  29. package/src/PredefinedConfig/DashboardState.d.ts +4 -0
  30. package/src/Redux/ActionsReducers/DashboardRedux.d.ts +11 -0
  31. package/src/Redux/ActionsReducers/DashboardRedux.js +14 -1
  32. package/src/Strategy/AlertModule.js +14 -31
  33. package/src/Utilities/Defaults/DefaultAdaptableOptions.js +3 -1
  34. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.d.ts +2 -0
  35. package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +14 -2
  36. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.d.ts +1 -1
  37. package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +93 -1
  38. package/src/Utilities/Services/AlertService.js +13 -6
  39. package/src/Utilities/Services/DataService.d.ts +4 -1
  40. package/src/Utilities/Services/DataService.js +10 -5
  41. package/src/Utilities/Services/Interface/IAlertService.d.ts +12 -3
  42. package/src/Utilities/Services/Interface/IAlertService.js +9 -0
  43. package/src/Utilities/Services/Interface/IDataService.d.ts +3 -0
  44. package/src/Utilities/Services/Interface/IQueryLanguageService.d.ts +2 -1
  45. package/src/Utilities/Services/ModuleService.js +2 -0
  46. package/src/Utilities/Services/QueryLanguageService.d.ts +2 -2
  47. package/src/View/Components/Selectors/ColumnSelector.js +0 -5
  48. package/src/View/Dashboard/{CustomToolbarWrapper.d.ts → CustomToolbar.d.ts} +1 -0
  49. package/src/View/Dashboard/{CustomToolbarWrapper.js → CustomToolbar.js} +36 -33
  50. package/src/View/Dashboard/Dashboard.d.ts +2 -2
  51. package/src/View/Dashboard/Dashboard.js +20 -24
  52. package/src/View/Dashboard/DashboardPopup.d.ts +2 -1
  53. package/src/View/Dashboard/DashboardPopup.js +7 -3
  54. package/src/View/Dashboard/DashboardToolbarFactory.d.ts +7 -0
  55. package/src/View/Dashboard/DashboardToolbarFactory.js +46 -0
  56. package/src/View/Dashboard/PinnedDashboard.d.ts +5 -0
  57. package/src/View/Dashboard/PinnedDashboard.js +21 -0
  58. package/src/View/Dashboard/PinnedToolbarsSelector.d.ts +5 -0
  59. package/src/View/Dashboard/PinnedToolbarsSelector.js +52 -0
  60. package/src/View/DataImport/DataImportPopup.js +1 -1
  61. package/src/View/DataImport/DataImportWizard/DataImportWizard.d.ts +6 -1
  62. package/src/View/DataImport/DataImportWizard/DataImportWizard.js +71 -9
  63. package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.d.ts +8 -0
  64. package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +119 -0
  65. package/src/View/DataImport/DataImportWizard/sections/DataPreview.d.ts +2 -1
  66. package/src/View/DataImport/DataImportWizard/sections/DataPreview.js +13 -17
  67. package/src/View/DataImport/DataImportWizard/sections/ValidationSection.d.ts +2 -1
  68. package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +1 -1
  69. package/src/View/QuickSearch/QuickSearchInput.js +1 -1
  70. package/src/components/Dashboard/Dashboard.d.ts +1 -0
  71. package/src/components/Dashboard/Dashboard.js +2 -1
  72. package/src/components/DragAndDropContext/ModuleManager.js +1 -1
  73. package/src/components/DragAndDropContext/TabList.js +1 -1
  74. package/src/components/ExpressionEditor/editorButtonsObservable.js +10 -0
  75. package/src/metamodel/adaptable.metamodel.d.ts +20 -0
  76. package/src/metamodel/adaptable.metamodel.js +1 -1
  77. package/src/parser/src/index.js +4 -1
  78. package/src/parser/src/tokenizer.js +5 -2
  79. package/src/types.d.ts +2 -0
  80. package/version.d.ts +1 -1
  81. package/version.js +1 -1
@@ -17,27 +17,27 @@ class DataImportInternalApi extends ApiBase_1.ApiBase {
17
17
  }
18
18
  const gridApi = this.getGridApi();
19
19
  const primaryKey = this.getOptions().primaryKey;
20
- let newRows = 0;
21
- let updatedRows = 0;
20
+ let newRowCount = 0;
21
+ let updatedRowCount = 0;
22
22
  const preparedDataRows = importData.map((dataRow) => {
23
23
  const node = gridApi.getRowNodeForPrimaryKey(dataRow[primaryKey]);
24
24
  if (!node) {
25
- newRows += 1;
25
+ newRowCount += 1;
26
26
  return dataRow;
27
27
  }
28
- updatedRows += 1;
28
+ updatedRowCount += 1;
29
29
  return Object.assign(Object.assign({}, node === null || node === void 0 ? void 0 : node.data), dataRow);
30
30
  });
31
31
  await gridApi.addOrUpdateGridData(preparedDataRows);
32
32
  let message = '';
33
- if (newRows && updatedRows) {
34
- message = `Added: ${newRows} new Row${newRows > 1 ? 's' : ''}; Updated: ${updatedRows} existing Row${updatedRows > 1 ? 's' : ''}`;
33
+ if (newRowCount && updatedRowCount) {
34
+ message = `Added: ${newRowCount} new Row${newRowCount > 1 ? 's' : ''}; Updated: ${updatedRowCount} existing Row${updatedRowCount > 1 ? 's' : ''}`;
35
35
  }
36
- else if (newRows && !updatedRows) {
37
- message = `Added: ${newRows} new Row${newRows > 1 ? 's' : ''}`;
36
+ else if (newRowCount && !updatedRowCount) {
37
+ message = `Added: ${newRowCount} new Row${newRowCount > 1 ? 's' : ''}`;
38
38
  }
39
- else if (!newRows && updatedRows) {
40
- message = `Updated: ${updatedRows} existing Row${updatedRows > 1 ? 's' : ''}`;
39
+ else if (!newRowCount && updatedRowCount) {
40
+ message = `Updated: ${updatedRowCount} existing Row${updatedRowCount > 1 ? 's' : ''}`;
41
41
  }
42
42
  const alert = {
43
43
  alertType: 'generic',
@@ -48,6 +48,24 @@ class DataImportInternalApi extends ApiBase_1.ApiBase {
48
48
  } }),
49
49
  };
50
50
  this.getAlertApi().showAdaptableAlert(alert);
51
+ this.publishDataImportedEvent(preparedDataRows, importData, newRowCount, updatedRowCount);
52
+ }
53
+ /**
54
+ * Publishes an event when Data has been imported
55
+ * @param gridDataRows Rows that were imported
56
+ */
57
+ publishDataImportedEvent(gridDataRows, importData, newRowCount, updatedRowCount) {
58
+ const adaptableApi = this.getAdaptableApi();
59
+ const dataImportedInfo = {
60
+ adaptableApi: adaptableApi,
61
+ gridDataRows,
62
+ importData,
63
+ newRowCount,
64
+ updatedRowCount,
65
+ userName: adaptableApi.optionsApi.getUserName(),
66
+ adaptableId: adaptableApi.optionsApi.getAdaptableId(),
67
+ };
68
+ this.getEventApi().emit('DataImported', dataImportedInfo);
51
69
  }
52
70
  }
53
71
  exports.DataImportInternalApi = DataImportInternalApi;
@@ -10,7 +10,7 @@ export declare class FilterInternalApi extends ApiBase {
10
10
  /**
11
11
  * Returns Predicate Definition for given Column and Quick Filter shortcut
12
12
  * @param shortcut Quick Filter shortcut to lookup
13
- * @param column Adaptable Column being Filtered
13
+ * @param column AdapTable Column being Filtered
14
14
  */
15
15
  findPredicateDefByShortcut(shortcut: string, column: AdaptableColumn): AdaptablePredicateDef;
16
16
  /**
@@ -10,7 +10,7 @@ class FilterInternalApi extends ApiBase_1.ApiBase {
10
10
  /**
11
11
  * Returns Predicate Definition for given Column and Quick Filter shortcut
12
12
  * @param shortcut Quick Filter shortcut to lookup
13
- * @param column Adaptable Column being Filtered
13
+ * @param column AdapTable Column being Filtered
14
14
  */
15
15
  findPredicateDefByShortcut(shortcut, column) {
16
16
  return this.getFilterApi()
@@ -53,6 +53,7 @@ class GridInternalApi extends ApiBase_1.ApiBase {
53
53
  adaptableId: this.adaptable.api.optionsApi.getAdaptableId(),
54
54
  };
55
55
  this.adaptable.api.eventApi.emit('GridDataChanged', gridDataChangedInfo);
56
+ this.adaptable.DataService.CreateGridChangedEvent(gridDataChangedInfo);
56
57
  }
57
58
  }
58
59
  /**
@@ -1,10 +1,10 @@
1
1
  import { AdaptableObject } from './AdaptableObject';
2
2
  /**
3
- * Type of data stored in an Adaptable Column
3
+ * Type of data stored in an AdapTable Column
4
4
  */
5
5
  export declare type AdaptableColumnDataType = 'String' | 'Number' | 'Boolean' | 'Date' | 'Object' | 'StringArray' | 'NumberArray' | 'TupleNumberArray' | 'ObjectNumberArray' | 'Unknown';
6
6
  /**
7
- * Base class for Adaptable Column containing most important properties
7
+ * Base class for AdapTable Column containing most important properties
8
8
  */
9
9
  export interface AdaptableColumnBase extends AdaptableObject {
10
10
  /**
@@ -46,7 +46,7 @@ export interface AdaptableColumnGroup {
46
46
  groupCount: number;
47
47
  }
48
48
  /**
49
- * Defines an Adaptable Column - created at run-time based on AG Grid ColDef
49
+ * Defines an AdapTable Column - created at run-time based on AG Grid ColDef
50
50
  */
51
51
  export interface AdaptableColumn<TData = any> extends AdaptableColumnBase {
52
52
  /**
@@ -97,7 +97,7 @@ export interface PredicateDefHandlerContext extends BaseContext {
97
97
  */
98
98
  node: IRowNode;
99
99
  /**
100
- * Adaptable Column which contains the cell
100
+ * AdapTable Column which contains the cell
101
101
  */
102
102
  column: AdaptableColumn;
103
103
  /**
@@ -30,7 +30,7 @@ export declare const Fdc3IntentConfiguration: {
30
30
  readonly icon: "spark-line";
31
31
  };
32
32
  readonly ViewChart: {
33
- readonly contexts: readonly ["fdc3.chart", "fdc3.instrument", "fdc3.organization", "fdc3.portfolio", "fdc3.position", "fdc3.nothing"];
33
+ readonly contexts: readonly ["fdc3.chart", "fdc3.instrument", "fdc3.instrumentList", "fdc3.portfolio", "fdc3.position", "fdc3.nothing"];
34
34
  readonly icon: "pie-chart";
35
35
  };
36
36
  readonly ViewContact: {
@@ -46,7 +46,7 @@ export declare const Fdc3IntentConfiguration: {
46
46
  readonly icon: "money";
47
47
  };
48
48
  readonly ViewInteractions: {
49
- readonly contexts: readonly ["fdc3.contact", "fdc3.instrumentList", "fdc3.organization", "fdc3.nothing"];
49
+ readonly contexts: readonly ["fdc3.contact", "fdc3.instrument", "fdc3.organization", "fdc3.nothing"];
50
50
  readonly icon: "interactions";
51
51
  };
52
52
  readonly ViewNews: {
@@ -54,7 +54,7 @@ export declare const Fdc3IntentConfiguration: {
54
54
  readonly icon: "news";
55
55
  };
56
56
  readonly ViewOrders: {
57
- readonly contexts: readonly ["fdc3.contact", "fdc3.instrumentList", "fdc3.organization", "fdc3.nothing"];
57
+ readonly contexts: readonly ["fdc3.contact", "fdc3.instrument", "fdc3.organization", "fdc3.nothing"];
58
58
  readonly icon: "order";
59
59
  };
60
60
  readonly ViewProfile: {
@@ -66,7 +66,7 @@ export declare const Fdc3IntentConfiguration: {
66
66
  readonly icon: "quote";
67
67
  };
68
68
  readonly ViewResearch: {
69
- readonly contexts: readonly ["fdc3.contact", "fdc3.instrumentList", "fdc3.organization", "fdc3.nothing"];
69
+ readonly contexts: readonly ["fdc3.contact", "fdc3.instrument", "fdc3.organization", "fdc3.nothing"];
70
70
  readonly icon: "science";
71
71
  };
72
72
  };
@@ -47,7 +47,7 @@ exports.Fdc3IntentConfiguration = {
47
47
  contexts: [
48
48
  Fdc3Context_1.ChartContextKey,
49
49
  Fdc3Context_1.InstrumentContextKey,
50
- Fdc3Context_1.OrganizationContextKey,
50
+ Fdc3Context_1.InstrumentListContextKey,
51
51
  Fdc3Context_1.PortfolioContextKey,
52
52
  Fdc3Context_1.PositionContextKey,
53
53
  Fdc3Context_1.NothingContextKey,
@@ -72,12 +72,7 @@ exports.Fdc3IntentConfiguration = {
72
72
  icon: 'money',
73
73
  },
74
74
  [exports.ViewInteractionsIntent]: {
75
- contexts: [
76
- Fdc3Context_1.ContactContextKey,
77
- Fdc3Context_1.InstrumentListContextKey,
78
- Fdc3Context_1.OrganizationContextKey,
79
- Fdc3Context_1.NothingContextKey,
80
- ],
75
+ contexts: [Fdc3Context_1.ContactContextKey, Fdc3Context_1.InstrumentContextKey, Fdc3Context_1.OrganizationContextKey, Fdc3Context_1.NothingContextKey],
81
76
  icon: 'interactions',
82
77
  },
83
78
  [exports.ViewNewsIntent]: {
@@ -92,12 +87,7 @@ exports.Fdc3IntentConfiguration = {
92
87
  icon: 'news',
93
88
  },
94
89
  [exports.ViewOrdersIntent]: {
95
- contexts: [
96
- Fdc3Context_1.ContactContextKey,
97
- Fdc3Context_1.InstrumentListContextKey,
98
- Fdc3Context_1.OrganizationContextKey,
99
- Fdc3Context_1.NothingContextKey,
100
- ],
90
+ contexts: [Fdc3Context_1.ContactContextKey, Fdc3Context_1.InstrumentContextKey, Fdc3Context_1.OrganizationContextKey, Fdc3Context_1.NothingContextKey],
101
91
  icon: 'order',
102
92
  },
103
93
  [exports.ViewProfileIntent]: {
@@ -109,12 +99,7 @@ exports.Fdc3IntentConfiguration = {
109
99
  icon: 'quote',
110
100
  },
111
101
  [exports.ViewResearchIntent]: {
112
- contexts: [
113
- Fdc3Context_1.ContactContextKey,
114
- Fdc3Context_1.InstrumentListContextKey,
115
- Fdc3Context_1.OrganizationContextKey,
116
- Fdc3Context_1.NothingContextKey,
117
- ],
102
+ contexts: [Fdc3Context_1.ContactContextKey, Fdc3Context_1.InstrumentContextKey, Fdc3Context_1.OrganizationContextKey, Fdc3Context_1.NothingContextKey],
118
103
  icon: 'science',
119
104
  },
120
105
  };
@@ -68,7 +68,7 @@ export interface UserMenuItem<CONTEXT_TYPE extends BaseContext> {
68
68
  */
69
69
  export interface ColumnMenuContext<TData = any> extends BaseContext {
70
70
  /**
71
- * Current Adaptable Column
71
+ * Current AdapTable Column
72
72
  */
73
73
  adaptableColumn: AdaptableColumn<TData>;
74
74
  /**
@@ -89,7 +89,7 @@ export interface ContextMenuContext<TData = any> extends BaseContext {
89
89
  */
90
90
  gridCell: GridCell<TData>;
91
91
  /**
92
- * Current Adaptable Column
92
+ * Current AdapTable Column
93
93
  */
94
94
  adaptableColumn: AdaptableColumn<TData>;
95
95
  /**
@@ -10,6 +10,10 @@ export interface DashboardState extends ConfigState {
10
10
  * @defaultValue Empty Array
11
11
  */
12
12
  Tabs?: DashboardTab[];
13
+ /**
14
+ * Toolbars displayed above Grid (and not in Tab)
15
+ */
16
+ PinnedToolbars?: AdaptableDashboardToolbars | string[];
13
17
  /**
14
18
  * Index of Active Tab (in Tabs collection)
15
19
  */
@@ -35,6 +35,10 @@ export declare const DASHBOARD_SET_FLOATING_POSITION = "DASHBOARD_SET_FLOATING_P
35
35
  * @ReduxAction New Dashboard Tabs have been set
36
36
  */
37
37
  export declare const DASHBOARD_SET_TABS = "DASHBOARD_SET_TABS";
38
+ /**
39
+ * @ReduxAction Set Pinned Toolbars Contents
40
+ */
41
+ export declare const DASHBOARD_SET_PINNED_TOOLBARS = "DASHBOARD_SET_PINNED_TOOLBARS";
38
42
  /**
39
43
  * @ReduxAction A Toolbar has been closed
40
44
  */
@@ -84,6 +88,9 @@ export interface DashboardCloseToolbarAction extends Redux.Action {
84
88
  export interface DashboardSetTabsAction extends Redux.Action {
85
89
  Tabs: DashboardTab[];
86
90
  }
91
+ export interface DashboardSetPinnedToolbarsAction extends Redux.Action {
92
+ pinnedToolbars: DashboardState['PinnedToolbars'];
93
+ }
87
94
  export interface DashboardSetCustomToolbarButtonVisibilityAction extends Redux.Action {
88
95
  toolbarButton: AdaptableButton<DashboardButtonContext>;
89
96
  customToolbar: CustomToolbar;
@@ -106,4 +113,8 @@ export declare const DashboardSetTabs: (Tabs: DashboardTab[]) => DashboardSetTab
106
113
  export declare const DashboardCloseToolbar: (toolbar: AdaptableDashboardToolbar) => DashboardCloseToolbarAction;
107
114
  export declare const DashboardSetTitle: (title: string) => DashboardSetTitleAction;
108
115
  export declare const DashboardReady: (dashboardState: DashboardState) => DashboardReadyAction;
116
+ export declare const DashboardSetPinnedToolbars: (pinnedToolbars: DashboardState['PinnedToolbars']) => {
117
+ type: string;
118
+ pinnedToolbars: string[] | import("../../PredefinedConfig/Common/Types").AdaptableDashboardToolbars;
119
+ };
109
120
  export declare const DashboardReducer: Redux.Reducer<DashboardState>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DashboardReducer = exports.DashboardReady = exports.DashboardSetTitle = exports.DashboardCloseToolbar = exports.DashboardSetTabs = exports.DashboardSetFloatingPosition = exports.DashboardSetIsInline = exports.DashboardSetIsHidden = exports.DashboardSetIsFloating = exports.DashboardSetIsCollapsed = exports.DashboardSetActiveTabIndex = exports.DashboardSetModuleButtons = exports.DASHBOARD_READY = exports.DASHBOARD_SET_TITLE = exports.DASHBOARD_CLOSE_TOOLBAR = exports.DASHBOARD_SET_TABS = exports.DASHBOARD_SET_FLOATING_POSITION = exports.DASHBOARD_SET_IS_HIDDEN = exports.DASHBOARD_SET_IS_INLINE = exports.DASHBOARD_SET_IS_FLOATING = exports.DASHBOARD_SET_IS_COLLAPSED = exports.DASHBOARD_ACTIVE_TAB_INDEX_CHANGE = exports.DASHBOARD_SET_MODULE_BUTTONS = void 0;
3
+ exports.DashboardReducer = exports.DashboardSetPinnedToolbars = exports.DashboardReady = exports.DashboardSetTitle = exports.DashboardCloseToolbar = exports.DashboardSetTabs = exports.DashboardSetFloatingPosition = exports.DashboardSetIsInline = exports.DashboardSetIsHidden = exports.DashboardSetIsFloating = exports.DashboardSetIsCollapsed = exports.DashboardSetActiveTabIndex = exports.DashboardSetModuleButtons = exports.DASHBOARD_READY = exports.DASHBOARD_SET_TITLE = exports.DASHBOARD_CLOSE_TOOLBAR = exports.DASHBOARD_SET_PINNED_TOOLBARS = exports.DASHBOARD_SET_TABS = exports.DASHBOARD_SET_FLOATING_POSITION = exports.DASHBOARD_SET_IS_HIDDEN = exports.DASHBOARD_SET_IS_INLINE = exports.DASHBOARD_SET_IS_FLOATING = exports.DASHBOARD_SET_IS_COLLAPSED = exports.DASHBOARD_ACTIVE_TAB_INDEX_CHANGE = exports.DASHBOARD_SET_MODULE_BUTTONS = void 0;
4
4
  const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
5
5
  /**
6
6
  * @ReduxAction The Module Buttons have been set in the Dashboard
@@ -34,6 +34,10 @@ exports.DASHBOARD_SET_FLOATING_POSITION = 'DASHBOARD_SET_FLOATING_POSITION';
34
34
  * @ReduxAction New Dashboard Tabs have been set
35
35
  */
36
36
  exports.DASHBOARD_SET_TABS = 'DASHBOARD_SET_TABS';
37
+ /**
38
+ * @ReduxAction Set Pinned Toolbars Contents
39
+ */
40
+ exports.DASHBOARD_SET_PINNED_TOOLBARS = 'DASHBOARD_SET_PINNED_TOOLBARS';
37
41
  /**
38
42
  * @ReduxAction A Toolbar has been closed
39
43
  */
@@ -101,6 +105,11 @@ const DashboardReady = (dashboardState) => ({
101
105
  dashboardState,
102
106
  });
103
107
  exports.DashboardReady = DashboardReady;
108
+ const DashboardSetPinnedToolbars = (pinnedToolbars) => ({
109
+ type: exports.DASHBOARD_SET_PINNED_TOOLBARS,
110
+ pinnedToolbars,
111
+ });
112
+ exports.DashboardSetPinnedToolbars = DashboardSetPinnedToolbars;
104
113
  const initialState = {
105
114
  Tabs: GeneralConstants_1.EMPTY_ARRAY,
106
115
  ActiveTabIndex: 0,
@@ -169,6 +178,10 @@ const DashboardReducer = (state = initialState, action) => {
169
178
  const actionTyped = action;
170
179
  return Object.assign({}, state, { DashboardTitle: actionTyped.title });
171
180
  }
181
+ case exports.DASHBOARD_SET_PINNED_TOOLBARS: {
182
+ const actionTyped = action;
183
+ return Object.assign({}, state, { PinnedToolbars: actionTyped.pinnedToolbars });
184
+ }
172
185
  default:
173
186
  return state;
174
187
  }
@@ -7,7 +7,6 @@ const SystemRedux = tslib_1.__importStar(require("../Redux/ActionsReducers/Syste
7
7
  const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
8
8
  const ArrayExtensions_1 = require("../Utilities/Extensions/ArrayExtensions");
9
9
  const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
10
- const ObjectFactory_1 = tslib_1.__importDefault(require("../Utilities/ObjectFactory"));
11
10
  const AlertWizard_1 = require("../View/Alert/Wizard/AlertWizard");
12
11
  const getScopeViewItems_1 = require("./Utilities/getScopeViewItems");
13
12
  const getRuleViewItems_1 = require("./Utilities/getRuleViewItems");
@@ -154,41 +153,25 @@ class AlertModule extends AdaptableModuleBase_1.AdaptableModuleBase {
154
153
  }
155
154
  }
156
155
  handleGridDataChanged(gridDataChangedInfo) {
157
- const internalAlertApi = this.api.alertApi.internalApi;
158
156
  const alertDefinitions = this.getAlertDefinitionsForGridDataChange(gridDataChangedInfo);
159
- const rowAdded = gridDataChangedInfo.rowTrigger === 'Add';
160
- const numberOfChangedRows = gridDataChangedInfo.rowNodes.length;
161
- const actionName = rowAdded ? 'Added' : 'Removed';
162
- const alertHeader = numberOfChangedRows > 1 ? `${actionName} Rows` : `${actionName} Row `;
163
- const defaultMessage = numberOfChangedRows > 1
164
- ? `${numberOfChangedRows} rows were ${actionName.toLowerCase()}`
165
- : `${numberOfChangedRows} row was ${actionName.toLowerCase()}`;
166
- alertDefinitions === null || alertDefinitions === void 0 ? void 0 : alertDefinitions.forEach((alertDefinition) => {
167
- if (internalAlertApi.shouldFireAlertOnClient(alertDefinition)) {
168
- const customMessage = internalAlertApi.getCustomAlertDescription(alertDefinition, {
169
- gridDataChangedInfo,
170
- });
171
- const customHeader = internalAlertApi.getCustomAlertMessageHeader(alertDefinition, {
172
- gridDataChangedInfo,
173
- });
174
- const alertMessage = alertDefinition.MessageText
175
- ? alertDefinition.MessageText
176
- : customMessage !== null && customMessage !== void 0 ? customMessage : defaultMessage;
177
- const alert = ObjectFactory_1.default.CreateRowChangedAlert(customHeader !== null && customHeader !== void 0 ? customHeader : alertHeader, alertMessage, alertDefinition, gridDataChangedInfo);
178
- this.api.alertApi.showAdaptableAlert(alert);
179
- }
180
- });
157
+ this.api.alertApi.internalApi.showAlertsForGridDataChanges(gridDataChangedInfo, alertDefinitions);
181
158
  }
182
159
  handleReactiveAlertTriggered(reactiveAlertInfo) {
183
160
  // TODO - suppress Notification if alert is not relevant for layout
184
161
  var _a;
185
- // the row node data is most probably stale because the reactive queries buffer the changed data
186
- // so we have to refresh it
187
- reactiveAlertInfo.dataChangeLogEntry.rowNode = this.api.gridApi.getRowNodeForPrimaryKey(reactiveAlertInfo.dataChangeLogEntry.primaryKeyValue);
188
- reactiveAlertInfo.dataChangeLogEntry.rowData =
189
- (_a = reactiveAlertInfo.dataChangeLogEntry.rowNode) === null || _a === void 0 ? void 0 : _a.data;
190
- if (reactiveAlertInfo.type === 'alert') {
191
- this.api.alertApi.internalApi.showAlertForDefinitions(reactiveAlertInfo.dataChangeLogEntry, [
162
+ if (reactiveAlertInfo.type === 'cellDataChangedAlert') {
163
+ // the row node data is most probably stale because the reactive queries buffer the changed data
164
+ // so we have to refresh it
165
+ reactiveAlertInfo.cellChangeLogEntry.rowNode = this.api.gridApi.getRowNodeForPrimaryKey(reactiveAlertInfo.cellChangeLogEntry.primaryKeyValue);
166
+ reactiveAlertInfo.cellChangeLogEntry.rowData =
167
+ (_a = reactiveAlertInfo.cellChangeLogEntry.rowNode) === null || _a === void 0 ? void 0 : _a.data;
168
+ this.api.alertApi.internalApi.showAlertForDefinitions(reactiveAlertInfo.cellChangeLogEntry, [
169
+ reactiveAlertInfo.alertDefinition,
170
+ ]);
171
+ }
172
+ else {
173
+ // reactiveAlertInfo.type === gridDataChangedAlert'
174
+ this.api.alertApi.internalApi.showAlertForDefinitions(reactiveAlertInfo.gridChangeLogEntry, [
192
175
  reactiveAlertInfo.alertDefinition,
193
176
  ]);
194
177
  }
@@ -40,7 +40,9 @@ exports.DefaultAdaptableOptions = {
40
40
  showSystemStatusMessageNotifications: false,
41
41
  maxSystemMessagesInStore: 100,
42
42
  },
43
- dataImportOptions: {},
43
+ dataImportOptions: {
44
+ fileHandlers: undefined,
45
+ },
44
46
  flashingCellOptions: {
45
47
  defaultFlashDuration: 500,
46
48
  defaultFlashTarget: 'cell',
@@ -2,6 +2,7 @@ import { ExpressionContext } from '../../parser/src/types';
2
2
  import { AdaptableApi } from '../../Api/AdaptableApi';
3
3
  import { Observable } from 'rxjs';
4
4
  import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
5
+ import { GridDataChangedInfo } from '../../types';
5
6
  export interface BaseParameter<T = string, N = string> {
6
7
  type: T;
7
8
  name: N;
@@ -13,6 +14,7 @@ export declare const getStringValues: (context: ExpressionContext, ...stringArgu
13
14
  export declare const getStringValue: (context: ExpressionContext, stringArgument: string) => string;
14
15
  export declare const isTextSearchCaseInsensitive: (context: ExpressionContext) => boolean;
15
16
  export declare const getDataChangeLog$: (context: ExpressionContext, columnNameFilter: string) => Observable<CellDataChangedInfo>;
17
+ export declare const getGridChangeLog$: (context: ExpressionContext, gridChangeType: GridDataChangedInfo['rowTrigger']) => Observable<GridDataChangedInfo>;
16
18
  export declare const handleWhereFunction: (args: ExpressionNode[], context: ExpressionContext) => any;
17
19
  export declare type ExpressionNode = any;
18
20
  export declare const evaluateExpressionNode: (expressionNode: ExpressionNode, context: ExpressionContext, filterFn?: (item: any) => boolean) => any;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateColumnType = exports.getNumericValue = exports.handleColumnFunction = exports.extractParameters = exports.extractParameter = exports.extractColumnParameters = exports.extractColumnParameter = exports.evaluateExpressionNode = exports.handleWhereFunction = exports.getDataChangeLog$ = exports.isTextSearchCaseInsensitive = exports.getStringValue = exports.getStringValues = void 0;
3
+ exports.validateColumnType = exports.getNumericValue = exports.handleColumnFunction = exports.extractParameters = exports.extractParameter = exports.extractColumnParameters = exports.extractColumnParameter = exports.evaluateExpressionNode = exports.handleWhereFunction = exports.getGridChangeLog$ = exports.getDataChangeLog$ = exports.isTextSearchCaseInsensitive = exports.getStringValue = exports.getStringValues = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ExpressionEvaluationError_1 = require("../../parser/src/ExpressionEvaluationError");
6
6
  const StringExtensions_1 = tslib_1.__importDefault(require("../Extensions/StringExtensions"));
@@ -29,11 +29,23 @@ const getDataChangeLog$ = (context, columnNameFilter) => {
29
29
  dataChangeLog$ = dataChangeLog$.pipe((0, operators_1.filter)((dataChangeLog) => dataChangeLog.column.columnId === columnNameFilter));
30
30
  // filter based on the WHERE clause
31
31
  if (context.filterFn) {
32
- dataChangeLog$ = dataChangeLog$.pipe((0, operators_1.filter)((value) => context.filterFn(value.rowNode)));
32
+ dataChangeLog$ = dataChangeLog$.pipe((0, operators_1.filter)((value) => {
33
+ return context.filterFn(value.rowNode);
34
+ }));
33
35
  }
34
36
  return dataChangeLog$;
35
37
  };
36
38
  exports.getDataChangeLog$ = getDataChangeLog$;
39
+ const getGridChangeLog$ = (context, gridChangeType) => {
40
+ const gridChangeLog$ = context.adaptableApi.internalApi.getDataService().gridChangeLog$;
41
+ let gridChangeStream$ = gridChangeLog$.pipe((0, operators_1.filter)((gridDataChangedInfo) => gridDataChangedInfo.rowTrigger === gridChangeType));
42
+ // filter based on the WHERE clause
43
+ if (context.filterFn) {
44
+ gridChangeStream$ = gridChangeStream$.pipe((0, operators_1.filter)((value) => value.rowNodes.some((node) => context.filterFn(node))));
45
+ }
46
+ return gridChangeStream$;
47
+ };
48
+ exports.getGridChangeLog$ = getGridChangeLog$;
37
49
  const handleWhereFunction = (args, context) => {
38
50
  const reactiveExpressionNode = args[0];
39
51
  const whereClauseExpressionNode = args[1];
@@ -2,6 +2,6 @@ import { ExpressionFunction } from '../../parser/src/types';
2
2
  /**
3
3
  * List of all the Observable Functions available in AdaptableQL
4
4
  */
5
- export declare type ObservableFunctionName = 'WHERE' | 'COL' | 'TIMEFRAME' | 'ROW_CHANGE' | 'GRID_CHANGE' | 'MAX' | 'MIN' | 'NONE' | 'COUNT';
5
+ export declare type ObservableFunctionName = 'WHERE' | 'COL' | 'TIMEFRAME' | 'ROW_CHANGE' | 'ROW_ADDED' | 'GRID_CHANGE' | 'ROW_REMOVED' | 'MAX' | 'MIN' | 'NONE' | 'COUNT';
6
6
  export declare const observableExpressionFunctions: Record<ObservableFunctionName, ExpressionFunction>;
7
7
  export declare const observableExpressionFunctionNames: ObservableFunctionName[];
@@ -91,7 +91,7 @@ exports.observableExpressionFunctions = {
91
91
  (0, operators_1.debounceTime)(timeframeParameter.value),
92
92
  // completing the observable (ex. alert deletion) will also fire the NONE event
93
93
  // takeUntil takes care of this, ignoring any emissions as soon as the source completes
94
- // (count() result is irrelevant here, the main thing is that it emits an source completion)
94
+ // (count() result is irrelevant here, the main thing is that it emits a source completion)
95
95
  (0, operators_1.takeUntil)(dataChangeLog$.pipe((0, operators_1.count)())));
96
96
  }
97
97
  }
@@ -105,6 +105,48 @@ exports.observableExpressionFunctions = {
105
105
  ],
106
106
  category: 'observable',
107
107
  },
108
+ ROW_ADDED: {
109
+ handler(args, context) {
110
+ const gridChangeLog$ = (0, expressionFunctionUtils_1.getGridChangeLog$)(context, 'Add');
111
+ return handleGridRowAddedOrRemoved(args, gridChangeLog$, 'ROW_ADDED', context);
112
+ },
113
+ returnType: 'boolean',
114
+ description: 'Observes added rows in the grid',
115
+ signatures: [
116
+ 'ROW_ADDED()',
117
+ 'ROW_ADDED(rowCount: number)',
118
+ 'ROW_ADDED(timeframe:TIMEFRAME)',
119
+ 'ROW_ADDED(rowCount: number, timeframe:TIMEFRAME)',
120
+ ],
121
+ examples: [
122
+ 'ROW_ADDED()',
123
+ 'ROW_ADDED(2)',
124
+ "ROW_ADDED(TIMEFRAME('20s'))",
125
+ "ROW_ADDED(2, TIMEFRAME('20s'))",
126
+ ],
127
+ category: 'observable',
128
+ },
129
+ ROW_REMOVED: {
130
+ handler(args, context) {
131
+ const gridChangeLog$ = (0, expressionFunctionUtils_1.getGridChangeLog$)(context, 'Delete');
132
+ return handleGridRowAddedOrRemoved(args, gridChangeLog$, 'ROW_REMOVED', context);
133
+ },
134
+ returnType: 'boolean',
135
+ description: 'Observes removed rows in the grid',
136
+ signatures: [
137
+ 'ROW_REMOVED()',
138
+ 'ROW_REMOVED(rowCount: number)',
139
+ 'ROW_REMOVED(timeframe:TIMEFRAME)',
140
+ 'ROW_REMOVED(rowCount: number, timeframe:TIMEFRAME)',
141
+ ],
142
+ examples: [
143
+ 'ROW_REMOVED()',
144
+ 'ROW_REMOVED(2)',
145
+ "ROW_REMOVED(TIMEFRAME('20s'))",
146
+ "ROW_REMOVED(2, TIMEFRAME('20s'))",
147
+ ],
148
+ category: 'observable',
149
+ },
108
150
  COL: {
109
151
  handler(args, context) {
110
152
  return (0, expressionFunctionUtils_1.handleColumnFunction)(args, context);
@@ -320,6 +362,7 @@ const getTrailingGridCountChange$ = (source$, trailingPeriod, counterLimit) => {
320
362
  if (gridCounter === counterLimit) {
321
363
  // reset counter
322
364
  counter = 0;
365
+ console.log('reset counter');
323
366
  }
324
367
  return gridCounter;
325
368
  }));
@@ -434,3 +477,52 @@ const getMaxTimeframeSize = (expressionValue, context) => {
434
477
  }
435
478
  return expressionValue > maxTimeframeSize ? maxTimeframeSize : expressionValue;
436
479
  };
480
+ const handleGridRowAddedOrRemoved = (args, gridChangeLog$, consumingFunction, context) => {
481
+ let countValue = args.find((arg) => typeof arg === 'number');
482
+ if (countValue < 0) {
483
+ throw new ExpressionEvaluationError_1.ExpressionEvaluationError(consumingFunction, 'supports only zero or a positive number as argument');
484
+ }
485
+ let timeframeParameter = (0, expressionFunctionUtils_1.extractParameter)(consumingFunction, 'config', ['TIMEFRAME'], args, { isOptional: true });
486
+ if (countValue === 0 && timeframeParameter == null) {
487
+ throw new ExpressionEvaluationError_1.ExpressionEvaluationError(consumingFunction, 'requires a TIMEFRAME parameter when observing for no changes');
488
+ }
489
+ if (countValue == null && timeframeParameter == null) {
490
+ // default - return all new rows
491
+ return gridChangeLog$;
492
+ }
493
+ if (countValue == null) {
494
+ // default count value of 1
495
+ countValue = 1;
496
+ }
497
+ if (timeframeParameter == null) {
498
+ // default time parameter of max
499
+ timeframeParameter = {
500
+ name: 'TIMEFRAME',
501
+ type: 'config',
502
+ value: SYSTEM_MAX_TIMEFRAME_SIZE,
503
+ };
504
+ }
505
+ if (countValue === 0) {
506
+ // handle special case when observing NO changes
507
+ const gridDataChangeInfoStub = {
508
+ rowTrigger: consumingFunction === 'ROW_ADDED' ? 'Add' : 'Delete',
509
+ rowNodes: [],
510
+ dataRows: [],
511
+ changedAt: Date.now(),
512
+ adaptableId: context.adaptableId,
513
+ adaptableApi: context.adaptableApi,
514
+ userName: context.userName,
515
+ };
516
+ return gridChangeLog$.pipe(
517
+ // add a synthetic first value to ensure the grid is observed even when there are no changes
518
+ (0, operators_1.startWith)(gridDataChangeInfoStub),
519
+ // wait for the given time
520
+ (0, operators_1.debounceTime)(timeframeParameter.value),
521
+ // completing the observable (ex. alert deletion) will also fire the NONE event
522
+ // takeUntil takes care of this, ignoring any emissions as soon as the source completes
523
+ // (count() result is irrelevant here, the main thing is that it emits a source completion)
524
+ (0, operators_1.takeUntil)(gridChangeLog$.pipe((0, operators_1.count)())));
525
+ }
526
+ const timeframeChange$ = getTrailingGridCountChange$(gridChangeLog$, timeframeParameter.value, countValue);
527
+ return getDataChangeCount$(gridChangeLog$, timeframeChange$, countValue);
528
+ };
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AlertService = void 0;
4
4
  const tslib_1 = require("tslib");
5
+ const IAlertService_1 = require("./Interface/IAlertService");
5
6
  const Emitter_1 = tslib_1.__importDefault(require("../Emitter"));
6
7
  const rxjs_1 = require("rxjs");
7
8
  const ModuleConstants_1 = require("../Constants/ModuleConstants");
@@ -36,12 +37,18 @@ class AlertService {
36
37
  const reactiveAlertSubscription = (0, rxjs_1.combineLatest)([
37
38
  (0, rxjs_1.of)(alertDefinition),
38
39
  reactiveExpressionObservable,
39
- ]).subscribe(([alertDefinition, dataChangeLogEntry]) => {
40
- const reactiveAlertInfo = {
41
- alertDefinition: alertDefinition,
42
- dataChangeLogEntry,
43
- type: 'alert',
44
- };
40
+ ]).subscribe(([alertDefinition, changeLogEntry]) => {
41
+ const reactiveAlertInfo = (0, IAlertService_1.isGridDataChangedInfo)(changeLogEntry)
42
+ ? {
43
+ alertDefinition,
44
+ type: 'gridDataChangedAlert',
45
+ gridChangeLogEntry: changeLogEntry,
46
+ }
47
+ : {
48
+ alertDefinition,
49
+ type: 'cellDataChangedAlert',
50
+ cellChangeLogEntry: changeLogEntry,
51
+ };
45
52
  this.emitter.emitSync('ReactiveAlertTriggered', reactiveAlertInfo);
46
53
  });
47
54
  this.reactiveAlertsMap.set(alertDefinition.Uuid, {
@@ -3,11 +3,14 @@ import { IAdaptable } from '../../AdaptableInterfaces/IAdaptable';
3
3
  import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
4
4
  import { EmitterCallback } from '../../Utilities/Emitter';
5
5
  import { Observable } from 'rxjs';
6
+ import { GridDataChangedInfo } from '../../types';
6
7
  export declare class DataService implements IDataService {
7
8
  private adaptable;
8
9
  private emitter;
9
10
  private dataChangeLogSubject$;
10
11
  dataChangeLog$: Observable<CellDataChangedInfo>;
12
+ private gridChangeLogSubject$;
13
+ gridChangeLog$: Observable<GridDataChangedInfo>;
11
14
  private undoChangeLog;
12
15
  private undoChangeTimers;
13
16
  constructor(adaptable: IAdaptable);
@@ -15,9 +18,9 @@ export declare class DataService implements IDataService {
15
18
  on: (eventName: string, callback: EmitterCallback) => (() => void);
16
19
  emit: (eventName: string, data?: any) => Promise<any>;
17
20
  CreateDataChangedEvent(cellDataChangedInfo: CellDataChangedInfo): void;
21
+ CreateGridChangedEvent(gridDataChangedInfo: GridDataChangedInfo): void;
18
22
  logUndoChange(change: CellDataChangedInfo): void;
19
23
  extractUndoChange(change: CellDataChangedInfo): CellDataChangedInfo | undefined;
20
24
  private getUndoChangeKey;
21
- private logDataChange;
22
25
  private extractDataChangeLogEntry;
23
26
  }