@adaptabletools/adaptable 14.0.2 → 14.0.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.
- package/base.css +7 -1
- package/base.css.map +1 -1
- package/bundle.cjs.js +170 -169
- package/index.css +76 -62
- package/index.css.map +1 -1
- package/package.json +2 -2
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableOptions/ActionOptions.d.ts +3 -0
- package/src/AdaptableOptions/AdaptablePlugin.d.ts +3 -0
- package/src/AdaptableOptions/AdaptablePlugin.js +3 -0
- package/src/AdaptableOptions/AdaptableQLOptions.d.ts +6 -5
- package/src/AdaptableOptions/ChartingOptions.d.ts +1 -1
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +26 -26
- package/src/AdaptableOptions/ExportOptions.d.ts +17 -3
- package/src/AdaptableOptions/ExpressionOptions.d.ts +18 -18
- package/src/AdaptableOptions/PredicateOptions.d.ts +4 -4
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +5 -3
- package/src/Api/ActionApi.d.ts +2 -2
- package/src/Api/CalculatedColumnApi.d.ts +9 -0
- package/src/Api/ChartingApi.d.ts +41 -14
- package/src/Api/ColumnApi.d.ts +4 -0
- package/src/Api/DataSetApi.d.ts +2 -2
- package/src/Api/EventApi.d.ts +15 -1
- package/src/Api/Events/ChartStateChangeInfo.d.ts +5 -0
- package/src/Api/Events/ChartStateChangeInfo.js +2 -0
- package/src/Api/ExportApi.d.ts +5 -0
- package/src/Api/FilterApi.d.ts +10 -8
- package/src/Api/Implementation/ActionApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ActionApiImpl.js +3 -3
- package/src/Api/Implementation/CalculatedColumnApiImpl.d.ts +2 -0
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +24 -0
- package/src/Api/Implementation/ChartingApiImpl.d.ts +16 -2
- package/src/Api/Implementation/ChartingApiImpl.js +54 -2
- package/src/Api/Implementation/ColumnApiImpl.d.ts +1 -0
- package/src/Api/Implementation/ColumnApiImpl.js +3 -0
- package/src/Api/Implementation/ExportApiImpl.d.ts +2 -0
- package/src/Api/Implementation/ExportApiImpl.js +10 -0
- package/src/Api/Implementation/FilterApiImpl.js +0 -2
- package/src/Api/Implementation/PredicateApiImpl.d.ts +6 -4
- package/src/Api/Implementation/PredicateApiImpl.js +20 -1
- package/src/Api/Implementation/QueryApiImpl.js +8 -2
- package/src/Api/Internal/AdaptableInternalApi.d.ts +7 -1
- package/src/Api/Internal/AdaptableInternalApi.js +2 -1
- package/src/Api/Internal/AlertInternalApi.js +1 -1
- package/src/Api/Internal/CalculatedColumnInternalApi.d.ts +2 -0
- package/src/Api/Internal/CalculatedColumnInternalApi.js +9 -0
- package/src/Api/Internal/ChartingInternalApi.d.ts +6 -0
- package/src/Api/Internal/ChartingInternalApi.js +24 -0
- package/src/Api/Internal/FormatColumnInternalApi.d.ts +5 -0
- package/src/Api/Internal/FormatColumnInternalApi.js +25 -1
- package/src/Api/PredicateApi.d.ts +17 -1
- package/src/PredefinedConfig/AlertState.d.ts +5 -2
- package/src/PredefinedConfig/Common/AdaptableAlert.d.ts +6 -0
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +15 -11
- package/src/PredefinedConfig/Common/AdaptableForm.d.ts +6 -0
- package/src/PredefinedConfig/Common/AdaptableIcon.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptablePredicate.d.ts +6 -0
- package/src/PredefinedConfig/Common/AdaptableQuery.d.ts +15 -0
- package/src/PredefinedConfig/Common/Enums.d.ts +2 -1
- package/src/PredefinedConfig/Common/Enums.js +1 -0
- package/src/PredefinedConfig/Common/FDC3Context.d.ts +3 -0
- package/src/PredefinedConfig/Common/Types.d.ts +21 -6
- package/src/PredefinedConfig/Common/Types.js +1 -3
- package/src/PredefinedConfig/ExportState.d.ts +2 -2
- package/src/PredefinedConfig/FlashingCellState.d.ts +2 -2
- package/src/PredefinedConfig/FormatColumnState.d.ts +3 -2
- package/src/PredefinedConfig/FreeTextColumnState.d.ts +1 -1
- package/src/PredefinedConfig/PredefinedConfig.d.ts +4 -4
- package/src/PredefinedConfig/StyledColumnState.d.ts +1 -1
- package/src/PredefinedConfig/ThemeState.d.ts +0 -4
- package/src/Redux/ActionsReducers/PopupRedux.d.ts +2 -0
- package/src/Redux/ActionsReducers/PopupRedux.js +2 -0
- package/src/Redux/ActionsReducers/StatusBarRedux.d.ts +2 -2
- package/src/Redux/ActionsReducers/StatusBarRedux.js +4 -4
- package/src/Redux/Store/AdaptableStore.js +1 -11
- package/src/Strategy/AlertModule.js +7 -3
- package/src/Strategy/ChartingModule.js +5 -3
- package/src/Strategy/ExportModule.d.ts +1 -0
- package/src/Strategy/ExportModule.js +43 -0
- package/src/Strategy/FlashingCellModule.js +1 -1
- package/src/Strategy/FormatColumnModule.js +7 -2
- package/src/Strategy/Interface/IModule.d.ts +1 -1
- package/src/Strategy/LayoutModule.js +8 -1
- package/src/Strategy/StyledColumnModule.js +5 -0
- package/src/Strategy/ThemeModule.js +8 -2
- package/src/Strategy/Utilities/Alert/getAlertPreviewViewItems.js +2 -2
- package/src/Strategy/Utilities/Alert/getAlertTypeViewItems.d.ts +5 -0
- package/src/Strategy/Utilities/Alert/getAlertTypeViewItems.js +13 -0
- package/src/Strategy/Utilities/getObjectTagsViewItems.js +3 -3
- package/src/Utilities/Constants/ModuleConstants.d.ts +0 -3
- package/src/Utilities/Constants/ModuleConstants.js +2 -5
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +2 -1
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/aggregatedBooleanExpressionFunctions.js +3 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.d.ts +1 -1
- package/src/Utilities/ExpressionFunctions/aggregatedScalarExpressionFunctions.js +64 -3
- package/src/Utilities/Interface/MessagePopups.d.ts +1 -0
- package/src/Utilities/Services/AggregatedScalarLiveValue.js +13 -0
- package/src/Utilities/Services/ChartingService.d.ts +8 -0
- package/src/Utilities/Services/ChartingService.js +15 -0
- package/src/Utilities/Services/ReportService.js +1 -1
- package/src/View/AdaptableViewFactory.js +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +5 -4
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UIOptionsActionColumnsForm.js +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/UIOptions/UiOptionsForm.js +6 -5
- package/src/View/Alert/Utilities/getAlertType.d.ts +15 -0
- package/src/View/Alert/Utilities/getAlertType.js +58 -0
- package/src/View/Alert/Utilities/getAvailablePredicates.d.ts +3 -0
- package/src/View/Alert/Utilities/getAvailablePredicates.js +19 -0
- package/src/View/Alert/Utilities/getDefaultAlertDefinition.d.ts +37 -0
- package/src/View/Alert/Utilities/getDefaultAlertDefinition.js +32 -0
- package/src/View/Alert/Utilities/mapAlertDefinition.d.ts +2 -0
- package/src/View/Alert/Utilities/mapAlertDefinition.js +38 -0
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.d.ts +4 -2
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +18 -11
- package/src/View/Alert/Wizard/AlertButtonsEditor.d.ts +2 -0
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +15 -6
- package/src/View/Alert/Wizard/AlertMessageWizardSection.d.ts +10 -0
- package/src/View/Alert/Wizard/AlertMessageWizardSection.js +57 -0
- package/src/View/Alert/Wizard/{AlertDisplayWizardSection.d.ts → AlertNotificationWizardSection.d.ts} +7 -5
- package/src/View/Alert/Wizard/{AlertDisplayWizardSection.js → AlertNotificationWizardSection.js} +12 -50
- package/src/View/Alert/Wizard/AlertRulesWizardSection.d.ts +7 -4
- package/src/View/Alert/Wizard/AlertRulesWizardSection.js +66 -6
- package/src/View/Alert/Wizard/AlertScopeWizardSection.d.ts +2 -0
- package/src/View/Alert/Wizard/AlertScopeWizardSection.js +41 -2
- package/src/View/Alert/Wizard/AlertTypeWizardSection.d.ts +9 -0
- package/src/View/Alert/Wizard/AlertTypeWizardSection.js +27 -0
- package/src/View/Alert/Wizard/AlertWizard.js +53 -98
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.d.ts +1 -6
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +4 -39
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +1 -1
- package/src/View/{Components/Charting → Charting}/ChartingStatusBarPopover.d.ts +0 -0
- package/src/View/{Components/Charting → Charting}/ChartingStatusBarPopover.js +2 -2
- package/src/View/{Components/Charting → Charting}/ChartingViewPanel.d.ts +1 -1
- package/src/View/{Components/Charting → Charting}/ChartingViewPanel.js +0 -0
- package/src/View/{Components/Charting → Charting}/ChartingWizard/ChartingWizard.d.ts +2 -2
- package/src/View/{Components/Charting → Charting}/ChartingWizard/ChartingWizard.js +12 -2
- package/src/View/{Components/Charting → Charting}/ChartingWizard/PreviewChartSection.d.ts +1 -1
- package/src/View/{Components/Charting → Charting}/ChartingWizard/PreviewChartSection.js +2 -2
- package/src/View/{Components/Charting → Charting}/ChartingWizard/SettingsSection.d.ts +1 -1
- package/src/View/{Components/Charting → Charting}/ChartingWizard/SettingsSection.js +4 -4
- package/src/View/{Components/Charting → Charting}/DeleteChartButton.d.ts +1 -1
- package/src/View/{Components/Charting → Charting}/DeleteChartButton.js +3 -3
- package/src/View/{Components/Charting → Charting}/EditChartButton.d.ts +1 -1
- package/src/View/{Components/Charting → Charting}/EditChartButton.js +3 -3
- package/src/View/{Components/Charting → Charting}/ShowChartButton.d.ts +1 -1
- package/src/View/{Components/Charting → Charting}/ShowChartButton.js +5 -5
- package/src/View/{Components/Charting → Charting}/useChartState.d.ts +1 -1
- package/src/View/{Components/Charting → Charting}/useChartState.js +5 -5
- package/src/View/{Components/Charting → Charting}/useChartingElements.d.ts +1 -1
- package/src/View/{Components/Charting → Charting}/useChartingElements.js +6 -6
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicateEditor.d.ts +12 -0
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicateEditor.js +85 -0
- package/src/View/Components/EntityRulesEditor/{PredicatesEditor.d.ts → EntityRulePredicatesEditor/EntityRulePredicatesEditor.d.ts} +6 -4
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/EntityRulePredicatesEditor.js +87 -0
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/index.d.ts +1 -0
- package/src/View/Components/EntityRulesEditor/EntityRulePredicatesEditor/index.js +5 -0
- package/src/View/Components/EntityRulesEditor/Utilities.js +7 -1
- package/src/View/Components/EntityRulesEditor/index.d.ts +4 -2
- package/src/View/Components/EntityRulesEditor/index.js +27 -10
- package/src/View/Components/FilterForm/FilterForm.js +6 -7
- package/src/View/Components/FilterForm/QuickFilterForm.js +13 -9
- package/src/View/Components/NewScopeComponent.d.ts +9 -5
- package/src/View/Components/NewScopeComponent.js +19 -10
- package/src/View/Components/Popups/WindowPopups/WindowPopups.js +2 -2
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +1 -0
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +4 -1
- package/src/View/Components/PredicateEditor/PredicateEditor.js +16 -5
- package/src/View/Components/PreviewResultsPanel.js +30 -3
- package/src/View/CustomSort/Wizard/CustomSortWizard.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +3 -0
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +1 -1
- package/src/View/DataChangeHistory/DataChangeHistoryViewPanel.js +1 -1
- package/src/View/Export/ExportTablePopup.d.ts +3 -0
- package/src/View/Export/ExportTablePopup.js +59 -0
- package/src/View/Export/Wizard/NewReportWizard.js +1 -1
- package/src/View/Export/Wizard/ReportColumnsWizardSection.js +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +2 -2
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +1 -1
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +1 -1
- package/src/View/GridInfo/GridInfoPopup.js +4 -4
- package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +1 -1
- package/src/View/Query/Wizard/NamedQueryWizard.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleWizard.js +1 -1
- package/src/View/Shortcut/Wizard/ShortcutWizard.js +1 -1
- package/src/View/StatusBar/StatusBarPanel.d.ts +3 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +7 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardTypeSection.js +5 -5
- package/src/View/TeamSharing/TeamSharingApplyButton.js +1 -1
- package/src/View/Theme/ThemeStatusPanelPopover.js +10 -2
- package/src/View/Wizard/TypeRadio.d.ts +7 -0
- package/src/View/Wizard/TypeRadio.js +12 -0
- package/src/agGrid/Adaptable.d.ts +3 -1
- package/src/agGrid/Adaptable.js +28 -4
- package/src/agGrid/agGridHelper.d.ts +1 -0
- package/src/agGrid/agGridHelper.js +15 -0
- package/src/components/ExpressionEditor/EditorInputWithWhereClause.js +4 -0
- package/src/components/ExpressionEditor/editorButtonsAggregatedBoolean.js +5 -0
- package/src/components/ExpressionEditor/editorButtonsAggregatedScalar.js +5 -0
- package/src/components/icons/index.js +4 -0
- package/src/components/icons/visibility-off.d.ts +3 -0
- package/src/components/icons/visibility-off.js +7 -0
- package/src/components/icons/visibility.d.ts +3 -0
- package/src/components/icons/visibility.js +8 -0
- package/src/metamodel/adaptable.metamodel.d.ts +139 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +4 -4
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.d.ts +0 -9
- package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.js +0 -30
- package/src/View/Components/EntityRulesEditor/PredicatesEditor.js +0 -86
|
@@ -89,14 +89,21 @@ exports.renderAlertBehaviourSummary = renderAlertBehaviourSummary;
|
|
|
89
89
|
const AlertBehaviourWizardSection = (props) => {
|
|
90
90
|
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
91
91
|
const { AlertProperties = {} } = data;
|
|
92
|
-
const rowAddedAlert = api.alertApi.internalApi.isAlertDefinitionForAddedRowChangeEvent(data);
|
|
93
92
|
const rowRemovedAlert = api.alertApi.internalApi.isAlertDefinitionForRemovedRowChangeEvent(data);
|
|
94
|
-
|
|
95
|
-
const hasPreventCellEdit =
|
|
96
|
-
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
const
|
|
93
|
+
// data change only
|
|
94
|
+
const hasPreventCellEdit = props.alertType === 'DataChange';
|
|
95
|
+
// except row change
|
|
96
|
+
const hasHighlightCell = props.alertType !== 'RowChange';
|
|
97
|
+
// except row removed
|
|
98
|
+
const hasHighlightRow = !rowRemovedAlert;
|
|
99
|
+
// except row changed
|
|
100
|
+
const hasJumpToCell = props.alertType !== 'RowChange';
|
|
101
|
+
// for all
|
|
102
|
+
const showInSeparateDiv = true;
|
|
103
|
+
// for all
|
|
104
|
+
const logToConsole = true;
|
|
105
|
+
// except row removed
|
|
106
|
+
const hasJumpToRow = !rowRemovedAlert;
|
|
100
107
|
const onChange = (AlertProperties) => {
|
|
101
108
|
props.onChange(Object.assign(Object.assign({}, data), { AlertProperties: Object.assign(Object.assign({}, data.AlertProperties), AlertProperties) }));
|
|
102
109
|
};
|
|
@@ -122,14 +129,14 @@ const AlertBehaviourWizardSection = (props) => {
|
|
|
122
129
|
hasJumpToRow && (React.createElement(CheckBox_1.CheckBox, { "data-name": "jump-to-row", checked: AlertProperties.JumpToRow, onChange: (JumpToRow) => {
|
|
123
130
|
onChange({ JumpToRow });
|
|
124
131
|
} }, "Jump To Row")),
|
|
125
|
-
React.createElement(CheckBox_1.CheckBox, { "data-name": "show-in-div", checked: AlertProperties.ShowInDiv, onChange: (ShowInDiv) => {
|
|
132
|
+
showInSeparateDiv && (React.createElement(CheckBox_1.CheckBox, { "data-name": "show-in-div", checked: AlertProperties.ShowInDiv, onChange: (ShowInDiv) => {
|
|
126
133
|
onChange({ ShowInDiv });
|
|
127
134
|
} },
|
|
128
135
|
"Show in separate ",
|
|
129
136
|
React.createElement(CodeBlock_1.CodeBlock, null, `<div />`),
|
|
130
|
-
" element"),
|
|
131
|
-
React.createElement(CheckBox_1.CheckBox, { "data-name": "log-to-console", checked: AlertProperties.LogToConsole, onChange: (LogToConsole) => {
|
|
137
|
+
" element")),
|
|
138
|
+
logToConsole && (React.createElement(CheckBox_1.CheckBox, { "data-name": "log-to-console", checked: AlertProperties.LogToConsole, onChange: (LogToConsole) => {
|
|
132
139
|
onChange({ LogToConsole });
|
|
133
|
-
} }, "Log To Console"))));
|
|
140
|
+
} }, "Log To Console")))));
|
|
134
141
|
};
|
|
135
142
|
exports.AlertBehaviourWizardSection = AlertBehaviourWizardSection;
|
|
@@ -3,11 +3,13 @@ import { AlertButton } from '../../../PredefinedConfig/AlertState';
|
|
|
3
3
|
import { AdaptableAlert } from '../../../PredefinedConfig/Common/AdaptableAlert';
|
|
4
4
|
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
5
5
|
import { AlertFormContext } from '../../../types';
|
|
6
|
+
import { AlertType } from '../Utilities/getAlertType';
|
|
6
7
|
declare type AlertButtonsEditorProps = {
|
|
7
8
|
AlertButtons: AlertButton<AlertFormContext>[];
|
|
8
9
|
onChange: (buttons: AlertButton<AlertFormContext>[]) => void;
|
|
9
10
|
api: AdaptableApi;
|
|
10
11
|
adaptableAlert: AdaptableAlert;
|
|
12
|
+
alertType: AlertType;
|
|
11
13
|
};
|
|
12
14
|
export declare const AlertButtonsEditor: (props: AlertButtonsEditorProps) => JSX.Element;
|
|
13
15
|
export {};
|
|
@@ -21,11 +21,18 @@ const AlertButtonsEditor = (props) => {
|
|
|
21
21
|
const rowAddedAlert = api.alertApi.internalApi.isAlertDefinitionForAddedRowChangeEvent(alertDefinition);
|
|
22
22
|
const rowRemovedAlert = api.alertApi.internalApi.isAlertDefinitionForRemovedRowChangeEvent(alertDefinition);
|
|
23
23
|
const cellChangedAlert = !rowAddedAlert && !rowRemovedAlert;
|
|
24
|
-
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
24
|
+
// except row change
|
|
25
|
+
const hasHighlightCell = props.alertType !== 'RowChange';
|
|
26
|
+
// all, except row removed
|
|
27
|
+
const hasHighlightRow = !rowRemovedAlert;
|
|
28
|
+
// except row removed
|
|
29
|
+
const hasJumpToCell = props.alertType !== 'RowChange';
|
|
30
|
+
// all
|
|
31
|
+
const hasJumpToRow = !rowRemovedAlert;
|
|
32
|
+
// all
|
|
33
|
+
const hasSuspend = true;
|
|
34
|
+
// only data change
|
|
35
|
+
const hasUndo = props.alertType === 'DataChange';
|
|
29
36
|
const AlertButtons = (0, Helper_1.cloneObject)(props.AlertButtons || []) || [];
|
|
30
37
|
const buttonActions = [];
|
|
31
38
|
if (hasHighlightRow) {
|
|
@@ -43,7 +50,9 @@ const AlertButtonsEditor = (props) => {
|
|
|
43
50
|
if (hasUndo) {
|
|
44
51
|
buttonActions.push('undo');
|
|
45
52
|
}
|
|
46
|
-
|
|
53
|
+
if (hasSuspend) {
|
|
54
|
+
buttonActions.push('suspend');
|
|
55
|
+
}
|
|
47
56
|
return (React.createElement(React.Fragment, null,
|
|
48
57
|
React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "center", justifyContent: "space-between" },
|
|
49
58
|
React.createElement(rebass_1.Text, { fontSize: 2, mt: 3, mb: 2 }, "Add buttons to Alert, and Actions to perform when button is clicked"),
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AlertDefinition } from '../../../PredefinedConfig/AlertState';
|
|
3
|
+
import { AlertType } from '../Utilities/getAlertType';
|
|
4
|
+
export declare const renderAlertMessageSummary: () => JSX.Element;
|
|
5
|
+
declare type AlertDisplayWizardSectionProps = {
|
|
6
|
+
onChange: (data: AlertDefinition) => void;
|
|
7
|
+
alertType: AlertType;
|
|
8
|
+
};
|
|
9
|
+
export declare const AlertMessageWizardSection: (props: AlertDisplayWizardSectionProps) => JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlertMessageWizardSection = exports.renderAlertMessageSummary = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const Tabs_1 = require("../../../components/Tabs");
|
|
7
|
+
const Radio_1 = tslib_1.__importStar(require("../../../components/Radio"));
|
|
8
|
+
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
9
|
+
const rebass_1 = require("rebass");
|
|
10
|
+
const CodeBlock_1 = require("../../../components/CodeBlock");
|
|
11
|
+
const AdaptableInput_1 = tslib_1.__importDefault(require("../../Components/AdaptableInput"));
|
|
12
|
+
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
13
|
+
const renderAlertMessageSummary = () => {
|
|
14
|
+
const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
15
|
+
return (React.createElement(rebass_1.Text, { fontSize: 2 },
|
|
16
|
+
"Message Type ",
|
|
17
|
+
React.createElement(CodeBlock_1.CodeBlock, null, data.MessageType)));
|
|
18
|
+
};
|
|
19
|
+
exports.renderAlertMessageSummary = renderAlertMessageSummary;
|
|
20
|
+
const AlertMessageWizardSection = (props) => {
|
|
21
|
+
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
22
|
+
const messageType = data.MessageType;
|
|
23
|
+
const messageText = api.alertApi.internalApi.getAlertDescription(data);
|
|
24
|
+
const messageHeader = data.MessageHeader;
|
|
25
|
+
const onMessageTextChange = (e) => {
|
|
26
|
+
const { value } = e.target;
|
|
27
|
+
props.onChange(Object.assign(Object.assign({}, data), { MessageText: value }));
|
|
28
|
+
};
|
|
29
|
+
const onMessageHeaderChange = (e) => {
|
|
30
|
+
const { value } = e.target;
|
|
31
|
+
props.onChange(Object.assign(Object.assign({}, data), { MessageHeader: value }));
|
|
32
|
+
};
|
|
33
|
+
return (React.createElement(React.Fragment, null,
|
|
34
|
+
React.createElement(Tabs_1.Tabs, { "data-name": "message-type" },
|
|
35
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Message Type"),
|
|
36
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
37
|
+
React.createElement(Radio_1.RadioGroup, { value: messageType, name: "messageType", orientation: "horizontal", onRadioChange: (MessageType) => {
|
|
38
|
+
props.onChange(Object.assign(Object.assign({}, data), { MessageType }));
|
|
39
|
+
} },
|
|
40
|
+
React.createElement(Radio_1.default, { marginLeft: 1, value: "Info" }, "Info"),
|
|
41
|
+
React.createElement(Radio_1.default, { marginLeft: 4, value: "Success" }, "Success"),
|
|
42
|
+
React.createElement(Radio_1.default, { marginLeft: 4, value: "Warning" }, "Warning"),
|
|
43
|
+
React.createElement(Radio_1.default, { marginLeft: 4, value: "Error" }, "Error")))),
|
|
44
|
+
React.createElement(Tabs_1.Tabs, { "data-name": "message-text", mt: 2, mb: 3, autoFocus: false },
|
|
45
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Message Text"),
|
|
46
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
47
|
+
React.createElement(rebass_1.Text, { fontSize: 2, mt: 3, mb: 2 }, "The text to display as the Alert Message (leave blank to show automated Message based on Alert Type)"),
|
|
48
|
+
' ',
|
|
49
|
+
React.createElement(FormLayout_1.default, null,
|
|
50
|
+
React.createElement(FormLayout_1.FormRow, { label: "Header" },
|
|
51
|
+
React.createElement(AdaptableInput_1.default, { placeholder: "use defaults", marginTop: 2, type: 'text', autoFocus: false, value: messageHeader,
|
|
52
|
+
// placeholder="defaults to column name"
|
|
53
|
+
onChange: (e) => onMessageHeaderChange(e) })),
|
|
54
|
+
React.createElement(FormLayout_1.FormRow, { label: "Message" },
|
|
55
|
+
React.createElement(AdaptableInput_1.default, { marginTop: 2, type: 'text', autoFocus: false, value: messageText, onChange: (e) => onMessageTextChange(e) })))))));
|
|
56
|
+
};
|
|
57
|
+
exports.AlertMessageWizardSection = AlertMessageWizardSection;
|
package/src/View/Alert/Wizard/{AlertDisplayWizardSection.d.ts → AlertNotificationWizardSection.d.ts}
RENAMED
|
@@ -2,15 +2,17 @@ import * as React from 'react';
|
|
|
2
2
|
import { AlertDefinition } from '../../../PredefinedConfig/AlertState';
|
|
3
3
|
import { AdaptableApi } from '../../../types';
|
|
4
4
|
import { BoxProps } from 'rebass';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
export declare const renderAlertDisplaySummary: () => JSX.Element;
|
|
5
|
+
import { AlertType } from '../Utilities/getAlertType';
|
|
6
|
+
export declare const renderAlertNotificationSummary: () => JSX.Element;
|
|
9
7
|
interface AlertPreviewProps extends BoxProps {
|
|
10
8
|
api: AdaptableApi;
|
|
11
9
|
alertDefinition: AlertDefinition;
|
|
12
10
|
focusFirstButton?: boolean;
|
|
13
11
|
}
|
|
14
12
|
export declare const AlertPreview: React.FunctionComponent<AlertPreviewProps>;
|
|
15
|
-
|
|
13
|
+
declare type AlertNotificationWizardSectionProps = {
|
|
14
|
+
onChange: (data: AlertDefinition) => void;
|
|
15
|
+
alertType: AlertType;
|
|
16
|
+
};
|
|
17
|
+
export declare const AlertNotificationWizardSection: (props: AlertNotificationWizardSectionProps) => JSX.Element;
|
|
16
18
|
export {};
|
package/src/View/Alert/Wizard/{AlertDisplayWizardSection.js → AlertNotificationWizardSection.js}
RENAMED
|
@@ -1,19 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.AlertNotificationWizardSection = exports.AlertPreview = exports.renderAlertNotificationSummary = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const Tabs_1 = require("../../../components/Tabs");
|
|
7
|
-
const Radio_1 = tslib_1.__importStar(require("../../../components/Radio"));
|
|
8
7
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
9
8
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
10
9
|
const rebass_1 = require("rebass");
|
|
11
10
|
const AdaptablePopupAlert_1 = require("../../Components/Popups/AdaptablePopupAlert");
|
|
12
11
|
const AlertButtonsEditor_1 = require("./AlertButtonsEditor");
|
|
13
|
-
const CodeBlock_1 = require("../../../components/CodeBlock");
|
|
14
|
-
const AdaptableInput_1 = tslib_1.__importDefault(require("../../Components/AdaptableInput"));
|
|
15
12
|
const join_1 = tslib_1.__importDefault(require("../../../components/utils/join"));
|
|
16
|
-
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
17
13
|
const DEFAULT_BUTTONS = [
|
|
18
14
|
{
|
|
19
15
|
Label: 'OK',
|
|
@@ -22,18 +18,15 @@ const DEFAULT_BUTTONS = [
|
|
|
22
18
|
},
|
|
23
19
|
},
|
|
24
20
|
];
|
|
25
|
-
const
|
|
21
|
+
const renderAlertNotificationSummary = () => {
|
|
26
22
|
var _a;
|
|
27
23
|
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
28
24
|
if (!((_a = data.AlertProperties) === null || _a === void 0 ? void 0 : _a.DisplayNotification)) {
|
|
29
|
-
return
|
|
30
|
-
"Alert type ",
|
|
31
|
-
React.createElement(CodeBlock_1.CodeBlock, null, data.MessageType),
|
|
32
|
-
". No alert popup will be displayed"));
|
|
25
|
+
return React.createElement(rebass_1.Text, { fontSize: 2 }, "No Alert Notification will be displayed");
|
|
33
26
|
}
|
|
34
27
|
return React.createElement(exports.AlertPreview, { api: api, alertDefinition: data });
|
|
35
28
|
};
|
|
36
|
-
exports.
|
|
29
|
+
exports.renderAlertNotificationSummary = renderAlertNotificationSummary;
|
|
37
30
|
const AlertPreview = (_a) => {
|
|
38
31
|
var { alertDefinition, api, focusFirstButton } = _a, boxProps = tslib_1.__rest(_a, ["alertDefinition", "api", "focusFirstButton"]);
|
|
39
32
|
const mapButtons = React.useCallback((button) => {
|
|
@@ -59,62 +52,31 @@ const AlertPreview = (_a) => {
|
|
|
59
52
|
React.createElement(AdaptablePopupAlert_1.AdaptablePopupAlert, { headless: true, focusFirstButton: focusFirstButton, adaptableAlert: alertToPreview, onClose: () => { } })));
|
|
60
53
|
};
|
|
61
54
|
exports.AlertPreview = AlertPreview;
|
|
62
|
-
const
|
|
63
|
-
var _a, _b, _c, _d
|
|
55
|
+
const AlertNotificationWizardSection = (props) => {
|
|
56
|
+
var _a, _b, _c, _d;
|
|
64
57
|
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
65
|
-
const messageType = data.MessageType;
|
|
66
|
-
const messageText = api.alertApi.internalApi.getAlertDescription(data);
|
|
67
|
-
const messageHeader = (_a = data.MessageHeader) !== null && _a !== void 0 ? _a : '';
|
|
68
58
|
const adaptableAlert = {
|
|
69
59
|
alertType: 'generic',
|
|
70
60
|
header: data.MessageType,
|
|
71
61
|
message: '',
|
|
72
62
|
alertDefinition: data,
|
|
73
63
|
};
|
|
74
|
-
const onMessageTextChange = (e) => {
|
|
75
|
-
const { value } = e.target;
|
|
76
|
-
props.onChange(Object.assign(Object.assign({}, data), { MessageText: value }));
|
|
77
|
-
};
|
|
78
|
-
const onMessageHeaderChange = (e) => {
|
|
79
|
-
const { value } = e.target;
|
|
80
|
-
props.onChange(Object.assign(Object.assign({}, data), { MessageHeader: value }));
|
|
81
|
-
};
|
|
82
64
|
return (React.createElement(React.Fragment, null,
|
|
83
|
-
React.createElement(Tabs_1.Tabs, { "data-name": "message-type" },
|
|
84
|
-
React.createElement(Tabs_1.Tabs.Tab, null, "Message Type"),
|
|
85
|
-
React.createElement(Tabs_1.Tabs.Content, null,
|
|
86
|
-
React.createElement(Radio_1.RadioGroup, { value: messageType, name: "messageType", orientation: "horizontal", onRadioChange: (MessageType) => {
|
|
87
|
-
props.onChange(Object.assign(Object.assign({}, data), { MessageType }));
|
|
88
|
-
} },
|
|
89
|
-
React.createElement(Radio_1.default, { marginLeft: 1, value: "Info" }, "Info"),
|
|
90
|
-
React.createElement(Radio_1.default, { marginLeft: 4, value: "Success" }, "Success"),
|
|
91
|
-
React.createElement(Radio_1.default, { marginLeft: 4, value: "Warning" }, "Warning"),
|
|
92
|
-
React.createElement(Radio_1.default, { marginLeft: 4, value: "Error" }, "Error")))),
|
|
93
|
-
React.createElement(Tabs_1.Tabs, { "data-name": "message-text", mt: 2, mb: 3, autoFocus: false },
|
|
94
|
-
React.createElement(Tabs_1.Tabs.Tab, null, "Message Text"),
|
|
95
|
-
React.createElement(Tabs_1.Tabs.Content, null,
|
|
96
|
-
React.createElement(rebass_1.Text, { fontSize: 2, mt: 3, mb: 2 }, "The text to display as the Alert Message (leave blank to show automated Message based on Trigger and Condition)"),
|
|
97
|
-
' ',
|
|
98
|
-
React.createElement(FormLayout_1.default, null,
|
|
99
|
-
React.createElement(FormLayout_1.FormRow, { label: "Header" },
|
|
100
|
-
React.createElement(AdaptableInput_1.default, { marginTop: 2, type: 'text', autoFocus: false, value: messageHeader, onChange: (e) => onMessageHeaderChange(e) })),
|
|
101
|
-
React.createElement(FormLayout_1.FormRow, { label: "Message" },
|
|
102
|
-
React.createElement(AdaptableInput_1.default, { marginTop: 2, type: 'text', autoFocus: false, value: messageText, onChange: (e) => onMessageTextChange(e) }))))),
|
|
103
65
|
React.createElement(Tabs_1.Tabs, { "data-name": "display-options", mt: 2, mb: 3, autoFocus: false },
|
|
104
|
-
React.createElement(Tabs_1.Tabs.Tab, null, "
|
|
66
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Notification Options"),
|
|
105
67
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
106
|
-
React.createElement(CheckBox_1.CheckBox, { checked: (
|
|
68
|
+
React.createElement(CheckBox_1.CheckBox, { checked: (_a = data.AlertProperties) === null || _a === void 0 ? void 0 : _a.DisplayNotification, onChange: (DisplayNotification) => {
|
|
107
69
|
const newAlertDefinition = Object.assign(Object.assign({}, data), { AlertProperties: Object.assign(Object.assign({}, data.AlertProperties), { DisplayNotification }) });
|
|
108
70
|
if (!DisplayNotification && typeof newAlertDefinition.AlertForm === 'object') {
|
|
109
71
|
delete newAlertDefinition.AlertForm.Buttons;
|
|
110
72
|
}
|
|
111
73
|
props.onChange(newAlertDefinition);
|
|
112
74
|
} }, "Show a Notification when Alert is triggered (with action buttons)"),
|
|
113
|
-
((
|
|
75
|
+
((_b = data.AlertProperties) === null || _b === void 0 ? void 0 : _b.DisplayNotification) ? (typeof data.AlertForm === 'string' ? (React.createElement(rebass_1.Text, { fontSize: 2 }, "Alert buttons cannot be customized because form is dynamically driven")) : (React.createElement(AlertButtonsEditor_1.AlertButtonsEditor, { alertType: props.alertType, AlertButtons: ((_c = data.AlertForm) === null || _c === void 0 ? void 0 : _c.Buttons) || DEFAULT_BUTTONS, api: api, adaptableAlert: adaptableAlert, onChange: (buttons) => {
|
|
114
76
|
props.onChange(Object.assign(Object.assign({}, data), { AlertForm: Object.assign(Object.assign({}, data.AlertForm), { Buttons: buttons }) }));
|
|
115
77
|
} }))) : null)),
|
|
116
|
-
((
|
|
117
|
-
React.createElement(Tabs_1.Tabs.Tab, null, "Alert
|
|
78
|
+
((_d = data.AlertProperties) === null || _d === void 0 ? void 0 : _d.DisplayNotification) ? (React.createElement(Tabs_1.Tabs, { "data-name": "alert-preview", autoFocus: false },
|
|
79
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Alert Preview"),
|
|
118
80
|
React.createElement(Tabs_1.Tabs.Content, null, typeof data.AlertForm === 'string' ? (React.createElement(rebass_1.Text, { fontSize: 2 }, "Preview not available because form is dynamically driven")) : (React.createElement(exports.AlertPreview, { alertDefinition: data, api: api }))))) : null));
|
|
119
81
|
};
|
|
120
|
-
exports.
|
|
82
|
+
exports.AlertNotificationWizardSection = AlertNotificationWizardSection;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AlertDefinition } from '../../../PredefinedConfig/AlertState';
|
|
3
|
-
|
|
3
|
+
import { AlertType } from '../Utilities/getAlertType';
|
|
4
|
+
export declare const getRuleStepDescription: (alertType: AlertType) => "" | JSX.Element;
|
|
5
|
+
export declare const renderAlertRulesSummary: (alertDefinition: AlertDefinition) => JSX.Element;
|
|
6
|
+
export interface AlertRulesWizardSectionProps {
|
|
4
7
|
onChange: (data: AlertDefinition) => void;
|
|
5
8
|
module: 'alert';
|
|
6
|
-
|
|
9
|
+
wholeRowScope?: boolean;
|
|
10
|
+
alertType: AlertType | null;
|
|
11
|
+
}
|
|
7
12
|
export declare const AlertRulesWizardSection: (props: AlertRulesWizardSectionProps) => JSX.Element;
|
|
8
|
-
export declare const renderAlertRulesSummary: (alertDefinition: AlertDefinition) => JSX.Element;
|
|
9
|
-
export {};
|
|
@@ -1,19 +1,36 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.renderAlertRulesSummary = exports.
|
|
3
|
+
exports.AlertRulesWizardSection = exports.renderAlertRulesSummary = exports.getRuleStepDescription = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const BaseAlertRulesWizardSection_1 = require("./BaseAlertRulesWizardSection");
|
|
7
6
|
const EntityRulesEditor_1 = require("../../Components/EntityRulesEditor");
|
|
8
7
|
const Tag_1 = require("../../../components/Tag");
|
|
9
|
-
const
|
|
10
|
-
|
|
8
|
+
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
9
|
+
const getAvailablePredicates_1 = require("../Utilities/getAvailablePredicates");
|
|
10
|
+
const Tabs_1 = require("../../../components/Tabs");
|
|
11
|
+
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
12
|
+
const rebass_1 = require("rebass");
|
|
13
|
+
const getRuleStepDescription = (alertType) => {
|
|
14
|
+
switch (alertType) {
|
|
15
|
+
case 'DataChange':
|
|
16
|
+
return (React.createElement(React.Fragment, null,
|
|
17
|
+
"Build the Rule ",
|
|
18
|
+
React.createElement("b", null, "when"),
|
|
19
|
+
" the Alert should trigger, using a Predicate or a Query"));
|
|
20
|
+
case 'RowChange':
|
|
21
|
+
return React.createElement(React.Fragment, null, "Specify which type of Row Change will trigger the Alert");
|
|
22
|
+
case 'Aggregation':
|
|
23
|
+
return React.createElement(React.Fragment, null, "Build an Aggregation Boolean Rule to specify when the Alert should trigger");
|
|
24
|
+
case 'Observable':
|
|
25
|
+
return React.createElement(React.Fragment, null, "Build an Observable Rule to specify when the Alert should trigger");
|
|
26
|
+
}
|
|
27
|
+
return '';
|
|
11
28
|
};
|
|
12
|
-
exports.
|
|
29
|
+
exports.getRuleStepDescription = getRuleStepDescription;
|
|
13
30
|
const renderAlertRulesSummary = (alertDefinition) => {
|
|
14
31
|
return (React.createElement(EntityRulesEditor_1.EntityRulesSummary, { data: alertDefinition, renderPredicate: (contents) => {
|
|
15
32
|
return (React.createElement(React.Fragment, null,
|
|
16
|
-
"Alert
|
|
33
|
+
"Alert Rule ",
|
|
17
34
|
React.createElement(Tag_1.Tag, null, contents)));
|
|
18
35
|
}, renderQueryExpression: (contents) => {
|
|
19
36
|
return (React.createElement(React.Fragment, null,
|
|
@@ -22,3 +39,46 @@ const renderAlertRulesSummary = (alertDefinition) => {
|
|
|
22
39
|
} }));
|
|
23
40
|
};
|
|
24
41
|
exports.renderAlertRulesSummary = renderAlertRulesSummary;
|
|
42
|
+
const RowChangeEditor = (props) => {
|
|
43
|
+
var _a, _b, _c;
|
|
44
|
+
const predicate = (_c = (_b = (_a = props.alert.Rule) === null || _a === void 0 ? void 0 : _a.Predicates) === null || _b === void 0 ? void 0 : _b[0]) !== null && _c !== void 0 ? _c : { PredicateId: null };
|
|
45
|
+
const handleChange = (predicateId) => {
|
|
46
|
+
props.onChange(Object.assign(Object.assign({}, props.alert), { Rule: {
|
|
47
|
+
Predicates: [{ PredicateId: predicateId }],
|
|
48
|
+
} }));
|
|
49
|
+
};
|
|
50
|
+
return (React.createElement(rebass_1.Box, { p: 2 },
|
|
51
|
+
React.createElement(Tabs_1.Tabs, null,
|
|
52
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Row Change"),
|
|
53
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
54
|
+
React.createElement(Radio_1.default, { onClick: () => handleChange('AddedRow'), checked: predicate.PredicateId === 'AddedRow' }, "Row Added"),
|
|
55
|
+
React.createElement(Radio_1.default, { onClick: () => handleChange('RemovedRow'), checked: predicate.PredicateId === 'RemovedRow' }, "Row Removed")))));
|
|
56
|
+
};
|
|
57
|
+
const AlertRulesWizardSection = (props) => {
|
|
58
|
+
const { data, api, moduleInfo } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
59
|
+
const predicateDefs = (0, getAvailablePredicates_1.getAvailablePredicateDefinitions)(api, data.Scope, props.alertType);
|
|
60
|
+
const showObservable = props.alertType === 'Observable';
|
|
61
|
+
const showAggregation = props.alertType === 'Aggregation';
|
|
62
|
+
const showBoolean = props.alertType === 'DataChange';
|
|
63
|
+
const showPredicate = props.alertType === 'DataChange' || props.alertType === 'RowChange';
|
|
64
|
+
const enablePredicateColumnId = props.alertType === 'DataChange';
|
|
65
|
+
if (props.alertType === 'RowChange') {
|
|
66
|
+
return React.createElement(RowChangeEditor, { alert: data, onChange: props.onChange });
|
|
67
|
+
}
|
|
68
|
+
return (React.createElement(EntityRulesEditor_1.EntityRulesEditor, { module: moduleInfo.ModuleName, defaultPredicateId: "Any", data: data, predicateDefs: predicateDefs, enablePredicateColumnId: enablePredicateColumnId, getPredicateDefsForColId: (colId) => (0, getAvailablePredicates_1.getAvailablePredicateDefinitions)(api, { ColumnIds: [colId] }, props.alertType), onChange: props.onChange, showAggregation: showAggregation, showObservable: showObservable, showBoolean: showBoolean, showPredicate: showPredicate, descriptions: {
|
|
69
|
+
selectPredicate: 'Create an Alert Rule - to be applied when data changes',
|
|
70
|
+
useBooleanQuery: (React.createElement(React.Fragment, null,
|
|
71
|
+
"Use an BooleanQuery if ",
|
|
72
|
+
React.createElement("i", null, "Scope"),
|
|
73
|
+
" is 'All Columns' - so any data change may be evaluated in a complex BooleanExpression")),
|
|
74
|
+
useObservableQuery: (React.createElement(React.Fragment, null,
|
|
75
|
+
"Use an ObservableQuery if ",
|
|
76
|
+
React.createElement("i", null, "Scope"),
|
|
77
|
+
" is 'All Columns' - so any data change may be evaluated in a complex ObservableExpression")),
|
|
78
|
+
useAggregationQuery: (React.createElement(React.Fragment, null,
|
|
79
|
+
"Use an AggregatedBooleanQuery if ",
|
|
80
|
+
React.createElement("i", null, "Scope"),
|
|
81
|
+
" is 'All Columns' - so any data change may be evaluated in a complex AggregatedBooleanExpression")),
|
|
82
|
+
} }));
|
|
83
|
+
};
|
|
84
|
+
exports.AlertRulesWizardSection = AlertRulesWizardSection;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AlertDefinition } from '../../../PredefinedConfig/AlertState';
|
|
3
|
+
import { AlertType } from '../Utilities/getAlertType';
|
|
3
4
|
declare type AlertScopeWizardSectionProps = {
|
|
4
5
|
onChange: (data: AlertDefinition) => void;
|
|
6
|
+
alertType: AlertType;
|
|
5
7
|
};
|
|
6
8
|
export declare const AlertScopeWizardSection: (props: AlertScopeWizardSectionProps) => JSX.Element;
|
|
7
9
|
export {};
|
|
@@ -3,8 +3,47 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AlertScopeWizardSection = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const
|
|
6
|
+
const rebass_1 = require("rebass");
|
|
7
|
+
const NewScopeComponent_1 = require("../../Components/NewScopeComponent");
|
|
8
|
+
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
7
9
|
const AlertScopeWizardSection = (props) => {
|
|
8
|
-
|
|
10
|
+
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
11
|
+
let disableDataTypes = true;
|
|
12
|
+
let disableColumns = true;
|
|
13
|
+
if (props.alertType === 'DataChange') {
|
|
14
|
+
disableDataTypes = false;
|
|
15
|
+
disableColumns = false;
|
|
16
|
+
}
|
|
17
|
+
return (React.createElement(rebass_1.Flex, { flexDirection: "column", style: { height: '100%' }, padding: 2 },
|
|
18
|
+
React.createElement(NewScopeComponent_1.NewScopeComponent, { disableColumns: disableColumns, disableDataTypes: disableDataTypes, descriptions: {
|
|
19
|
+
rowScope: 'Changes in any Column in the row will trigger an Alert',
|
|
20
|
+
columnScope: 'Changes in selected Columns will trigger an Alert',
|
|
21
|
+
dataTypeScope: 'Changes in any Column which is of the selected Data Type(s) will trigger an Alert',
|
|
22
|
+
}, scope: data.Scope, updateScope: (Scope) => {
|
|
23
|
+
const newData = Object.assign(Object.assign({}, data), { Scope });
|
|
24
|
+
if (newData.Rule.Predicates) {
|
|
25
|
+
// when scope is changed, reset the rule to predicate of any
|
|
26
|
+
// if it was set to a predicate before
|
|
27
|
+
newData.Rule = {
|
|
28
|
+
Predicates: [{ PredicateId: 'Any' }],
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
if (newData.Rule.ObservableExpression !== undefined && !api.scopeApi.scopeIsAll(Scope)) {
|
|
32
|
+
// if it had observable expression and the scope is changed to partial
|
|
33
|
+
// we need to reset to not be an observable expression, as observable is not supported
|
|
34
|
+
// for partial scope
|
|
35
|
+
delete newData.Rule.ObservableExpression;
|
|
36
|
+
newData.Rule.BooleanExpression = '';
|
|
37
|
+
}
|
|
38
|
+
if (newData.Rule.AggregatedBooleanExpression !== undefined &&
|
|
39
|
+
!api.scopeApi.scopeIsAll(Scope)) {
|
|
40
|
+
// if it had aggregation expression and the scope is changed to partial
|
|
41
|
+
// we need to reset to not be an aggregation expression, as aggregation is not supported
|
|
42
|
+
// for partial scope
|
|
43
|
+
delete newData.Rule.AggregatedBooleanExpression;
|
|
44
|
+
newData.Rule.BooleanExpression = '';
|
|
45
|
+
}
|
|
46
|
+
props.onChange(newData);
|
|
47
|
+
} })));
|
|
9
48
|
};
|
|
10
49
|
exports.AlertScopeWizardSection = AlertScopeWizardSection;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AlertType } from '../Utilities/getAlertType';
|
|
3
|
+
export declare const renderAlertTypeSummary: (alertType: AlertType) => JSX.Element;
|
|
4
|
+
declare type AlertBehaviourWizardSectionProps = {
|
|
5
|
+
onAlertTypeChange: (alertType: AlertType) => void;
|
|
6
|
+
alertType: AlertType | null;
|
|
7
|
+
};
|
|
8
|
+
export declare const AlertTypeWizardSection: (props: AlertBehaviourWizardSectionProps) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlertTypeWizardSection = exports.renderAlertTypeSummary = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const Tabs_1 = require("../../../components/Tabs");
|
|
7
|
+
const getAlertType_1 = require("../Utilities/getAlertType");
|
|
8
|
+
const rebass_1 = require("rebass");
|
|
9
|
+
const TypeRadio_1 = require("../../Wizard/TypeRadio");
|
|
10
|
+
const Tag_1 = require("../../../components/Tag");
|
|
11
|
+
const renderAlertTypeSummary = (alertType) => {
|
|
12
|
+
const text = (0, getAlertType_1.getAlertTypeText)(alertType);
|
|
13
|
+
return (React.createElement(rebass_1.Box, null,
|
|
14
|
+
React.createElement(Tag_1.Tag, null, text)));
|
|
15
|
+
};
|
|
16
|
+
exports.renderAlertTypeSummary = renderAlertTypeSummary;
|
|
17
|
+
const AlertTypeWizardSection = (props) => {
|
|
18
|
+
return (React.createElement(Tabs_1.Tabs, null,
|
|
19
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Alert Type"),
|
|
20
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
21
|
+
React.createElement(rebass_1.Flex, { flexDirection: "column" },
|
|
22
|
+
React.createElement(TypeRadio_1.TypeRadio, { text: (0, getAlertType_1.getAlertTypeText)(getAlertType_1.AlertType.DataChange), description: "A change has been made to the Grid's underlying data", checked: props.alertType === getAlertType_1.AlertType.DataChange, onClick: () => props.onAlertTypeChange(getAlertType_1.AlertType.DataChange) }),
|
|
23
|
+
React.createElement(TypeRadio_1.TypeRadio, { text: (0, getAlertType_1.getAlertTypeText)(getAlertType_1.AlertType.RowChange), description: "A Row was added or removed from the data source", checked: props.alertType === getAlertType_1.AlertType.RowChange, onClick: () => props.onAlertTypeChange(getAlertType_1.AlertType.RowChange) }),
|
|
24
|
+
React.createElement(TypeRadio_1.TypeRadio, { text: (0, getAlertType_1.getAlertTypeText)(getAlertType_1.AlertType.Aggregation), description: "A change has been made to aggregated data (i.e. from multiple Rows)", onClick: () => props.onAlertTypeChange(getAlertType_1.AlertType.Aggregation), checked: props.alertType === getAlertType_1.AlertType.Aggregation }),
|
|
25
|
+
React.createElement(TypeRadio_1.TypeRadio, { text: (0, getAlertType_1.getAlertTypeText)(getAlertType_1.AlertType.Observable), description: "A specified change (or lack of change) over time has been observed in the Grid", onClick: () => props.onAlertTypeChange(getAlertType_1.AlertType.Observable), checked: props.alertType === getAlertType_1.AlertType.Observable })))));
|
|
26
|
+
};
|
|
27
|
+
exports.AlertTypeWizardSection = AlertTypeWizardSection;
|