@adaptabletools/adaptable 10.0.1 → 10.0.4-canary.1
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 +68 -26
- package/index.css +80 -28
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +12 -2
- package/src/AdaptableOptions/FilterOptions.d.ts +14 -7
- package/src/AdaptableOptions/LayoutOptions.d.ts +1 -1
- package/src/AdaptableOptions/NotificationsOptions.d.ts +3 -1
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +107 -5
- package/src/Api/AlertApi.d.ts +1 -1
- package/src/Api/CalculatedColumnApi.d.ts +15 -0
- package/src/Api/ColumnApi.d.ts +39 -0
- package/src/Api/ConfigApi.d.ts +8 -0
- package/src/Api/Events/AdaptableReady.d.ts +2 -6
- package/src/Api/Events/AdaptableStateChanged.d.ts +2 -1
- package/src/Api/Events/AlertFired.d.ts +2 -1
- package/src/Api/Events/BaseEventInfo.d.ts +10 -0
- package/src/{Utilities/Interface/ProgressIndicator.js → Api/Events/BaseEventInfo.js} +0 -0
- package/src/Api/Events/CellChanged.d.ts +2 -1
- package/src/Api/Events/ChexboxColumnClicked.d.ts +2 -1
- package/src/Api/Events/CustomToolbarConfigured.d.ts +2 -1
- package/src/Api/Events/DashboardChanged.d.ts +2 -1
- package/src/Api/Events/FlashingAlertFired.d.ts +2 -1
- package/src/Api/Events/GridDataChanged.d.ts +2 -1
- package/src/Api/Events/LayoutChanged.d.ts +2 -1
- package/src/Api/Events/LiveDataChanged.d.ts +2 -1
- package/src/Api/Events/SearchChanged.d.ts +2 -1
- package/src/Api/Events/SelectionChanged.d.ts +2 -1
- package/src/Api/Events/SystemStatusMessageDisplayed.d.ts +2 -1
- package/src/Api/Events/TeamSharingEntityChanged.d.ts +2 -1
- package/src/Api/Events/ThemeChanged.d.ts +2 -1
- package/src/Api/GridApi.d.ts +34 -8
- package/src/Api/Implementation/AlertApiImpl.d.ts +1 -1
- package/src/Api/Implementation/AlertApiImpl.js +22 -15
- package/src/Api/Implementation/CalculatedColumnApiImpl.d.ts +3 -0
- package/src/Api/Implementation/CalculatedColumnApiImpl.js +23 -0
- package/src/Api/Implementation/ColumnApiImpl.d.ts +8 -0
- package/src/Api/Implementation/ColumnApiImpl.js +69 -36
- package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +28 -17
- package/src/Api/Implementation/DashboardApiImpl.js +2 -1
- package/src/Api/Implementation/ExportApiImpl.js +4 -4
- package/src/Api/Implementation/FormatColumnApiImpl.js +2 -1
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +9 -3
- package/src/Api/Implementation/GridApiImpl.d.ts +9 -0
- package/src/Api/Implementation/GridApiImpl.js +28 -10
- package/src/Api/Implementation/InternalApiImpl.d.ts +3 -1
- package/src/Api/Implementation/InternalApiImpl.js +20 -4
- package/src/Api/Implementation/LayoutApiImpl.js +4 -3
- package/src/Api/Implementation/ScopeApiImpl.js +11 -11
- package/src/Api/Implementation/SystemStatusApiImpl.js +1 -0
- package/src/Api/Implementation/TeamSharingApiImpl.js +1 -0
- package/src/Api/Implementation/ThemeApiImpl.js +1 -0
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +12 -8
- package/src/Api/Implementation/UserInterfaceApiImpl.js +69 -87
- package/src/Api/InternalApi.d.ts +3 -1
- package/src/Api/UserInterfaceApi.d.ts +16 -6
- package/src/PredefinedConfig/AlertState.d.ts +4 -0
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +4 -37
- package/src/PredefinedConfig/Common/AdaptableButton.d.ts +1 -1
- package/src/PredefinedConfig/Common/AdaptableColumn.d.ts +33 -33
- package/src/PredefinedConfig/Common/AdaptableColumn.js +5 -5
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +19 -18
- package/src/PredefinedConfig/Common/DataChangedInfo.d.ts +3 -2
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +5 -1
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +49 -0
- package/src/PredefinedConfig/Common/SpecialColumnSettings.js +2 -0
- package/src/PredefinedConfig/FilterState.d.ts +1 -1
- package/src/PredefinedConfig/FreeTextColumnState.d.ts +10 -0
- package/src/PredefinedConfig/Selection/GridCell.d.ts +2 -1
- package/src/PredefinedConfig/Selection/GridRow.d.ts +12 -4
- package/src/PredefinedConfig/SystemState.d.ts +4 -1
- package/src/Redux/ActionsReducers/SystemRedux.js +1 -1
- package/src/Redux/Store/AdaptableStore.js +7 -3
- package/src/Strategy/AdaptableModuleBase.js +8 -8
- package/src/Strategy/AlertModule.js +12 -11
- package/src/Strategy/BulkUpdateModule.js +5 -5
- package/src/Strategy/CalculatedColumnModule.js +1 -1
- package/src/Strategy/CellSummaryModule.js +3 -3
- package/src/Strategy/ConditionalStyleModule.js +3 -3
- package/src/Strategy/CustomSortModule.js +2 -2
- package/src/Strategy/ExportModule.d.ts +0 -2
- package/src/Strategy/ExportModule.js +59 -62
- package/src/Strategy/FilterModule.js +4 -4
- package/src/Strategy/FormatColumnModule.js +5 -5
- package/src/Strategy/FreeTextColumnModule.js +1 -1
- package/src/Strategy/LayoutModule.js +3 -3
- package/src/Strategy/PlusMinusModule.js +8 -9
- package/src/Strategy/SmartEditModule.js +6 -6
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +1 -0
- package/src/Utilities/ExpressionFunctions/booleanExpressionFunctions.js +1 -1
- package/src/Utilities/ExpressionFunctions/expressionFunctionUtils.js +2 -2
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +3 -2
- package/src/Utilities/ExpressionFunctions/scalarExpressionFunctions.js +1 -1
- package/src/Utilities/Helpers/DateHelper.d.ts +2 -2
- package/src/Utilities/Helpers/DateHelper.js +30 -20
- package/src/Utilities/Helpers/PreviewHelper.js +2 -2
- package/src/Utilities/ObjectFactory.d.ts +1 -1
- package/src/Utilities/ObjectFactory.js +14 -2
- package/src/Utilities/Services/DataService.js +5 -5
- package/src/Utilities/Services/ReportService.js +13 -12
- package/src/Utilities/Services/ValidationService.js +4 -5
- package/src/Utilities/runIfNotResolvedIn.d.ts +8 -0
- package/src/Utilities/runIfNotResolvedIn.js +23 -0
- package/src/View/AdaptableView.js +1 -1
- package/src/View/Alert/AlertPopup.js +1 -1
- package/src/View/Alert/Wizard/AlertDisplayWizardSection.js +19 -5
- package/src/View/Alert/Wizard/BaseAlertScopeWizardSection.js +1 -1
- package/src/View/BulkUpdate/BulkUpdatePopup.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdatePopup.js +6 -4
- package/src/View/BulkUpdate/BulkUpdateViewPanel.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdateViewPanel.js +3 -1
- package/src/View/CalculatedColumn/CalculatedColumnPopup.js +1 -1
- package/src/View/CalculatedColumn/CalculatedColumnSummary.js +1 -1
- package/src/View/CalculatedColumn/Wizard/CalculatedColumnSettingsWizardSection.js +1 -1
- package/src/View/Components/ColumnSelector/index.js +2 -2
- package/src/View/Components/FilterForm/FilterForm.d.ts +3 -51
- package/src/View/Components/FilterForm/FilterForm.js +53 -32
- package/src/View/Components/FilterForm/ListBoxFilterForm.d.ts +3 -0
- package/src/View/Components/FilterForm/ListBoxFilterForm.js +14 -5
- package/src/View/Components/FilterForm/QuickFilterForm.d.ts +3 -43
- package/src/View/Components/FilterForm/QuickFilterForm.js +72 -31
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +3 -0
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +8 -0
- package/src/View/Components/NewScopeComponent.js +1 -1
- package/src/View/Components/Popups/AdaptablePopup.d.ts +1 -1
- package/src/View/Components/Popups/AdaptablePopupAlert.js +1 -1
- package/src/View/Components/PreviewResultsPanel.js +1 -1
- package/src/View/Components/RangesComponent.js +2 -2
- package/src/View/Components/Selectors/ColumnSelector.js +5 -5
- package/src/View/Components/Selectors/ColumnValueSelector.d.ts +10 -2
- package/src/View/Components/Selectors/ColumnValueSelector.js +47 -15
- package/src/View/Components/ToolPanel/AdaptableToolPanel.js +7 -7
- package/src/View/Components/ToolPanel/CustomToolPanelContent.js +1 -1
- package/src/View/ConditionalStyle/ConditionalStylePopup.js +1 -1
- package/src/View/ConditionalStyle/ConditionalStyleSummary.js +1 -1
- package/src/View/CustomSort/CustomSortEntityRow.js +2 -2
- package/src/View/CustomSort/CustomSortPopup.js +1 -1
- package/src/View/CustomSort/CustomSortSummary.js +3 -3
- package/src/View/CustomSort/Wizard/CustomSortColumnWizardSection.js +3 -3
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +24 -6
- package/src/View/Dashboard/CustomToolbarWrapper.js +2 -1
- package/src/View/Dashboard/Dashboard.js +2 -3
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +5 -5
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +4 -1
- package/src/View/Export/ExportCustomDestinationDialog.js +1 -1
- package/src/View/Filter/FilterSummary.js +2 -2
- package/src/View/FormatColumn/FormatColumnPopup.js +1 -1
- package/src/View/FormatColumn/FormatColumnSummary.js +1 -1
- package/src/View/FormatColumn/Wizard/FormatColumnFormatWizardSection.js +1 -1
- package/src/View/FreeTextColumn/FreeTextColumnPopup.js +4 -2
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +5 -3
- package/src/View/FreeTextColumn/Wizard/FreeTextColumnSettingsWizardSection.js +1 -1
- package/src/View/GridInfo/ColumnInfoComponent.js +16 -16
- package/src/View/GridInfo/GridInfoPopup.js +4 -1
- package/src/View/Layout/Wizard/LayoutEditor/ColumnList.js +6 -6
- package/src/View/Layout/Wizard/LayoutEditor/ColumnSortList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/PivotList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/RowGroupsList.js +1 -1
- package/src/View/Layout/Wizard/LayoutEditor/getItemStyle.js +2 -2
- package/src/View/Layout/Wizard/LayoutEditor/index.js +41 -41
- package/src/View/PlusMinus/PlusMinusPopup.js +1 -1
- package/src/View/PlusMinus/PlusMinusSummary.js +1 -1
- package/src/View/Query/QueryViewPanel.js +2 -2
- package/src/View/UIHelper.d.ts +2 -0
- package/src/View/UIHelper.js +10 -1
- package/src/agGrid/ActionColumnRenderer.d.ts +2 -1
- package/src/agGrid/ActionColumnRenderer.js +21 -4
- package/src/agGrid/Adaptable.d.ts +20 -4
- package/src/agGrid/Adaptable.js +249 -102
- package/src/agGrid/agGridHelper.js +33 -32
- package/src/agGrid/agGridMenuHelper.js +2 -2
- package/src/components/AdaptableFormComponent/AdaptableFormComponent.js +3 -3
- package/src/components/Dashboard/Dashboard.js +1 -1
- package/src/components/DropdownButton/index.js +1 -1
- package/src/components/ExpressionEditor/index.js +7 -7
- package/src/components/Loader/Loader.d.ts +7 -0
- package/src/components/Loader/Loader.js +13 -0
- package/src/components/Loader/index.d.ts +2 -0
- package/src/components/Loader/index.js +7 -0
- package/src/components/ProgressIndicator/ProgressIndicator.d.ts +2 -0
- package/src/components/ProgressIndicator/ProgressIndicator.js +54 -0
- package/src/metamodel/adaptable.metamodel.d.ts +125 -16
- package/src/metamodel/adaptable.metamodel.js +403 -106
- package/src/types.d.ts +4 -3
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/Utilities/Interface/ProgressIndicator.d.ts +0 -4
- package/src/View/Export/ProgressIndicator.d.ts +0 -6
- package/src/View/Export/ProgressIndicator.js +0 -25
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { AdaptableColumn } from '../../../PredefinedConfig/Common/AdaptableColumn';
|
|
3
3
|
import { DropdownButtonProps } from '../../../components/DropdownButton';
|
|
4
4
|
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
5
|
+
import { GridCell } from '../../../types';
|
|
5
6
|
export interface ColumnValueSelectorProps extends React.HTMLProps<ColumnValueSelector> {
|
|
6
7
|
selectedColumn: AdaptableColumn;
|
|
7
8
|
selectedColumnValue: string;
|
|
@@ -12,19 +13,26 @@ export interface ColumnValueSelectorProps extends React.HTMLProps<ColumnValueSel
|
|
|
12
13
|
newLabel?: string;
|
|
13
14
|
existingLabel?: string;
|
|
14
15
|
dropdownButtonProps?: DropdownButtonProps;
|
|
16
|
+
selectedGridCells: GridCell[];
|
|
15
17
|
}
|
|
16
18
|
declare enum NEW_OR_EXISTING {
|
|
17
19
|
existing = "Existing value",
|
|
18
20
|
new = "New value"
|
|
19
21
|
}
|
|
20
|
-
|
|
22
|
+
interface ColumnValueSelectorState {
|
|
21
23
|
newOrExisting: NEW_OR_EXISTING;
|
|
22
|
-
|
|
24
|
+
distinctColumnValues: any[];
|
|
25
|
+
isDistinctColumnValuesLoading: boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare class ColumnValueSelector extends React.Component<ColumnValueSelectorProps, ColumnValueSelectorState> {
|
|
23
28
|
static defaultProps: {
|
|
24
29
|
newLabel: string;
|
|
25
30
|
existingLabel: string;
|
|
26
31
|
};
|
|
27
32
|
constructor(props: ColumnValueSelectorProps);
|
|
33
|
+
componentDidUpdate(prevProps: ColumnValueSelectorProps): void;
|
|
34
|
+
loadPermittedValues: () => Promise<void>;
|
|
35
|
+
handleSelectedValueExpand: () => void;
|
|
28
36
|
render(): JSX.Element;
|
|
29
37
|
onSelectedValueChange(selected: any[]): void;
|
|
30
38
|
}
|
|
@@ -10,6 +10,8 @@ const FieldWrap_1 = tslib_1.__importDefault(require("../../../components/FieldWr
|
|
|
10
10
|
const DropdownButton_1 = tslib_1.__importDefault(require("../../../components/DropdownButton"));
|
|
11
11
|
const UIHelper_1 = tslib_1.__importDefault(require("../../UIHelper"));
|
|
12
12
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../AdaptableInput"));
|
|
13
|
+
const runIfNotResolvedIn_1 = require("../../../Utilities/runIfNotResolvedIn");
|
|
14
|
+
const join_1 = tslib_1.__importDefault(require("../../../components/utils/join"));
|
|
13
15
|
var NEW_OR_EXISTING;
|
|
14
16
|
(function (NEW_OR_EXISTING) {
|
|
15
17
|
NEW_OR_EXISTING["existing"] = "Existing value";
|
|
@@ -18,35 +20,65 @@ var NEW_OR_EXISTING;
|
|
|
18
20
|
class ColumnValueSelector extends React.Component {
|
|
19
21
|
constructor(props) {
|
|
20
22
|
super(props);
|
|
23
|
+
this.loadPermittedValues = async () => {
|
|
24
|
+
var _a;
|
|
25
|
+
if (!((_a = this.props.selectedColumn) === null || _a === void 0 ? void 0 : _a.columnId)) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
// JW "fixed" this by replacing display values with raw values but really we should do it nicer in some way
|
|
29
|
+
// so that you we show the display value but we work on the raw value
|
|
30
|
+
const columnDisplayValuePairs = await runIfNotResolvedIn_1.runIfNotResolvedIn(this.props.api.columnApi.getDistinctBulkUpdateDisplayValuesForColumn(this.props.selectedColumn.columnId, this.props.selectedGridCells), () => this.setState({ isDistinctColumnValuesLoading: true }));
|
|
31
|
+
this.setState({ isDistinctColumnValuesLoading: false });
|
|
32
|
+
const newSortedColumnValues = ArrayExtensions_1.ArrayExtensions.sortArray(columnDisplayValuePairs, Enums_1.SortOrder.Asc).map((v) => ({
|
|
33
|
+
label: v,
|
|
34
|
+
value: v,
|
|
35
|
+
onClick: () => this.onSelectedValueChange([{ DisplayValue: v }]),
|
|
36
|
+
}));
|
|
37
|
+
this.setState({
|
|
38
|
+
distinctColumnValues: newSortedColumnValues,
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
this.handleSelectedValueExpand = () => {
|
|
42
|
+
// load only if not loaded
|
|
43
|
+
if (!this.state.distinctColumnValues.length) {
|
|
44
|
+
this.loadPermittedValues();
|
|
45
|
+
}
|
|
46
|
+
};
|
|
21
47
|
this.state = {
|
|
22
48
|
newOrExisting: NEW_OR_EXISTING.existing,
|
|
49
|
+
distinctColumnValues: [],
|
|
50
|
+
isDistinctColumnValuesLoading: false,
|
|
23
51
|
};
|
|
24
52
|
}
|
|
53
|
+
componentDidUpdate(prevProps) {
|
|
54
|
+
if (this.props.selectedColumn !== prevProps.selectedColumn ||
|
|
55
|
+
this.props.selectedGridCells !== prevProps.selectedGridCells) {
|
|
56
|
+
this.loadPermittedValues();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
25
59
|
render() {
|
|
26
60
|
let placeholderText = 'Select';
|
|
27
|
-
let sortedColumnValues = [];
|
|
28
61
|
let allowNew = this.props.allowNew != null ? this.props.allowNew : true;
|
|
29
62
|
if (allowNew) {
|
|
30
63
|
// placeholderText += ' or enter free text';
|
|
31
64
|
}
|
|
65
|
+
const baseClassName = 'ab-column-value-selector';
|
|
66
|
+
const className = join_1.default('ab-column-value-selector', this.state.isDistinctColumnValuesLoading && `${baseClassName}--loading`);
|
|
32
67
|
const fieldWidth = 150;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
onClick: () => this.onSelectedValueChange([{ DisplayValue: v }]),
|
|
42
|
-
}));
|
|
43
|
-
}
|
|
68
|
+
const items = this.state.isDistinctColumnValuesLoading
|
|
69
|
+
? [
|
|
70
|
+
{
|
|
71
|
+
label: 'Loading',
|
|
72
|
+
disabled: true,
|
|
73
|
+
},
|
|
74
|
+
]
|
|
75
|
+
: this.state.distinctColumnValues;
|
|
44
76
|
const dd = (React.createElement("div", null,
|
|
45
|
-
React.createElement(DropdownButton_1.default, { className:
|
|
77
|
+
React.createElement(DropdownButton_1.default, { className: className, columns: ['label'], variant: "text", showClearButton: true, onClear: () => this.onSelectedValueChange([]), style: { fontSize: 'small' }, disabled: this.props.disabled, items: items, onExpand: this.handleSelectedValueExpand }, this.props.selectedColumnValue ? this.props.selectedColumnValue : placeholderText)));
|
|
46
78
|
const input = (React.createElement(AdaptableInput_1.default, { type: this.props.selectedColumn
|
|
47
|
-
? UIHelper_1.default.getDescriptionForDataType(this.props.selectedColumn.
|
|
79
|
+
? UIHelper_1.default.getDescriptionForDataType(this.props.selectedColumn.dataType)
|
|
48
80
|
: 'text', placeholder: this.props.selectedColumn
|
|
49
|
-
? UIHelper_1.default.getPlaceHolderforDataType(this.props.selectedColumn.
|
|
81
|
+
? UIHelper_1.default.getPlaceHolderforDataType(this.props.selectedColumn.dataType)
|
|
50
82
|
: 'Enter Value', autoFocus: true, disabled: this.props.disabled, style: { width: fieldWidth }, value: this.props.selectedColumnValue, onChange: (e) => {
|
|
51
83
|
this.onSelectedValueChange([
|
|
52
84
|
{ customOption: true, DisplayValue: e.target.value },
|
|
@@ -154,11 +154,11 @@ const AdaptableToolPanelComponent = (props) => {
|
|
|
154
154
|
];
|
|
155
155
|
props.Columns.forEach((col, index) => {
|
|
156
156
|
colItems.push({
|
|
157
|
-
id: col.
|
|
157
|
+
id: col.columnId,
|
|
158
158
|
onClick: () => {
|
|
159
|
-
onSetColumnVisibility(col.
|
|
159
|
+
onSetColumnVisibility(col.columnId);
|
|
160
160
|
},
|
|
161
|
-
label: (React.createElement(CheckBox_1.CheckBox, { as: "div", className: "ab-dd-checkbox", variant: "agGrid", my: 0, value: col.
|
|
161
|
+
label: (React.createElement(CheckBox_1.CheckBox, { as: "div", className: "ab-dd-checkbox", variant: "agGrid", my: 0, value: col.columnId, key: col.columnId, checked: col.visible, onMouseDown: preventDefault }, col.friendlyName)),
|
|
162
162
|
});
|
|
163
163
|
});
|
|
164
164
|
return (React.createElement(DropdownButton_1.default, { listMinWidth: 150, variant: "text", tone: "none", collapseOnItemClick: false, items: colItems, columns: ['label'], className: "ab-Toolpanel__columns", key: 'dropdown-cols', id: 'dropdown-cols', tooltip: "Select Columns" }, colsGlyph));
|
|
@@ -180,7 +180,7 @@ const AdaptableToolPanelComponent = (props) => {
|
|
|
180
180
|
};
|
|
181
181
|
const iconProps = button.icon && Object.assign({}, defaultIconProps, button.icon);
|
|
182
182
|
const toolPanelContext = {
|
|
183
|
-
|
|
183
|
+
adaptableApi: props.api,
|
|
184
184
|
toolPanelState: props.api.toolPanelApi.getToolPanelState(),
|
|
185
185
|
};
|
|
186
186
|
let buttonStyle = props.api.internalApi.getStyleForButton(button, toolPanelContext);
|
|
@@ -213,11 +213,11 @@ const AdaptableToolPanelComponent = (props) => {
|
|
|
213
213
|
let changedColumn = props.api.columnApi.getColumnFromId(name);
|
|
214
214
|
let columns = [].concat(props.Columns);
|
|
215
215
|
changedColumn = Object.assign({}, changedColumn, {
|
|
216
|
-
Visible: !changedColumn.
|
|
216
|
+
Visible: !changedColumn.visible,
|
|
217
217
|
});
|
|
218
|
-
let index = columns.findIndex((x) => x.
|
|
218
|
+
let index = columns.findIndex((x) => x.columnId == name);
|
|
219
219
|
columns[index] = changedColumn;
|
|
220
|
-
props.onNewColumnListOrder(columns.filter((c) => c.
|
|
220
|
+
props.onNewColumnListOrder(columns.filter((c) => c.visible).map((c) => c.columnId));
|
|
221
221
|
};
|
|
222
222
|
const onSetToolPanelVisibility = (name, checked) => {
|
|
223
223
|
if (checked) {
|
|
@@ -48,7 +48,7 @@ exports.CustomToolPanelContent = (props) => {
|
|
|
48
48
|
};
|
|
49
49
|
const iconProps = button.icon && Object.assign({}, defaultIconProps, button.icon);
|
|
50
50
|
const toolPanelContext = {
|
|
51
|
-
api,
|
|
51
|
+
adaptableApi: api,
|
|
52
52
|
toolPanelState: api.toolPanelApi.getToolPanelState(),
|
|
53
53
|
customToolPanel: customToolPanel,
|
|
54
54
|
};
|
|
@@ -61,7 +61,7 @@ class ConditionalStylePopupComponent extends React.Component {
|
|
|
61
61
|
if (this.props.popupParams.action == 'New') {
|
|
62
62
|
_editedConditionalStyle = ObjectFactory_1.ObjectFactory.CreateEmptyConditionalStyle();
|
|
63
63
|
_editedConditionalStyle.Scope = {
|
|
64
|
-
ColumnIds: [column.
|
|
64
|
+
ColumnIds: [column.columnId],
|
|
65
65
|
};
|
|
66
66
|
this.setState({
|
|
67
67
|
editedAdaptableObject: _editedConditionalStyle,
|
|
@@ -57,7 +57,7 @@ class ConditionalStyleSummaryComponent extends React.Component {
|
|
|
57
57
|
onNew() {
|
|
58
58
|
let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyConditionalStyle();
|
|
59
59
|
configEntity.Scope = {
|
|
60
|
-
ColumnIds: [this.props.summarisedColumn.
|
|
60
|
+
ColumnIds: [this.props.summarisedColumn.columnId],
|
|
61
61
|
};
|
|
62
62
|
this.setState({
|
|
63
63
|
editedAdaptableObject: configEntity,
|
|
@@ -14,10 +14,10 @@ class CustomSortEntityRow extends React.Component {
|
|
|
14
14
|
let customSort = this.props.adaptableObject;
|
|
15
15
|
const columnSortComparer = this.props.api.internalApi.getCustomSortComparer(this.props.column);
|
|
16
16
|
let colItems = Helper_1.cloneObject(this.props.colItems);
|
|
17
|
-
colItems[0].Content = React.createElement(EntityRowItem_1.EntityRowItem, { Content: this.props.column.
|
|
17
|
+
colItems[0].Content = React.createElement(EntityRowItem_1.EntityRowItem, { Content: this.props.column.friendlyName });
|
|
18
18
|
colItems[1].Content = (React.createElement(EntityRowItem_1.EntityRowItem, { Content: customSort ? this.getCustomSortedValues(customSort) : 'Custom Sort Function' }));
|
|
19
19
|
colItems[2].Content = (React.createElement(EntityListActionButtons_1.EntityListActionButtons, { showSuspend: true, suspendableObject: customSort, confirmDeleteAction: this.props.onDeleteConfirm, editClick: () => this.props.onEdit(customSort), shareClick: (config) => this.props.onShare(config), showShare: this.props.teamSharingActivated, overrideDisableEdit: columnSortComparer != undefined ||
|
|
20
|
-
this.props.column.
|
|
20
|
+
this.props.column.friendlyName.includes(GeneralConstants.MISSING_COLUMN), entityType: this.props.moduleInfo.FriendlyName, accessLevel: this.props.accessLevel, onSuspend: this.props.onSuspend, onUnSuspend: this.props.onUnSuspend }));
|
|
21
21
|
return React.createElement(AdaptableObjectRow_1.AdaptableObjectRow, { isSuspended: customSort.IsSuspended, colItems: colItems });
|
|
22
22
|
}
|
|
23
23
|
getCustomSortedValues(customSort) {
|
|
@@ -53,7 +53,7 @@ class CustomSortPopupComponent extends React.Component {
|
|
|
53
53
|
componentDidMount() {
|
|
54
54
|
if (this.props.popupParams) {
|
|
55
55
|
if (this.props.popupParams.action && this.props.popupParams.column) {
|
|
56
|
-
let columnId = this.props.popupParams.column.
|
|
56
|
+
let columnId = this.props.popupParams.column.columnId;
|
|
57
57
|
if (this.props.popupParams.action == 'New') {
|
|
58
58
|
let newCustomSort = ObjectFactory_1.ObjectFactory.CreateEmptyCustomSort();
|
|
59
59
|
newCustomSort.ColumnId = columnId;
|
|
@@ -36,11 +36,11 @@ class CustomSortSummaryComponent extends React.Component {
|
|
|
36
36
|
this.state = UIHelper_1.UIHelper.getEmptyConfigState();
|
|
37
37
|
}
|
|
38
38
|
render() {
|
|
39
|
-
const customSort = this.props.CustomSorts.find((c) => c.ColumnId == this.props.summarisedColumn.
|
|
39
|
+
const customSort = this.props.CustomSorts.find((c) => c.ColumnId == this.props.summarisedColumn.columnId);
|
|
40
40
|
const columnSortComparer = this.props.api.internalApi.getCustomSortComparer(this.props.summarisedColumn);
|
|
41
41
|
let noCustomSort = customSort == null && columnSortComparer == null;
|
|
42
42
|
let customSortRow;
|
|
43
|
-
if (!this.props.summarisedColumn.
|
|
43
|
+
if (!this.props.summarisedColumn.sortable) {
|
|
44
44
|
customSortRow = (React.createElement(ModuleHeader_1.ModuleHeader, { key: this.props.moduleInfo.FriendlyName, moduleInfo: this.props.moduleInfo, moduleSummary: 'Column is not sortable', newButtonDisabled: true, onNew: () => this.onNew(), newButtonTooltip: this.props.moduleInfo.FriendlyName, accessLevel: this.props.accessLevel }));
|
|
45
45
|
}
|
|
46
46
|
else if (noCustomSort) {
|
|
@@ -59,7 +59,7 @@ class CustomSortSummaryComponent extends React.Component {
|
|
|
59
59
|
}
|
|
60
60
|
onNew() {
|
|
61
61
|
let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyCustomSort();
|
|
62
|
-
configEntity.ColumnId = this.props.summarisedColumn.
|
|
62
|
+
configEntity.ColumnId = this.props.summarisedColumn.columnId;
|
|
63
63
|
this.setState({
|
|
64
64
|
editedAdaptableObject: configEntity,
|
|
65
65
|
wizardStartIndex: 1,
|
|
@@ -29,16 +29,16 @@ exports.CustomSortColumnWizardSection = (props) => {
|
|
|
29
29
|
const customSorts = api.customSortApi.getAllCustomSort();
|
|
30
30
|
const columnSortComparers = ((_b = (_a = api.internalApi.getAdaptableOptions()) === null || _a === void 0 ? void 0 : _a.generalOptions) === null || _b === void 0 ? void 0 : _b.customSortComparers) || [];
|
|
31
31
|
const usedColumnIds = [
|
|
32
|
-
...customSorts.map((
|
|
32
|
+
...customSorts.map((customSort) => customSort.ColumnId),
|
|
33
33
|
...columnSortComparers.map((comparer) => comparer.columnId),
|
|
34
34
|
];
|
|
35
35
|
// filter out used colum ids, but include the current one
|
|
36
36
|
return sortableColumns.filter((column) => {
|
|
37
|
-
if (!props.isNew && column.
|
|
37
|
+
if (!props.isNew && column.columnId === (data === null || data === void 0 ? void 0 : data.ColumnId)) {
|
|
38
38
|
return true;
|
|
39
39
|
}
|
|
40
40
|
return usedColumnIds.every((usedColumnId) => {
|
|
41
|
-
return column.
|
|
41
|
+
return column.columnId !== usedColumnId;
|
|
42
42
|
});
|
|
43
43
|
});
|
|
44
44
|
}, []);
|
|
@@ -5,7 +5,10 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const react_1 = require("react");
|
|
7
7
|
const rebass_1 = require("rebass");
|
|
8
|
+
const Loader_1 = require("../../../components/Loader");
|
|
8
9
|
const Tabs_1 = require("../../../components/Tabs");
|
|
10
|
+
const join_1 = tslib_1.__importDefault(require("../../../components/utils/join"));
|
|
11
|
+
const runIfNotResolvedIn_1 = require("../../../Utilities/runIfNotResolvedIn");
|
|
9
12
|
const sortWithOrder_1 = require("../../../Utilities/sortWithOrder");
|
|
10
13
|
const ValueSelector_1 = require("../../Components/ValueSelector");
|
|
11
14
|
const OnePageAdaptableWizard_1 = require("../../Wizard/OnePageAdaptableWizard");
|
|
@@ -21,8 +24,23 @@ exports.renderCustomSortValuesSummary = (data) => {
|
|
|
21
24
|
};
|
|
22
25
|
exports.CustomSortValuesWizardSection = (props) => {
|
|
23
26
|
const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
|
|
24
|
-
const distinctValues = react_1.
|
|
25
|
-
|
|
27
|
+
const [distinctValues, setDistinctValues] = react_1.useState([]);
|
|
28
|
+
const [isDistinctValuesLoading, setIsDistinctValuesLoading] = react_1.useState(false);
|
|
29
|
+
react_1.useEffect(() => {
|
|
30
|
+
let isMounted = true;
|
|
31
|
+
(async () => {
|
|
32
|
+
// for sync and very fast resolving promises does not make sense to show a loader
|
|
33
|
+
setDistinctValues([]);
|
|
34
|
+
const newValues = await runIfNotResolvedIn_1.runIfNotResolvedIn(api.columnApi.getDistinctCustomSortDisplayValuesForColumn(data.ColumnId), () => isMounted && setIsDistinctValuesLoading(true));
|
|
35
|
+
if (!isMounted) {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
setIsDistinctValuesLoading(false);
|
|
39
|
+
setDistinctValues(newValues);
|
|
40
|
+
})();
|
|
41
|
+
return () => {
|
|
42
|
+
isMounted = false;
|
|
43
|
+
};
|
|
26
44
|
}, [data.ColumnId]);
|
|
27
45
|
const sortedValuesMap = react_1.useMemo(() => {
|
|
28
46
|
if (!data.SortedValues || !data.SortedValues.length) {
|
|
@@ -37,14 +55,14 @@ exports.CustomSortValuesWizardSection = (props) => {
|
|
|
37
55
|
return sortedValuesMap.has(option);
|
|
38
56
|
}, [sortedValuesMap]);
|
|
39
57
|
const options = react_1.useMemo(() => {
|
|
40
|
-
// if (!allowReorder) {
|
|
41
|
-
// return distinctValues;
|
|
42
|
-
// }
|
|
43
58
|
return sortWithOrder_1.sortWithOrderArray(distinctValues, data.SortedValues, { sortUnorderedItems: false });
|
|
44
59
|
}, [allowReorder, distinctValues, data.SortedValues]);
|
|
45
|
-
|
|
60
|
+
const baseClassName = 'ab-CustomSortWizard__SortOrder';
|
|
61
|
+
const className = join_1.default(baseClassName, isDistinctValuesLoading && `${baseClassName}--loading`);
|
|
62
|
+
return (React.createElement(Tabs_1.Tabs, { style: { height: '100%' }, className: className },
|
|
46
63
|
React.createElement(Tabs_1.Tabs.Tab, null, "Sort Order"),
|
|
47
64
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
65
|
+
isDistinctValuesLoading && React.createElement(Loader_1.Loader, null, "Loading"),
|
|
48
66
|
React.createElement(ValueSelector_1.ValueSelector, { toIdentifier: (x) => `${x}`, toLabel: (x) => `${x}`, options: options, value: data.SortedValues, allowReorder: allowReorder, xSelectedLabel: () => {
|
|
49
67
|
return `Your Sort Order:`;
|
|
50
68
|
}, onChange: (SortedValues) => {
|
|
@@ -35,6 +35,7 @@ exports.CustomToolbarWrapper = (props) => {
|
|
|
35
35
|
return (React.createElement(PanelDashboard_1.PanelDashboard, { className: `ab-CustomToolbar ab-DashboardToolbar__${props.customToolbar.name}`, "data-name": `ab-CustomToolbar ab-DashboardToolbar__${props.customToolbar.name}`, headerText: props.customToolbar.title ? props.customToolbar.title : '', showConfigureButton: props.customToolbar.showConfigureButton != null &&
|
|
36
36
|
props.customToolbar.showConfigureButton == true, showCloseButton: props.customToolbar.showCloseButton != null && props.customToolbar.showCloseButton == true, onConfigure: () => {
|
|
37
37
|
const customToolbarConfiguredInfo = {
|
|
38
|
+
adaptableApi: api,
|
|
38
39
|
customToolbar: props.customToolbar,
|
|
39
40
|
};
|
|
40
41
|
api.eventApi.emit('CustomToolbarConfigured', customToolbarConfiguredInfo);
|
|
@@ -48,7 +49,7 @@ exports.CustomToolbarWrapper = (props) => {
|
|
|
48
49
|
// with the next opportunity we should abstract it
|
|
49
50
|
const dashboardContext = {
|
|
50
51
|
customToolbar: props.customToolbar,
|
|
51
|
-
api,
|
|
52
|
+
adaptableApi: api,
|
|
52
53
|
dashboardState: api.dashboardApi.getDashboardState(),
|
|
53
54
|
};
|
|
54
55
|
let buttonStyle = api.internalApi.getStyleForButton(button, dashboardContext);
|
|
@@ -84,8 +84,7 @@ const DashboardComponent = (props) => {
|
|
|
84
84
|
};
|
|
85
85
|
const renderDashboardButtons = () => {
|
|
86
86
|
var _a;
|
|
87
|
-
let dashboardButtonsArray = (_a = props.api.dashboardApi
|
|
88
|
-
.getCustomDashboardButtons()) === null || _a === void 0 ? void 0 : _a.filter((c) => c);
|
|
87
|
+
let dashboardButtonsArray = (_a = props.api.dashboardApi.getCustomDashboardButtons()) === null || _a === void 0 ? void 0 : _a.filter((c) => c);
|
|
89
88
|
let customDashboardButtons = null;
|
|
90
89
|
if (dashboardButtonsArray) {
|
|
91
90
|
customDashboardButtons = dashboardButtonsArray.map((button) => {
|
|
@@ -103,7 +102,7 @@ const DashboardComponent = (props) => {
|
|
|
103
102
|
// delete iconProps.Uuid;
|
|
104
103
|
// }
|
|
105
104
|
const dashboardContext = {
|
|
106
|
-
|
|
105
|
+
adaptableApi: props.api,
|
|
107
106
|
dashboardState: props.api.dashboardApi.getDashboardState(),
|
|
108
107
|
};
|
|
109
108
|
let buttonStyle = props.api.internalApi.getStyleForButton(button, dashboardContext);
|
|
@@ -104,7 +104,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
|
|
|
104
104
|
includeGroupedRows: true,
|
|
105
105
|
actionColumnButton: {
|
|
106
106
|
label: (button, context) => {
|
|
107
|
-
if (context.
|
|
107
|
+
if (context.adaptableApi.gridApi.isGroupRowNode(context.rowNode)) {
|
|
108
108
|
return 'Undo Group';
|
|
109
109
|
}
|
|
110
110
|
return 'Undo Change';
|
|
@@ -112,7 +112,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
|
|
|
112
112
|
onClick: (button, context) => {
|
|
113
113
|
var _a;
|
|
114
114
|
const rowNode = context.rowNode;
|
|
115
|
-
if (context.
|
|
115
|
+
if (context.adaptableApi.gridApi.isGroupRowNode(rowNode)) {
|
|
116
116
|
// undo all children
|
|
117
117
|
const childrenNodes = (_a = context.rowNode) === null || _a === void 0 ? void 0 : _a.childrenAfterFilter;
|
|
118
118
|
if (childrenNodes) {
|
|
@@ -195,7 +195,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
|
|
|
195
195
|
};
|
|
196
196
|
const buildGridOptions = (mainAdaptableInstance, changeHistoryLog) => {
|
|
197
197
|
var _a, _b;
|
|
198
|
-
const mainPrimaryKeyColumnHeader = (_b = (_a = mainAdaptableInstance.api.columnApi.getPrimaryKeyColumn()) === null || _a === void 0 ? void 0 : _a.
|
|
198
|
+
const mainPrimaryKeyColumnHeader = (_b = (_a = mainAdaptableInstance.api.columnApi.getPrimaryKeyColumn()) === null || _a === void 0 ? void 0 : _a.friendlyName) !== null && _b !== void 0 ? _b : 'Row ID';
|
|
199
199
|
const options = {
|
|
200
200
|
suppressLoadingOverlay: true,
|
|
201
201
|
overlayNoRowsTemplate: '<div style="font-size: var(--ab-font-size-2);color: var(--ab-color-text-on-primary);">No Data Changes</div>',
|
|
@@ -295,7 +295,7 @@ const mapChangeHistoryRowData = (changeHistoryLog = {}, mainAdaptableInstance) =
|
|
|
295
295
|
primaryKey: `${changeKey}::${changeInfo.changedAt}`,
|
|
296
296
|
changeKey,
|
|
297
297
|
changeTriggerLabel: getChangeTriggerLabel(changeInfo),
|
|
298
|
-
changedColumnLabel: getColumnHeaderLabel(changeInfo.columnId, mainAdaptableInstance),
|
|
298
|
+
changedColumnLabel: getColumnHeaderLabel(changeInfo.column.columnId, mainAdaptableInstance),
|
|
299
299
|
changeInfo,
|
|
300
300
|
};
|
|
301
301
|
});
|
|
@@ -305,7 +305,7 @@ const headerMap = new Map();
|
|
|
305
305
|
const getColumnHeaderLabel = (columnId, mainAdaptableInstance) => {
|
|
306
306
|
var _a, _b;
|
|
307
307
|
if (!headerMap.has(columnId)) {
|
|
308
|
-
headerMap.set(columnId, (_b = (_a = mainAdaptableInstance.api.columnApi.getColumnFromId(columnId)) === null || _a === void 0 ? void 0 : _a.
|
|
308
|
+
headerMap.set(columnId, (_b = (_a = mainAdaptableInstance.api.columnApi.getColumnFromId(columnId)) === null || _a === void 0 ? void 0 : _a.friendlyName) !== null && _b !== void 0 ? _b : columnId);
|
|
309
309
|
}
|
|
310
310
|
return headerMap.get(columnId);
|
|
311
311
|
};
|
|
@@ -53,6 +53,9 @@ class DataChangeHistoryPopupComponent extends React.Component {
|
|
|
53
53
|
this.props.api.dataChangeHistoryApi.undoDataChangeHistoryEntry(changeToBeUndone);
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
+
const currentVendorTheme = this.props.api.internalApi
|
|
57
|
+
.getAdaptableInstance()
|
|
58
|
+
.getVendorGridCurrentThemeName();
|
|
56
59
|
return (React.createElement(PanelWithButton_1.PanelWithButton, { headerText: this.props.moduleInfo.FriendlyName, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed(), border: "none", bodyProps: { padding: 0 } },
|
|
57
60
|
React.createElement(rebass_1.Flex, { className: "ab-DataChangeHistoryPopup", flexDirection: "column", style: { height: '100%' } },
|
|
58
61
|
React.createElement(rebass_1.Flex, { style: {
|
|
@@ -64,7 +67,7 @@ class DataChangeHistoryPopupComponent extends React.Component {
|
|
|
64
67
|
statusPanel)),
|
|
65
68
|
React.createElement(rebass_1.Flex, { className: "ab-DataChangeHistoryPopup--grid", "data-name": 'data-change-history--grid', flex: 1, alignSelf: 'stretch', flexDirection: 'column' },
|
|
66
69
|
React.createElement("div", { id: adaptableContainerId }),
|
|
67
|
-
React.createElement("div", { id: vendorContainerId, style: { height: '100%', width: '1000px' } }),
|
|
70
|
+
React.createElement("div", { id: vendorContainerId, className: currentVendorTheme, style: { height: '100%', width: '1000px' } }),
|
|
68
71
|
React.createElement(DataChangeHistoryGrid_1.DataChangeHistoryGrid, { adaptableContainerId: adaptableContainerId, vendorContainerId: vendorContainerId, changeHistoryLog: this.props.changeHistoryLog, onUndoChange: handleChangeUndo })))));
|
|
69
72
|
}
|
|
70
73
|
}
|
|
@@ -18,7 +18,7 @@ class FilterSummaryComponent extends React.Component {
|
|
|
18
18
|
this.state = UIHelper_1.UIHelper.getEmptyConfigState();
|
|
19
19
|
}
|
|
20
20
|
render() {
|
|
21
|
-
let columnFilter = this.props.ColumnFilters.find((c) => c.ColumnId == this.props.summarisedColumn.
|
|
21
|
+
let columnFilter = this.props.ColumnFilters.find((c) => c.ColumnId == this.props.summarisedColumn.columnId);
|
|
22
22
|
let description = this.getDescription(columnFilter);
|
|
23
23
|
let summaryItems = [];
|
|
24
24
|
summaryItems.push(React.createElement("b", null, React.createElement(ModuleProfile_1.ModuleProfile, { moduleInfo: this.props.moduleInfo })));
|
|
@@ -27,7 +27,7 @@ class FilterSummaryComponent extends React.Component {
|
|
|
27
27
|
return React.createElement(SummaryRowItem_1.SummaryRowItem, { SummaryItems: summaryItems });
|
|
28
28
|
}
|
|
29
29
|
getDescription(columnFilter) {
|
|
30
|
-
if (this.props.summarisedColumn && !this.props.summarisedColumn.
|
|
30
|
+
if (this.props.summarisedColumn && !this.props.summarisedColumn.filterable) {
|
|
31
31
|
return 'Column is not filterable';
|
|
32
32
|
}
|
|
33
33
|
if (columnFilter == null) {
|
|
@@ -55,7 +55,7 @@ class FormatColumnPopupComponent extends React.Component {
|
|
|
55
55
|
if (this.props.popupParams.action == 'New') {
|
|
56
56
|
let newFormatColumn = ObjectFactory_1.ObjectFactory.CreateEmptyFormatColumn();
|
|
57
57
|
newFormatColumn.Scope = {
|
|
58
|
-
ColumnIds: [column.
|
|
58
|
+
ColumnIds: [column.columnId],
|
|
59
59
|
};
|
|
60
60
|
this.onNewFromColumn(newFormatColumn);
|
|
61
61
|
}
|
|
@@ -51,7 +51,7 @@ class FormatColumnSummaryComponent extends React.Component {
|
|
|
51
51
|
onNew() {
|
|
52
52
|
let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyFormatColumn();
|
|
53
53
|
configEntity.Scope = {
|
|
54
|
-
ColumnIds: [this.props.summarisedColumn.
|
|
54
|
+
ColumnIds: [this.props.summarisedColumn.columnId],
|
|
55
55
|
};
|
|
56
56
|
this.setState({
|
|
57
57
|
editedAdaptableObject: configEntity,
|
|
@@ -104,7 +104,7 @@ exports.getFormatDisplayTypeForScope = (scope, api) => {
|
|
|
104
104
|
// need to see if all columns are numeric or date
|
|
105
105
|
if ('ColumnIds' in scope) {
|
|
106
106
|
const columns = scope.ColumnIds.map((c) => api.columnApi.getColumnFromId(c));
|
|
107
|
-
const columnDataTypes = uniq_1.default(columns.map((c) => c.
|
|
107
|
+
const columnDataTypes = uniq_1.default(columns.map((c) => c.dataType));
|
|
108
108
|
if (columnDataTypes.length == 1 && columnDataTypes[0] == 'Number') {
|
|
109
109
|
return 'Number';
|
|
110
110
|
}
|
|
@@ -44,7 +44,7 @@ class FreeTextColumnPopupComponent extends React.Component {
|
|
|
44
44
|
if (this.props.popupParams) {
|
|
45
45
|
if (this.props.popupParams.action && this.props.popupParams.column) {
|
|
46
46
|
if (this.props.popupParams.action == 'Edit') {
|
|
47
|
-
let editFreeTextColumn = this.props.FreeTextColumns.find((x) => x.ColumnId == this.props.popupParams.column.
|
|
47
|
+
let editFreeTextColumn = this.props.FreeTextColumns.find((x) => x.ColumnId == this.props.popupParams.column.columnId);
|
|
48
48
|
let index = this.props.FreeTextColumns.indexOf(editFreeTextColumn);
|
|
49
49
|
this.onEdit(editFreeTextColumn);
|
|
50
50
|
}
|
|
@@ -74,7 +74,9 @@ class FreeTextColumnPopupComponent extends React.Component {
|
|
|
74
74
|
this.state.editedAdaptableObject != null && (React.createElement(FreeTextColumnWizard_1.FreeTextColumnWizard, { moduleInfo: this.props.moduleInfo, data: this.state.editedAdaptableObject, configEntities: this.props.FreeTextColumns, wizardStartIndex: this.state.wizardStartIndex, onCloseWizard: () => this.onCloseWizard(), onFinishWizard: this.onFinishWizard })))));
|
|
75
75
|
}
|
|
76
76
|
onNew() {
|
|
77
|
-
const
|
|
77
|
+
const specialColumnsAreFilterable = this.props.api.internalApi.getAdaptableOptions()
|
|
78
|
+
.filterOptions.enableFilterOnSpecialColumns;
|
|
79
|
+
const editedAdaptableObject = ObjectFactory_1.ObjectFactory.CreateEmptyFreeTextColumn(specialColumnsAreFilterable);
|
|
78
80
|
// we want to do this here, as we need a way to differentiate in the wizard
|
|
79
81
|
// if it's a new or existing column
|
|
80
82
|
delete editedAdaptableObject.Uuid;
|
|
@@ -35,7 +35,7 @@ class FreeTextColumnSummaryComponent extends React.Component {
|
|
|
35
35
|
this.state = UIHelper_1.UIHelper.getEmptyConfigState();
|
|
36
36
|
}
|
|
37
37
|
render() {
|
|
38
|
-
let freeTextColumn = this.props.FreeTextColumns.find((c) => c.ColumnId == this.props.summarisedColumn.
|
|
38
|
+
let freeTextColumn = this.props.FreeTextColumns.find((c) => c.ColumnId == this.props.summarisedColumn.columnId);
|
|
39
39
|
let noFreeTextColumn = freeTextColumn == null;
|
|
40
40
|
let FreeTextColumnRow;
|
|
41
41
|
if (!noFreeTextColumn) {
|
|
@@ -49,8 +49,10 @@ class FreeTextColumnSummaryComponent extends React.Component {
|
|
|
49
49
|
this.state.editedAdaptableObject && (React.createElement(FreeTextColumnWizard_1.FreeTextColumnWizard, { moduleInfo: this.props.moduleInfo, data: this.state.editedAdaptableObject, configEntities: this.props.FreeTextColumns, onCloseWizard: () => this.onCloseWizard(), onFinishWizard: this.onFinishWizard }))));
|
|
50
50
|
}
|
|
51
51
|
onNew() {
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
const specialColumnsAreFilterable = this.props.api.internalApi.getAdaptableOptions()
|
|
53
|
+
.filterOptions.enableFilterOnSpecialColumns;
|
|
54
|
+
let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyFreeTextColumn(specialColumnsAreFilterable);
|
|
55
|
+
configEntity.ColumnId = this.props.summarisedColumn.columnId;
|
|
54
56
|
this.setState({
|
|
55
57
|
editedAdaptableObject: configEntity,
|
|
56
58
|
wizardStartIndex: 1,
|
|
@@ -47,7 +47,7 @@ exports.isValidFreeTextColumn = (data, api) => {
|
|
|
47
47
|
if (!data.ColumnId) {
|
|
48
48
|
return 'Column id cannot be empty';
|
|
49
49
|
}
|
|
50
|
-
const columnsWithSameIdCount = columns.filter((c) => c.
|
|
50
|
+
const columnsWithSameIdCount = columns.filter((c) => c.columnId === data.ColumnId).length;
|
|
51
51
|
const hasAlreadyExistingId = data.Uuid ? columnsWithSameIdCount > 1 : columnsWithSameIdCount > 0;
|
|
52
52
|
if (hasAlreadyExistingId) {
|
|
53
53
|
return 'A Column already exists with that id';
|