@adaptabletools/adaptable-cjs 22.0.0-canary.3 → 22.0.0-canary.4

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 (85) hide show
  1. package/index.css +12 -3
  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/RowSummary.d.ts +1 -1
  15. package/src/AdaptableState/Common/Schedule.d.ts +3 -4
  16. package/src/AdaptableState/Common/SystemStatusMessageInfo.d.ts +2 -2
  17. package/src/AdaptableState/CustomSortState.d.ts +2 -2
  18. package/src/AdaptableState/DashboardState.d.ts +2 -2
  19. package/src/AdaptableState/ExportState.d.ts +2 -2
  20. package/src/AdaptableState/FlashingCellState.d.ts +2 -2
  21. package/src/AdaptableState/FormatColumnState.d.ts +2 -2
  22. package/src/AdaptableState/LayoutState.d.ts +8 -3
  23. package/src/AdaptableState/NamedQueryState.d.ts +2 -2
  24. package/src/AdaptableState/PlusMinusState.d.ts +2 -2
  25. package/src/AdaptableState/ShortcutState.d.ts +2 -2
  26. package/src/AdaptableState/StyledColumnState.d.ts +1 -1
  27. package/src/AdaptableState/ThemeState.d.ts +2 -2
  28. package/src/Api/CustomSortApi.d.ts +6 -3
  29. package/src/Api/Implementation/CustomSortApiImpl.d.ts +5 -1
  30. package/src/Api/Implementation/CustomSortApiImpl.js +2 -2
  31. package/src/Api/Implementation/LayoutHelpers.js +7 -0
  32. package/src/Api/Implementation/ScheduleApiImpl.js +1 -0
  33. package/src/Redux/ActionsReducers/LayoutRedux.d.ts +1 -1
  34. package/src/Strategy/AlertModule.js +4 -0
  35. package/src/Strategy/CustomSortModule.js +4 -0
  36. package/src/Strategy/FlashingCellModule.js +5 -0
  37. package/src/Strategy/FormatColumnModule.js +4 -0
  38. package/src/Strategy/LayoutModule.js +4 -4
  39. package/src/Strategy/PlusMinusModule.js +4 -0
  40. package/src/Strategy/ScheduleModule.js +4 -0
  41. package/src/Strategy/ShortcutModule.js +4 -0
  42. package/src/Utilities/Extensions/StringExtensions.d.ts +2 -0
  43. package/src/Utilities/Extensions/StringExtensions.js +17 -0
  44. package/src/Utilities/Helpers/FormatHelper.js +9 -2
  45. package/src/Utilities/ObjectFactory.js +15 -2
  46. package/src/View/Alert/Utilities/getDefaultAlertDefinition.d.ts +2 -1
  47. package/src/View/Alert/Wizard/AlertTypeWizardSection.d.ts +5 -2
  48. package/src/View/Alert/Wizard/AlertTypeWizardSection.js +48 -12
  49. package/src/View/Alert/Wizard/AlertWizard.js +12 -8
  50. package/src/View/Components/Buttons/EntityListActionButtons.d.ts +1 -2
  51. package/src/View/Components/Buttons/SuspendToggleButton/SuspendToggleButton.d.ts +1 -2
  52. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.d.ts +2 -1
  53. package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +39 -13
  54. package/src/View/CustomSort/Wizard/CustomSortWizard.js +4 -4
  55. package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -0
  56. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.d.ts +2 -1
  57. package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +36 -15
  58. package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +13 -9
  59. package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +47 -29
  60. package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +22 -11
  61. package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +8 -0
  62. package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +32 -9
  63. package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +20 -15
  64. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsIPushPull.js +12 -1
  65. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsOpenFin.js +12 -1
  66. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReminder.js +12 -2
  67. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/ScheduleSettingsReport.js +12 -1
  68. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/isSettingsValid.d.ts +2 -1
  69. package/src/View/Schedule/Wizard/ScheduleSettingsWizard/isSettingsValid.js +10 -1
  70. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.d.ts +2 -1
  71. package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +25 -4
  72. package/src/View/Shortcut/Wizard/ShortcutWizard.js +18 -14
  73. package/src/env.js +2 -2
  74. package/src/layout-manager/src/LayoutManagerModel.d.ts +1 -0
  75. package/src/layout-manager/src/index.js +25 -7
  76. package/src/layout-manager/src/normalizeLayoutModel.js +3 -0
  77. package/src/metamodel/adaptable.metamodel.d.ts +30 -0
  78. package/src/metamodel/adaptable.metamodel.js +1 -1
  79. package/src/migration/AdaptableUpgradeHelper.js +1 -1
  80. package/src/migration/VersionUpgrade22.d.ts +15 -0
  81. package/src/migration/VersionUpgrade22.js +160 -0
  82. package/src/types.d.ts +1 -2
  83. package/tsconfig.cjs.tsbuildinfo +1 -1
  84. package/src/AdaptableState/Common/SuspendableObject.d.ts +0 -10
  85. package/src/AdaptableState/Common/SuspendableObject.js +0 -2
