@adaptabletools/adaptable-cjs 23.0.0-canary.4 → 23.0.0-canary.6
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/index.css +117 -62
- package/package.json +9 -4
- package/src/AdaptableOptions/EditOptions.d.ts +2 -2
- package/src/AdaptableState/Common/AggregationColumns.d.ts +14 -6
- package/src/AdaptableState/Common/AggregationColumns.js +30 -3
- package/src/AdaptableState/Common/ColumnScope.d.ts +4 -0
- package/src/AdaptableState/Common/Enums.d.ts +5 -5
- package/src/AdaptableState/Common/Enums.js +4 -4
- package/src/AdaptableState/PlusMinusState.d.ts +3 -3
- package/src/AdaptableState/ShortcutState.d.ts +2 -6
- package/src/AdaptableState/StyledColumnState.d.ts +3 -5
- package/src/AdaptableState/ThemeState.d.ts +33 -28
- package/src/Api/EventApi.d.ts +14 -1
- package/src/Api/Events/ThemeChanged.d.ts +6 -0
- package/src/Api/Events/ThemeSelected.d.ts +11 -0
- package/src/Api/Events/ThemeSelected.js +2 -0
- package/src/Api/Implementation/EventApiImpl.js +4 -0
- package/src/Api/Implementation/LayoutApiImpl.d.ts +0 -2
- package/src/Api/Implementation/LayoutApiImpl.js +0 -14
- package/src/Api/Implementation/LayoutHelpers.d.ts +2 -0
- package/src/Api/Implementation/LayoutHelpers.js +19 -8
- package/src/Api/Implementation/ThemeApiImpl.d.ts +3 -2
- package/src/Api/Implementation/ThemeApiImpl.js +19 -15
- package/src/Api/Internal/EventInternalApi.d.ts +2 -0
- package/src/Api/Internal/EventInternalApi.js +8 -1
- package/src/Api/Internal/StyledColumnInternalApi.d.ts +4 -4
- package/src/Api/Internal/StyledColumnInternalApi.js +4 -4
- package/src/Api/Internal/ThemeInternalApi.d.ts +0 -1
- package/src/Api/Internal/ThemeInternalApi.js +0 -10
- package/src/Api/LayoutApi.d.ts +1 -8
- package/src/Api/ThemeApi.d.ts +6 -2
- package/src/Redux/ActionsReducers/ThemeRedux.d.ts +3 -3
- package/src/Strategy/FormatColumnModule.js +12 -5
- package/src/Strategy/LayoutModule.js +13 -8
- package/src/Strategy/StyledColumnModule.js +58 -30
- package/src/Utilities/Constants/ReduxConstants.d.ts +2 -2
- package/src/Utilities/Constants/ReduxConstants.js +1 -14
- package/src/Utilities/Helpers/FormatHelper.js +20 -1
- package/src/Utilities/Helpers/SparklineOptionsHelper.d.ts +7 -0
- package/src/Utilities/Helpers/SparklineOptionsHelper.js +68 -0
- package/src/Utilities/Helpers/StyledColumnGradientHelper.d.ts +23 -1
- package/src/Utilities/Helpers/StyledColumnGradientHelper.js +212 -1
- package/src/Utilities/Helpers/ThemeHelpers.d.ts +5 -0
- package/src/Utilities/Helpers/ThemeHelpers.js +43 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.d.ts +19 -0
- package/src/Utilities/Helpers/percentBarPreviewHelper.js +155 -0
- package/src/Utilities/ObjectFactory.d.ts +1 -3
- package/src/Utilities/ObjectFactory.js +0 -9
- package/src/Utilities/Services/ThemeService.js +1 -1
- package/src/View/Alert/Wizard/AlertBehaviourWizardSection.js +17 -16
- package/src/View/Alert/Wizard/AlertButtonsEditor.js +113 -102
- package/src/View/Alert/Wizard/AlertMessageWizardSection.js +12 -13
- package/src/View/Alert/Wizard/AlertNotificationWizardSection.js +54 -54
- package/src/View/Alert/Wizard/AlertRulesWizardSection.js +4 -3
- package/src/View/Alert/Wizard/AlertScheduledWizardSection.js +1 -1
- package/src/View/Alert/Wizard/AlertScopeWizardSection.js +29 -37
- package/src/View/Alert/Wizard/AlertTypeWizardSection.js +2 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnDefinitionWizardSection.js +9 -13
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnExpressionWizardSection.js +28 -15
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +7 -9
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnTypeSection.js +2 -2
- package/src/View/CellSummary/CellSummaryViewPanel.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/AgChargingWizard.js +3 -10
- package/src/View/Charting/ChartingWizard/AgChargingWizard/PreviewChartSection.js +1 -1
- package/src/View/Charting/ChartingWizard/AgChargingWizard/SettingsSection.js +32 -41
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/ExternalChartingWizard.js +4 -31
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.d.ts +5 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/PreviewChartSection.js +26 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.d.ts +1 -0
- package/src/View/Charting/ChartingWizard/ExternalChartingWizard/SettingsSection.js +9 -6
- package/src/View/Comments/CommentsEditor.js +1 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInput.js +0 -1
- package/src/View/Components/ColumnFilter/components/ColumnFilterInputList.js +3 -1
- package/src/View/Components/ModuleProfile.js +1 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.d.ts +0 -1
- package/src/View/Components/Popups/WindowPopups/windowFactory.js +1 -2
- package/src/View/Components/RangesComponent.d.ts +7 -2
- package/src/View/Components/RangesComponent.js +94 -22
- package/src/View/Components/StyleComponent.d.ts +1 -0
- package/src/View/Components/StyleComponent.js +1 -1
- package/src/View/Components/ValueSelector/index.js +70 -57
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +8 -13
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +8 -8
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +1 -1
- package/src/View/DataImport/DataImportWizard/sections/ColumnsSection.js +11 -12
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadSection.js +5 -4
- package/src/View/DataImport/DataImportWizard/sections/UploadSection/UploadTextSection.js +2 -1
- package/src/View/DataImport/DataImportWizard/sections/ValidationSection.js +4 -15
- package/src/View/Export/Wizard/ReportColumnsWizardSection.js +24 -27
- package/src/View/Export/Wizard/ReportNameWizardSection.js +8 -11
- package/src/View/Export/Wizard/ReportRowsWizardSection.js +19 -22
- package/src/View/Export/Wizard/ScheduledReportSettings.d.ts +2 -0
- package/src/View/Export/Wizard/ScheduledReportSettings.js +12 -12
- package/src/View/Export/Wizard/ScheduledReportWizard.js +2 -3
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +8 -6
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +19 -20
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +20 -11
- package/src/View/FlashingCell/Wizard/FlashingCellStyleWizardSection.js +19 -3
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +4 -4
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.d.ts +7 -0
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +120 -13
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.d.ts +15 -0
- package/src/View/FormatColumn/Wizard/FormatColumnPreview.js +78 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.d.ts +4 -0
- package/src/View/FormatColumn/Wizard/FormatColumnRuleWizardSection.js +34 -0
- package/src/View/FormatColumn/Wizard/FormatColumnScopeWizardSection.js +11 -6
- package/src/View/FormatColumn/Wizard/FormatColumnSettingsWizardSection.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.d.ts +3 -1
- package/src/View/FormatColumn/Wizard/FormatColumnStyleWizardSection.js +64 -13
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +3 -1
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.d.ts +2 -0
- package/src/View/FreeTextColumn/Utilities/getFreeTextColumnSettingsTags.js +19 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.d.ts +10 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnDefinitionWizardSection.js +60 -0
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.d.ts +2 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +35 -70
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +14 -10
- package/src/View/Layout/TransposedPopup.js +2 -2
- package/src/View/Layout/Wizard/LayoutWizard.js +3 -3
- package/src/View/Layout/Wizard/sections/AggregationsSection.d.ts +2 -3
- package/src/View/Layout/Wizard/sections/AggregationsSection.js +116 -26
- package/src/View/Layout/Wizard/sections/ColumnsSection.js +79 -79
- package/src/View/Layout/Wizard/sections/FilterSection.js +31 -32
- package/src/View/Layout/Wizard/sections/GridFilterSection.js +10 -10
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.d.ts +1 -2
- package/src/View/Layout/Wizard/sections/PivotAggregationsSection.js +101 -51
- package/src/View/Layout/Wizard/sections/PivotColumnsSection.js +9 -8
- package/src/View/Layout/Wizard/sections/PivotRowGroupingSection.js +4 -4
- package/src/View/Layout/Wizard/sections/RowGroupingSection.js +36 -33
- package/src/View/Layout/Wizard/sections/RowSelectionSection.js +2 -2
- package/src/View/Layout/Wizard/sections/RowSummarySection.js +95 -73
- package/src/View/Layout/Wizard/sections/SettingsSection.js +3 -4
- package/src/View/Layout/Wizard/sections/SortSection.js +2 -2
- package/src/View/NamedQuery/Wizard/NamedQueryExpressionWizardSection.js +1 -1
- package/src/View/NamedQuery/Wizard/NamedQuerySettingsWizardSection.js +7 -12
- package/src/View/NamedQuery/Wizard/NamedQueryWizard.js +1 -3
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.d.ts +4 -0
- package/src/View/PlusMinus/Wizard/PlusMinusRuleWizardSection.js +45 -12
- package/src/View/PlusMinus/Wizard/PlusMinusScopeWizardSection.js +10 -17
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.d.ts +2 -6
- package/src/View/PlusMinus/Wizard/PlusMinusSettingsWizardSection.js +5 -21
- package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +15 -21
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +2 -2
- package/src/View/Shortcut/Wizard/ShortcutScopeWizardSection.js +10 -17
- package/src/View/Shortcut/Wizard/ShortcutSettingsWizard.js +16 -5
- package/src/View/Shortcut/Wizard/ShortcutWizard.js +2 -2
- package/src/View/Shortcut/shortcutOperations.d.ts +3 -0
- package/src/View/Shortcut/shortcutOperations.js +32 -1
- package/src/View/SpecialColumnSettingsWizardStep.js +7 -6
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/BadgePillStyleEditor.js +26 -16
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.d.ts +10 -2
- package/src/View/StyledColumn/Wizard/StyledColumnBadgeSection.js +100 -15
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.d.ts +14 -0
- package/src/View/StyledColumn/Wizard/StyledColumnSliceStyleEditors.js +48 -25
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.d.ts +2 -3
- package/src/View/StyledColumn/Wizard/StyledColumnSparklineSettingsSection.js +109 -33
- package/src/View/StyledColumn/Wizard/StyledColumnWizard.js +20 -12
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardBulletSection.js +124 -23
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.d.ts +1 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardGradientSection.js +35 -11
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardIconSection.js +88 -11
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRangeBarSection.js +125 -35
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.d.ts +1 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardRatingSection.js +55 -74
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/BulletRangesSummaryPreview.js +20 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/GradientSummaryPreview.js +6 -12
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarColumnComparisonPreview.js +5 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarRangesPreview.js +2 -1
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.d.ts +5 -4
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/PercentBarStylePreview.js +11 -13
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.d.ts +5 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/RangeBarRangesSummaryPreview.js +20 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.d.ts +3 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgePreview.js +32 -3
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.d.ts +9 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBulletPreview.js +64 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnGradientPreview.js +35 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnIconPreview.js +96 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnPercentBarPreview.js +57 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.d.ts +8 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRangeBarPreview.js +58 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.d.ts +18 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnRatingPreview.js +66 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.d.ts +10 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnSparklinePreview.js +133 -0
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardRangesSection.js +12 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.d.ts +1 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/StyledColumnWizardStyleSection.js +53 -29
- package/src/View/SystemStatus/Utilities/getStatusItemStyle.js +1 -1
- package/src/View/Theme/ThemePopup.d.ts +2 -14
- package/src/View/Theme/ThemePopup.js +1 -36
- package/src/View/UIHelper.js +1 -1
- package/src/View/Wizard/OnePageAdaptableWizard.js +6 -20
- package/src/agGrid/AdaptableAgGrid.d.ts +1 -0
- package/src/agGrid/AdaptableAgGrid.js +34 -24
- package/src/agGrid/AgGridAdapter.d.ts +1 -1
- package/src/agGrid/AgGridAdapter.js +27 -17
- package/src/agGrid/AgGridColumnAdapter.js +9 -15
- package/src/agGrid/AgGridMenuAdapter.d.ts +0 -1
- package/src/agGrid/AgGridMenuAdapter.js +20 -37
- package/src/agGrid/buildValueAggregationMenuItem.d.ts +19 -0
- package/src/agGrid/buildValueAggregationMenuItem.js +114 -0
- package/src/agGrid/cellRenderers/IconRenderer.d.ts +6 -0
- package/src/agGrid/cellRenderers/IconRenderer.js +46 -17
- package/src/agGrid/createAgGridIcon.d.ts +10 -0
- package/src/agGrid/createAgGridIcon.js +19 -0
- package/src/components/DragAndDropContext/UnusedPanel.js +1 -1
- package/src/components/ExpressionEditor/BaseEditorInput.js +1 -1
- package/src/components/ExpressionEditor/ExpressionFunctionDocumentation.js +1 -1
- package/src/components/Input/NumberInput.js +1 -1
- package/src/components/Panel/index.js +1 -1
- package/src/components/SimpleButton/index.js +4 -4
- package/src/components/Toggle/Toggle.js +1 -1
- package/src/components/Toggle/ToggleGroup.js +1 -1
- package/src/env.js +2 -2
- package/src/layout-manager/src/index.js +2 -9
- package/src/metamodel/adaptable.metamodel.d.ts +39 -29
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +5 -4
- package/themes/dark.css +1 -68
- package/themes/light.css +1 -5
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/src/Aggregation/ParameterizedAggregationRegistry.d.ts +0 -35
- package/src/Aggregation/ParameterizedAggregationRegistry.js +0 -74
- package/src/Aggregation/definitions/weightedAverageAggregationDefinition.d.ts +0 -3
- package/src/Aggregation/definitions/weightedAverageAggregationDefinition.js +0 -58
- package/src/Aggregation/parameterizedAggregationColumnMenu.d.ts +0 -8
- package/src/Aggregation/parameterizedAggregationColumnMenu.js +0 -143
- package/src/Aggregation/parameterizedAggregationHeader.d.ts +0 -13
- package/src/Aggregation/parameterizedAggregationHeader.js +0 -65
- package/src/Aggregation/parameterizedAggregationHelpers.d.ts +0 -23
- package/src/Aggregation/parameterizedAggregationHelpers.js +0 -121
- package/src/Aggregation/parameterizedAggregationWizardHelpers.d.ts +0 -9
- package/src/Aggregation/parameterizedAggregationWizardHelpers.js +0 -74
- package/src/Aggregation/validateParameterizedAggregations.d.ts +0 -4
- package/src/Aggregation/validateParameterizedAggregations.js +0 -25
- package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.d.ts +0 -12
- package/src/View/Layout/Wizard/sections/ParameterizedAggFuncPicker.js +0 -48
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.d.ts +0 -5
- package/src/View/StyledColumn/Wizard/StyledColumnWizardStyleSection/Components/StyledColumnBadgeSettings.js +0 -32
- package/src/View/Theme/VariantSelector.d.ts +0 -8
- package/src/View/Theme/VariantSelector.js +0 -25
|
@@ -13,6 +13,7 @@ const AdaptableIconSelector_1 = require("../../Components/AdaptableIconSelector"
|
|
|
13
13
|
const Flex_1 = require("../../../components/Flex");
|
|
14
14
|
const sentenceCase_1 = tslib_1.__importDefault(require("../../../Utilities/utils/sentenceCase"));
|
|
15
15
|
const NewSelect_1 = require("../../../components/NewSelect");
|
|
16
|
+
const Card_1 = require("../../../components/Card");
|
|
16
17
|
const TONE_OPTIONS = [
|
|
17
18
|
{
|
|
18
19
|
label: 'Tone: Use Alert Tone',
|
|
@@ -25,6 +26,14 @@ const TONE_OPTIONS = [
|
|
|
25
26
|
};
|
|
26
27
|
}),
|
|
27
28
|
];
|
|
29
|
+
const AlertButtonPreview = ({ button, messageType }) => {
|
|
30
|
+
const buttonStyle = button.ButtonStyle ?? {};
|
|
31
|
+
const variant = (buttonStyle.variant ?? 'raised');
|
|
32
|
+
const tone = (buttonStyle.tone ??
|
|
33
|
+
messageType.toLowerCase());
|
|
34
|
+
const icon = button.icon && 'name' in button.icon && button.icon.name ? button.icon : undefined;
|
|
35
|
+
return ((0, jsx_runtime_1.jsx)(SimpleButton_1.default, { variant: variant, tone: tone, icon: icon, className: "twa:cursor-default twa:pointer-events-none", tabIndex: -1, children: button.Label || 'Untitled' }));
|
|
36
|
+
};
|
|
28
37
|
function renderTone(option) {
|
|
29
38
|
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(SimpleButton_1.default, { className: "twa:mr-2 twa:w-[10px] twa:h-[10px] twa:line-height-0 twa:rounded-[100%] twa:bg-current", tone: option.value, variant: "text" }), option.label] }));
|
|
30
39
|
}
|
|
@@ -34,6 +43,7 @@ const AlertButtonsEditor = (props) => {
|
|
|
34
43
|
props.onChange(newButtons);
|
|
35
44
|
};
|
|
36
45
|
const alertDefinition = adaptableAlert.alertDefinition;
|
|
46
|
+
const messageType = alertDefinition?.MessageType ?? 'Info';
|
|
37
47
|
// const rowAddedAlert =
|
|
38
48
|
// api.alertApi.internalApi.isAlertDefinitionForAddedRowChangeEvent(alertDefinition);
|
|
39
49
|
const isRowRemovedAlert = api.alertApi.internalApi.isAlertDefinitionForRemovedRowChangeEvent(alertDefinition);
|
|
@@ -75,7 +85,7 @@ const AlertButtonsEditor = (props) => {
|
|
|
75
85
|
buttonCommands.push(ch.name);
|
|
76
86
|
});
|
|
77
87
|
}
|
|
78
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
88
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:mt-3", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", alignItems: "center", justifyContent: "space-between", className: "twa:mb-3", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2 twa:max-w-[520px]", children: "Add buttons to the notification and set actions to perform when clicked" }), (0, jsx_runtime_1.jsx)(SimpleButton_1.default, { icon: "plus", onClick: () => {
|
|
79
89
|
onChange([
|
|
80
90
|
...(AlertButtons || []),
|
|
81
91
|
{
|
|
@@ -85,110 +95,111 @@ const AlertButtonsEditor = (props) => {
|
|
|
85
95
|
},
|
|
86
96
|
},
|
|
87
97
|
]);
|
|
88
|
-
}, children: "Add" })] }), AlertButtons.map((button, index) => {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
}
|
|
110
|
-
return btn;
|
|
111
|
-
}));
|
|
112
|
-
};
|
|
113
|
-
const setTone = (tone) => {
|
|
114
|
-
onChange(AlertButtons.map((btn, i) => {
|
|
115
|
-
if (i === index) {
|
|
116
|
-
const buttonStyle = { ...btn.ButtonStyle };
|
|
117
|
-
if (tone == null) {
|
|
118
|
-
delete buttonStyle.tone;
|
|
98
|
+
}, children: "Add" })] }), (0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3", children: AlertButtons.map((button, index) => {
|
|
99
|
+
let buttonStyle = button.ButtonStyle;
|
|
100
|
+
let buttonLabel = button.Label;
|
|
101
|
+
let btnCommands = [];
|
|
102
|
+
if (button.Command && typeof button.Command === 'string') {
|
|
103
|
+
btnCommands = [button.Command];
|
|
104
|
+
}
|
|
105
|
+
else if (button.Command && Array.isArray(button.Command)) {
|
|
106
|
+
btnCommands = button.Command;
|
|
107
|
+
}
|
|
108
|
+
// filter out the adaptable standard commands
|
|
109
|
+
const btnUserFunctions = btnCommands.filter((command) => !buttonCommands.includes(command));
|
|
110
|
+
const setVariant = (variant) => {
|
|
111
|
+
onChange(AlertButtons.map((btn, i) => {
|
|
112
|
+
if (i === index) {
|
|
113
|
+
const buttonStyle = { ...btn.ButtonStyle };
|
|
114
|
+
buttonStyle.variant = variant;
|
|
115
|
+
return {
|
|
116
|
+
...btn,
|
|
117
|
+
ButtonStyle: buttonStyle,
|
|
118
|
+
};
|
|
119
119
|
}
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
return btn;
|
|
121
|
+
}));
|
|
122
|
+
};
|
|
123
|
+
const setTone = (tone) => {
|
|
124
|
+
onChange(AlertButtons.map((btn, i) => {
|
|
125
|
+
if (i === index) {
|
|
126
|
+
const buttonStyle = { ...btn.ButtonStyle };
|
|
127
|
+
if (tone == null) {
|
|
128
|
+
delete buttonStyle.tone;
|
|
129
|
+
}
|
|
130
|
+
else {
|
|
131
|
+
buttonStyle.tone = tone;
|
|
132
|
+
}
|
|
133
|
+
return {
|
|
134
|
+
...btn,
|
|
135
|
+
ButtonStyle: buttonStyle,
|
|
136
|
+
};
|
|
122
137
|
}
|
|
123
|
-
return
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
138
|
+
return btn;
|
|
139
|
+
}));
|
|
140
|
+
};
|
|
141
|
+
const handleCommandChange = (checked, commandName) => {
|
|
142
|
+
let commands = btnCommands;
|
|
143
|
+
if (!checked) {
|
|
144
|
+
// remove current Command
|
|
145
|
+
commands = commands.filter((a) => a !== commandName);
|
|
127
146
|
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
};
|
|
131
|
-
const handleCommandChange = (checked, commandName) => {
|
|
132
|
-
let commands = btnCommands;
|
|
133
|
-
if (!checked) {
|
|
134
|
-
// remove current Command
|
|
135
|
-
commands = commands.filter((a) => a !== commandName);
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
commands = [...commands, commandName];
|
|
139
|
-
}
|
|
140
|
-
onChange(AlertButtons.map((btn, i) => {
|
|
141
|
-
if (i === index) {
|
|
142
|
-
return {
|
|
143
|
-
...btn,
|
|
144
|
-
Command: commands.length ? commands : undefined,
|
|
145
|
-
};
|
|
147
|
+
else {
|
|
148
|
+
commands = [...commands, commandName];
|
|
146
149
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
150
|
+
onChange(AlertButtons.map((btn, i) => {
|
|
151
|
+
if (i === index) {
|
|
152
|
+
return {
|
|
153
|
+
...btn,
|
|
154
|
+
Command: commands.length ? commands : undefined,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
return btn;
|
|
158
|
+
}));
|
|
159
|
+
};
|
|
160
|
+
let iconSelector = null;
|
|
161
|
+
if (!button.icon || (button.icon && 'name' in button.icon)) {
|
|
162
|
+
iconSelector = ((0, jsx_runtime_1.jsx)(AdaptableIconSelector_1.AdaptableIconSelector, { value: button.icon && 'name' in button.icon ? button?.icon?.name : '', onChange: (iconName) => {
|
|
163
|
+
onChange(AlertButtons.map((btn) => {
|
|
164
|
+
if (btn === button) {
|
|
165
|
+
return {
|
|
166
|
+
...btn,
|
|
167
|
+
icon: {
|
|
168
|
+
name: iconName,
|
|
169
|
+
},
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
return btn;
|
|
173
|
+
}));
|
|
174
|
+
} }));
|
|
175
|
+
}
|
|
176
|
+
return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { className: "twa:justify-between twa:gap-3", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:font-medium twa:shrink-0", children: ["Button ", index + 1] }), (0, jsx_runtime_1.jsx)(Flex_1.Flex, { justifyContent: "center", className: "twa:flex-1 twa:min-w-0", children: (0, jsx_runtime_1.jsx)(AlertButtonPreview, { button: button, messageType: messageType }) }), (0, jsx_runtime_1.jsx)(SimpleButton_1.default, { icon: "close", tone: "error", disabled: AlertButtons.length <= 1, variant: "text", tooltip: AlertButtons.length <= 1 ? 'Cannot remove last button' : 'Remove button', onClick: () => {
|
|
177
|
+
onChange(AlertButtons.filter((btn) => btn !== button));
|
|
178
|
+
} })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(FormLayout_1.default, { children: [(0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: "Button Text" }), children: (0, jsx_runtime_1.jsx)(Input_1.default, { value: buttonLabel, className: "twa:max-w-[200px]", onChange: (e) => {
|
|
179
|
+
onChange(AlertButtons.map((btn, i) => {
|
|
180
|
+
if (i === index) {
|
|
181
|
+
return { ...btn, Label: e.target.value };
|
|
182
|
+
}
|
|
183
|
+
return btn;
|
|
184
|
+
}));
|
|
185
|
+
} }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: "Style" }), children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", className: "twa:gap-2 twa:flex-wrap", children: [(0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { items: ['text', 'outlined', 'raised'].map((variant) => {
|
|
186
|
+
return {
|
|
187
|
+
label: StringExtensions_1.default.CapitaliseFirstLetter(variant),
|
|
188
|
+
value: variant,
|
|
189
|
+
};
|
|
190
|
+
}), renderValue: (option) => `Variant: ${option.label}`, value: buttonStyle?.variant, onValueChange: (value) => {
|
|
191
|
+
setVariant(value);
|
|
192
|
+
} }), (0, jsx_runtime_1.jsx)(NewSelect_1.SingleSelect, { items: TONE_OPTIONS, onValueChange: (value) => {
|
|
193
|
+
if (value === 'text') {
|
|
194
|
+
setTone(null);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
setTone(value);
|
|
198
|
+
}, value: buttonStyle?.tone ?? 'text' })] }) }), (0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: "Actions" }), children: (0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", className: "twa:gap-3 twa:flex-wrap", children: [buttonCommands.map((commandName) => {
|
|
199
|
+
return ((0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { onChange: (checked) => handleCommandChange(checked, commandName), checked: button.Command === commandName ||
|
|
200
|
+
(Array.isArray(button.Command) &&
|
|
201
|
+
button.Command.includes(commandName)), children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: (0, sentenceCase_1.default)(commandName) }) }, commandName));
|
|
202
|
+
}), btnUserFunctions.length ? ((0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { checked: true, disabled: true, children: (0, jsx_runtime_1.jsxs)(Flex_1.Box, { className: "twa:text-2", children: ["User function", btnUserFunctions.length > 1 ? 's' : '', ":", ' ', btnUserFunctions.join(', ')] }) })) : null] }) }), iconSelector && ((0, jsx_runtime_1.jsx)(FormLayout_1.FormRow, { label: (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: "Icon" }), children: (0, jsx_runtime_1.jsx)(Flex_1.Box, { children: iconSelector }) }))] }) })] }, index));
|
|
203
|
+
}) })] }));
|
|
193
204
|
};
|
|
194
205
|
exports.AlertButtonsEditor = AlertButtonsEditor;
|
|
@@ -3,21 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AlertMessageWizardSection = exports.renderAlertMessageSummary = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const Tabs_1 = require("../../../components/Tabs");
|
|
7
6
|
const Radio_1 = tslib_1.__importStar(require("../../../components/Radio"));
|
|
8
7
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
9
8
|
const Tag_1 = require("../../../components/Tag");
|
|
10
|
-
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
11
9
|
const getAlertType_1 = require("../Utilities/getAlertType");
|
|
12
10
|
const ButtonInfo_1 = require("../../Components/Buttons/ButtonInfo");
|
|
13
11
|
const DocumentationLinkConstants_1 = require("../../../Utilities/Constants/DocumentationLinkConstants");
|
|
14
12
|
const Textarea_1 = tslib_1.__importDefault(require("../../../components/Textarea"));
|
|
15
13
|
const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlock"));
|
|
16
14
|
const Flex_1 = require("../../../components/Flex");
|
|
15
|
+
const Card_1 = require("../../../components/Card");
|
|
17
16
|
const renderAlertMessageSummary = (alertType) => {
|
|
18
17
|
const { data } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
19
18
|
if (alertType === getAlertType_1.AlertType.Scheduled) {
|
|
20
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(OnePageAdaptableWizard_1.SummaryText, { children: ["Message Type: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: data.MessageType })] }), (0, jsx_runtime_1.jsxs)(OnePageAdaptableWizard_1.SummaryText, { children: ["Header: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: data.MessageHeader || 'Not specified' })] }), (0, jsx_runtime_1.jsxs)(OnePageAdaptableWizard_1.SummaryText, { children: ["
|
|
19
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(OnePageAdaptableWizard_1.SummaryText, { children: ["Message Type: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: data.MessageType })] }), (0, jsx_runtime_1.jsxs)(OnePageAdaptableWizard_1.SummaryText, { children: ["Header: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: data.MessageHeader || 'Not specified' })] }), (0, jsx_runtime_1.jsxs)(OnePageAdaptableWizard_1.SummaryText, { children: ["Body: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: data.MessageText || 'Not specified' })] })] }));
|
|
21
20
|
}
|
|
22
21
|
return ((0, jsx_runtime_1.jsxs)(OnePageAdaptableWizard_1.SummaryText, { children: ["Message Type: ", (0, jsx_runtime_1.jsx)(Tag_1.Tag, { children: data.MessageType })] }));
|
|
23
22
|
};
|
|
@@ -45,15 +44,15 @@ const AlertMessageWizardSection = (props) => {
|
|
|
45
44
|
MessageHeader: value,
|
|
46
45
|
});
|
|
47
46
|
};
|
|
48
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
47
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { "data-name": "message-type", children: (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Message Type" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose how the Alert message is styled" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: (0, jsx_runtime_1.jsxs)(Radio_1.RadioGroup, { value: messageType, name: "messageType", orientation: "horizontal", onRadioChange: (MessageType) => {
|
|
48
|
+
props.onChange({
|
|
49
|
+
...data,
|
|
50
|
+
MessageType,
|
|
51
|
+
});
|
|
52
|
+
}, children: [(0, jsx_runtime_1.jsx)(Radio_1.default, { className: "twa:ml-1", value: "Info", children: "Info" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { className: "twa:ml-4", value: "Success", children: "Success" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { className: "twa:ml-4", value: "Warning", children: "Warning" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { className: "twa:ml-4", value: "Error", children: "Error" })] }) })] }) }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { "data-name": "message-header", children: (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Header" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: isScheduled
|
|
53
|
+
? 'Enter the header shown when this scheduled alert fires'
|
|
54
|
+
: 'Optional header text (leave blank to use the default)' })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { className: "twa:p-1", children: (0, jsx_runtime_1.jsx)(Textarea_1.default, { className: "twa:min-w-[300px] twa:w-full twa:max-w-[500px]", rows: 3, placeholder: isScheduled ? 'Enter header (required)' : '(Use Default Header Message)', type: 'text', autoFocus: false, value: messageHeader, onChange: (e) => onMessageHeaderChange(e) }) })] }) }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { "data-name": "message-body", children: (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Body" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: isScheduled
|
|
55
|
+
? 'Enter the message body shown when this scheduled alert fires'
|
|
56
|
+
: 'Alert message body (leave blank to show automated message based on Alert Type)' })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card.Body, { className: "twa:p-1", children: [(0, jsx_runtime_1.jsx)(Textarea_1.default, { className: "twa:min-w-[300px] twa:w-full twa:max-w-[500px]", rows: 3, type: 'text', autoFocus: false, placeholder: isScheduled ? 'Enter message (required)' : undefined, value: messageText, onChange: (e) => onMessageTextChange(e) }), showDocumentationLinks && !isScheduled && ((0, jsx_runtime_1.jsxs)(HelpBlock_1.default, { "data-name": "alert-message-documentation", className: "twa:mt-3 twa:p-0 twa:text-3", children: [(0, jsx_runtime_1.jsx)(ButtonInfo_1.ButtonInfo, { className: "twa:mr-2", onClick: () => window.open(DocumentationLinkConstants_1.AlertMessageDocsLink, '_blank') }), "See how to create dynamic Alert Messages using placeholders"] }))] })] }) })] }));
|
|
58
57
|
};
|
|
59
58
|
exports.AlertMessageWizardSection = AlertMessageWizardSection;
|
|
@@ -4,7 +4,6 @@ exports.AlertNotificationWizardSection = exports.AlertPreview = exports.renderAl
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
6
|
const React = tslib_1.__importStar(require("react"));
|
|
7
|
-
const Tabs_1 = require("../../../components/Tabs");
|
|
8
7
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
9
8
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
10
9
|
const AdaptablePopupAlert_1 = require("../../Components/Popups/AdaptablePopupAlert");
|
|
@@ -14,6 +13,7 @@ const ScheduledAlertHelper_1 = require("../../../Utilities/Helpers/ScheduledAler
|
|
|
14
13
|
const alertFormHelper_1 = require("../../../Utilities/Helpers/alertFormHelper");
|
|
15
14
|
const Flex_1 = require("../../../components/Flex");
|
|
16
15
|
const clsx_1 = tslib_1.__importDefault(require("clsx"));
|
|
16
|
+
const Card_1 = require("../../../components/Card");
|
|
17
17
|
const renderAlertNotificationSummary = () => {
|
|
18
18
|
const { data, api } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
19
19
|
if (!data.AlertProperties?.DisplayNotification) {
|
|
@@ -88,58 +88,58 @@ const AlertNotificationWizardSection = (props) => {
|
|
|
88
88
|
},
|
|
89
89
|
});
|
|
90
90
|
};
|
|
91
|
-
return ((0, jsx_runtime_1.jsxs)(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
91
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { "data-name": "display-options", children: (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Notification Options" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose whether to display a notification when the Alert fires" })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card.Body, { children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", alignItems: "flex-start", className: isScheduled ? 'twa:gap-4' : undefined, children: [(0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { className: isScheduled ? 'twa:my-0' : undefined, checked: data.AlertProperties?.DisplayNotification, onChange: (DisplayNotification) => {
|
|
92
|
+
if (isScheduled && scheduledData) {
|
|
93
|
+
updateScheduledProperties({ DisplayNotification });
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const ruleData = data;
|
|
97
|
+
const newAlertDefinition = {
|
|
98
|
+
...ruleData,
|
|
99
|
+
AlertProperties: {
|
|
100
|
+
...ruleData.AlertProperties,
|
|
101
|
+
DisplayNotification,
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
if (!DisplayNotification && typeof newAlertDefinition.AlertForm === 'object') {
|
|
105
|
+
delete newAlertDefinition.AlertForm.Buttons;
|
|
106
|
+
}
|
|
107
|
+
if (DisplayNotification) {
|
|
108
|
+
newAlertDefinition.AlertForm =
|
|
109
|
+
newAlertDefinition.AlertForm ??
|
|
110
|
+
api.alertApi.internalApi.getDefaultAlertNotificationForm();
|
|
111
|
+
}
|
|
112
|
+
if (DisplayNotification &&
|
|
113
|
+
typeof newAlertDefinition.AlertForm === 'object' &&
|
|
114
|
+
(!newAlertDefinition.AlertForm?.Buttons ||
|
|
115
|
+
newAlertDefinition.AlertForm?.Buttons?.length === 0)) {
|
|
116
|
+
newAlertDefinition.AlertForm.Buttons = [
|
|
117
|
+
api.alertApi.internalApi.getDefaultButton(),
|
|
118
|
+
];
|
|
119
|
+
}
|
|
120
|
+
props.onChange(newAlertDefinition);
|
|
121
|
+
}, children: isScheduled
|
|
122
|
+
? 'Display a Notification when the Schedule is triggered'
|
|
123
|
+
: 'Display a Notification when Alert is triggered (with action buttons)' }), isScheduled && scheduledData && data.AlertProperties?.DisplayNotification ? ((0, jsx_runtime_1.jsx)(CheckBox_1.CheckBox, { className: "twa:my-0", checked: includeSuspendButton, onChange: (IncludeSuspendButton) => {
|
|
124
|
+
updateScheduledProperties({ IncludeSuspendButton });
|
|
125
|
+
}, children: "Include Suspend button on notification" })) : null] }), data.AlertProperties?.DisplayNotification && !isScheduled
|
|
126
|
+
? (() => {
|
|
127
|
+
const ruleData = data;
|
|
128
|
+
const alertForm = ruleData.AlertForm;
|
|
129
|
+
if (typeof alertForm === 'string') {
|
|
130
|
+
return ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2 twa:mt-3", children: "Alert buttons cannot be customized because form is dynamically driven" }));
|
|
131
|
+
}
|
|
132
|
+
return ((0, jsx_runtime_1.jsx)(AlertButtonsEditor_1.AlertButtonsEditor, { alertType: props.alertType, AlertButtons: alertForm?.Buttons, api: api, adaptableAlert: adaptableAlert, onChange: (buttons) => {
|
|
133
|
+
props.onChange({
|
|
134
|
+
...ruleData,
|
|
135
|
+
AlertForm: {
|
|
136
|
+
...(alertForm ?? { fields: [] }),
|
|
137
|
+
Buttons: buttons,
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
} }));
|
|
141
|
+
})()
|
|
142
|
+
: null] })] }) }), data.AlertProperties?.DisplayNotification ? ((0, jsx_runtime_1.jsx)(Flex_1.Box, { "data-name": "alert-preview", children: (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:font-medium", children: "Alert Preview" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Preview how the notification will appear when triggered" })] }), (0, jsx_runtime_1.jsx)(Card_1.Card.Body, { children: !isScheduled &&
|
|
143
|
+
typeof data.AlertForm === 'string' ? ((0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-2", children: "Preview not available because form is dynamically driven" })) : ((0, jsx_runtime_1.jsx)(exports.AlertPreview, { alertDefinition: data, api: api })) })] }) })) : null] }));
|
|
144
144
|
};
|
|
145
145
|
exports.AlertNotificationWizardSection = AlertNotificationWizardSection;
|
|
@@ -8,10 +8,11 @@ const EntityRulesEditor_1 = require("../../Components/EntityRulesEditor");
|
|
|
8
8
|
const Tag_1 = require("../../../components/Tag");
|
|
9
9
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
10
10
|
const getAvailablePredicates_1 = require("../Utilities/getAvailablePredicates");
|
|
11
|
-
const Tabs_1 = require("../../../components/Tabs");
|
|
12
11
|
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
13
|
-
const
|
|
12
|
+
const Card_1 = require("../../../components/Card");
|
|
14
13
|
const Flex_1 = require("../../../components/Flex");
|
|
14
|
+
const GeneralConstants_1 = require("./../../../Utilities/Constants/GeneralConstants");
|
|
15
|
+
const Flex_2 = require("../../../components/Flex");
|
|
15
16
|
const getRuleStepDescription = (alertType) => {
|
|
16
17
|
switch (alertType) {
|
|
17
18
|
case 'DataChange':
|
|
@@ -56,7 +57,7 @@ const RowChangeEditor = (props) => {
|
|
|
56
57
|
},
|
|
57
58
|
});
|
|
58
59
|
};
|
|
59
|
-
return ((0, jsx_runtime_1.jsx)(Flex_1.
|
|
60
|
+
return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: (0, jsx_runtime_1.jsxs)(Card_1.Card, { shadow: false, children: [(0, jsx_runtime_1.jsxs)(Card_1.Card.Title, { children: [(0, jsx_runtime_1.jsx)(Flex_2.Box, { className: "twa:font-medium", children: "Row Change" }), (0, jsx_runtime_1.jsx)(Flex_2.Box, { className: "twa:text-xs twa:opacity-70 twa:font-normal twa:max-w-[520px]", children: "Choose which type of Row Change will trigger the Alert" })] }), (0, jsx_runtime_1.jsxs)(Card_1.Card.Body, { children: [(0, jsx_runtime_1.jsx)(Radio_1.default, { onClick: () => handleRowAddedChange(), checked: expression?.includes(GeneralConstants_1.OBSERVABLE_EXPRESSION_ROW_ADDED), children: "Row Added" }), (0, jsx_runtime_1.jsx)(Radio_1.default, { onClick: () => handleRowRemovedChange(), checked: expression?.includes(GeneralConstants_1.OBSERVABLE_EXPRESSION_ROW_REMOVED), children: "Row Removed" })] })] }) }));
|
|
60
61
|
};
|
|
61
62
|
const AlertRulesWizardSection = (props) => {
|
|
62
63
|
const { data: alertData, api, moduleInfo } = (0, OnePageAdaptableWizard_1.useOnePageAdaptableWizardContext)();
|
|
@@ -33,6 +33,6 @@ const AlertScheduledWizardSection = (props) => {
|
|
|
33
33
|
Schedule: scheduleData.Schedule,
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
|
-
return ((0, jsx_runtime_1.jsx)(Flex_1.
|
|
36
|
+
return ((0, jsx_runtime_1.jsx)(Flex_1.Flex, { flexDirection: "column", className: "twa:gap-3 twa:p-3", children: (0, jsx_runtime_1.jsx)(ScheduleScheduleWizard_1.ScheduleBuilderWizard, { onChange: handleScheduleChange }) }));
|
|
37
37
|
};
|
|
38
38
|
exports.AlertScheduledWizardSection = AlertScheduledWizardSection;
|
|
@@ -19,42 +19,34 @@ const AlertScopeWizardSection = (props) => {
|
|
|
19
19
|
disableDataTypes = false;
|
|
20
20
|
disableColumns = false;
|
|
21
21
|
}
|
|
22
|
-
return ((0, jsx_runtime_1.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
// if it had aggregation expression and the scope is changed to partial
|
|
52
|
-
// we need to reset to not be an aggregation expression, as aggregation is not supported
|
|
53
|
-
// for partial scope
|
|
54
|
-
delete newData.Rule.AggregatedBooleanExpression;
|
|
55
|
-
newData.Rule.BooleanExpression = '';
|
|
56
|
-
}
|
|
57
|
-
props.onChange(newData);
|
|
58
|
-
} }) }));
|
|
22
|
+
return ((0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "column", className: "twa:h-full", children: [(0, jsx_runtime_1.jsxs)(Flex_1.Flex, { flexDirection: "row", alignItems: "center", className: "twa:p-2 twa:gap-3 twa:border-b twa:mb-2 twa:border-b-foreground/20", children: [(0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-5 twa:font-medium", children: "Columns" }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:text-xs twa:opacity-70 twa:max-w-[520px]", children: "Specify which columns should trigger the Alert" })] }), (0, jsx_runtime_1.jsx)(Flex_1.Box, { className: "twa:flex-1 twa:min-h-0 twa:overflow-auto twa:p-2", children: (0, jsx_runtime_1.jsx)(NewScopeComponent_1.NewScopeComponent, { disableColumns: disableColumns, disableDataTypes: disableDataTypes, descriptions: {
|
|
23
|
+
rowScope: 'Changes in any Column in the row will trigger an Alert',
|
|
24
|
+
columnScope: 'Changes in selected Columns will trigger an Alert',
|
|
25
|
+
dataTypeScope: 'Changes in any Column which is of the selected Data Type(s) will trigger an Alert',
|
|
26
|
+
}, scope: data.Scope, updateScope: (Scope) => {
|
|
27
|
+
const newData = { ...data, Scope };
|
|
28
|
+
if (newData.Rule.Predicates) {
|
|
29
|
+
const validPredicateIds = new Set(api.alertApi.internalApi.getAlertPredicateDefsForScope(Scope).map((def) => def.id));
|
|
30
|
+
newData.Rule = {
|
|
31
|
+
Predicates: newData.Rule.Predicates.filter((p) => validPredicateIds.has(p.PredicateId)).filter((predicate) => {
|
|
32
|
+
if ((0, ColumnScope_1.isScopeColumnIds)(Scope) && Scope.ColumnIds.length > 1) {
|
|
33
|
+
return predicate.PredicateId !== 'In' && predicate.PredicateId !== 'NotIn';
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
}),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
if (newData.Rule.ObservableExpression !== undefined &&
|
|
40
|
+
!api.columnScopeApi.scopeIsAll(Scope)) {
|
|
41
|
+
delete newData.Rule.ObservableExpression;
|
|
42
|
+
newData.Rule.BooleanExpression = '';
|
|
43
|
+
}
|
|
44
|
+
if (newData.Rule.AggregatedBooleanExpression !== undefined &&
|
|
45
|
+
!api.columnScopeApi.scopeIsAll(Scope)) {
|
|
46
|
+
delete newData.Rule.AggregatedBooleanExpression;
|
|
47
|
+
newData.Rule.BooleanExpression = '';
|
|
48
|
+
}
|
|
49
|
+
props.onChange(newData);
|
|
50
|
+
} }) })] }));
|
|
59
51
|
};
|
|
60
52
|
exports.AlertScopeWizardSection = AlertScopeWizardSection;
|