@adaptabletools/adaptable 22.0.0-canary.3 → 22.0.0-canary.5

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 (150) hide show
  1. package/index.css +58 -29
  2. package/index.css.map +1 -1
  3. package/package.json +1 -1
  4. package/src/AdaptableOptions/ActionColumnOptions.d.ts +2 -2
  5. package/src/AdaptableOptions/CustomSortOptions.d.ts +5 -0
  6. package/src/AdaptableOptions/DashboardOptions.d.ts +1 -2
  7. package/src/AdaptableOptions/ToolPanelOptions.d.ts +1 -2
  8. package/src/AdaptableState/AlertState.d.ts +2 -2
  9. package/src/AdaptableState/ChartingState.d.ts +3 -3
  10. package/src/AdaptableState/Common/AdaptableAlert.d.ts +2 -2
  11. package/src/AdaptableState/Common/AdaptableButton.d.ts +2 -2
  12. package/src/AdaptableState/Common/AdaptableFlashingCell.d.ts +2 -2
  13. package/src/AdaptableState/Common/AdaptableObject.d.ts +25 -2
  14. package/src/AdaptableState/Common/AdaptableStyle.d.ts +1 -1
  15. package/src/AdaptableState/Common/RowSummary.d.ts +1 -1
  16. package/src/AdaptableState/Common/Schedule.d.ts +3 -4
  17. package/src/AdaptableState/Common/SystemStatusMessageInfo.d.ts +2 -2
  18. package/src/AdaptableState/CustomSortState.d.ts +2 -2
  19. package/src/AdaptableState/DashboardState.d.ts +2 -2
  20. package/src/AdaptableState/ExportState.d.ts +2 -2
  21. package/src/AdaptableState/FlashingCellState.d.ts +2 -2
  22. package/src/AdaptableState/FormatColumnState.d.ts +2 -2
  23. package/src/AdaptableState/LayoutState.d.ts +8 -3
  24. package/src/AdaptableState/NamedQueryState.d.ts +2 -2
  25. package/src/AdaptableState/PlusMinusState.d.ts +2 -2
  26. package/src/AdaptableState/ShortcutState.d.ts +2 -2
  27. package/src/AdaptableState/StyledColumnState.d.ts +1 -1
  28. package/src/AdaptableState/ThemeState.d.ts +2 -2
  29. package/src/Api/CustomSortApi.d.ts +6 -3
  30. package/src/Api/Implementation/CustomSortApiImpl.d.ts +5 -1
  31. package/src/Api/Implementation/CustomSortApiImpl.js +2 -2
  32. package/src/Api/Implementation/LayoutHelpers.js +7 -0
  33. package/src/Api/Implementation/ScheduleApiImpl.js +1 -0
  34. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +1 -1
  35. package/src/Strategy/AlertModule.js +4 -0
  36. package/src/Strategy/CustomSortModule.js +4 -0
  37. package/src/Strategy/FlashingCellModule.js +5 -0
  38. package/src/Strategy/FormatColumnModule.js +4 -0
  39. package/src/Strategy/LayoutModule.js +4 -4
  40. package/src/Strategy/PlusMinusModule.js +4 -0
  41. package/src/Strategy/ScheduleModule.js +4 -0
  42. package/src/Strategy/ShortcutModule.js +4 -0
  43. package/src/Utilities/Extensions/StringExtensions.d.ts +2 -0
  44. package/src/Utilities/Extensions/StringExtensions.js +16 -0
  45. package/src/Utilities/Helpers/FormatHelper.js +9 -2
  46. package/src/Utilities/ObjectFactory.js +15 -2
  47. package/src/View/Alert/Utilities/getDefaultAlertDefinition.d.ts +2 -1
  48. package/src/View/Alert/Wizard/AlertTypeWizardSection.d.ts +5 -2
  49. package/src/View/Alert/Wizard/AlertTypeWizardSection.js +47 -12
  50. package/src/View/Alert/Wizard/AlertWizard.js +14 -10
  51. package/src/View/Components/Buttons/EntityListActionButtons.d.ts +1 -2
  52. package/src/View/Components/Buttons/SuspendToggleButton/SuspendToggleButton.d.ts +1 -2
  53. package/src/View/Components/StyleComponent.d.ts +1 -0
  54. package/src/View/Components/StyleComponent.js +84 -33
  55. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.d.ts +2 -1
  56. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +40 -14
  57. package/src/View/CustomSort/Wizard/CustomSortWizard.js +4 -4
  58. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -0
  59. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.d.ts +2 -1
  60. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +34 -14
  61. package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +14 -10
  62. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +47 -29
  63. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +20 -9
  64. package/src/View/GridFilter/GridFilterExpressionEditor.js +6 -1
  65. package/src/View/GridFilter/GridFilterViewPanel.js +33 -70
  66. package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +8 -0
  67. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +32 -9
  68. package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +20 -15
  69. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsIPushPull.js +12 -1
  70. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsOpenFin.js +12 -1
  71. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReminder.js +12 -2
  72. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +12 -1
  73. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/isSettingsValid.d.ts +2 -1
  74. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/isSettingsValid.js +10 -1
  75. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.d.ts +2 -1
  76. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +25 -4
  77. package/src/View/Shortcut/Wizard/ShortcutWizard.js +18 -14
  78. package/src/components/ColorPicker/ColorPicker.js +5 -4
  79. package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
  80. package/src/env.js +2 -2
  81. package/src/layout-manager/src/LayoutManagerModel.d.ts +1 -0
  82. package/src/layout-manager/src/index.js +25 -7
  83. package/src/layout-manager/src/normalizeLayoutModel.js +3 -0
  84. package/src/metamodel/adaptable.metamodel.d.ts +30 -0
  85. package/src/metamodel/adaptable.metamodel.js +1 -1
  86. package/src/migration/AdaptableUpgradeHelper.js +1 -1
  87. package/src/migration/VersionUpgrade22.d.ts +15 -0
  88. package/src/migration/VersionUpgrade22.js +160 -0
  89. package/src/types.d.ts +1 -2
  90. package/tsconfig.esm.tsbuildinfo +1 -1
  91. package/src/AdaptableState/Common/SuspendableObject.d.ts +0 -10
  92. package/src/AdaptableState/Common/SuspendableObject.js +0 -1
  93. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.d.ts +0 -1
  94. package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/FinanceForm/FinanceForm.js +0 -632
  95. package/src/View/Alert/AlertEntityRow.d.ts +0 -11
  96. package/src/View/Alert/AlertEntityRow.js +0 -28
  97. package/src/View/CalculatedColumn/CalculatedColumnSummary.d.ts +0 -21
  98. package/src/View/CalculatedColumn/CalculatedColumnSummary.js +0 -58
  99. package/src/View/Components/Buttons/ButtonFunction.d.ts +0 -7
  100. package/src/View/Components/Buttons/ButtonFunction.js +0 -8
  101. package/src/View/Components/Buttons/ButtonGeneral.d.ts +0 -5
  102. package/src/View/Components/Buttons/ButtonGeneral.js +0 -7
  103. package/src/View/Components/Buttons/ButtonPreviewDelete.d.ts +0 -4
  104. package/src/View/Components/Buttons/ButtonPreviewDelete.js +0 -5
  105. package/src/View/Components/Buttons/ButtonShow.d.ts +0 -5
  106. package/src/View/Components/Buttons/ButtonShow.js +0 -7
  107. package/src/View/Components/Buttons/ButtonShowChart.d.ts +0 -5
  108. package/src/View/Components/Buttons/ButtonShowChart.js +0 -7
  109. package/src/View/Components/Buttons/ButtonUndo.d.ts +0 -5
  110. package/src/View/Components/Buttons/ButtonUndo.js +0 -7
  111. package/src/View/Components/ExpressionWizard.d.ts +0 -24
  112. package/src/View/Components/ExpressionWizard.js +0 -77
  113. package/src/View/Components/FilterForm/Waiting.d.ts +0 -10
  114. package/src/View/Components/FilterForm/Waiting.js +0 -14
  115. package/src/View/Components/Panels/PanelFooter.d.ts +0 -10
  116. package/src/View/Components/Panels/PanelFooter.js +0 -9
  117. package/src/View/Components/Panels/PanelWithTwoButtons.d.ts +0 -12
  118. package/src/View/Components/Panels/PanelWithTwoButtons.js +0 -15
  119. package/src/View/Components/Panels/ToolPanelSettingsPanel.d.ts +0 -8
  120. package/src/View/Components/Panels/ToolPanelSettingsPanel.js +0 -26
  121. package/src/View/Components/Selectors/ColumnSelectorOld.d.ts +0 -18
  122. package/src/View/Components/Selectors/ColumnSelectorOld.js +0 -45
  123. package/src/View/Components/SharedProps/WizardScopeState.d.ts +0 -4
  124. package/src/View/Components/SharedProps/WizardScopeState.js +0 -1
  125. package/src/View/Components/WizardSummaryRow.d.ts +0 -9
  126. package/src/View/Components/WizardSummaryRow.js +0 -11
  127. package/src/View/CustomSort/CustomSortSummary.d.ts +0 -23
  128. package/src/View/CustomSort/CustomSortSummary.js +0 -105
  129. package/src/View/DataImport/DataImportWizard/sections/ImportSection.d.ts +0 -9
  130. package/src/View/DataImport/DataImportWizard/sections/ImportSection.js +0 -19
  131. package/src/View/Export/Wizard/ReportColumnTypeWizard.d.ts +0 -19
  132. package/src/View/Export/Wizard/ReportColumnTypeWizard.js +0 -68
  133. package/src/View/Export/Wizard/ReportRowTypeWizard.d.ts +0 -19
  134. package/src/View/Export/Wizard/ReportRowTypeWizard.js +0 -68
  135. package/src/View/Export/Wizard/ReportSettingsWizard.d.ts +0 -21
  136. package/src/View/Export/Wizard/ReportSettingsWizard.js +0 -56
  137. package/src/View/Export/Wizard/ReportSummaryWizard.d.ts +0 -15
  138. package/src/View/Export/Wizard/ReportSummaryWizard.js +0 -35
  139. package/src/View/Filter/FilterSummary.d.ts +0 -18
  140. package/src/View/Filter/FilterSummary.js +0 -48
  141. package/src/View/FormatColumn/FormatColumnSummary.d.ts +0 -22
  142. package/src/View/FormatColumn/FormatColumnSummary.js +0 -90
  143. package/src/View/FreeTextColumn/FreeTextColumnSummary.d.ts +0 -22
  144. package/src/View/FreeTextColumn/FreeTextColumnSummary.js +0 -88
  145. package/src/View/GridInfo/GridInfoPopup/AdaptableOptionsComponent.d.ts +0 -7
  146. package/src/View/GridInfo/GridInfoPopup/AdaptableOptionsComponent.js +0 -94
  147. package/src/View/PlusMinus/PlusMinusSummary.d.ts +0 -22
  148. package/src/View/PlusMinus/PlusMinusSummary.js +0 -95
  149. package/src/View/Wizard/WizardLegend.d.ts +0 -12
  150. package/src/View/Wizard/WizardLegend.js +0 -23