@@ -11,9 +11,10 @@ const FormatColumnStyleWizardSection_1 = require("./FormatColumnStyleWizardSecti
11
11
  const FormatColumnFormatWizardSection_1 = require("./FormatColumnFormatWizardSection");
12
12
  const AdaptableContext_1 = require("../../AdaptableContext");
13
13
  const FormatColumnSettingsWizardSection_1 = require("./FormatColumnSettingsWizardSection");
14
+ const react_redux_1 = require("react-redux");
14
15
  const NewScopeComponent_1 = require("../../Components/NewScopeComponent");
15
16
  const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/ObjectFactory"));
16
- const react_redux_1 = require("react-redux");
17
+ const react_redux_2 = require("react-redux");
17
18
  const FormatColumnRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/FormatColumnRedux"));
18
19
  const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection");
19
20
  const Utilities_1 = require("../../Components/EntityRulesEditor/Utilities");
@@ -61,6 +62,7 @@ const adjustFormatColumn = (formatColumn, api) => {
61
62
  };
62
63
  function FormatColumnWizard(props) {
63
64
  const { api } = (0, AdaptableContext_1.useAdaptable)();
65
+ const allFormatColumns = (0, react_redux_1.useSelector)((state) => state.FormatColumn?.FormatColumns ?? []);
64
66
  const data = props.data ?? props.popupParams?.value;
65
67
  const [formatColumn, doSetFormatColumn] = (0, react_1.useState)(() => {
66
68
  let formatColumn = data ? (0, Helper_1.cloneObject)(data) : ObjectFactory_1.default.CreateEmptyFormatColumn();
@@ -78,7 +80,7 @@ function FormatColumnWizard(props) {
78
80
  const setFormatColumn = React.useCallback((formatColumn) => {
79
81
  doSetFormatColumn(adjustFormatColumn(formatColumn, api));
80
82
  }, []);
81
- const dispatch = (0, react_redux_1.useDispatch)();
83
+ const dispatch = (0, react_redux_2.useDispatch)();
82
84
  const handleFinish = () => {
83
85
  if (formatColumn?.DisplayFormat?.Options &&
84
86
  (0, ObjectExtensions_1.isObjectEmpty)(formatColumn?.DisplayFormat?.Options)) {
@@ -96,6 +98,24 @@ function FormatColumnWizard(props) {
96
98
  props.onFinishWizard(formatColumn);
97
99
  };
98
100
  return (React.createElement(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, modal: props.modal, data: formatColumn, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
101
+ {
102
+ title: 'Settings',
103
+ details: 'Enter Name and set Additional Properties',
104
+ isValid: (formatColumnData) => {
105
+ if (!formatColumnData.Name) {
106
+ return 'Format Column Name cannot be blank';
107
+ }
108
+ if (allFormatColumns.some((fc) => fc.Name === formatColumnData.Name && fc.Uuid !== formatColumnData.Uuid)) {
109
+ return 'A Format Column already exists with that name';
110
+ }
111
+ return true;
112
+ },
113
+ renderSummary: FormatColumnSettingsWizardSection_1.renderFormatColumnSettingsSummary,
114
+ render: () => {
115
+ return (React.createElement(Flex_1.Box, { className: "twa:p-2" },
116
+ React.createElement(FormatColumnSettingsWizardSection_1.FormatColumnSettingsWizardSection, { onChange: setFormatColumn })));
117
+ },
118
+ },
99
119
  {
100
120
  title: 'Scope',
101
121
  details: 'Select which Columns will be formatted',
@@ -146,15 +166,6 @@ function FormatColumnWizard(props) {
146
166
  return React.createElement(FormatColumnFormatWizardSection_1.FormatColumnFormatWizardSection, { onChange: setFormatColumn });
147
167
  },
148
168
  },
149
- {
150
- title: 'Settings',
151
- details: 'Set Additional Properties',
152
- renderSummary: FormatColumnSettingsWizardSection_1.renderFormatColumnSettingsSummary,
153
- render: () => {
154
- return (React.createElement(Flex_1.Box, { className: "twa:p-2" },
155
- React.createElement(FormatColumnSettingsWizardSection_1.FormatColumnSettingsWizardSection, { onChange: setFormatColumn })));
156
- },
157
- },
158
169
  {
159
170
  details: 'Select Format Column Tags',
160
171
  title: 'Tags',
@@ -11,6 +11,7 @@ const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard
11
11
  const Utilities_1 = require("./Utilities");
12
12
  const ArrayExtensions_1 = tslib_1.__importDefault(require("../../../../Utilities/Extensions/ArrayExtensions"));
13
13
  const Flex_1 = require("../../../../components/Flex");
14
+ const CheckBox_1 = require("../../../../components/CheckBox");
14
15
  const PivotColumnsSectionSummary = () => {
15
16
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
16
17
  const { data: layout } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
@@ -33,6 +34,13 @@ const PivotColumnsSection = (props) => {
33
34
  return (React.createElement(Tabs_1.Tabs, { className: "twa:h-full" },
34
35
  React.createElement(Tabs_1.Tabs.Tab, null, "Pivot Columns"),
35
36
  React.createElement(Tabs_1.Tabs.Content, null,
37
+ React.createElement(Flex_1.Box, { className: "twa:mb-3 twa:px-2" },
38
+ React.createElement(CheckBox_1.CheckBox, { checked: !!layout.PivotResultColumns, onChange: (checked) => {
39
+ props.onChange({
40
+ ...layout,
41
+ PivotResultColumns: checked,
42
+ });
43
+ } }, "Persist Order of Pivot Result Columns")),
36
44
  React.createElement(ValueSelector_1.ValueSelector, { showFilterInput: true, filter: Utilities_1.columnFilter, toIdentifier: (option) => `${option.columnId}`, toLabel: (option) => option.friendlyName ?? option.columnId, options: sortedPivotColumns, value: layout.PivotColumns ?? [], allowReorder: true, onChange: handleColumnsChange }))));
37
45
  };
38
46
  exports.PivotColumnsSection = PivotColumnsSection;
@@ -4,7 +4,6 @@ exports.PlusMinusSettingsWizardSection = exports.isSettingsValid = exports.PlusM
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
7
- const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
8
7
  const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
9
8
  const Tabs_1 = require("../../../components/Tabs");
10
9
  const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
@@ -16,13 +15,27 @@ const Flex_1 = require("../../../components/Flex");
16
15
  const PlusMinusSettingsSummary = (props) => {
17
16
  const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
18
17
  return (React.createElement(React.Fragment, null,
18
+ React.createElement(OnePageAdaptableWizard_2.SummaryText, null,
19
+ "Name ",
20
+ React.createElement(Tag_1.Tag, null, data.Name || 'Not specified')),
19
21
  React.createElement(OnePageAdaptableWizard_2.SummaryText, null,
20
22
  "Nudge Value ",
21
23
  React.createElement(Tag_1.Tag, null, data.NudgeValue ?? 'Not selected')),
24
+ React.createElement(OnePageAdaptableWizard_2.SummaryText, null,
25
+ "Nudge Type ",
26
+ React.createElement(Tag_1.Tag, null, props.hasCondition ? 'Conditional' : 'Always Apply')),
22
27
  props.hasCondition && React.createElement(PlusMinusRuleWizardSection_1.PlusMinusRuleSummary, null)));
23
28
  };
24
29
  exports.PlusMinusSettingsSummary = PlusMinusSettingsSummary;
25
30
  const isSettingsValid = (hasCondition) => (data, api, context) => {
31
+ if (!data.Name?.trim()) {
32
+ return 'Name is required';
33
+ }
34
+ const allPlusMinusNudges = api.plusMinusApi.getAllPlusMinus();
35
+ const isDuplicateName = allPlusMinusNudges.some((nudge) => nudge.Name === data.Name && nudge.Uuid !== data.Uuid);
36
+ if (isDuplicateName) {
37
+ return 'A Plus Minus Nudge already exists with that name';
38
+ }
26
39
  if (hasCondition) {
27
40
  if (!data?.Rule?.BooleanExpression) {
28
41
  return 'No valid Rule is specified';
@@ -43,6 +56,12 @@ const isSettingsValid = (hasCondition) => (data, api, context) => {
43
56
  exports.isSettingsValid = isSettingsValid;
44
57
  const PlusMinusSettingsWizardSection = (props) => {
45
58
  const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
59
+ const handleNameChange = (event) => {
60
+ props.onChange({
61
+ ...data,
62
+ Name: event.target.value,
63
+ });
64
+ };
46
65
  const handleNudgeValueChange = (event) => {
47
66
  const newValue = parseFloat(event.target.value);
48
67
  props.onChange({
@@ -51,16 +70,20 @@ const PlusMinusSettingsWizardSection = (props) => {
51
70
  });
52
71
  };
53
72
  return (React.createElement(Flex_1.Flex, { flexDirection: "column", "data-name": "plus-minus-column-settings", className: "twa:h-full" },
54
- React.createElement(Tabs_1.Tabs, { autoFocus: false, className: "twa:p-2" },
55
- React.createElement(Tabs_1.Tabs.Tab, null, "Plus Minus Settings"),
73
+ React.createElement(Tabs_1.Tabs, { className: "twa:p-2" },
74
+ React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
56
75
  React.createElement(Tabs_1.Tabs.Content, null,
57
76
  React.createElement(FormLayout_1.default, null,
77
+ React.createElement(FormLayout_1.FormRow, { label: "Name" },
78
+ React.createElement(Input_1.default, { "data-name": "plus-minus-name", className: "twa:flex-1 twa:mr-3", onChange: handleNameChange, placeholder: "Enter Name", value: data.Name ?? '' })),
58
79
  React.createElement(FormLayout_1.FormRow, { label: "Nudge Value" },
59
- React.createElement(Input_1.default, { "data-name": "nudge-value", className: "twa:flex-1 twa:mr-3", onChange: handleNudgeValueChange, placeholder: "Enter Number", type: "number", value: data.NudgeValue ?? '' })),
60
- React.createElement(FormLayout_1.FormRow, { label: "Nudge Type" },
61
- React.createElement(Flex_1.Flex, null,
62
- React.createElement(Radio_1.default, { "data-name": "nudge-type-always", value: "Always", checked: !props.hasCondition, onChange: () => props.onConditionChange(false) }, "Always Apply Nudge"),
63
- React.createElement(Radio_1.default, { "data-name": "nudge-type-condition", className: "twa:ml-3", value: "Expression", checked: props.hasCondition, onChange: () => props.onConditionChange(true) }, "Create a Rule")))))),
64
- props.hasCondition && (React.createElement(PlusMinusRuleWizardSection_1.PlusMinusRuleWizardSection, { defaultPredicateId: "NonBlanks", onChange: props.onChange }))));
80
+ React.createElement(Input_1.default, { "data-name": "nudge-value", className: "twa:flex-1 twa:mr-3", onChange: handleNudgeValueChange, placeholder: "Enter Number", type: "number", value: data.NudgeValue ?? '' }))))),
81
+ React.createElement(Tabs_1.Tabs, { className: "twa:p-2", selectedIndex: props.hasCondition ? 1 : 0, onSelectedIndexChange: (index) => props.onConditionChange(index === 1) },
82
+ React.createElement(Tabs_1.Tabs.Tab, { "data-name": "nudge-type-always" }, "Always Apply"),
83
+ React.createElement(Tabs_1.Tabs.Tab, { "data-name": "nudge-type-condition" }, "Conditional"),
84
+ React.createElement(Tabs_1.Tabs.Content, null,
85
+ React.createElement(Flex_1.Flex, { className: "twa:text-2 twa:py-2" }, "The nudge value is always applied when using Plus/Minus")),
86
+ React.createElement(Tabs_1.Tabs.Content, { className: "twa:p-0" },
87
+ React.createElement(PlusMinusRuleWizardSection_1.PlusMinusRuleWizardSection, { defaultPredicateId: "NonBlanks", onChange: props.onChange })))));
65
88
  };
66
89
  exports.PlusMinusSettingsWizardSection = PlusMinusSettingsWizardSection;
@@ -13,7 +13,7 @@ const PlusMinusRedux = tslib_1.__importStar(require("../../../Redux/ActionsReduc
13
13
  const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection");
14
14
  const Flex_1 = require("../../../components/Flex");
15
15
  const PlusMinusWizard = (props) => {
16
- const [plusMinus, setPlusMinus] = React.useState(() => {
16
+ const [plusMinus, doSetPlusMinus] = React.useState(() => {
17
17
  const newPlusMinus = {
18
18
  ...(props.data ? props.data : ObjectFactory_1.default.CreateEmptyPlusMinusNudge()),
19
19
  Scope: props?.data?.Scope ?? { All: true },
@@ -26,19 +26,24 @@ const PlusMinusWizard = (props) => {
26
26
  }
27
27
  return newPlusMinus;
28
28
  });
29
+ const setPlusMinus = React.useCallback((data) => {
30
+ doSetPlusMinus(data);
31
+ }, []);
29
32
  const [hasCondition, setHasCondition] = React.useState(() => {
30
33
  // true if on edit and it has a condition
31
34
  return Boolean(props?.data?.Rule);
32
35
  });
33
36
  React.useEffect(() => {
34
- const preparedData = { ...plusMinus };
35
- if (hasCondition) {
36
- preparedData.Rule = preparedData.Rule ?? { BooleanExpression: '' };
37
- }
38
- else {
39
- delete preparedData.Rule;
40
- }
41
- setPlusMinus(preparedData);
37
+ doSetPlusMinus((prev) => {
38
+ const preparedData = { ...prev };
39
+ if (hasCondition) {
40
+ preparedData.Rule = preparedData.Rule ?? { BooleanExpression: '' };
41
+ }
42
+ else {
43
+ delete preparedData.Rule;
44
+ }
45
+ return preparedData;
46
+ });
42
47
  }, [hasCondition]);
43
48
  const dispatch = (0, react_redux_1.useDispatch)();
44
49
  const handleFinish = () => {
@@ -51,6 +56,12 @@ const PlusMinusWizard = (props) => {
51
56
  props.onFinishWizard(plusMinus);
52
57
  };
53
58
  return (React.createElement(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: plusMinus, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
59
+ {
60
+ title: 'Settings',
61
+ isValid: (0, PlusMinusSettingsWizardSection_1.isSettingsValid)(hasCondition),
62
+ renderSummary: () => React.createElement(PlusMinusSettingsWizardSection_1.PlusMinusSettingsSummary, { hasCondition: hasCondition }),
63
+ render: () => (React.createElement(PlusMinusSettingsWizardSection_1.PlusMinusSettingsWizardSection, { hasCondition: hasCondition, onConditionChange: setHasCondition, onChange: setPlusMinus })),
64
+ },
54
65
  {
55
66
  title: 'Target',
56
67
  isValid: NewScopeComponent_1.isScopeValid,
@@ -63,12 +74,6 @@ const PlusMinusWizard = (props) => {
63
74
  render: () => (React.createElement(Flex_1.Box, { className: "twa:p-2" },
64
75
  React.createElement(PlusMinusScopeWizardSection_1.PlusMinusScopeWizardSection, { onChange: setPlusMinus }))),
65
76
  },
66
- {
67
- title: 'Settings',
68
- isValid: (0, PlusMinusSettingsWizardSection_1.isSettingsValid)(hasCondition),
69
- renderSummary: () => React.createElement(PlusMinusSettingsWizardSection_1.PlusMinusSettingsSummary, { hasCondition: hasCondition }),
70
- render: () => (React.createElement(PlusMinusSettingsWizardSection_1.PlusMinusSettingsWizardSection, { hasCondition: hasCondition, onConditionChange: setHasCondition, onChange: setPlusMinus })),
71
- },
72
77
  {
73
78
  details: 'Select Plus/Minus Tags',
74
79
  title: 'Tags',
@@ -5,11 +5,18 @@ const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const Tabs_1 = require("../../../../components/Tabs");
7
7
  const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
8
+ const Input_1 = tslib_1.__importDefault(require("../../../../components/Input"));
8
9
  const Radio_1 = tslib_1.__importDefault(require("../../../../components/Radio"));
9
10
  const DropdownButton_1 = tslib_1.__importDefault(require("../../../../components/DropdownButton"));
10
11
  const OnePageAdaptableWizard_1 = require("../../../Wizard/OnePageAdaptableWizard");
11
12
  const Flex_1 = require("../../../../components/Flex");
12
13
  const ScheduleSettingsIPushPull = (props) => {
14
+ const handleNameChange = (event) => {
15
+ props.onChange({
16
+ ...props.iPushPull,
17
+ Name: event.target.value,
18
+ });
19
+ };
13
20
  const reportOptions = props.allReports.map((report) => ({
14
21
  label: report.Name,
15
22
  value: report.Name,
@@ -49,9 +56,13 @@ const ScheduleSettingsIPushPull = (props) => {
49
56
  });
50
57
  return (React.createElement(Flex_1.Box, { "data-name": "schedule-settings-ipushpull" },
51
58
  React.createElement(Tabs_1.Tabs, { autoFocus: false },
52
- React.createElement(Tabs_1.Tabs.Tab, null, "Ipushpull Schedule Settings"),
59
+ React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
53
60
  React.createElement(Tabs_1.Tabs.Content, null,
54
61
  React.createElement(FormLayout_1.default, null,
62
+ React.createElement(FormLayout_1.FormRow, { label: "Name" },
63
+ React.createElement(Input_1.default, { "data-name": "schedule-name", className: "twa:w-[300px]", onChange: handleNameChange, placeholder: "Enter Schedule Name", type: "string", value: props.iPushPull?.Name ?? '' })),
64
+ React.createElement(FormLayout_1.FormRow, { label: "" },
65
+ React.createElement(Flex_1.Box, { className: "twa:h-2" })),
55
66
  React.createElement(FormLayout_1.FormRow, { label: "Select Report" },
56
67
  React.createElement(DropdownButton_1.default, { "data-name": "report-name", disabled: props.allReports.length == 0, items: reportOptions, className: "twa:w-[300px]" }, props?.iPushPull?.IPushPullReport?.ReportName || 'Select Report')),
57
68
  React.createElement(FormLayout_1.FormRow, { label: "Select Folder" },
@@ -5,9 +5,16 @@ const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const Tabs_1 = require("../../../../components/Tabs");
7
7
  const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
8
+ const Input_1 = tslib_1.__importDefault(require("../../../../components/Input"));
8
9
  const DropdownButton_1 = tslib_1.__importDefault(require("../../../../components/DropdownButton"));
9
10
  const Flex_1 = require("../../../../components/Flex");
10
11
  const ScheduleSettingsOpenFin = (props) => {
12
+ const handleNameChange = (event) => {
13
+ props.onChange({
14
+ ...props.openFin,
15
+ Name: event.target.value,
16
+ });
17
+ };
11
18
  const reportOptions = props.allReports.map((report) => ({
12
19
  label: report.Name,
13
20
  value: report.Name,
@@ -21,9 +28,13 @@ const ScheduleSettingsOpenFin = (props) => {
21
28
  }));
22
29
  return (React.createElement(Flex_1.Box, { "data-name": "schedule-settings-openfin" },
23
30
  React.createElement(Tabs_1.Tabs, { autoFocus: false },
24
- React.createElement(Tabs_1.Tabs.Tab, null, "OpenFin Schedule Settings"),
31
+ React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
25
32
  React.createElement(Tabs_1.Tabs.Content, null,
26
33
  React.createElement(FormLayout_1.default, null,
34
+ React.createElement(FormLayout_1.FormRow, { label: "Name" },
35
+ React.createElement(Input_1.default, { "data-name": "schedule-name", className: "twa:w-[300px]", onChange: handleNameChange, placeholder: "Enter Schedule Name", type: "string", value: props.openFin?.Name ?? '' })),
36
+ React.createElement(FormLayout_1.FormRow, { label: "" },
37
+ React.createElement(Flex_1.Box, { className: "twa:h-2" })),
27
38
  React.createElement(FormLayout_1.FormRow, { label: "Select Report" },
28
39
  React.createElement(DropdownButton_1.default, { "data-name": "select-report", columns: ['label'], className: "twa:w-[300px]", disabled: props.allReports.length == 0, items: reportOptions }, props?.openFin?.OpenFinReport?.ReportName || 'Select Report')))))));
29
40
  };
@@ -21,6 +21,12 @@ const ScheduleSettingsReminder = (props) => {
21
21
  });
22
22
  },
23
23
  }));
24
+ const handleNameChange = (event) => {
25
+ props.onChange({
26
+ ...props.reminderSchedule,
27
+ Name: event.target.value,
28
+ });
29
+ };
24
30
  const handleHeaderChange = (event) => {
25
31
  props.onChange({
26
32
  ...props.reminderSchedule,
@@ -45,11 +51,15 @@ const ScheduleSettingsReminder = (props) => {
45
51
  DisplaySystemStatusMessage: checked,
46
52
  });
47
53
  };
48
- return (React.createElement(Flex_1.Box, { "data-name": "schedule-settings-remainder" },
54
+ return (React.createElement(Flex_1.Box, { "data-name": "schedule-settings-reminder" },
49
55
  React.createElement(Tabs_1.Tabs, { autoFocus: false },
50
- React.createElement(Tabs_1.Tabs.Tab, null, "Reminder Schedule Settings"),
56
+ React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
51
57
  React.createElement(Tabs_1.Tabs.Content, null,
52
58
  React.createElement(FormLayout_1.default, null,
59
+ React.createElement(FormLayout_1.FormRow, { label: "Name" },
60
+ React.createElement(Input_1.default, { "data-name": "schedule-name", className: "twa:w-[300px]", onChange: handleNameChange, placeholder: "Enter Schedule Name", type: "string", value: props.reminderSchedule?.Name ?? '' })),
61
+ React.createElement(FormLayout_1.FormRow, { label: "" },
62
+ React.createElement(Flex_1.Box, { className: "twa:h-2" })),
53
63
  React.createElement(FormLayout_1.FormRow, { label: "Header" },
54
64
  React.createElement(Input_1.default, { "data-name": "header", className: "twa:w-[300px]", onChange: handleHeaderChange, placeholder: "Enter Reminder Header", type: "string", value: props.reminderSchedule?.Header })),
55
65
  React.createElement(FormLayout_1.FormRow, { label: "Message" },
@@ -4,10 +4,17 @@ exports.ScheduleSettingsReport = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const React = tslib_1.__importStar(require("react"));
6
6
  const FormLayout_1 = tslib_1.__importStar(require("../../../../components/FormLayout"));
7
+ const Input_1 = tslib_1.__importDefault(require("../../../../components/Input"));
7
8
  const Select_1 = require("../../../../components/Select");
8
9
  const Tabs_1 = require("../../../../components/Tabs");
9
10
  const Flex_1 = require("../../../../components/Flex");
10
11
  const ScheduleSettingsReport = (props) => {
12
+ const handleNameChange = (event) => {
13
+ props.onChange({
14
+ ...props.report,
15
+ Name: event.target.value,
16
+ });
17
+ };
11
18
  const reportOptions = props.allReports.map((report) => ({
12
19
  label: report.Name,
13
20
  value: report.Name,
@@ -34,9 +41,13 @@ const ScheduleSettingsReport = (props) => {
34
41
  }));
35
42
  return (React.createElement(Flex_1.Box, { "data-name": "schedule-settings-report" },
36
43
  React.createElement(Tabs_1.Tabs, { autoFocus: false, className: "twa:mb-3" },
37
- React.createElement(Tabs_1.Tabs.Tab, null, "Report Settings"),
44
+ React.createElement(Tabs_1.Tabs.Tab, null, "Settings"),
38
45
  React.createElement(Tabs_1.Tabs.Content, null,
39
46
  React.createElement(FormLayout_1.default, null,
47
+ React.createElement(FormLayout_1.FormRow, { label: "Name" },
48
+ React.createElement(Input_1.default, { "data-name": "schedule-name", className: "twa:w-[300px]", onChange: handleNameChange, placeholder: "Enter Schedule Name", type: "string", value: props.report?.Name ?? '' })),
49
+ React.createElement(FormLayout_1.FormRow, { label: "" },
50
+ React.createElement(Flex_1.Box, { className: "twa:h-2" })),
40
51
  React.createElement(FormLayout_1.FormRow, { label: "Export" },
41
52
  React.createElement(Flex_1.Box, { className: "twa:max-w-[300px]" },
42
53
  React.createElement(Select_1.Select, { "data-name": "select-report", options: reportOptions, value: props?.report?.ReportName, placeholder: "Select Export", onChange: (value) => props.onChange({
@@ -1,2 +1,3 @@
1
+ import { AdaptableApi } from '../../../../Api/AdaptableApi';
1
2
  import { BaseSchedule } from '../../../../AdaptableState/Common/Schedule';
2
- export declare const isSettingsValid: (schedule: BaseSchedule) => true | "Message type not selected" | "Reminder header not specified" | "Reminder message not specified" | "Report source not specified" | "Report format not selected" | "Report not selected" | "Report folder not selected" | "Report page not selected";
3
+ export declare const isSettingsValid: (schedule: BaseSchedule, api: AdaptableApi) => true | "Name is required" | "A Schedule with this name already exists" | "Message type not selected" | "Reminder header not specified" | "Reminder message not specified" | "Report source not specified" | "Report format not selected" | "Report not selected" | "Report folder not selected" | "Report page not selected";
@@ -4,7 +4,16 @@ exports.isSettingsValid = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const Enums_1 = require("../../../../AdaptableState/Common/Enums");
6
6
  const StringExtensions_1 = tslib_1.__importDefault(require("../../../../Utilities/Extensions/StringExtensions"));
7
- const isSettingsValid = (schedule) => {
7
+ const isSettingsValid = (schedule, api) => {
8
+ // Validate Name - mandatory and unique
9
+ if (!schedule.Name?.trim()) {
10
+ return 'Name is required';
11
+ }
12
+ const allSchedules = api.scheduleApi.getSchedules();
13
+ const isDuplicateName = allSchedules.some((s) => s.Name === schedule.Name && s.Uuid !== schedule.Uuid);
14
+ if (isDuplicateName) {
15
+ return 'A Schedule with this name already exists';
16
+ }
8
17
  if (schedule.ScheduleType === Enums_1.ScheduleType.Reminder) {
9
18
  const reminder = schedule;
10
19
  if (!reminder.MessageType) {
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import { Shortcut } from '../../../AdaptableState/ShortcutState';
3
- export declare const isSettingsValid: (data: Shortcut) => string | true;
3
+ import { AdaptableApi } from '../../../types';
4
+ export declare const isSettingsValid: (data: Shortcut, api: AdaptableApi) => string | true;
4
5
  export declare const ShortcutSettingsSummary: React.FunctionComponent;
5
6
  interface ShortcutSettingsWizardProps {
6
7
  availableKeys: Array<string>;
@@ -13,7 +13,15 @@ const Tag_1 = require("../../../components/Tag");
13
13
  const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlock"));
14
14
  const Select_1 = require("../../../components/Select");
15
15
  const Flex_1 = require("../../../components/Flex");
16
- const isSettingsValid = (data) => {
16
+ const isSettingsValid = (data, api) => {
17
+ if (!data.Name?.trim()) {
18
+ return 'Name is required';
19
+ }
20
+ const allShortcuts = api.shortcutApi.getShortcuts();
21
+ const isDuplicateName = allShortcuts.some((s) => s.Name === data.Name && s.Uuid !== data.Uuid);
22
+ if (isDuplicateName) {
23
+ return 'A Shortcut already exists with that name';
24
+ }
17
25
  const shortcutKey = data.ShortcutKey && typeof data.ShortcutKey === 'string' ? '' : 'Shortcut key is not selected';
18
26
  const shortcutValue = typeof data.ShortcutValue === 'number' ? '' : 'Shortcut value is not specified';
19
27
  const shortcutOperation = data.ShortcutOperation && typeof data.ShortcutOperation === 'string'
@@ -26,6 +34,9 @@ exports.isSettingsValid = isSettingsValid;
26
34
  const ShortcutSettingsSummary = () => {
27
35
  const { data: shortcut } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
28
36
  return (React.createElement(React.Fragment, null,
37
+ React.createElement(OnePageAdaptableWizard_2.SummaryText, null,
38
+ "Name ",
39
+ React.createElement(Tag_1.Tag, null, shortcut.Name || 'Not specified')),
29
40
  React.createElement(OnePageAdaptableWizard_2.SummaryText, null,
30
41
  "Shortcut Key ",
31
42
  React.createElement(Tag_1.Tag, null, shortcut.ShortcutKey || 'Not selected')),
@@ -39,6 +50,12 @@ const ShortcutSettingsSummary = () => {
39
50
  exports.ShortcutSettingsSummary = ShortcutSettingsSummary;
40
51
  const ShortcutSettingsWizard = (props) => {
41
52
  const { data: shortcut } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
53
+ const handleNameChange = (event) => {
54
+ props.onChange({
55
+ ...shortcut,
56
+ Name: event.target.value,
57
+ });
58
+ };
42
59
  const handleKeyChange = React.useCallback((ShortcutKey) => {
43
60
  props.onChange({
44
61
  ...shortcut,
@@ -69,17 +86,21 @@ const ShortcutSettingsWizard = (props) => {
69
86
  React.createElement(Tabs_1.Tabs.Tab, null, "Shortcut Settings"),
70
87
  React.createElement(Tabs_1.Tabs.Content, null,
71
88
  React.createElement(FormLayout_1.default, null,
72
- React.createElement(FormLayout_1.FormRow, null,
89
+ React.createElement(FormLayout_1.FormRow, { label: "Name" },
90
+ React.createElement(Input_1.default, { "data-name": "shortcut-name", className: "twa:flex-1 twa:max-w-[200px] twa:mr-3", onChange: handleNameChange, placeholder: "Enter Name", value: shortcut.Name ?? '' })),
91
+ React.createElement(FormLayout_1.FormRow, { label: "" },
92
+ React.createElement(Flex_1.Box, { className: "twa:h-2" })),
93
+ React.createElement(FormLayout_1.FormRow, { label: "" },
73
94
  React.createElement(HelpBlock_1.default, { className: "twa:text-2 twa:mb-0" }, "Keyboard key that, when pressed, triggers the Shortcut")),
74
95
  React.createElement(FormLayout_1.FormRow, { label: "Key" },
75
96
  React.createElement(Flex_1.Flex, { flexDirection: "row" },
76
97
  React.createElement(Select_1.Select, { "data-name": "shortcut-key", placeholder: "Select Key", options: optionKeys, onChange: (key) => handleKeyChange(key), value: shortcut.ShortcutKey || 'Select Key' }))),
77
- React.createElement(FormLayout_1.FormRow, null,
98
+ React.createElement(FormLayout_1.FormRow, { label: "" },
78
99
  React.createElement(HelpBlock_1.default, { className: "twa:text-2 twa:mb-0" }, "Mathematical operation performed on Cell's current value (using the Shortcut's 'value') - used to calculate the Cell's new total")),
79
100
  React.createElement(FormLayout_1.FormRow, { label: "Operation" },
80
101
  React.createElement(Flex_1.Flex, { flexDirection: "row" },
81
102
  React.createElement(Select_1.Select, { "data-name": "shortcut-operation", placeholder: "Select Operation", options: optionActions, onChange: (operation) => handleOperationChange(operation), value: shortcut.ShortcutOperation }))),
82
- React.createElement(FormLayout_1.FormRow, null,
103
+ React.createElement(FormLayout_1.FormRow, { label: "" },
83
104
  React.createElement(HelpBlock_1.default, { className: "twa:text-2 twa:mb-0" }, "Number that is used - together with the 'Operation' and the current cell value - to calculate the new total for the cell")),
84
105
  React.createElement(FormLayout_1.FormRow, { label: "Value" },
85
106
  React.createElement(Flex_1.Flex, { flexDirection: "row" },
@@ -15,8 +15,9 @@ const shortcutKeys_1 = require("../shortcutKeys");
15
15
  const AdaptableContext_1 = require("../../AdaptableContext");
16
16
  const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection");
17
17
  const Flex_1 = require("../../../components/Flex");
18
+ const StringExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Extensions/StringExtensions"));
18
19
  const ShortcutWizard = (props) => {
19
- const [shortcut, setShortcut] = React.useState(() => {
20
+ const [shortcut, doSetShortcut] = React.useState(() => {
20
21
  const shortcut = props.data ? (0, Helper_1.cloneObject)(props.data) : ObjectFactory_1.default.CreateEmptyShortcut();
21
22
  shortcut.Scope = shortcut.Scope ?? { All: true };
22
23
  if (props.popupParams?.column && props.popupParams?.action === 'New') {
@@ -26,10 +27,13 @@ const ShortcutWizard = (props) => {
26
27
  }
27
28
  return shortcut;
28
29
  });
30
+ const setShortcut = React.useCallback((data) => {
31
+ doSetShortcut(data);
32
+ }, []);
29
33
  const adaptable = (0, AdaptableContext_1.useAdaptable)();
30
34
  const availableKeys = React.useMemo(() => {
31
35
  const availableKeys = shortcutKeys_1.shortcutKeys.filter((key) => adaptable.api.shortcutApi.getShortcuts().every((shortcut) => shortcut.ShortcutKey !== key));
32
- if (shortcut) {
36
+ if (shortcut && StringExtensions_1.default.IsNotNullOrEmptyOrWhiteSpace(shortcut.ShortcutKey)) {
33
37
  availableKeys.push(shortcut.ShortcutKey);
34
38
  }
35
39
  availableKeys.sort();
@@ -46,18 +50,6 @@ const ShortcutWizard = (props) => {
46
50
  props.onFinishWizard(shortcut);
47
51
  };
48
52
  return (React.createElement(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: shortcut, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
49
- {
50
- title: 'Target',
51
- isValid: NewScopeComponent_1.isScopeValid,
52
- details: 'Specify where Shortcut should be applied',
53
- renderSummary: () => (0, NewScopeComponent_1.renderScopeSummary)(shortcut.Scope, {
54
- scopeWholeRow: 'Shortcut is triggered for all numeric cells',
55
- scopeColumns: 'Shortcut is triggered for cells in selected columns',
56
- scopeDataTypes: 'Shortcut is triggered for all numeric cells',
57
- }),
58
- render: () => (React.createElement(Flex_1.Box, { className: "twa:p-2" },
59
- React.createElement(ShortcutScopeWizardSection_1.ShortcutScopeWizardSection, { onChange: setShortcut }))),
60
- },
61
53
  {
62
54
  title: 'Settings',
63
55
  isValid: ShortcutSettingsWizard_1.isSettingsValid,
@@ -73,6 +65,18 @@ const ShortcutWizard = (props) => {
73
65
  render: () => (React.createElement(Flex_1.Box, { className: "twa:p-2" },
74
66
  React.createElement(ShortcutSettingsWizard_1.ShortcutSettingsWizard, { availableKeys: props.availableKeys ?? availableKeys, onChange: setShortcut }))),
75
67
  },
68
+ {
69
+ title: 'Target',
70
+ isValid: NewScopeComponent_1.isScopeValid,
71
+ details: 'Specify where Shortcut should be applied',
72
+ renderSummary: () => (0, NewScopeComponent_1.renderScopeSummary)(shortcut.Scope, {
73
+ scopeWholeRow: 'Shortcut is triggered for all numeric cells',
74
+ scopeColumns: 'Shortcut is triggered for cells in selected columns',
75
+ scopeDataTypes: 'Shortcut is triggered for all numeric cells',
76
+ }),
77
+ render: () => (React.createElement(Flex_1.Box, { className: "twa:p-2" },
78
+ React.createElement(ShortcutScopeWizardSection_1.ShortcutScopeWizardSection, { onChange: setShortcut }))),
79
+ },
76
80
  {
77
81
  details: 'Select Shortcut Tags',
78
82
  title: 'Tags',
package/src/env.js CHANGED
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = {
4
4
  NEXT_PUBLIC_INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
5
- PUBLISH_TIMESTAMP: 1770107080647 || Date.now(),
6
- VERSION: "22.0.0-canary.3" || '--current-version--',
5
+ PUBLISH_TIMESTAMP: 1770224017085 || Date.now(),
6
+ VERSION: "22.0.0-canary.4" || '--current-version--',
7
7
  };
@@ -172,5 +172,6 @@ export interface PivotLayoutModel extends BaseLayoutModel {
172
172
  * Display automatically calculated Totals within EACH Pivot Column Group, in the position specified
173
173
  */
174
174
  PivotColumnTotal?: 'before' | 'after' | boolean;
175
+ PivotResultColumns?: string[] | boolean;
175
176
  }
176
177
  export type LayoutModel = TableLayoutModel | PivotLayoutModel;