@adaptabletools/adaptable 14.0.3 → 14.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/ChartingOptions.d.ts +1 -1
- package/src/AdaptableOptions/DataChangeHistoryOptions.d.ts +26 -26
- package/src/AdaptableOptions/ExportOptions.d.ts +17 -3
- 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/ChartChanged.d.ts +8 -0
- package/src/Api/Events/ChartChanged.js +2 -0
- package/src/Api/ExportApi.d.ts +5 -0
- 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/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/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/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 +1 -0
- 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 +16 -0
- package/src/Utilities/Services/ReportService.js +1 -1
- package/src/View/AdaptableViewFactory.js +1 -1
- package/src/View/AdaptableWizardView/AdaptableConfigurationDialog/ConfigurationWizard.js +3 -2
- 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/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 +1 -1
- 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 +129 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +5 -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
|
@@ -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;
|
|
@@ -12,7 +12,7 @@ const AlertRulesWizardSection_1 = require("./AlertRulesWizardSection");
|
|
|
12
12
|
const isValidAlertRules_1 = require("./isValidAlertRules");
|
|
13
13
|
const AlertBehaviourWizardSection_1 = require("./AlertBehaviourWizardSection");
|
|
14
14
|
const GeneralConstants_1 = require("../../../Utilities/Constants/GeneralConstants");
|
|
15
|
-
const
|
|
15
|
+
const AlertMessageWizardSection_1 = require("./AlertMessageWizardSection");
|
|
16
16
|
const BaseAlertScopeWizardSection_1 = require("./BaseAlertScopeWizardSection");
|
|
17
17
|
const NewScopeComponent_1 = require("../../Components/NewScopeComponent");
|
|
18
18
|
const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/ObjectFactory"));
|
|
@@ -20,7 +20,15 @@ const react_redux_1 = require("react-redux");
|
|
|
20
20
|
const AlertRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/AlertRedux"));
|
|
21
21
|
const AdaptableContext_1 = require("../../AdaptableContext");
|
|
22
22
|
const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection");
|
|
23
|
+
const AlertTypeWizardSection_1 = require("./AlertTypeWizardSection");
|
|
24
|
+
const getAlertType_1 = require("../Utilities/getAlertType");
|
|
25
|
+
const mapAlertDefinition_1 = require("../Utilities/mapAlertDefinition");
|
|
26
|
+
const getDefaultAlertDefinition_1 = require("../Utilities/getDefaultAlertDefinition");
|
|
27
|
+
const AlertNotificationWizardSection_1 = require("./AlertNotificationWizardSection");
|
|
23
28
|
const AlertWizard = (props) => {
|
|
29
|
+
const { api } = (0, AdaptableContext_1.useAdaptable)();
|
|
30
|
+
const dispatch = (0, react_redux_1.useDispatch)();
|
|
31
|
+
const behaviourSpelling = api.internalApi.getCorrectEnglishVariant('Behaviour');
|
|
24
32
|
const [alertDefinition, setAlertDefinition] = (0, react_1.useState)(() => {
|
|
25
33
|
var _a;
|
|
26
34
|
const alertDefinition = props.data
|
|
@@ -35,86 +43,12 @@ const AlertWizard = (props) => {
|
|
|
35
43
|
alertDefinition.MessageType = (_a = alertDefinition.MessageType) !== null && _a !== void 0 ? _a : GeneralConstants_1.ALERT_DEFAULT_MESSAGE_TYPE;
|
|
36
44
|
return alertDefinition;
|
|
37
45
|
});
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
// Alert type is based initialy on data, but can be changed by the user
|
|
47
|
+
// the default objects do not neccesary have enough information to determine the type
|
|
48
|
+
const [alertType, setAlertType] = (0, react_1.useState)(() => {
|
|
40
49
|
var _a;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const isRemovedRowChangeAlert = api.alertApi.internalApi.isAlertDefinitionForRemovedRowChangeEvent(alertDefinition);
|
|
44
|
-
const isCellChangeAlert = !isAddedRowChangeAlert && !isRemovedRowChangeAlert;
|
|
45
|
-
// map FormButton Actions
|
|
46
|
-
const mapValidButtonActions = (alertAction) => {
|
|
47
|
-
if (isCellChangeAlert) {
|
|
48
|
-
if (alertAction === 'highlight-row') {
|
|
49
|
-
return 'highlight-cell';
|
|
50
|
-
}
|
|
51
|
-
if (alertAction === 'jump-to-row') {
|
|
52
|
-
return 'jump-to-cell';
|
|
53
|
-
}
|
|
54
|
-
return alertAction;
|
|
55
|
-
}
|
|
56
|
-
if (isAddedRowChangeAlert) {
|
|
57
|
-
if (alertAction === 'highlight-cell') {
|
|
58
|
-
return 'highlight-row';
|
|
59
|
-
}
|
|
60
|
-
if (alertAction === 'jump-to-cell') {
|
|
61
|
-
return 'jump-to-row';
|
|
62
|
-
}
|
|
63
|
-
if (alertAction === 'jump-to-column' || alertAction === 'undo') {
|
|
64
|
-
return null;
|
|
65
|
-
}
|
|
66
|
-
return alertAction;
|
|
67
|
-
}
|
|
68
|
-
if (isRemovedRowChangeAlert) {
|
|
69
|
-
if (alertAction === 'highlight-cell' ||
|
|
70
|
-
alertAction === 'jump-to-cell' ||
|
|
71
|
-
alertAction === 'highlight-row' ||
|
|
72
|
-
alertAction === 'jump-to-row' ||
|
|
73
|
-
alertAction === 'jump-to-column' ||
|
|
74
|
-
alertAction === 'undo') {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
return alertAction;
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
if (alertDefinition.AlertForm && typeof alertDefinition.AlertForm !== 'string') {
|
|
81
|
-
const alertButtons = (_a = alertDefinition.AlertForm) === null || _a === void 0 ? void 0 : _a.Buttons;
|
|
82
|
-
alertButtons === null || alertButtons === void 0 ? void 0 : alertButtons.forEach((alertButton) => {
|
|
83
|
-
const alertAction = alertButton.Action;
|
|
84
|
-
if (Array.isArray(alertAction)) {
|
|
85
|
-
alertButton.Action = alertAction
|
|
86
|
-
.map(mapValidButtonActions)
|
|
87
|
-
.filter(Boolean);
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
alertButton.Action = mapValidButtonActions(alertAction);
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
// map Alert Properties(Behaviour)
|
|
95
|
-
if (isCellChangeAlert) {
|
|
96
|
-
alertDefinition.AlertProperties.HighlightCell = alertDefinition.AlertProperties.HighlightRow;
|
|
97
|
-
delete alertDefinition.AlertProperties.HighlightRow;
|
|
98
|
-
alertDefinition.AlertProperties.JumpToCell = alertDefinition.AlertProperties.JumpToRow;
|
|
99
|
-
delete alertDefinition.AlertProperties.JumpToRow;
|
|
100
|
-
}
|
|
101
|
-
if (isAddedRowChangeAlert) {
|
|
102
|
-
alertDefinition.AlertProperties.HighlightRow = alertDefinition.AlertProperties.HighlightCell;
|
|
103
|
-
delete alertDefinition.AlertProperties.HighlightCell;
|
|
104
|
-
alertDefinition.AlertProperties.JumpToRow = alertDefinition.AlertProperties.JumpToCell;
|
|
105
|
-
delete alertDefinition.AlertProperties.JumpToCell;
|
|
106
|
-
delete alertDefinition.AlertProperties.PreventEdit;
|
|
107
|
-
}
|
|
108
|
-
if (isRemovedRowChangeAlert) {
|
|
109
|
-
delete alertDefinition.AlertProperties.PreventEdit;
|
|
110
|
-
delete alertDefinition.AlertProperties.HighlightRow;
|
|
111
|
-
delete alertDefinition.AlertProperties.JumpToRow;
|
|
112
|
-
delete alertDefinition.AlertProperties.HighlightCell;
|
|
113
|
-
delete alertDefinition.AlertProperties.JumpToCell;
|
|
114
|
-
}
|
|
115
|
-
setAlertDefinition(alertDefinition);
|
|
116
|
-
};
|
|
117
|
-
const dispatch = (0, react_redux_1.useDispatch)();
|
|
50
|
+
return (_a = (0, getAlertType_1.getAlertType)(alertDefinition)) !== null && _a !== void 0 ? _a : getAlertType_1.AlertType.DataChange;
|
|
51
|
+
});
|
|
118
52
|
const handleFinish = () => {
|
|
119
53
|
if (props.data) {
|
|
120
54
|
dispatch(AlertRedux.AlertDefinitionEdit(alertDefinition));
|
|
@@ -124,44 +58,65 @@ const AlertWizard = (props) => {
|
|
|
124
58
|
}
|
|
125
59
|
props.onCloseWizard();
|
|
126
60
|
};
|
|
127
|
-
const
|
|
61
|
+
const updateAlertDefinition = (newAlertDefinition) => {
|
|
62
|
+
setAlertDefinition((0, mapAlertDefinition_1.mapAlertDefinition)(api, newAlertDefinition));
|
|
63
|
+
};
|
|
64
|
+
const handleAlertTypeChange = (newAlertType) => {
|
|
65
|
+
setAlertType(newAlertType);
|
|
66
|
+
setAlertDefinition((0, getDefaultAlertDefinition_1.getDefaultAlertDefinition)(alertDefinition, newAlertType));
|
|
67
|
+
};
|
|
128
68
|
return (React.createElement(OnePageAdaptableWizard_1.OnePageAdaptableWizard, { defaultCurrentSectionName: props.defaultCurrentSectionName, moduleInfo: props.moduleInfo, data: alertDefinition, onHide: props.onCloseWizard, onFinish: handleFinish, sections: [
|
|
129
69
|
{
|
|
70
|
+
title: 'Type',
|
|
71
|
+
details: (React.createElement(React.Fragment, null,
|
|
72
|
+
"Select ",
|
|
73
|
+
React.createElement("b", null, "what"),
|
|
74
|
+
" type of change in AdapTable will cause the Alert to fire")),
|
|
75
|
+
render: () => (React.createElement(rebass_1.Box, { padding: 2 },
|
|
76
|
+
React.createElement(AlertTypeWizardSection_1.AlertTypeWizardSection, { alertType: alertType, onAlertTypeChange: handleAlertTypeChange }))),
|
|
77
|
+
renderSummary: () => (0, AlertTypeWizardSection_1.renderAlertTypeSummary)(alertType),
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
title: 'Trigger',
|
|
81
|
+
isVisible: () => alertType === getAlertType_1.AlertType.DataChange,
|
|
130
82
|
details: (React.createElement(React.Fragment, null,
|
|
131
83
|
"Specify ",
|
|
132
|
-
React.createElement("b", null, "
|
|
84
|
+
React.createElement("b", null, "where"),
|
|
133
85
|
" data changes should trigger the Alert")),
|
|
134
86
|
isValid: NewScopeComponent_1.isScopeValid,
|
|
135
|
-
render: () => React.createElement(AlertScopeWizardSection_1.AlertScopeWizardSection, { onChange: setAlertDefinition }),
|
|
136
|
-
renderSummary: BaseAlertScopeWizardSection_1.
|
|
137
|
-
title: 'Trigger',
|
|
87
|
+
render: () => (React.createElement(AlertScopeWizardSection_1.AlertScopeWizardSection, { alertType: alertType, onChange: setAlertDefinition })),
|
|
88
|
+
renderSummary: BaseAlertScopeWizardSection_1.renderScopeSummary,
|
|
138
89
|
},
|
|
139
90
|
{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
React.createElement("b", null, "when"),
|
|
143
|
-
" the Alert should trigger")),
|
|
91
|
+
title: 'Rule',
|
|
92
|
+
details: (0, AlertRulesWizardSection_1.getRuleStepDescription)(alertType),
|
|
144
93
|
isValid: isValidAlertRules_1.isValidAlertRules,
|
|
145
|
-
render: () => React.createElement(AlertRulesWizardSection_1.AlertRulesWizardSection, { onChange: updateAlertDefinition, module: "alert" }),
|
|
94
|
+
render: () => (React.createElement(AlertRulesWizardSection_1.AlertRulesWizardSection, { alertType: alertType, onChange: updateAlertDefinition, module: "alert" })),
|
|
146
95
|
renderSummary: AlertRulesWizardSection_1.renderAlertRulesSummary,
|
|
147
|
-
title: 'Rule',
|
|
148
96
|
},
|
|
149
97
|
{
|
|
150
|
-
|
|
98
|
+
title: 'Message',
|
|
99
|
+
details: "Select the Alert's Message Type and Text",
|
|
151
100
|
render: () => (React.createElement(rebass_1.Box, { padding: 2 },
|
|
152
|
-
React.createElement(
|
|
153
|
-
renderSummary:
|
|
154
|
-
|
|
101
|
+
React.createElement(AlertMessageWizardSection_1.AlertMessageWizardSection, { alertType: alertType, onChange: setAlertDefinition }))),
|
|
102
|
+
renderSummary: AlertMessageWizardSection_1.renderAlertMessageSummary,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
title: 'Notification',
|
|
106
|
+
details: 'Create a Notification for the Alert',
|
|
107
|
+
render: () => (React.createElement(rebass_1.Box, { padding: 2 },
|
|
108
|
+
React.createElement(AlertNotificationWizardSection_1.AlertNotificationWizardSection, { alertType: alertType, onChange: setAlertDefinition }))),
|
|
109
|
+
renderSummary: AlertNotificationWizardSection_1.renderAlertNotificationSummary,
|
|
155
110
|
},
|
|
156
111
|
{
|
|
157
|
-
details: 'Configure ' + behaviourSpelling + ' for the Alert',
|
|
158
112
|
title: behaviourSpelling,
|
|
113
|
+
details: 'Configure ' + behaviourSpelling + ' for the Alert',
|
|
159
114
|
render: () => (React.createElement(rebass_1.Box, { padding: 2 },
|
|
160
|
-
React.createElement(AlertBehaviourWizardSection_1.AlertBehaviourWizardSection, { onChange: setAlertDefinition }))),
|
|
115
|
+
React.createElement(AlertBehaviourWizardSection_1.AlertBehaviourWizardSection, { alertType: alertType, onChange: setAlertDefinition }))),
|
|
161
116
|
renderSummary: AlertBehaviourWizardSection_1.renderAlertBehaviourWizardSummary,
|
|
162
117
|
},
|
|
163
118
|
{
|
|
164
|
-
details: 'Select Alert
|
|
119
|
+
details: 'Select Alert Tags',
|
|
165
120
|
title: 'Tags',
|
|
166
121
|
isVisible: () => api.internalApi.shouldDisplayTagSections(),
|
|
167
122
|
render: () => (React.createElement(rebass_1.Box, { padding: 2 },
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AlertDefinition } from '../../../PredefinedConfig/AlertState';
|
|
3
3
|
import { FlashingCellDefinition } from '../../../../types';
|
|
4
|
-
declare
|
|
5
|
-
onChange: (data: T) => void;
|
|
6
|
-
};
|
|
7
|
-
export declare const BaseAlertScopeWizardSection: <T extends AlertDefinition>(props: BaseAlertScopeWizardSectionProps<T>) => JSX.Element;
|
|
8
|
-
export declare const renderBaseAlertScopeSummary: (data: AlertDefinition | FlashingCellDefinition) => JSX.Element;
|
|
9
|
-
export {};
|
|
4
|
+
export declare const renderScopeSummary: (data: AlertDefinition | FlashingCellDefinition) => JSX.Element;
|
|
@@ -1,47 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.renderScopeSummary = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
7
7
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
8
|
-
const NewScopeComponent_1 = require("../../Components/NewScopeComponent");
|
|
9
8
|
const ValueSelector_1 = require("../../Components/ValueSelector");
|
|
10
|
-
const
|
|
11
|
-
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
12
|
-
return (React.createElement(rebass_1.Flex, { flexDirection: "column", style: { height: '100%' }, padding: 2 },
|
|
13
|
-
React.createElement(NewScopeComponent_1.NewScopeComponent, { descriptions: {
|
|
14
|
-
rowScope: 'Changes in any Column in the row will trigger an Alert',
|
|
15
|
-
columnScope: 'Changes in selected Columns will trigger an Alert',
|
|
16
|
-
}, scope: data.Scope, updateScope: (Scope) => {
|
|
17
|
-
const newData = Object.assign(Object.assign({}, data), { Scope });
|
|
18
|
-
if (newData.Rule.Predicates) {
|
|
19
|
-
// when scope is changed, reset the rule to predicate of any
|
|
20
|
-
// if it was set to a predicate before
|
|
21
|
-
newData.Rule = {
|
|
22
|
-
Predicates: [{ PredicateId: 'Any' }],
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
if (newData.Rule.ObservableExpression !== undefined && !api.scopeApi.scopeIsAll(Scope)) {
|
|
26
|
-
// if it had observable expression and the scope is changed to partial
|
|
27
|
-
// we need to reset to not be an observable expression, as observable is not supported
|
|
28
|
-
// for partial scope
|
|
29
|
-
delete newData.Rule.ObservableExpression;
|
|
30
|
-
newData.Rule.BooleanExpression = '';
|
|
31
|
-
}
|
|
32
|
-
if (newData.Rule.AggregatedBooleanExpression !== undefined &&
|
|
33
|
-
!api.scopeApi.scopeIsAll(Scope)) {
|
|
34
|
-
// if it had aggregation expression and the scope is changed to partial
|
|
35
|
-
// we need to reset to not be an aggregation expression, as aggregation is not supported
|
|
36
|
-
// for partial scope
|
|
37
|
-
delete newData.Rule.AggregatedBooleanExpression;
|
|
38
|
-
newData.Rule.BooleanExpression = '';
|
|
39
|
-
}
|
|
40
|
-
props.onChange(newData);
|
|
41
|
-
} })));
|
|
42
|
-
};
|
|
43
|
-
exports.BaseAlertScopeWizardSection = BaseAlertScopeWizardSection;
|
|
44
|
-
const renderBaseAlertScopeSummary = (data) => {
|
|
9
|
+
const renderScopeSummary = (data) => {
|
|
45
10
|
const { api: { scopeApi }, } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
46
11
|
const columnsInScope = scopeApi.getColumnsForScope(data.Scope);
|
|
47
12
|
return (React.createElement(React.Fragment, null,
|
|
@@ -53,7 +18,7 @@ const renderBaseAlertScopeSummary = (data) => {
|
|
|
53
18
|
React.createElement(rebass_1.Text, { fontSize: 2, mb: columnsInScope.length ? 2 : 0 }, "Changes in selected columns will trigger an alert"),
|
|
54
19
|
columnsInScope.length ? (React.createElement(ValueSelector_1.ValueOptionsTags, { options: columnsInScope, value: columnsInScope.map((c) => c.columnId), toLabel: (c) => c.friendlyName, allowWrap: true, readOnly: true, renderLabel: (c) => React.createElement(React.Fragment, null, c), toIdentifier: (c) => c.columnId })) : null)) : null),
|
|
55
20
|
React.createElement(rebass_1.Box, null, 'DataTypes' in data.Scope ? (React.createElement(React.Fragment, null,
|
|
56
|
-
React.createElement(rebass_1.Text, { fontSize: 2, mb: 2 }, "Changes in
|
|
21
|
+
React.createElement(rebass_1.Text, { fontSize: 2, mb: 2 }, "Changes in Columns with these Data Types trigger an Alert"),
|
|
57
22
|
React.createElement(ValueSelector_1.ValueOptionsTags, { readOnly: true, options: data.Scope.DataTypes, value: data.Scope.DataTypes, toLabel: (c) => c, allowWrap: true, renderLabel: (c) => React.createElement(React.Fragment, null, `DataType: ${c}`), toIdentifier: (c) => c }))) : null)));
|
|
58
23
|
};
|
|
59
|
-
exports.
|
|
24
|
+
exports.renderScopeSummary = renderScopeSummary;
|
|
@@ -74,7 +74,7 @@ const CalculatedColumnWizard = (props) => {
|
|
|
74
74
|
},
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
|
-
details: 'Select Calculated Column
|
|
77
|
+
details: 'Select Calculated Column Tags',
|
|
78
78
|
title: 'Tags',
|
|
79
79
|
isVisible: () => adaptable.api.internalApi.shouldDisplayTagSections(),
|
|
80
80
|
render: () => (React.createElement(rebass_1.Box, { padding: 2 },
|
|
File without changes
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ChartingStatusBarPopover = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const AdaptableContext_1 = require("
|
|
7
|
-
const ModuleConstants = tslib_1.__importStar(require("
|
|
6
|
+
const AdaptableContext_1 = require("../AdaptableContext");
|
|
7
|
+
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
|
|
8
8
|
const useChartingElements_1 = require("./useChartingElements");
|
|
9
9
|
const rebass_1 = require("rebass");
|
|
10
10
|
const ChartingStatusBarPopover = (props) => {
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ChartDefinition } from '
|
|
3
|
-
import { AdaptableOnePageWizardProps } from '
|
|
2
|
+
import { ChartDefinition } from '../../../types';
|
|
3
|
+
import { AdaptableOnePageWizardProps } from '../../Wizard/Interface/IAdaptableWizard';
|
|
4
4
|
export interface ChartingWizardProps extends AdaptableOnePageWizardProps<ChartDefinition> {
|
|
5
5
|
}
|
|
6
6
|
export declare const ChartingWizard: React.FunctionComponent<ChartingWizardProps>;
|
|
@@ -4,10 +4,11 @@ exports.ChartingWizard = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const rebass_1 = require("rebass");
|
|
7
|
-
const AdaptableContext_1 = require("
|
|
8
|
-
const OnePageAdaptableWizard_1 = require("
|
|
7
|
+
const AdaptableContext_1 = require("../../AdaptableContext");
|
|
8
|
+
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
9
9
|
const PreviewChartSection_1 = require("./PreviewChartSection");
|
|
10
10
|
const SettingsSection_1 = require("./SettingsSection");
|
|
11
|
+
const ObjectTagsWizardSection_1 = require("../../Wizard/ObjectTagsWizardSection");
|
|
11
12
|
const ChartingWizard = (props) => {
|
|
12
13
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
13
14
|
const [chartDefinition, setChartDefinition] = React.useState(() => {
|
|
@@ -26,6 +27,15 @@ const ChartingWizard = (props) => {
|
|
|
26
27
|
render: () => (React.createElement(rebass_1.Box, { padding: 2 },
|
|
27
28
|
React.createElement(SettingsSection_1.SettingsSection, { chartDefinition: chartDefinition, onChange: setChartDefinition }))),
|
|
28
29
|
},
|
|
30
|
+
{
|
|
31
|
+
details: 'Select Chart Tags',
|
|
32
|
+
title: 'Tags',
|
|
33
|
+
isVisible: () => adaptable.api.internalApi.shouldDisplayTagSections(),
|
|
34
|
+
render: () => (React.createElement(rebass_1.Box, { padding: 2 },
|
|
35
|
+
React.createElement(ObjectTagsWizardSection_1.ObjectTagsWizardSection, { onChange: setChartDefinition }))),
|
|
36
|
+
renderSummary: ObjectTagsWizardSection_1.renderObjectTagsSummary,
|
|
37
|
+
},
|
|
38
|
+
'-',
|
|
29
39
|
{
|
|
30
40
|
title: 'Preview Chart',
|
|
31
41
|
details: 'Chart Preview',
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ChartDefinition } from '
|
|
2
|
+
import { ChartDefinition } from '../../../types';
|
|
3
3
|
export declare const PreviewChartSection: React.FunctionComponent<{
|
|
4
4
|
chartDefinition: ChartDefinition;
|
|
5
5
|
onChange: (chartDefinition: ChartDefinition) => void;
|
|
@@ -5,8 +5,8 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_redux_1 = require("react-redux");
|
|
7
7
|
const isEqual_1 = tslib_1.__importDefault(require("lodash/isEqual"));
|
|
8
|
-
const SystemRedux = tslib_1.__importStar(require("
|
|
9
|
-
const AdaptableContext_1 = require("
|
|
8
|
+
const SystemRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/SystemRedux"));
|
|
9
|
+
const AdaptableContext_1 = require("../../AdaptableContext");
|
|
10
10
|
const PreviewChartSection = (props) => {
|
|
11
11
|
const currentChartModels = (0, react_redux_1.useSelector)((state) => SystemRedux.SystemChartingCurrentChartModelsSelector(state.System));
|
|
12
12
|
const [localChartId, setLocalChartId] = React.useState(null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { AdaptableApi, ChartDefinition } from '
|
|
2
|
+
import { AdaptableApi, ChartDefinition } from '../../../types';
|
|
3
3
|
export declare const isSettingsValid: (chartDefinition: ChartDefinition, api: AdaptableApi) => true | string;
|
|
4
4
|
export interface SettingsSectionProps {
|
|
5
5
|
chartDefinition: ChartDefinition;
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SettingsSection = exports.isSettingsValid = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const CheckBox_1 = require("
|
|
7
|
-
const DropdownButton_1 = tslib_1.__importDefault(require("
|
|
8
|
-
const FormLayout_1 = tslib_1.__importStar(require("
|
|
9
|
-
const AdaptableInput_1 = tslib_1.__importDefault(require("../../AdaptableInput"));
|
|
6
|
+
const CheckBox_1 = require("../../../components/CheckBox");
|
|
7
|
+
const DropdownButton_1 = tslib_1.__importDefault(require("../../../components/DropdownButton"));
|
|
8
|
+
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
9
|
+
const AdaptableInput_1 = tslib_1.__importDefault(require("../../Components/AdaptableInput"));
|
|
10
10
|
const isSettingsValid = (chartDefinition, api) => {
|
|
11
11
|
if (!chartDefinition.Name) {
|
|
12
12
|
return 'Name is mandatory';
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DeleteChartButton = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const ButtonDelete_1 = require("../Buttons/ButtonDelete");
|
|
7
|
-
const ChartingRedux = tslib_1.__importStar(require("
|
|
6
|
+
const ButtonDelete_1 = require("../Components/Buttons/ButtonDelete");
|
|
7
|
+
const ChartingRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/ChartingRedux"));
|
|
8
8
|
const DeleteChartButton = (props) => {
|
|
9
9
|
var _a;
|
|
10
|
-
return (React.createElement(ButtonDelete_1.ButtonDelete, { iconSize: props.iconSize, disabled: !props.chart, ConfirmAction: ChartingRedux.ChartingDeleteChart((_a = props.chart) === null || _a === void 0 ? void 0 : _a.Name), ConfirmationMsg: `Are you sure you want to delete this Charts?`, ConfirmationTitle: 'Delete Charts', accessLevel: props.accessLevel }));
|
|
10
|
+
return (React.createElement(ButtonDelete_1.ButtonDelete, { iconSize: props.iconSize, disabled: !props.chart, ConfirmAction: ChartingRedux.ChartingDeleteChart((_a = props.chart) === null || _a === void 0 ? void 0 : _a.Name), ConfirmationMsg: `Are you sure you want to delete this Charts?`, ConfirmationTitle: 'Delete Charts', accessLevel: props.accessLevel, tooltip: "Delete Chart" }));
|
|
11
11
|
};
|
|
12
12
|
exports.DeleteChartButton = DeleteChartButton;
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.EditChartButton = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const PopupRedux = tslib_1.__importStar(require("
|
|
7
|
-
const ButtonEdit_1 = require("../Buttons/ButtonEdit");
|
|
8
|
-
const ModuleConstants = tslib_1.__importStar(require("
|
|
6
|
+
const PopupRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/PopupRedux"));
|
|
7
|
+
const ButtonEdit_1 = require("../Components/Buttons/ButtonEdit");
|
|
8
|
+
const ModuleConstants = tslib_1.__importStar(require("../../Utilities/Constants/ModuleConstants"));
|
|
9
9
|
const react_redux_1 = require("react-redux");
|
|
10
10
|
const EditChartButton = (props) => {
|
|
11
11
|
const dispatch = (0, react_redux_1.useDispatch)();
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ShowChartButton = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const SimpleButton_1 = tslib_1.__importDefault(require("
|
|
7
|
-
const AdaptableContext_1 = require("
|
|
8
|
-
const DropdownButton_1 = tslib_1.__importDefault(require("
|
|
6
|
+
const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
|
|
7
|
+
const AdaptableContext_1 = require("../AdaptableContext");
|
|
8
|
+
const DropdownButton_1 = tslib_1.__importDefault(require("../../components/DropdownButton"));
|
|
9
9
|
const useChartState_1 = require("./useChartState");
|
|
10
10
|
const ShowChartButton = (props) => {
|
|
11
11
|
var _a, _b;
|
|
@@ -13,10 +13,10 @@ const ShowChartButton = (props) => {
|
|
|
13
13
|
const chartContainers = (_b = (_a = adaptable.adaptableOptions) === null || _a === void 0 ? void 0 : _a.chartingOptions) === null || _b === void 0 ? void 0 : _b.chartContainers;
|
|
14
14
|
const { isOpen, showChart, closeChart } = (0, useChartState_1.useChartState)(props.data);
|
|
15
15
|
if (isOpen) {
|
|
16
|
-
return (React.createElement(SimpleButton_1.default, { "data-name": "close-chart-button", onClick: closeChart, variant: "
|
|
16
|
+
return (React.createElement(SimpleButton_1.default, { "data-name": "close-chart-button", onClick: closeChart, variant: "text", tone: "error", icon: "visibility-off", tooltip: "Hide Chart" }));
|
|
17
17
|
}
|
|
18
18
|
if (!(chartContainers === null || chartContainers === void 0 ? void 0 : chartContainers.length)) {
|
|
19
|
-
return (React.createElement(SimpleButton_1.default, { "data-name": "show-chart-button", onClick: () => showChart(), variant: "text", tone: "success"
|
|
19
|
+
return (React.createElement(SimpleButton_1.default, { "data-name": "show-chart-button", onClick: () => showChart(), variant: "text", tone: "success", icon: "visibility", tooltip: "Show Chart" }));
|
|
20
20
|
}
|
|
21
21
|
const containerOptions = [
|
|
22
22
|
{
|
|
@@ -4,20 +4,20 @@ exports.useChartState = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_redux_1 = require("react-redux");
|
|
7
|
-
const AdaptableContext_1 = require("
|
|
8
|
-
const SystemRedux = tslib_1.__importStar(require("
|
|
9
|
-
const LoggingHelper_1 = require("
|
|
7
|
+
const AdaptableContext_1 = require("../AdaptableContext");
|
|
8
|
+
const SystemRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/SystemRedux"));
|
|
9
|
+
const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
|
|
10
10
|
const useChartState = (chartDefinition) => {
|
|
11
11
|
const [chartRef, setChartRef] = React.useState(null);
|
|
12
12
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
13
13
|
const currentChartModels = (0, react_redux_1.useSelector)((state) => SystemRedux.SystemChartingCurrentChartModelsSelector(state.System));
|
|
14
14
|
React.useEffect(() => {
|
|
15
|
-
var _a;
|
|
15
|
+
var _a, _b;
|
|
16
16
|
if (!chartDefinition) {
|
|
17
17
|
setChartRef(null);
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
const currentChartRef = (
|
|
20
|
+
const currentChartRef = (_b = adaptable.api.chartingApi.getChartRef((_a = chartDefinition === null || chartDefinition === void 0 ? void 0 : chartDefinition.Model) === null || _a === void 0 ? void 0 : _a.chartId)) !== null && _b !== void 0 ? _b : null;
|
|
21
21
|
setChartRef(currentChartRef);
|
|
22
22
|
}, [currentChartModels, chartDefinition]);
|
|
23
23
|
const closeAlreadyOpenedChartsInContainer = (element) => {
|