@@ -1,10 +0,0 @@
1
- import { AdaptableObject } from './AdaptableObject';
2
- /**
3
- * Interface that extends Adaptable Object for those config items that can be suspended at run-time
4
- */
5
- export interface SuspendableObject extends AdaptableObject {
6
- /**
7
- * Suspends (i.e. turns off) an Adaptable Object
8
- */
9
- IsSuspended?: boolean;
10
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,632 +0,0 @@
1
- export {};
2
- /*
3
-
4
- This is no longer required since we cannot build FDC3 columns
5
- But keeping it like this as it was rather useful ...
6
-
7
- import { ColDef } from 'ag-grid-enterprise';
8
- import * as React from 'react';
9
- import { Box, BoxProps, Flex } from 'rebass';
10
- import { CheckBox } from '../../../../components/CheckBox';
11
- import DropdownButton, { DropdownButtonProps } from '../../../../components/DropdownButton';
12
- import FormLayout, { FormRow } from '../../../../components/FormLayout';
13
- import HelpBlock from '../../../../components/HelpBlock';
14
- import Input from '../../../../components/Input';
15
- import SimpleButton from '../../../../components/SimpleButton';
16
- import {
17
- AdaptableConfig,
18
- AdaptableOptions,
19
- ContactColumn,
20
- CountryColumn,
21
- FDC3Column_Depr,
22
- FinancePluginOptions,
23
- InstrumentColumn,
24
- OrganizationColumn,
25
- PositionColumn,
26
- } from '../../../../types';
27
- import StringExtensions from '../../../../Utilities/Extensions/StringExtensions';
28
- import { NocodeWizardFormBox } from '../Components/FormBox';
29
-
30
- const LocalDropdownButton = (props: DropdownButtonProps) => (
31
- <DropdownButton {...props} width="100%" columns={['label']} />
32
- );
33
-
34
- const AlertMessage: React.FunctionComponent<React.PropsWithChildren<BoxProps>> = (props) => (
35
- <Box color="var(--ab-color-error)" {...props} />
36
- );
37
-
38
- type FDC3ColumnsKey = Exclude<
39
- keyof FinancePluginOptions['fdc3Columns'],
40
- 'customFDC3Columns' | 'customFDC3Intents'
41
- >;
42
-
43
- type AnyFDC3Column =
44
- | InstrumentColumn
45
- | PositionColumn
46
- | ContactColumn
47
- | CountryColumn
48
- | OrganizationColumn;
49
-
50
- interface FDC3ColumnField<COLUMN_TYPE, INTENTS> {
51
- fields: {
52
- label: string;
53
- id: keyof COLUMN_TYPE;
54
- value?: string;
55
- required?: boolean;
56
- }[];
57
- intents: INTENTS;
58
- }
59
-
60
- const fdc3ColumnDefinitions: {
61
- instrumentColumns: FDC3ColumnField<
62
- Omit<InstrumentColumn, 'intents'>,
63
- InstrumentColumn['intents']
64
- >;
65
- positionColumns: FDC3ColumnField<Omit<PositionColumn, 'intents'>, PositionColumn['intents']>;
66
- contactColumns: FDC3ColumnField<Omit<ContactColumn, 'intents'>, ContactColumn['intents']>;
67
- countryColumns: FDC3ColumnField<Omit<CountryColumn, 'intents'>, CountryColumn['intents']>;
68
- organizationColumns: FDC3ColumnField<
69
- Omit<OrganizationColumn, 'intents'>,
70
- OrganizationColumn['intents']
71
- >;
72
- } = {
73
- instrumentColumns: {
74
- fields: [
75
- { label: 'Ticker', id: 'tickerColumnId' },
76
- { label: 'ISIN', id: 'isinColumnId' },
77
- { label: 'CUSIP', id: 'cusipColumnId' },
78
- { label: 'SEDOL', id: 'sedolColumnId' },
79
- { label: 'RIC', id: 'ricColumnId' },
80
- { label: 'BBG', id: 'bbgColumnId' },
81
- { label: 'PERMID', id: 'permidColumnId' },
82
- { label: 'FIGI', id: 'figiColumnId' },
83
- ],
84
- intents: ['ViewChart', 'ViewQuote', 'ViewNews', 'ViewAnalysis', 'ViewInstrument'],
85
- },
86
- positionColumns: {
87
- fields: [{ label: 'Instrument', id: 'instrumentColumnId', required: true }],
88
- intents: ['ViewChart', 'ViewNews', 'ViewAnalysis'],
89
- },
90
- contactColumns: {
91
- fields: [
92
- { label: 'Email', id: 'emailColumnId' },
93
- { label: 'FDS_ID', id: 'fds_idColumnId' },
94
- ],
95
- intents: ['StartCall', 'StartChat', 'ViewContact'],
96
- },
97
- countryColumns: {
98
- fields: [
99
- { label: 'ISOALPHA2', id: 'isoalpha2ColumnId' },
100
- { label: 'ISOALPHA3', id: 'isoalpha3ColumnId' },
101
- ],
102
- intents: ['ViewChart'],
103
- },
104
- organizationColumns: {
105
- fields: [
106
- { label: 'LEI', id: 'leiColumnId' },
107
- { label: 'PERM ID', id: 'permidColumnId' },
108
- { label: 'FDS ID', id: 'fds_idColumnId' },
109
- ],
110
- intents: ['ViewNews', 'ViewAnalysis'],
111
- },
112
- };
113
-
114
- const FDC3ColumnSelector: React.FunctionComponent<{
115
- label: string;
116
- id: string;
117
- value?: string;
118
- required?: boolean;
119
- onChange: (columnId: string) => void;
120
- columnOptions: { label: string; value: string }[];
121
- }> = (props) => {
122
- const options = React.useMemo(() => {
123
- return props.columnOptions.map((columnOption) => ({
124
- ...columnOption,
125
- onClick: () => props.onChange(columnOption.value),
126
- }));
127
- }, [props.onChange]);
128
-
129
- return (
130
- <FormRow
131
- label={
132
- <>
133
- {props.label} {props.required && <AlertMessage as="span">*</AlertMessage>}{' '}
134
- </>
135
- }
136
- >
137
- <LocalDropdownButton items={options}>
138
- {StringExtensions.Humanize(props.value) || 'Select Column'}
139
- </LocalDropdownButton>
140
- </FormRow>
141
- );
142
- };
143
-
144
- const FDC3InstrumentColumnBuilder: React.FunctionComponent<{
145
- column: InstrumentColumn;
146
- columnOptions: { label: string; value: string }[];
147
- onColumnFieldChange: (fieldId: string, columnId: string) => void;
148
- onIntentToggle: (intent: string) => void;
149
- }> = (props) => {
150
- const fields = fdc3ColumnDefinitions.instrumentColumns.fields;
151
- return (
152
- <Flex>
153
- <FormLayout mr={2}>
154
- {fields.slice(0, 4).map((field) => (
155
- <FDC3ColumnSelector
156
- {...field}
157
- key={field.id}
158
- value={(props.column[field.id] as string) ?? 'Select Column'}
159
- onChange={(columnId) => props.onColumnFieldChange(field.id, columnId)}
160
- columnOptions={props.columnOptions}
161
- />
162
- ))}
163
- </FormLayout>
164
- <FormLayout>
165
- {fields.slice(4).map((field) => (
166
- <FDC3ColumnSelector
167
- {...field}
168
- key={field.id}
169
- value={(props.column[field.id] as string) ?? 'Select Column'}
170
- onChange={(columnId) => props.onColumnFieldChange(field.id, columnId)}
171
- columnOptions={props.columnOptions}
172
- />
173
- ))}
174
- </FormLayout>
175
- <Flex ml={3} flexDirection="column">
176
- {fdc3ColumnDefinitions.instrumentColumns.intents.map((intent) => (
177
- <CheckBox
178
- checked={props.column.intents?.includes?.(intent)}
179
- onClick={() => props.onIntentToggle(intent)}
180
- key={intent}
181
- >
182
- {intent}
183
- </CheckBox>
184
- ))}
185
- </Flex>
186
- </Flex>
187
- );
188
- };
189
-
190
- const FDC3BaseColumnBuilder: React.FunctionComponent<{
191
- fdc3ColumnType: FDC3ColumnsKey;
192
- columnOptions: { label: string; value: string }[];
193
- column: AnyFDC3Column;
194
- onColumnFieldChange: (fieldId: string, columnId?: string) => void;
195
- onIntentToggle: (intent: string) => void;
196
- }> = (props) => {
197
- const fields = fdc3ColumnDefinitions[props.fdc3ColumnType].fields;
198
- const intents = fdc3ColumnDefinitions[props.fdc3ColumnType].intents;
199
- return (
200
- <Flex>
201
- <FormLayout>
202
- {fields.map((field) => (
203
- <FDC3ColumnSelector
204
- {...field}
205
- key={field.id}
206
- columnOptions={props.columnOptions}
207
- onChange={(columnId) => props.onColumnFieldChange(field.id, columnId)}
208
- value={(props.column as any)?.[field.id] ?? ''}
209
- />
210
- ))}
211
- <FormRow label="">
212
- <Flex flexDirection="column">
213
- {intents.map((intent: string) => (
214
- <CheckBox
215
- checked={((props.column?.intents as string[]) ?? []).includes(intent)}
216
- onClick={() => props.onIntentToggle(intent)}
217
- key={intent}
218
- >
219
- {intent}
220
- </CheckBox>
221
- ))}
222
- </Flex>
223
- </FormRow>
224
- </FormLayout>
225
- </Flex>
226
- );
227
- };
228
-
229
- const FDC3ColumnBuilder: React.FunctionComponent<{
230
- columnOptions: { label: string; value: string }[];
231
- fdc3Column: FDC3Column_Depr;
232
- fdc3ColumnType?: FDC3ColumnsKey;
233
- onChange: (fdc3Column: FDC3Column_Depr) => void;
234
- beforeContent?: React.ReactElement;
235
- disabled?: boolean;
236
- footer: React.ReactElement;
237
- }> = (props) => {
238
- const handleColumnFieldChange = React.useCallback(
239
- (fieldId: string, columnId?: string) => {
240
- props.onChange({
241
- ...props.fdc3Column,
242
- [fieldId]: columnId,
243
- });
244
- },
245
- [props.fdc3Column, props.onChange]
246
- );
247
-
248
- const handleIntentToggle = React.useCallback(
249
- (intent: string) => {
250
- const newFDC3Column = { ...props.fdc3Column };
251
- newFDC3Column.intents = newFDC3Column.intents ?? [];
252
- if ((newFDC3Column.intents as string[]).includes(intent)) {
253
- (newFDC3Column.intents as string[]) = (newFDC3Column.intents as string[]).filter(
254
- (i: string) => i !== intent
255
- );
256
- } else {
257
- (newFDC3Column.intents as string[]).push(intent);
258
- }
259
- props.onChange(newFDC3Column);
260
- },
261
- [props.fdc3Column]
262
- );
263
-
264
- const columnOptions = React.useMemo(() => {
265
- return props.columnOptions.map((columnOption) => ({
266
- ...columnOption,
267
- onClick: () => {
268
- props.onChange({
269
- ...props.fdc3Column,
270
- columnId: columnOption.value,
271
- });
272
- },
273
- }));
274
- }, [props.fdc3Column]);
275
-
276
- const handleNameColumnIdChange = React.useCallback(
277
- (event: any) => {
278
- props.onChange({
279
- ...props.fdc3Column,
280
- nameColumnId: event.target.value ?? '',
281
- });
282
- },
283
- [props.fdc3Column]
284
- );
285
-
286
- const handleShowBroadcastToggle = React.useCallback(() => {
287
- props.onChange({
288
- ...props.fdc3Column,
289
- showBroadcastContextMenu: !props.fdc3Column?.showBroadcastContextMenu,
290
- });
291
- }, [props.fdc3Column]);
292
-
293
- const handleBroadcastLabelChange = React.useCallback(
294
- (event: any) => {
295
- props.onChange({
296
- ...props.fdc3Column,
297
- broadcastContextMenuLabel: event.target.value ?? '',
298
- });
299
- },
300
- [props.fdc3Column]
301
- );
302
-
303
- return (
304
- <NocodeWizardFormBox>
305
- <Flex flexWrap="wrap">
306
- <FormLayout mr={3} mb={3}>
307
- {props.beforeContent}
308
- <FormRow
309
- label={
310
- <>
311
- Column <AlertMessage as="span">*</AlertMessage>{' '}
312
- </>
313
- }
314
- >
315
- <LocalDropdownButton disabled={props.disabled} items={columnOptions}>
316
- {columnOptions.find((item) => item.value === props.fdc3Column?.columnId)?.label ??
317
- 'Select Column'}
318
- </LocalDropdownButton>
319
- </FormRow>
320
- <FormRow label="FDC3 Name">
321
- <Input
322
- disabled={props.disabled}
323
- onChange={handleNameColumnIdChange}
324
- value={props.fdc3Column?.nameColumnId ?? ''}
325
- />
326
- </FormRow>
327
-
328
- <FormRow label="">
329
- <CheckBox
330
- disabled={props.disabled}
331
- checked={Boolean(props.fdc3Column?.showBroadcastContextMenu)}
332
- onChange={handleShowBroadcastToggle}
333
- >
334
- Show Broadcast <br /> Context Menu
335
- </CheckBox>
336
- </FormRow>
337
-
338
- <FormRow label="Broadcast Label">
339
- <Input
340
- disabled={props.disabled || !Boolean(props.fdc3Column?.showBroadcastContextMenu)}
341
- onChange={handleBroadcastLabelChange}
342
- value={
343
- typeof props.fdc3Column?.broadcastContextMenuLabel === 'string'
344
- ? props.fdc3Column?.broadcastContextMenuLabel
345
- : ''
346
- }
347
- />
348
- </FormRow>
349
- </FormLayout>
350
-
351
- <Box flex={1}>
352
- {props.fdc3ColumnType === 'instrumentColumns' ? (
353
- <FDC3InstrumentColumnBuilder
354
- onIntentToggle={handleIntentToggle}
355
- onColumnFieldChange={(...args) => handleColumnFieldChange(...args)}
356
- column={props.fdc3Column as InstrumentColumn}
357
- columnOptions={props.columnOptions}
358
- />
359
- ) : (
360
- props.fdc3ColumnType && (
361
- <FDC3BaseColumnBuilder
362
- onColumnFieldChange={(...args) => handleColumnFieldChange(...args)}
363
- onIntentToggle={handleIntentToggle}
364
- column={props.fdc3Column}
365
- fdc3ColumnType={props.fdc3ColumnType}
366
- columnOptions={props.columnOptions}
367
- />
368
- )
369
- )}
370
- </Box>
371
- </Flex>
372
- {props.footer}
373
- </NocodeWizardFormBox>
374
- );
375
- };
376
-
377
- const FDC3ColumnEditor: React.FunctionComponent<{
378
- onChange: (fdc3Column: AnyFDC3Column) => void;
379
- columnOptions: { label: string; value: string }[];
380
- fdc3Column: AnyFDC3Column;
381
- fdc3ColumnType: FDC3ColumnsKey;
382
- footer: React.ReactElement;
383
- }> = (props) => {
384
- return (
385
- <FDC3ColumnBuilder
386
- columnOptions={props.columnOptions}
387
- fdc3Column={props.fdc3Column}
388
- fdc3ColumnType={props.fdc3ColumnType}
389
- onChange={props.onChange}
390
- footer={props.footer}
391
- />
392
- );
393
- };
394
-
395
- const FDC3ColumnCreator: React.FunctionComponent<{
396
- onNew: (fdc3ColumnType: FDC3ColumnsKey, fdc3Column: FDC3Column_Depr) => void;
397
- columnOptions: { label: string; value: string }[];
398
- }> = (props) => {
399
- const [fdc3Column, setFDC3Column] = React.useState<AnyFDC3Column>();
400
- const [fdc3ColumnType, setFDC3ColumnType] = React.useState<FDC3ColumnsKey>();
401
-
402
- const handleOnNew = React.useCallback(() => {
403
- props.onNew(fdc3ColumnType, fdc3Column);
404
- setFDC3Column(null);
405
- setFDC3ColumnType(null);
406
- }, [fdc3Column]);
407
-
408
- const fdc3ColumnOptions: { label: string; columnField: FDC3ColumnsKey; onClick: () => void }[] =
409
- React.useMemo(() => {
410
- return [
411
- {
412
- label: 'Instrument',
413
- columnField: 'instrumentColumns',
414
- },
415
- {
416
- label: 'Position',
417
- columnField: 'positionColumns',
418
- },
419
- {
420
- label: 'Contact',
421
- columnField: 'contactColumns',
422
- },
423
- {
424
- label: 'Country',
425
- columnField: 'countryColumns',
426
- },
427
- {
428
- label: 'Organization',
429
- columnField: 'organizationColumns',
430
- },
431
- ].map((item: { label: string; columnField: FDC3ColumnsKey }) => ({
432
- ...item,
433
- onClick: () => {
434
- setFDC3ColumnType(item.columnField);
435
- setFDC3Column({ columnId: '' });
436
- },
437
- }));
438
- }, []);
439
-
440
- const typeSelector = (
441
- <FormRow label="FDC3 Type">
442
- <LocalDropdownButton items={fdc3ColumnOptions}>
443
- {fdc3ColumnOptions.find((item) => item.columnField === fdc3ColumnType)?.label ??
444
- 'Select Column'}
445
- </LocalDropdownButton>
446
- </FormRow>
447
- );
448
-
449
- const fieldsDisabled = !fdc3ColumnType;
450
-
451
- const errors: string[] = [];
452
- if (fdc3Column && !fdc3Column.columnId) {
453
- errors.push('Column is required.');
454
- }
455
- if (fdc3Column) {
456
- const fields = fdc3ColumnDefinitions[fdc3ColumnType].fields;
457
- fields.forEach((field) => {
458
- if (field.required && !(fdc3Column as any)[field.id]) {
459
- errors.push(`${field.label} is required.`);
460
- }
461
- });
462
- }
463
-
464
- return (
465
- <FDC3ColumnBuilder
466
- disabled={fieldsDisabled}
467
- columnOptions={props.columnOptions}
468
- fdc3Column={fdc3Column}
469
- fdc3ColumnType={fdc3ColumnType}
470
- onChange={(newFDC3Column) => setFDC3Column(newFDC3Column)}
471
- beforeContent={typeSelector}
472
- footer={
473
- <Flex>
474
- <Box flex={1} />
475
- <Flex alignItems="center" mr={3}>
476
- {errors.slice(0, 1).map((error) => (
477
- <AlertMessage key={error} ml={2}>
478
- {error}
479
- </AlertMessage>
480
- ))}
481
- </Flex>
482
-
483
- <SimpleButton
484
- disabled={fieldsDisabled || !fdc3Column.columnId}
485
- onClick={handleOnNew}
486
- icon="plus"
487
- variant="raised"
488
- >
489
- Add FDC3 Column
490
- </SimpleButton>
491
- </Flex>
492
- }
493
- />
494
- );
495
- };
496
-
497
- const FinanceFormSectionTitle: React.FunctionComponent<React.PropsWithChildren<BoxProps>> = (
498
- props
499
- ) => (
500
- <Box {...props} mb={2}>
501
- <HelpBlock>{props.children}</HelpBlock>
502
- </Box>
503
- );
504
-
505
- export interface FinanceFormProps {
506
- adaptableConfig: AdaptableConfig;
507
- onChangedAdaptableConfig: (adaptableConfig: AdaptableConfig) => void;
508
- }
509
-
510
- export const FinanceForm: React.FunctionComponent<React.PropsWithChildren<FinanceFormProps>> = (
511
- props
512
- ) => {
513
- const columnOptions = props.adaptableConfig.gridOptions?.columnDefs?.map?.((item: ColDef) => ({
514
- label: StringExtensions.Humanize(item.headerName ?? item.field),
515
- value: item.field,
516
- }));
517
-
518
- const financePlugin = props.adaptableConfig.adaptableOptions?.plugins?.find(
519
- (item) => item.pluginId === 'finance'
520
- );
521
- const financePluginOptions = (financePlugin?.options ?? {}) as FinancePluginOptions;
522
- const fdc3Columns = financePluginOptions?.fdc3Columns ?? {};
523
-
524
- const handleSetFdc3Columns = (key: FDC3ColumnsKey, newFDC3Columns: any) => {
525
- // Unfurtunatly finance plugin options need to be mutated.
526
- // It is the only was without instanciating the plugin again.
527
- // But that would mean to inport the finance plugin inside the nocode plugin.
528
- financePluginOptions.fdc3Columns = financePluginOptions.fdc3Columns ?? {};
529
- financePluginOptions.fdc3Columns[key] = newFDC3Columns;
530
-
531
- // on change is called with a new array of plugins so the component refreshes.
532
- props.onChangedAdaptableConfig({
533
- ...props.adaptableConfig,
534
- adaptableOptions: {
535
- ...props.adaptableConfig.adaptableOptions,
536
- plugins: [...props.adaptableConfig.adaptableOptions.plugins],
537
- },
538
- });
539
- };
540
-
541
- const renderEditor = (fdc3ColumnType: FDC3ColumnsKey, fdc3ColumnsItems: AnyFDC3Column[]) => {
542
- return fdc3ColumnsItems.map((fdc3Column, currentFDCColumnId) => (
543
- <Box key={currentFDCColumnId} mb={3}>
544
- <FDC3ColumnEditor
545
- columnOptions={columnOptions}
546
- fdc3Column={fdc3Column}
547
- fdc3ColumnType={fdc3ColumnType}
548
- onChange={(editedFDC3Column) => {
549
- const newFDC3Columns = fdc3ColumnsItems.map((fdc3Column, index) => {
550
- if (index === currentFDCColumnId) {
551
- return editedFDC3Column;
552
- }
553
- return fdc3Column;
554
- });
555
-
556
- handleSetFdc3Columns(fdc3ColumnType, newFDC3Columns);
557
- }}
558
- footer={
559
- <Flex>
560
- <Box flex={1} />
561
- <SimpleButton
562
- onClick={() => {
563
- const newFDC3Columns = fdc3ColumnsItems.filter(
564
- (_, index) => index !== currentFDCColumnId
565
- );
566
- handleSetFdc3Columns(fdc3ColumnType, newFDC3Columns);
567
- }}
568
- tone="error"
569
- variant="raised"
570
- icon="delete"
571
- >
572
- Delete
573
- </SimpleButton>
574
- </Flex>
575
- }
576
- />
577
- </Box>
578
- ));
579
- };
580
-
581
- return (
582
- <Box p={2} className="ab-FinanceForm">
583
- <Box mb={3}>
584
- <HelpBlock mb={3}>Create FDC3 Column</HelpBlock>
585
- <FDC3ColumnCreator
586
- columnOptions={columnOptions}
587
- onNew={(type, fdc3Column) => {
588
- handleSetFdc3Columns(type, [...(fdc3Columns[type] ?? []), fdc3Column]);
589
- }}
590
- />
591
- </Box>
592
-
593
- {Boolean(fdc3Columns.instrumentColumns?.length) && (
594
- <Box>
595
- <FinanceFormSectionTitle>Instrument Columns</FinanceFormSectionTitle>
596
- {renderEditor('instrumentColumns', fdc3Columns.instrumentColumns)}
597
- </Box>
598
- )}
599
-
600
- {Boolean(fdc3Columns.positionColumns?.length) && (
601
- <Box>
602
- <FinanceFormSectionTitle>Position Columns</FinanceFormSectionTitle>
603
- {renderEditor('positionColumns', fdc3Columns.positionColumns)}
604
- </Box>
605
- )}
606
-
607
- {Boolean(fdc3Columns.contactColumns?.length) && (
608
- <Box>
609
- <FinanceFormSectionTitle>Contact Columns</FinanceFormSectionTitle>
610
- {renderEditor('contactColumns', fdc3Columns.contactColumns)}
611
- </Box>
612
- )}
613
-
614
- {Boolean(fdc3Columns.countryColumns?.length) && (
615
- <Box>
616
- <FinanceFormSectionTitle>Country Columns</FinanceFormSectionTitle>
617
- {renderEditor('countryColumns', fdc3Columns.countryColumns)}
618
- </Box>
619
- )}
620
-
621
- {Boolean(fdc3Columns.organizationColumns?.length) && (
622
- <Box>
623
- <FinanceFormSectionTitle>Organization Columns</FinanceFormSectionTitle>
624
- {renderEditor('organizationColumns', fdc3Columns.organizationColumns)}
625
- </Box>
626
- )}
627
- </Box>
628
- );
629
- };
630
-
631
-
632
- */
@@ -1,11 +0,0 @@
1
- import * as React from 'react';
2
- import { SharedEntityRowProps } from '../Components/SharedProps/ConfigEntityRowProps';
3
- import { AlertDefinition } from '../../AdaptableState/AlertState';
4
- import { AdaptableMessageType } from '../../AdaptableState/Common/AdaptableMessageType';
5
- export interface AlertEntityRowProps extends SharedEntityRowProps<AlertEntityRow> {
6
- onChangeMessageType: (alertDefinition: AlertDefinition, Type: AdaptableMessageType) => void;
7
- }
8
- export declare class AlertEntityRow extends React.Component<AlertEntityRowProps, {}> {
9
- render(): any;
10
- onMessageTypeChanged(alertDefinition: AlertDefinition, value: AdaptableMessageType): void;
11
- }
@@ -1,28 +0,0 @@
1
- import * as React from 'react';
2
- import { EntityListActionButtons } from '../Components/Buttons/EntityListActionButtons';
3
- import { AdaptableObjectRow } from '../Components/AdaptableObjectRow';
4
- import { EntityRowItem } from '../Components/EntityRowItem';
5
- import DropdownButton from '../../components/DropdownButton';
6
- import { cloneObject } from '../../Utilities/Helpers/Helper';
7
- export class AlertEntityRow extends React.Component {
8
- render() {
9
- let alertDefinition = this.props.adaptableObject;
10
- let messageTypes = ['Info', 'Success', 'Warning', 'Error'];
11
- let colItems = cloneObject(this.props.colItems);
12
- colItems[0].Content = (React.createElement(EntityRowItem, { Content: this.props.api.columnScopeApi.getScopeToString(alertDefinition.Scope) }));
13
- colItems[1].Content = (React.createElement(EntityRowItem, { Content: this.props.api.alertApi.internalApi.getAlertRuleDescription(alertDefinition) }));
14
- colItems[2].Content = (React.createElement("div", null,
15
- React.createElement(DropdownButton, { showClearButton: false, items: messageTypes.map((item) => ({
16
- value: item,
17
- label: item,
18
- onClick: () => this.onMessageTypeChanged(alertDefinition, item),
19
- })), columns: ['label'], accessLevel: this.props.accessLevel }, alertDefinition.MessageType)));
20
- colItems[3].Content = (React.createElement(EntityListActionButtons, { showSuspend: true, suspendableObject: alertDefinition, confirmDeleteAction: this.props.onDeleteConfirm, showShare: this.props.teamSharingActivated, editClick: () => this.props.onEdit(alertDefinition), shareClick: (config) => this.props.onShare(config),
21
- //overrideDisableEdit={!this.props.Column}
22
- entityType: this.props.moduleInfo.FriendlyName, accessLevel: this.props.accessLevel, onSuspend: this.props.onSuspend, onUnSuspend: this.props.onUnSuspend }));
23
- return React.createElement(AdaptableObjectRow, { isSuspended: alertDefinition.IsSuspended, colItems: colItems });
24
- }
25
- onMessageTypeChanged(alertDefinition, value) {
26
- this.props.onChangeMessageType(alertDefinition, value);
27
- }
28
- }