@adaptabletools/adaptable 11.0.0-canary.0 → 11.0.0-canary.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/base.css +21 -10
- package/bundle.cjs.js +98 -94
- package/index.css +23 -10
- package/package.json +32 -32
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +0 -1
- package/src/AdaptableOptions/DashboardOptions.d.ts +3 -2
- package/src/AdaptableOptions/EntitlementOptions.d.ts +1 -1
- package/src/AdaptableOptions/GeneralOptions.d.ts +1 -1
- package/src/AdaptableOptions/TeamSharingOptions.d.ts +1 -1
- package/src/AdaptableOptions/ToolPanelOptions.d.ts +0 -1
- package/src/Api/Events/SearchChanged.d.ts +1 -1
- package/src/Api/GridApi.d.ts +5 -4
- package/src/Api/Implementation/DashboardApiImpl.js +1 -1
- package/src/Api/Implementation/FlashingCellApiImpl.js +2 -4
- package/src/Api/Implementation/GridApiImpl.d.ts +5 -4
- package/src/Api/Implementation/GridApiImpl.js +4 -0
- package/src/Api/Implementation/InternalApiImpl.d.ts +0 -1
- package/src/Api/Implementation/InternalApiImpl.js +1 -9
- package/src/Api/Implementation/LayoutApiImpl.js +1 -1
- package/src/Api/InternalApi.d.ts +0 -1
- package/src/PredefinedConfig/Common/CellHighlightInfo.d.ts +1 -12
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +1 -1
- package/src/PredefinedConfig/Common/RowHighlightInfo.d.ts +15 -0
- package/src/PredefinedConfig/Common/RowHighlightInfo.js +2 -0
- package/src/PredefinedConfig/Common/Types.d.ts +1 -1
- package/src/PredefinedConfig/DashboardState.d.ts +4 -4
- package/src/PredefinedConfig/FlashingCellState.d.ts +2 -1
- package/src/PredefinedConfig/SystemState.d.ts +2 -1
- package/src/Redux/ActionsReducers/DashboardRedux.d.ts +0 -7
- package/src/Redux/ActionsReducers/DashboardRedux.js +1 -11
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +6 -5
- package/src/Redux/ActionsReducers/SystemRedux.js +13 -13
- package/src/Redux/Store/AdaptableReduxLocalStorageEngine.js +1 -1
- package/src/Redux/Store/AdaptableReduxMerger.js +5 -5
- package/src/Redux/Store/AdaptableStore.js +13 -3
- package/src/Strategy/AlertModule.js +1 -1
- package/src/Strategy/DataChangeHistoryModule.js +1 -1
- package/src/Strategy/FlashingCellModule.d.ts +1 -1
- package/src/Strategy/FlashingCellModule.js +32 -16
- package/src/Strategy/TeamSharingModule.js +1 -1
- package/src/Strategy/Utilities/getFlashingTargetViewItems.d.ts +1 -1
- package/src/Strategy/Utilities/getFlashingTargetViewItems.js +3 -1
- package/src/Utilities/ExpressionFunctions/aggregationExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +1 -1
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +2 -3
- package/src/Utilities/Extensions/StringExtensions.js +1 -1
- package/src/Utilities/Helpers/AdaptableHelper.js +2 -2
- package/src/Utilities/ObjectFactory.js +4 -2
- package/src/Utilities/Services/LicenseService.js +1 -1
- package/src/Utilities/Services/ReportService.js +1 -1
- package/src/View/AdaptableView.js +1 -1
- package/src/View/Alert/Wizard/AlertRulesWizardSection.d.ts +1 -1
- package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.d.ts +2 -3
- package/src/View/Alert/Wizard/BaseAlertRulesWizardSection.js +1 -3
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +10 -23
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnWizard.js +15 -4
- package/src/View/Components/FilterForm/QuickFilterForm.js +4 -6
- package/src/View/Components/ModuleValueSelector/index.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.d.ts +0 -3
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopup.js +43 -87
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.d.ts +10 -0
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupDialog.js +54 -0
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.d.ts +3 -1
- package/src/View/Components/Popups/AdaptablePopup/AdaptablePopupModuleView.js +19 -6
- package/src/View/Components/Popups/AdaptablePopup/Navigation.d.ts +1 -3
- package/src/View/Components/Popups/AdaptablePopup/Navigation.js +6 -14
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.d.ts +2 -0
- package/src/View/Components/Popups/AdaptablePopup/useMenuItems.js +44 -0
- package/src/View/Components/SharedProps/ModuleViewPopupProps.d.ts +1 -1
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +1 -1
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/Components/ToolPanel/ToolPanelPopup.js +4 -4
- package/src/View/Components/ValueSelector/index.d.ts +2 -1
- package/src/View/Components/ValueSelector/index.js +5 -5
- package/src/View/ConditionalStyle/Wizard/ConditionalStyleWizard.js +10 -5
- package/src/View/CustomSort/Wizard/CustomSortWizard.js +16 -4
- package/src/View/Dashboard/Dashboard.js +4 -4
- package/src/View/Dashboard/DashboardPopup.js +5 -5
- package/src/View/Export/Wizard/NewReportWizard.js +13 -3
- package/src/View/FlashingCell/Wizard/FlashingCellRulesWizardSection.js +17 -26
- package/src/View/FlashingCell/Wizard/FlashingCellScopeWizardSection.js +19 -2
- package/src/View/FlashingCell/Wizard/{FlashingCellDurationWizardSection.d.ts → FlashingCellSettingsWizardSection.d.ts} +3 -3
- package/src/View/FlashingCell/Wizard/FlashingCellSettingsWizardSection.js +81 -0
- package/src/View/FlashingCell/Wizard/FlashingCellWizard.js +5 -5
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +2 -2
- package/src/View/FormatColumn/Wizard/FormatColumnWizard.js +10 -5
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +8 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnWizard.js +13 -5
- package/src/View/PlusMinus/Wizard/PlusMinusWizard.js +8 -2
- package/src/View/Query/QueryViewPanel.js +12 -9
- package/src/View/Query/Wizard/NamedQueryWizard.js +3 -1
- package/src/View/QuickSearch/useQuickSearchDebounced.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleWizard.js +14 -14
- package/src/View/SpecialColumnSettingsWizardStep.d.ts +9 -0
- package/src/View/SpecialColumnSettingsWizardStep.js +62 -0
- package/src/View/Wizard/AdaptableWizard.js +1 -1
- package/src/View/Wizard/Interface/IAdaptableWizard.d.ts +2 -0
- package/src/View/Wizard/OnePageAdaptableWizard.js +1 -1
- package/src/agGrid/Adaptable.d.ts +0 -2
- package/src/agGrid/Adaptable.js +32 -22
- package/src/agGrid/agGridHelper.js +2 -3
- package/src/agGrid/agGridMenuHelper.js +5 -9
- package/src/components/Dashboard/Dashboard.js +1 -1
- package/src/components/Dashboard/DashboardManager.d.ts +5 -3
- package/src/components/Dashboard/DashboardManager.js +33 -27
- package/src/components/DropdownButton/renderItem.js +1 -1
- package/src/components/FormLayout/index.js +1 -1
- package/src/components/OverlayTrigger/Overlay.js +1 -1
- package/src/components/WindowModal/WindowModal.js +17 -2
- package/src/components/utils/useDraggable.js +2 -1
- package/src/metamodel/adaptable.metamodel.d.ts +9 -0
- package/src/metamodel/adaptable.metamodel.js +18 -11
- package/src/types.d.ts +2 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/View/FlashingCell/Wizard/FlashingCellDurationWizardSection.js +0 -60
|
@@ -18,14 +18,14 @@ const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/Obje
|
|
|
18
18
|
const react_redux_1 = require("react-redux");
|
|
19
19
|
const ConditionalStyleRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/ConditionalStyleRedux"));
|
|
20
20
|
exports.ConditionalStyleWizard = (props) => {
|
|
21
|
+
var _a;
|
|
22
|
+
const data = (_a = props.data) !== null && _a !== void 0 ? _a : props.popupParams.value;
|
|
21
23
|
const [conditionalStyle, setConditionalStyle] = react_1.useState(() => {
|
|
22
|
-
var _a;
|
|
24
|
+
var _a, _b, _c;
|
|
23
25
|
const DEFAULT_RULE = {
|
|
24
26
|
BooleanExpression: '',
|
|
25
27
|
};
|
|
26
|
-
const conditionalStyle =
|
|
27
|
-
? Helper_1.cloneObject(props.data)
|
|
28
|
-
: ObjectFactory_1.default.CreateEmptyConditionalStyle();
|
|
28
|
+
const conditionalStyle = data ? Helper_1.cloneObject(data) : ObjectFactory_1.default.CreateEmptyConditionalStyle();
|
|
29
29
|
conditionalStyle.Scope = (_a = conditionalStyle.Scope) !== null && _a !== void 0 ? _a : { All: true };
|
|
30
30
|
if (!conditionalStyle.Rule) {
|
|
31
31
|
conditionalStyle.Rule = DEFAULT_RULE;
|
|
@@ -33,11 +33,16 @@ exports.ConditionalStyleWizard = (props) => {
|
|
|
33
33
|
if (!conditionalStyle.Rule.Predicate && conditionalStyle.Rule.BooleanExpression == undefined) {
|
|
34
34
|
conditionalStyle.Rule.BooleanExpression = '';
|
|
35
35
|
}
|
|
36
|
+
if (((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.action) === 'New' && ((_c = props.popupParams) === null || _c === void 0 ? void 0 : _c.column)) {
|
|
37
|
+
conditionalStyle.Scope = {
|
|
38
|
+
ColumnIds: [props.popupParams.column.columnId],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
36
41
|
return conditionalStyle;
|
|
37
42
|
});
|
|
38
43
|
const dispatch = react_redux_1.useDispatch();
|
|
39
44
|
const handleFinish = () => {
|
|
40
|
-
if (
|
|
45
|
+
if (data) {
|
|
41
46
|
dispatch(ConditionalStyleRedux.ConditionalStyleEdit(conditionalStyle));
|
|
42
47
|
}
|
|
43
48
|
else {
|
|
@@ -13,14 +13,26 @@ const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/Obje
|
|
|
13
13
|
const react_redux_1 = require("react-redux");
|
|
14
14
|
const CustomSortRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/CustomSortRedux"));
|
|
15
15
|
exports.CustomSortWizard = (props) => {
|
|
16
|
+
var _a, _b;
|
|
17
|
+
let data = props.data;
|
|
18
|
+
const allCustomSorts = react_redux_1.useSelector((state) => { var _a; return (_a = state.CustomSort) === null || _a === void 0 ? void 0 : _a.CustomSorts; });
|
|
19
|
+
if (((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit' && ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.column)) {
|
|
20
|
+
data = allCustomSorts.find((x) => { var _a; return x.ColumnId == ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.column.columnId); });
|
|
21
|
+
}
|
|
16
22
|
const [customSort, setCustomSort] = react_1.useState(() => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
var _a, _b;
|
|
24
|
+
if (data) {
|
|
25
|
+
return Helper_1.cloneObject(data);
|
|
26
|
+
}
|
|
27
|
+
const newData = ObjectFactory_1.default.CreateEmptyCustomSort();
|
|
28
|
+
if ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.column) {
|
|
29
|
+
newData.ColumnId = (_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.column.columnId;
|
|
30
|
+
}
|
|
31
|
+
return newData;
|
|
20
32
|
});
|
|
21
33
|
const dispatch = react_redux_1.useDispatch();
|
|
22
34
|
const handleFinish = () => {
|
|
23
|
-
if (
|
|
35
|
+
if (data) {
|
|
24
36
|
dispatch(CustomSortRedux.CustomSortEdit(customSort));
|
|
25
37
|
}
|
|
26
38
|
else {
|
|
@@ -13,7 +13,7 @@ const LoggingHelper_1 = require("../../Utilities/Helpers/LoggingHelper");
|
|
|
13
13
|
const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
|
|
14
14
|
const rebass_1 = require("rebass");
|
|
15
15
|
const Dashboard_1 = require("../../components/Dashboard");
|
|
16
|
-
const kebabCase_1 = tslib_1.__importDefault(require("lodash
|
|
16
|
+
const kebabCase_1 = tslib_1.__importDefault(require("lodash/kebabCase"));
|
|
17
17
|
const AdaptableFormControlTextClear_1 = require("../Components/Forms/AdaptableFormControlTextClear");
|
|
18
18
|
const useQuickSearchDebounced_1 = require("../QuickSearch/useQuickSearchDebounced");
|
|
19
19
|
const UIHelper_1 = tslib_1.__importDefault(require("../UIHelper"));
|
|
@@ -69,8 +69,7 @@ const DashboardComponent = (props) => {
|
|
|
69
69
|
const renderModuleButtons = () => {
|
|
70
70
|
let shortcutsArray = props.DashboardState.ModuleButtons;
|
|
71
71
|
let shortcuts = null;
|
|
72
|
-
const alwaysShowInDashboard = props.api.internalApi.getAdaptableOptions().settingsPanelOptions
|
|
73
|
-
.alwaysShowInDashboard;
|
|
72
|
+
const alwaysShowInDashboard = props.api.internalApi.getAdaptableOptions().settingsPanelOptions.alwaysShowInDashboard;
|
|
74
73
|
const shouldAddSettingsPanel = alwaysShowInDashboard &&
|
|
75
74
|
!props.api.internalApi.getEntitlementService().isModuleHiddenEntitlement('SettingsPanel');
|
|
76
75
|
if (shouldAddSettingsPanel && !shortcutsArray.includes('SettingsPanel')) {
|
|
@@ -90,7 +89,8 @@ const DashboardComponent = (props) => {
|
|
|
90
89
|
};
|
|
91
90
|
const renderDashboardButtons = () => {
|
|
92
91
|
var _a;
|
|
93
|
-
let dashboardButtonsArray = (_a = props.api.dashboardApi
|
|
92
|
+
let dashboardButtonsArray = (_a = props.api.dashboardApi
|
|
93
|
+
.getCustomDashboardButtons()) === null || _a === void 0 ? void 0 : _a.filter((c) => c);
|
|
94
94
|
let customDashboardButtons = null;
|
|
95
95
|
if (dashboardButtonsArray) {
|
|
96
96
|
customDashboardButtons = dashboardButtonsArray.map((button) => {
|
|
@@ -58,11 +58,11 @@ class DashboardPopupComponent extends React.Component {
|
|
|
58
58
|
});
|
|
59
59
|
const allModuleButtons = this.props.GridState.ModuleDropdownMenuItems.map((x) => x.module);
|
|
60
60
|
const baseClassName = 'ab-Dashboard-Popup';
|
|
61
|
-
// const isDisabled = this.props.Entitlements
|
|
62
61
|
const dashboardAccessLevel = this.props.api.internalApi
|
|
63
62
|
.getEntitlementService()
|
|
64
63
|
.getEntitlementAccessLevelForModule('Dashboard');
|
|
65
|
-
const
|
|
64
|
+
const areDashboardSettingsVisible = dashboardAccessLevel == 'Full' || dashboardAccessLevel == 'ReadOnly';
|
|
65
|
+
const isDashboardDisabled = dashboardAccessLevel === 'ReadOnly';
|
|
66
66
|
const isModuleCheckboxDisabled = (module) => {
|
|
67
67
|
if (module === 'SettingsPanel') {
|
|
68
68
|
return this.props.api.internalApi.getAdaptableOptions().settingsPanelOptions
|
|
@@ -72,7 +72,7 @@ class DashboardPopupComponent extends React.Component {
|
|
|
72
72
|
};
|
|
73
73
|
return (React.createElement(PopupPanel_1.PopupPanel, { headerText: this.props.moduleInfo.FriendlyName, glyphicon: this.props.moduleInfo.Glyph },
|
|
74
74
|
React.createElement(rebass_1.Flex, { flex: 1, height: "100%", flexDirection: "column" },
|
|
75
|
-
|
|
75
|
+
areDashboardSettingsVisible && (React.createElement(Panel_1.default, { header: 'Dashboard Settings', style: { height: 'auto', overflow: 'visible' }, variant: "default", borderRadius: "none", marginLeft: 2, marginRight: 2 },
|
|
76
76
|
React.createElement(rebass_1.Flex, null,
|
|
77
77
|
React.createElement(CheckBox_1.CheckBox, { mr: 3, className: `${baseClassName}__Checkbox__collapsed-check`, checked: this.props.IsCollapsed, onChange: (checked) => this.props.onSetDashboardCollapsed(checked) }, "Collapse"),
|
|
78
78
|
' ',
|
|
@@ -84,8 +84,8 @@ class DashboardPopupComponent extends React.Component {
|
|
|
84
84
|
React.createElement(Radio_1.default, { marginLeft: 3, value: DashboardConfigView.Toolbars, checked: this.state.DashboardConfigView == DashboardConfigView.Toolbars, onChange: (_, e) => this.onDashboardConfigViewChanged(e) }, "Toolbars"),
|
|
85
85
|
React.createElement(Radio_1.default, { marginLeft: 3, value: DashboardConfigView.Buttons, checked: this.state.DashboardConfigView == DashboardConfigView.Buttons, onChange: (_, e) => this.onDashboardConfigViewChanged(e) }, "Buttons")),
|
|
86
86
|
React.createElement(rebass_1.Box, { className: `${baseClassName}__Module-Selector`, style: { minHeight: 0, flex: '1 1 0' }, padding: 2 },
|
|
87
|
-
this.state.DashboardConfigView == DashboardConfigView.Toolbars && (React.createElement(DashboardManager_1.default, { availableToolbars: [...systemToolbars, ...customToolbars], tabs: tabs, onTabsChange: this.props.onDashboardSetTabs, api: this.props.api })),
|
|
88
|
-
this.state.DashboardConfigView == DashboardConfigView.Buttons && (React.createElement(ModuleValueSelector_1.ModuleValueSelector, { options: allModuleButtons, value: selectedModuleButtons, noSelectionLabel: 'No selected Module Button',
|
|
87
|
+
this.state.DashboardConfigView == DashboardConfigView.Toolbars && (React.createElement(DashboardManager_1.default, { disabled: isDashboardDisabled, availableToolbars: [...systemToolbars, ...customToolbars], tabs: tabs, onTabsChange: this.props.onDashboardSetTabs, api: this.props.api })),
|
|
88
|
+
this.state.DashboardConfigView == DashboardConfigView.Buttons && (React.createElement(ModuleValueSelector_1.ModuleValueSelector, { disabled: isDashboardDisabled, options: allModuleButtons, value: selectedModuleButtons, noSelectionLabel: 'No selected Module Button', isOptionDisabled: isModuleCheckboxDisabled, xSelectedLabel: () => `Visible Module Buttons:`, onChange: (selectedValues) => this.props.onDashboardSetModuleButtons(selectedValues) })))))));
|
|
89
89
|
}
|
|
90
90
|
onDashboardConfigViewChanged(event) {
|
|
91
91
|
let e = event.target;
|
|
@@ -14,13 +14,23 @@ const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/Obje
|
|
|
14
14
|
const react_redux_1 = require("react-redux");
|
|
15
15
|
const ExportRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/ExportRedux"));
|
|
16
16
|
exports.NewReportWizard = (props) => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const isEdit = ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) ? props.popupParams.action === 'Edit'
|
|
19
|
+
: Boolean(props.data);
|
|
20
|
+
const currentReport = react_redux_1.useSelector((state) => {
|
|
21
|
+
if (!isEdit) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
return state.Export.Reports.find((report) => report.Name === state.Export.CurrentReport);
|
|
25
|
+
});
|
|
26
|
+
const data = (_b = props.data) !== null && _b !== void 0 ? _b : currentReport;
|
|
17
27
|
const [report, setReport] = react_1.useState(() => {
|
|
18
|
-
return
|
|
28
|
+
return data ? Helper_1.cloneObject(data) : ObjectFactory_1.default.CreateEmptyReport();
|
|
19
29
|
});
|
|
20
30
|
const dispatch = react_redux_1.useDispatch();
|
|
21
31
|
const handleFinish = () => {
|
|
22
|
-
if (
|
|
23
|
-
dispatch(ExportRedux.
|
|
32
|
+
if (isEdit) {
|
|
33
|
+
dispatch(ExportRedux.ReportEdit(report));
|
|
24
34
|
}
|
|
25
35
|
else {
|
|
26
36
|
dispatch(ExportRedux.ReportAdd(report));
|
|
@@ -4,10 +4,6 @@ exports.FlashingAlertRulesWizardSection = exports.renderFlashingAlertRulesSummar
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
7
|
-
const Tabs_1 = require("../../../components/Tabs");
|
|
8
|
-
const rebass_1 = require("rebass");
|
|
9
|
-
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
10
|
-
const BaseAlertRulesWizardSection_1 = require("../../Alert/Wizard/BaseAlertRulesWizardSection");
|
|
11
7
|
const CodeBlock_1 = require("../../../components/CodeBlock");
|
|
12
8
|
const EntityRulesEditor_1 = require("../../Components/EntityRulesEditor");
|
|
13
9
|
exports.renderFlashingAlertRulesSummary = (flashingAlert) => {
|
|
@@ -32,26 +28,21 @@ exports.renderFlashingAlertRulesSummary = (flashingAlert) => {
|
|
|
32
28
|
} }));
|
|
33
29
|
};
|
|
34
30
|
exports.FlashingAlertRulesWizardSection = (props) => {
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
React.createElement(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
React.createElement(rebass_1.Text, { fontSize: 2 },
|
|
53
|
-
"Flash the updated ",
|
|
54
|
-
React.createElement("b", null, "cell"),
|
|
55
|
-
" only"))),
|
|
56
|
-
React.createElement(rebass_1.Text, { mt: 3, fontSize: 2, pl: 2 }, "Flash rules")));
|
|
31
|
+
const { data, api, moduleInfo } = OnePageAdaptableWizard_1.useOnePageWizardContext();
|
|
32
|
+
const predicateDefs = api.flashingCellApi.getFlashingCellPredicateDefsForScope(data.Scope);
|
|
33
|
+
return (React.createElement(EntityRulesEditor_1.EntityRulesEditor, { module: moduleInfo.ModuleName, defaultPredicateId: "Any", data: data, predicateDefs: predicateDefs, onChange: props.onChange, showAggregation: false, showObservable: false, showBoolean: true, showPredicate: true, descriptions: {
|
|
34
|
+
selectPredicate: 'Select an Flashing Cell Rule - to be applied when data changes',
|
|
35
|
+
useBooleanQuery: (React.createElement(React.Fragment, null,
|
|
36
|
+
"Use an BooleanQuery if ",
|
|
37
|
+
React.createElement("i", null, "Scope"),
|
|
38
|
+
" is 'Whole Row' - so any data change may be evaluated in a complex BooleanExpression")),
|
|
39
|
+
useObservableQuery: (React.createElement(React.Fragment, null,
|
|
40
|
+
"Use an ObservableQuery if ",
|
|
41
|
+
React.createElement("i", null, "Scope"),
|
|
42
|
+
" is 'Whole Row' - so any data change may be evaluated in a complex ObservableExpression")),
|
|
43
|
+
useAggregationQuery: (React.createElement(React.Fragment, null,
|
|
44
|
+
"Use an AggregationQuery if ",
|
|
45
|
+
React.createElement("i", null, "Scope"),
|
|
46
|
+
" is 'Whole Row' - so any data change may be evaluated in a complex AggregationExpression")),
|
|
47
|
+
} }));
|
|
57
48
|
};
|
|
@@ -3,7 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FlashingAlertScopeWizardSection = 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
|
exports.FlashingAlertScopeWizardSection = (props) => {
|
|
8
|
-
|
|
10
|
+
const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
|
|
11
|
+
return (React.createElement(rebass_1.Flex, { flexDirection: "column", style: { height: '100%' }, padding: 2 },
|
|
12
|
+
React.createElement(NewScopeComponent_1.NewScopeComponent, { descriptions: {
|
|
13
|
+
rowScope: 'Changes anywhere in the row will trigger an Flashing Cell',
|
|
14
|
+
columnScope: 'Changes in selected columns will trigger an Flashing Cell',
|
|
15
|
+
}, scope: data.Scope, updateScope: (Scope) => {
|
|
16
|
+
const newData = Object.assign(Object.assign({}, data), { Scope });
|
|
17
|
+
if (newData.Rule.Predicate) {
|
|
18
|
+
// when scope is changed, reset the rule to predicate of any
|
|
19
|
+
// if it was set to a predicate before
|
|
20
|
+
newData.Rule = {
|
|
21
|
+
Predicate: { PredicateId: 'Any' },
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
props.onChange(newData);
|
|
25
|
+
} })));
|
|
9
26
|
};
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { FlashingCellDefinition } from '../../../types';
|
|
3
3
|
declare type FlashingAlertDurationWizardSectionProps = {
|
|
4
4
|
readOnly?: boolean;
|
|
5
|
-
|
|
5
|
+
flashingCell?: FlashingCellDefinition;
|
|
6
6
|
onChange: (data: FlashingCellDefinition) => void;
|
|
7
7
|
};
|
|
8
|
-
export declare const
|
|
9
|
-
export declare const
|
|
8
|
+
export declare const renderFlashingAlertSettingsSummary: (flashingAlert: FlashingCellDefinition) => JSX.Element;
|
|
9
|
+
export declare const FlashingAlertSettingsWizardSection: (props: FlashingAlertDurationWizardSectionProps) => JSX.Element;
|
|
10
10
|
export {};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlashingAlertSettingsWizardSection = exports.renderFlashingAlertSettingsSummary = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const React = tslib_1.__importStar(require("react"));
|
|
6
|
+
const react_1 = require("react");
|
|
7
|
+
const rebass_1 = require("rebass");
|
|
8
|
+
const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
9
|
+
const usePrevious_1 = tslib_1.__importDefault(require("../../../components/utils/usePrevious"));
|
|
10
|
+
const Radio_1 = tslib_1.__importDefault(require("../../../components/Radio"));
|
|
11
|
+
const Tabs_1 = require("../../../components/Tabs");
|
|
12
|
+
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
13
|
+
const CodeBlock_1 = require("../../../components/CodeBlock");
|
|
14
|
+
const FormLayout_1 = tslib_1.__importStar(require("../../../components/FormLayout"));
|
|
15
|
+
const CheckBox_1 = require("../../../components/CheckBox");
|
|
16
|
+
exports.renderFlashingAlertSettingsSummary = (flashingAlert) => {
|
|
17
|
+
return (React.createElement(React.Fragment, null,
|
|
18
|
+
React.createElement(rebass_1.Text, { fontSize: 2 }, flashingAlert.FlashDuration === 'always' ? (React.createElement(React.Fragment, null, "Flashing is never removed")) : (React.createElement(React.Fragment, null,
|
|
19
|
+
"Flashing is removed after ",
|
|
20
|
+
React.createElement(CodeBlock_1.CodeBlock, null, flashingAlert.FlashDuration),
|
|
21
|
+
' ',
|
|
22
|
+
"milliseconds")))));
|
|
23
|
+
};
|
|
24
|
+
exports.FlashingAlertSettingsWizardSection = (props) => {
|
|
25
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
26
|
+
let { data: flashingCell } = OnePageAdaptableWizard_1.useOnePageWizardContext();
|
|
27
|
+
flashingCell = flashingCell !== null && flashingCell !== void 0 ? flashingCell : props.flashingCell;
|
|
28
|
+
const setDuration = (FlashDuration) => {
|
|
29
|
+
props.onChange(Object.assign(Object.assign({}, flashingCell), { FlashDuration: FlashDuration }));
|
|
30
|
+
};
|
|
31
|
+
const duration = (_a = flashingCell.FlashDuration) !== null && _a !== void 0 ? _a : 500;
|
|
32
|
+
const numberDuration = React.useRef(typeof duration === 'number' ? duration : 500);
|
|
33
|
+
const inputRef = react_1.useRef(null);
|
|
34
|
+
const oldDuration = usePrevious_1.default(duration, duration);
|
|
35
|
+
React.useEffect(() => {
|
|
36
|
+
var _a;
|
|
37
|
+
if (oldDuration === 'always' && duration != oldDuration) {
|
|
38
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
39
|
+
}
|
|
40
|
+
}, [duration, oldDuration]);
|
|
41
|
+
const handleTypeChange = (type) => {
|
|
42
|
+
setDuration(type === 'number' ? numberDuration.current : 'always');
|
|
43
|
+
};
|
|
44
|
+
const handleTargetChange = (type, checked) => {
|
|
45
|
+
var _a;
|
|
46
|
+
let FlashTarget = (_a = flashingCell.FlashTarget) !== null && _a !== void 0 ? _a : [];
|
|
47
|
+
if (typeof FlashTarget === 'string') {
|
|
48
|
+
FlashTarget = [FlashTarget];
|
|
49
|
+
}
|
|
50
|
+
if (Array.isArray(FlashTarget)) {
|
|
51
|
+
if (checked) {
|
|
52
|
+
FlashTarget = [...FlashTarget, type];
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
FlashTarget = FlashTarget.filter((target) => type != target);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
props.onChange(Object.assign(Object.assign({}, flashingCell), { FlashTarget }));
|
|
59
|
+
};
|
|
60
|
+
return (React.createElement(rebass_1.Flex, { height: "100%", flexDirection: "column", "data-name": "plus-minus-column-settings" },
|
|
61
|
+
React.createElement(Tabs_1.Tabs, { autoFocus: false, padding: 2 },
|
|
62
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Flashing Cell Settings"),
|
|
63
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
64
|
+
React.createElement(FormLayout_1.default, null,
|
|
65
|
+
React.createElement(FormLayout_1.FormRow, { label: "Duration Type" },
|
|
66
|
+
React.createElement(Radio_1.default, { mr: 3, checked: duration == 'always', tabIndex: -1, onChange: () => handleTypeChange('always') }, "Always"),
|
|
67
|
+
React.createElement(Radio_1.default, { checked: duration !== 'always', tabIndex: -1, onChange: () => handleTypeChange('number') }, "Limited (ms)")),
|
|
68
|
+
React.createElement(FormLayout_1.FormRow, { label: "" },
|
|
69
|
+
duration !== 'always' && (React.createElement(rebass_1.Flex, { flexDirection: "row", alignItems: "baseline" },
|
|
70
|
+
React.createElement(rebass_1.Text, { fontSize: 2, mr: 2 }, "After"),
|
|
71
|
+
React.createElement(Input_1.default, { readOnly: props.readOnly, type: "text", name: "value", ref: inputRef, mt: 2, mr: 1, value: duration, onChange: (event) => {
|
|
72
|
+
const value = event.target.value;
|
|
73
|
+
setDuration(isNaN(Number(value)) ? 500 : Number(value));
|
|
74
|
+
} }),
|
|
75
|
+
React.createElement(rebass_1.Text, { fontSize: 2 }, "milliseconds"))),
|
|
76
|
+
duration === 'always' && (React.createElement(rebass_1.Text, { height: 43, fontSize: 3 }, "Persists the flashing style indeterminately - can be removed manually"))),
|
|
77
|
+
React.createElement(FormLayout_1.FormRow, { label: "Flash Target" },
|
|
78
|
+
React.createElement(CheckBox_1.CheckBox, { onChange: (checked) => handleTargetChange('cell', checked), mr: 3, checked: (flashingCell === null || flashingCell === void 0 ? void 0 : flashingCell.FlashTarget) === 'cell' || ((_c = (_b = flashingCell === null || flashingCell === void 0 ? void 0 : flashingCell.FlashTarget) === null || _b === void 0 ? void 0 : _b.includes) === null || _c === void 0 ? void 0 : _c.call(_b, 'cell')), tabIndex: -1 }, "Cell"),
|
|
79
|
+
React.createElement(CheckBox_1.CheckBox, { mr: 3, onChange: (checked) => handleTargetChange('row', checked), checked: (flashingCell === null || flashingCell === void 0 ? void 0 : flashingCell.FlashTarget) === 'row' || ((_e = (_d = flashingCell === null || flashingCell === void 0 ? void 0 : flashingCell.FlashTarget) === null || _d === void 0 ? void 0 : _d.includes) === null || _e === void 0 ? void 0 : _e.call(_d, 'row')), tabIndex: -1 }, "Row"),
|
|
80
|
+
React.createElement(CheckBox_1.CheckBox, { onChange: (checked) => handleTargetChange('aggFuncCell', checked), checked: (flashingCell === null || flashingCell === void 0 ? void 0 : flashingCell.FlashTarget) === 'aggFuncCell' || ((_g = (_f = flashingCell === null || flashingCell === void 0 ? void 0 : flashingCell.FlashTarget) === null || _f === void 0 ? void 0 : _f.includes) === null || _g === void 0 ? void 0 : _g.call(_f, 'aggFuncCell')), tabIndex: -1 }, "Aggregated Function Cell")))))));
|
|
81
|
+
};
|
|
@@ -6,7 +6,7 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const rebass_1 = require("rebass");
|
|
8
8
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
9
|
-
const
|
|
9
|
+
const FlashingCellSettingsWizardSection_1 = require("./FlashingCellSettingsWizardSection");
|
|
10
10
|
const Helper_1 = require("../../../Utilities/Helpers/Helper");
|
|
11
11
|
const FlashingCellRulesWizardSection_1 = require("./FlashingCellRulesWizardSection");
|
|
12
12
|
const FlashingCellStyleWizardSection_1 = require("./FlashingCellStyleWizardSection");
|
|
@@ -69,14 +69,14 @@ exports.FlashingCellWizard = (props) => {
|
|
|
69
69
|
isValid: isValidFlashingCellRules_1.isValidFlashingCellRules,
|
|
70
70
|
render: () => React.createElement(FlashingCellRulesWizardSection_1.FlashingAlertRulesWizardSection, { onChange: setFlashingCell }),
|
|
71
71
|
renderSummary: FlashingCellRulesWizardSection_1.renderFlashingAlertRulesSummary,
|
|
72
|
-
title: '
|
|
72
|
+
title: 'Rule',
|
|
73
73
|
},
|
|
74
74
|
{
|
|
75
75
|
details: 'Select the Duration of the Flash',
|
|
76
76
|
render: () => (React.createElement(rebass_1.Box, { padding: 2 },
|
|
77
|
-
React.createElement(
|
|
78
|
-
renderSummary:
|
|
79
|
-
title: '
|
|
77
|
+
React.createElement(FlashingCellSettingsWizardSection_1.FlashingAlertSettingsWizardSection, { onChange: setFlashingCell }))),
|
|
78
|
+
renderSummary: FlashingCellSettingsWizardSection_1.renderFlashingAlertSettingsSummary,
|
|
79
|
+
title: 'Settings',
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
details: 'Choose the Flashing Styles',
|
|
@@ -4,8 +4,8 @@ exports.FormatColumnFormatWizardSection = exports.getFormatDisplayTypeForScope =
|
|
|
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 uniq_1 = tslib_1.__importDefault(require("lodash
|
|
8
|
-
const clamp_1 = tslib_1.__importDefault(require("lodash
|
|
7
|
+
const uniq_1 = tslib_1.__importDefault(require("lodash/uniq"));
|
|
8
|
+
const clamp_1 = tslib_1.__importDefault(require("lodash/clamp"));
|
|
9
9
|
const HelpBlock_1 = tslib_1.__importDefault(require("../../../components/HelpBlock"));
|
|
10
10
|
const Input_1 = tslib_1.__importDefault(require("../../../components/Input"));
|
|
11
11
|
const SimpleButton_1 = tslib_1.__importDefault(require("../../../components/SimpleButton"));
|
|
@@ -70,15 +70,20 @@ const adjustFormatColumn = (formatColumn, api) => {
|
|
|
70
70
|
return formatColumn;
|
|
71
71
|
};
|
|
72
72
|
function FormatColumnWizard(props) {
|
|
73
|
+
var _a;
|
|
73
74
|
const { api } = AdaptableContext_1.useAdaptable();
|
|
75
|
+
const data = (_a = props.data) !== null && _a !== void 0 ? _a : props.popupParams.value;
|
|
74
76
|
const [formatColumn, doSetFormatColumn] = react_1.useState(() => {
|
|
75
|
-
var _a;
|
|
76
|
-
let formatColumn =
|
|
77
|
-
? Helper_1.cloneObject(props.data)
|
|
78
|
-
: ObjectFactory_1.default.CreateEmptyFormatColumn();
|
|
77
|
+
var _a, _b, _c, _d;
|
|
78
|
+
let formatColumn = data ? Helper_1.cloneObject(data) : ObjectFactory_1.default.CreateEmptyFormatColumn();
|
|
79
79
|
formatColumn.Scope = (_a = formatColumn.Scope) !== null && _a !== void 0 ? _a : {
|
|
80
80
|
ColumnIds: [],
|
|
81
81
|
};
|
|
82
|
+
if (((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.action) === 'New' && ((_c = props.popupParams) === null || _c === void 0 ? void 0 : _c.column)) {
|
|
83
|
+
formatColumn.Scope = {
|
|
84
|
+
ColumnIds: [(_d = props.popupParams) === null || _d === void 0 ? void 0 : _d.column.columnId],
|
|
85
|
+
};
|
|
86
|
+
}
|
|
82
87
|
formatColumn = adjustFormatColumn(formatColumn, api);
|
|
83
88
|
return formatColumn;
|
|
84
89
|
});
|
|
@@ -87,7 +92,7 @@ function FormatColumnWizard(props) {
|
|
|
87
92
|
}, []);
|
|
88
93
|
const dispatch = react_redux_1.useDispatch();
|
|
89
94
|
const handleFinish = () => {
|
|
90
|
-
if (
|
|
95
|
+
if (data) {
|
|
91
96
|
dispatch(FormatColumnRedux.FormatColumnEdit(formatColumn));
|
|
92
97
|
}
|
|
93
98
|
else {
|
|
@@ -17,6 +17,7 @@ const CheckBox_1 = require("../../../components/CheckBox");
|
|
|
17
17
|
const FormatHelper_1 = require("../../../Utilities/Helpers/FormatHelper");
|
|
18
18
|
const DateHelper_1 = require("../../../Utilities/Helpers/DateHelper");
|
|
19
19
|
const Tag_1 = require("../../../components/Tag");
|
|
20
|
+
const SpecialColumnSettingsWizardStep_1 = require("../../SpecialColumnSettingsWizardStep");
|
|
20
21
|
const options = [
|
|
21
22
|
{ value: Enums_1.DataType.Number, label: Enums_1.DataType.Number },
|
|
22
23
|
{ value: Enums_1.DataType.String, label: Enums_1.DataType.String },
|
|
@@ -59,8 +60,7 @@ exports.isValidFreeTextColumn = (data, api) => {
|
|
|
59
60
|
};
|
|
60
61
|
exports.FreeTextColumnSettingsWizardSection = (props) => {
|
|
61
62
|
const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
|
|
62
|
-
const Pattern = api.internalApi.getAdaptableOptions().userInterfaceOptions.dateInputOptions
|
|
63
|
-
.dateFormat;
|
|
63
|
+
const Pattern = api.internalApi.getAdaptableOptions().userInterfaceOptions.dateInputOptions.dateFormat;
|
|
64
64
|
const [ColumnNameFocused, setColumnNameFocused] = react_1.useState(false);
|
|
65
65
|
const inEdit = props.isEdit;
|
|
66
66
|
const validCheck = exports.isValidFreeTextColumn(data, api);
|
|
@@ -98,6 +98,9 @@ exports.FreeTextColumnSettingsWizardSection = (props) => {
|
|
|
98
98
|
}
|
|
99
99
|
props.onChange(Object.assign(Object.assign({}, data), { DefaultValue }));
|
|
100
100
|
};
|
|
101
|
+
const handleSpecialColumnSettingsChange = (settings) => {
|
|
102
|
+
props.onChange(Object.assign(Object.assign({}, data), { FreeTextColumnSettings: Object.assign(Object.assign({}, data === null || data === void 0 ? void 0 : data.FreeTextColumnSettings), settings) }));
|
|
103
|
+
};
|
|
101
104
|
return (React.createElement(React.Fragment, null,
|
|
102
105
|
React.createElement(FormLayout_1.default, null,
|
|
103
106
|
React.createElement(FormLayout_1.FormRow, { label: "ColumnId" },
|
|
@@ -127,5 +130,7 @@ exports.FreeTextColumnSettingsWizardSection = (props) => {
|
|
|
127
130
|
data.DataType == 'String' && (React.createElement(FormLayout_1.FormRow, { label: "Editor Type" },
|
|
128
131
|
React.createElement(Radio_1.default, { value: "Inline", checked: data.TextEditor == 'Inline', onChange: (_, e) => onDynamicSelectChanged(e), marginRight: 2 }, "Inline Editor"),
|
|
129
132
|
React.createElement(Radio_1.default, { value: "Large", checked: data.TextEditor == 'Large', onChange: (_, e) => onDynamicSelectChanged(e) }, "Large Editor")))),
|
|
130
|
-
ErrorMessage ? React.createElement(ErrorBox_1.default, {
|
|
133
|
+
ErrorMessage ? (React.createElement(ErrorBox_1.default, { mt: 2, mb: 2 }, ErrorMessage)) : null,
|
|
134
|
+
React.createElement(rebass_1.Box, { mt: 2 },
|
|
135
|
+
React.createElement(SpecialColumnSettingsWizardStep_1.SpecialColumnSettingsWizardStep, { isEditable: true, settings: data.FreeTextColumnSettings, onChange: handleSpecialColumnSettingsChange }))));
|
|
131
136
|
};
|
|
@@ -12,15 +12,22 @@ const ObjectFactory_1 = tslib_1.__importDefault(require("../../../Utilities/Obje
|
|
|
12
12
|
const FreeTextColumnRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/FreeTextColumnRedux"));
|
|
13
13
|
const react_redux_1 = require("react-redux");
|
|
14
14
|
exports.FreeTextColumnWizard = (props) => {
|
|
15
|
+
var _a;
|
|
16
|
+
const allFreeTextColumns = react_redux_1.useSelector((state) => state.FreeTextColumn.FreeTextColumns);
|
|
15
17
|
const [freeTextColumn, setFreeTextColumn] = react_1.useState(() => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
var _a, _b;
|
|
19
|
+
if (props.data) {
|
|
20
|
+
return Helper_1.cloneObject(props.data);
|
|
21
|
+
}
|
|
22
|
+
if (((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit' && ((_b = props.popupParams) === null || _b === void 0 ? void 0 : _b.column)) {
|
|
23
|
+
return allFreeTextColumns.find((column) => column.ColumnId === props.popupParams.column.columnId);
|
|
24
|
+
}
|
|
25
|
+
return ObjectFactory_1.default.CreateEmptyFreeTextColumn(false);
|
|
20
26
|
});
|
|
21
27
|
const dispatch = react_redux_1.useDispatch();
|
|
28
|
+
const isEdit = props.data || ((_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.action) === 'Edit';
|
|
22
29
|
const handleFinish = () => {
|
|
23
|
-
if (
|
|
30
|
+
if (isEdit) {
|
|
24
31
|
dispatch(FreeTextColumnRedux.FreeTextColumnEdit(freeTextColumn));
|
|
25
32
|
}
|
|
26
33
|
else {
|
|
@@ -32,6 +39,7 @@ exports.FreeTextColumnWizard = (props) => {
|
|
|
32
39
|
{
|
|
33
40
|
title: 'Settings',
|
|
34
41
|
details: 'Configure the Free Text Column',
|
|
42
|
+
isValid: FreeTextColumnSettingsWizardSection_1.isValidFreeTextColumn,
|
|
35
43
|
render: () => {
|
|
36
44
|
return (React.createElement(rebass_1.Box, { padding: 2 },
|
|
37
45
|
React.createElement(FreeTextColumnSettingsWizardSection_1.FreeTextColumnSettingsWizardSection, { isEdit: Boolean(props.data), onChange: setFreeTextColumn })));
|
|
@@ -13,8 +13,14 @@ const react_redux_1 = require("react-redux");
|
|
|
13
13
|
const PlusMinusRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/PlusMinusRedux"));
|
|
14
14
|
exports.PlusMinusWizard = (props) => {
|
|
15
15
|
const [plusMinus, setPlusMinus] = React.useState(() => {
|
|
16
|
-
var _a, _b, _c, _d;
|
|
17
|
-
|
|
16
|
+
var _a, _b, _c, _d, _e;
|
|
17
|
+
const newPlusMinus = Object.assign(Object.assign({}, (props.data ? props.data : ObjectFactory_1.default.CreateEmptyPlusMinusNudge())), { Scope: (_b = (_a = props === null || props === void 0 ? void 0 : props.data) === null || _a === void 0 ? void 0 : _a.Scope) !== null && _b !== void 0 ? _b : { All: true }, NudgeValue: (_d = (_c = props === null || props === void 0 ? void 0 : props.data) === null || _c === void 0 ? void 0 : _c.NudgeValue) !== null && _d !== void 0 ? _d : 20 });
|
|
18
|
+
if ((_e = props === null || props === void 0 ? void 0 : props.popupParams) === null || _e === void 0 ? void 0 : _e.column) {
|
|
19
|
+
newPlusMinus.Scope = {
|
|
20
|
+
ColumnIds: [props.popupParams.column.columnId],
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
return newPlusMinus;
|
|
18
24
|
});
|
|
19
25
|
const [hasCondition, setHasCondition] = React.useState(() => {
|
|
20
26
|
var _a;
|
|
@@ -78,28 +78,31 @@ class QueryViewPanelComponent extends React.Component {
|
|
|
78
78
|
};
|
|
79
79
|
});
|
|
80
80
|
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
81
|
+
const handleEnter = (e) => {
|
|
82
|
+
if (e.key === 'Enter') {
|
|
83
|
+
this.runQuery();
|
|
84
|
+
}
|
|
85
|
+
};
|
|
81
86
|
const renderTextInput = () => {
|
|
82
87
|
return this.props.viewType === 'Toolbar' ? (React.createElement(FieldWrap_1.default, { marginRight: 1, width: 600 },
|
|
83
88
|
React.createElement(ButtonExpand_1.ButtonExpand, { variant: "text", tone: "neutral", onClick: () => this.props.onExpand(this.state.expression), tooltip: "Expand", marginLeft: 1 }),
|
|
84
|
-
React.createElement(Input_1.default, { type: "text", placeholder: "Query", spellCheck: false, value: this.state.expression, onChange: (x) => this.setState({ expression: x.target.value }), style: { fontFamily: 'monospace', fontSize: 12 }
|
|
85
|
-
if (e.key === 'Enter') {
|
|
86
|
-
this.runQuery();
|
|
87
|
-
}
|
|
88
|
-
} }),
|
|
89
|
+
React.createElement(Input_1.default, { type: "text", placeholder: "Query", spellCheck: false, value: this.state.expression, onChange: (x) => this.setState({ expression: x.target.value }), style: { fontFamily: 'monospace', fontSize: 12 } }),
|
|
89
90
|
isExpressionValid ? (React.createElement(ButtonPlay_1.ButtonPlay, { onClick: () => this.runQuery(), tooltip: '', accessLevel: 'Full', variant: "text", tone: "neutral", disabled: this.state.expression == '' || this.state.expression == this.props.CurrentQuery, marginRight: 1 })) : (React.createElement(ButtonInvalid_1.ButtonInvalid, { variant: "text", tone: "neutral", tooltip: "Invalid Query", marginRight: 1 })),
|
|
90
91
|
' ',
|
|
91
|
-
this.props.CurrentQuery !== '' && (React.createElement(ButtonClear_1.ButtonClear, { onClick: () => this.
|
|
92
|
+
this.props.CurrentQuery !== '' && (React.createElement(ButtonClear_1.ButtonClear, { onClick: () => this.clearQuery(), tooltip: "Clear Query", accessLevel: 'Full' })))) : (React.createElement(Input_1.default, { type: "text", placeholder: "Query", spellCheck: false, value: this.state.expression, onChange: (x) => this.setState({ expression: x.target.value }), style: { width: '100%' } }));
|
|
92
93
|
};
|
|
93
94
|
const queryModuleAccessLevel = this.props.api.internalApi
|
|
94
95
|
.getEntitlementService()
|
|
95
96
|
.getEntitlementAccessLevelForModule(ModuleConstants_1.QueryModuleId);
|
|
97
|
+
const saveButton = (React.createElement(ButtonSave_1.ButtonSave, { onClick: () => this.saveQuery(), tooltip: "Save as New Query", accessLevel: queryModuleAccessLevel, disabled: !isExpressionValid || isExpressionNamedQuery || this.state.expression == '', variant: "text", tone: "neutral", marginRight: 1 }));
|
|
96
98
|
const renderButtons = () => {
|
|
97
99
|
return this.props.viewType === 'Toolbar' ? (React.createElement(React.Fragment, null,
|
|
98
|
-
|
|
100
|
+
saveButton,
|
|
99
101
|
React.createElement(DropdownButton_1.default, { variant: "text", items: availableColumns, marginRight: 1, tooltip: "Pick Columns" },
|
|
100
102
|
React.createElement(icons_1.Icon, { name: 'list' })),
|
|
101
103
|
React.createElement(DropdownButton_1.default, { disabled: ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(availableSearches), variant: "text", items: availableSearches, marginRight: 1, tooltip: "Load Query", icon: "folder-open" }),
|
|
102
104
|
' ')) : (React.createElement(React.Fragment, null,
|
|
105
|
+
saveButton,
|
|
103
106
|
React.createElement(ButtonExpand_1.ButtonExpand, { variant: "text", tone: "neutral", onClick: () => this.props.onExpand(this.state.expression), tooltip: "Expand", marginLeft: 1 }),
|
|
104
107
|
React.createElement(ButtonClear_1.ButtonClear, { onClick: () => this.clearQuery(), tooltip: "Clear Query", accessLevel: 'Full', disabled: this.state.expression == '' }),
|
|
105
108
|
React.createElement(ButtonPlay_1.ButtonPlay, { onClick: () => this.runQuery(), tooltip: "Run Query", accessLevel: 'Full', variant: "text", tone: "neutral", disabled: !isExpressionValid ||
|
|
@@ -107,12 +110,12 @@ class QueryViewPanelComponent extends React.Component {
|
|
|
107
110
|
this.state.expression == this.props.CurrentQuery, marginRight: 1 }),
|
|
108
111
|
React.createElement(DropdownButton_1.default, { variant: "text", disabled: ArrayExtensions_1.ArrayExtensions.IsNullOrEmpty(availableSearches), items: availableSearches, marginRight: 1, tooltip: "Load Query", icon: "folder-open" })));
|
|
109
112
|
};
|
|
110
|
-
return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__Query__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
113
|
+
return (React.createElement(rebass_1.Flex, { onKeyDown: handleEnter, flexDirection: "row", className: `ab-${elementType}__Query__wrap`, flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
111
114
|
React.createElement(rebass_1.Flex, null, renderTextInput()),
|
|
112
115
|
React.createElement(rebass_1.Flex, null, renderButtons())));
|
|
113
116
|
}
|
|
114
117
|
clearQuery() {
|
|
115
|
-
this.
|
|
118
|
+
this.props.onRunQuery('');
|
|
116
119
|
}
|
|
117
120
|
saveQuery() {
|
|
118
121
|
this.props.onShowNamedQueries(this.state.expression, this.props.moduleInfo.Popup);
|
|
@@ -14,9 +14,11 @@ const react_redux_1 = require("react-redux");
|
|
|
14
14
|
const QueryRedux = tslib_1.__importStar(require("../../../Redux/ActionsReducers/QueryRedux"));
|
|
15
15
|
function NamedQueryWizard(props) {
|
|
16
16
|
const [namedQuery, setNamedQuery] = react_1.useState(() => {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const value = (_b = (_a = props.popupParams) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : '';
|
|
17
19
|
return props.data
|
|
18
20
|
? Helper_1.cloneObject(props.data)
|
|
19
|
-
: ObjectFactory_1.default.CreateEmptyNamedQuery();
|
|
21
|
+
: ObjectFactory_1.default.CreateEmptyNamedQuery(value);
|
|
20
22
|
});
|
|
21
23
|
const dispatch = react_redux_1.useDispatch();
|
|
22
24
|
const handleFinish = () => {
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useQuickSearchDebounced = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const react_1 = require("react");
|
|
6
|
-
const debounce_1 = tslib_1.__importDefault(require("lodash
|
|
6
|
+
const debounce_1 = tslib_1.__importDefault(require("lodash/debounce"));
|
|
7
7
|
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
8
8
|
exports.useQuickSearchDebounced = (props) => {
|
|
9
9
|
var _a;
|