@adaptabletools/adaptable 10.0.0-canary.3 → 10.0.3
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 +77 -29
- package/index.css +89 -31
- package/package.json +1 -5
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +12 -2
- package/src/AdaptableOptions/AdaptableOptions.d.ts +1 -1
- package/src/AdaptableOptions/FilterOptions.d.ts +14 -7
- package/src/AdaptableOptions/GeneralOptions.d.ts +0 -7
- package/src/AdaptableOptions/LayoutOptions.d.ts +1 -1
- package/src/AdaptableOptions/QueryLanguageOptions.d.ts +7 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +89 -4
- package/src/Api/AlertApi.d.ts +1 -1
- package/src/Api/ColumnApi.d.ts +33 -0
- package/src/Api/ConfigApi.d.ts +8 -0
- package/src/Api/DataChangeHistoryApi.d.ts +10 -4
- package/src/Api/GridApi.d.ts +34 -8
- package/src/Api/Implementation/AlertApiImpl.d.ts +1 -1
- package/src/Api/Implementation/AlertApiImpl.js +11 -4
- package/src/Api/Implementation/ColumnApiImpl.d.ts +7 -0
- package/src/Api/Implementation/ColumnApiImpl.js +37 -1
- package/src/Api/Implementation/ConfigApiImpl.d.ts +1 -1
- package/src/Api/Implementation/ConfigApiImpl.js +28 -17
- package/src/Api/Implementation/DataChangeHistoryApiImpl.d.ts +1 -0
- package/src/Api/Implementation/DataChangeHistoryApiImpl.js +3 -0
- package/src/Api/Implementation/FreeTextColumnApiImpl.js +2 -1
- package/src/Api/Implementation/GridApiImpl.d.ts +9 -0
- package/src/Api/Implementation/GridApiImpl.js +17 -1
- package/src/Api/Implementation/InternalApiImpl.d.ts +2 -0
- package/src/Api/Implementation/InternalApiImpl.js +16 -0
- package/src/Api/Implementation/QueryLanguageApiImpl.d.ts +2 -0
- package/src/Api/Implementation/QueryLanguageApiImpl.js +3 -0
- package/src/Api/Implementation/UserInterfaceApiImpl.d.ts +11 -8
- package/src/Api/Implementation/UserInterfaceApiImpl.js +57 -80
- package/src/Api/InternalApi.d.ts +2 -0
- package/src/Api/QueryLanguageApi.d.ts +5 -0
- package/src/Api/UserInterfaceApi.d.ts +14 -5
- package/src/PredefinedConfig/AlertState.d.ts +10 -0
- package/src/PredefinedConfig/CalculatedColumnState.d.ts +4 -37
- package/src/PredefinedConfig/Common/AdaptablePredicate.js +16 -15
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +5 -1
- package/src/PredefinedConfig/Common/SpecialColumnSettings.d.ts +49 -0
- package/src/{AdaptableOptions/DataChangeTrackingOptions.js → PredefinedConfig/Common/SpecialColumnSettings.js} +0 -0
- package/src/PredefinedConfig/FilterState.d.ts +1 -1
- package/src/PredefinedConfig/FreeTextColumnState.d.ts +10 -0
- package/src/PredefinedConfig/Selection/GridRow.d.ts +12 -4
- package/src/PredefinedConfig/SystemState.d.ts +4 -1
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +6 -6
- package/src/Redux/ActionsReducers/SystemRedux.js +11 -11
- package/src/Redux/Store/AdaptableReduxMerger.js +7 -1
- package/src/Redux/Store/AdaptableStore.js +12 -0
- package/src/Strategy/AlertModule.js +1 -1
- package/src/Strategy/DataChangeHistoryModule.js +1 -1
- package/src/Strategy/ExportModule.d.ts +0 -2
- package/src/Strategy/ExportModule.js +58 -61
- package/src/Utilities/Defaults/DefaultAdaptableOptions.js +2 -4
- package/src/Utilities/ExpressionFunctions/observableExpressionFunctions.js +11 -5
- package/src/Utilities/Helpers/DateHelper.d.ts +8 -2
- package/src/Utilities/Helpers/DateHelper.js +42 -20
- package/src/Utilities/ObjectFactory.d.ts +1 -1
- package/src/Utilities/ObjectFactory.js +13 -1
- package/src/Utilities/Services/AlertService.d.ts +1 -0
- package/src/Utilities/Services/AlertService.js +5 -0
- package/src/Utilities/Services/DataService.d.ts +0 -4
- package/src/Utilities/Services/DataService.js +2 -18
- package/src/Utilities/Services/Interface/IAlertService.d.ts +2 -1
- package/src/Utilities/Services/Interface/IDataService.d.ts +0 -2
- package/src/Utilities/Services/Interface/ILicenseService.d.ts +2 -1
- package/src/Utilities/Services/LicenseService.d.ts +2 -2
- package/src/Utilities/Services/MetamodelService.js +1 -0
- package/src/Utilities/Services/ModuleService.js +31 -24
- package/src/Utilities/Services/ReportService.js +1 -1
- package/src/Utilities/Services/TeamSharingService.d.ts +1 -0
- package/src/Utilities/Services/TeamSharingService.js +4 -2
- 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/Wizard/AlertDisplayWizardSection.js +19 -5
- package/src/View/BulkUpdate/BulkUpdatePopup.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdatePopup.js +4 -2
- package/src/View/BulkUpdate/BulkUpdateViewPanel.d.ts +2 -0
- package/src/View/BulkUpdate/BulkUpdateViewPanel.js +3 -1
- package/src/View/Components/FilterForm/FilterForm.d.ts +3 -51
- package/src/View/Components/FilterForm/FilterForm.js +44 -23
- 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 +64 -23
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.d.ts +3 -0
- package/src/View/Components/FilterForm/getDefaultColumnFilterPredicate.js +8 -0
- package/src/View/Components/Popups/AdaptablePopup.d.ts +1 -1
- package/src/View/Components/Selectors/ColumnValueSelector.d.ts +10 -2
- package/src/View/Components/Selectors/ColumnValueSelector.js +45 -13
- package/src/View/CustomSort/Wizard/CustomSortValuesWizardSection.js +24 -6
- package/src/View/DataChangeHistory/DataChangeHistoryGrid.js +42 -32
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.d.ts +5 -1
- package/src/View/DataChangeHistory/DataChangeHistoryPopup.js +8 -5
- package/src/View/FreeTextColumn/FreeTextColumnPopup.js +3 -1
- package/src/View/FreeTextColumn/FreeTextColumnSummary.js +3 -1
- package/src/View/GridInfo/GridInfoPopup.js +4 -1
- package/src/View/Query/QueryViewPanel.js +1 -1
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.d.ts +1 -1
- package/src/View/Schedule/Wizard/ScheduleScheduleWizard.js +6 -8
- 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 +20 -3
- package/src/agGrid/Adaptable.d.ts +20 -4
- package/src/agGrid/Adaptable.js +186 -55
- package/src/components/Dashboard/Dashboard.js +1 -1
- package/src/components/DropdownButton/index.js +1 -1
- package/src/components/ExpressionEditor/index.js +2 -1
- 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 +74 -34
- package/src/metamodel/adaptable.metamodel.js +346 -116
- package/src/parser/src/types.d.ts +11 -11
- package/src/types.d.ts +4 -4
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/src/AdaptableOptions/DataChangeTrackingOptions.d.ts +0 -16
- package/src/Utilities/Interface/ProgressIndicator.d.ts +0 -4
- package/src/Utilities/Interface/ProgressIndicator.js +0 -2
- package/src/View/Export/ProgressIndicator.d.ts +0 -6
- package/src/View/Export/ProgressIndicator.js +0 -25
|
@@ -1,50 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import * as FilterRedux from '../../../Redux/ActionsReducers/FilterRedux';
|
|
1
|
+
/// <reference types="react" />
|
|
3
2
|
import { ColumnFilterContext } from '../../../Utilities/Interface/ColumnFilterContext';
|
|
4
|
-
import { ModuleViewPopupProps } from '../SharedProps/ModuleViewPopupProps';
|
|
5
|
-
import { AdaptableColumn } from '../../../PredefinedConfig/Common/AdaptableColumn';
|
|
6
|
-
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
7
3
|
import { ColumnFilter } from '../../../PredefinedConfig/FilterState';
|
|
8
|
-
import { AdaptablePredicateDef } from '../../../PredefinedConfig/Common/AdaptablePredicate';
|
|
9
|
-
import { FilterOptions } from '../../../AdaptableOptions/FilterOptions';
|
|
10
|
-
interface QuickFilterFormProps extends ModuleViewPopupProps<QuickFilterFormComponent> {
|
|
11
|
-
api: AdaptableApi;
|
|
12
|
-
currentColumn: AdaptableColumn;
|
|
13
|
-
columnFilters: ColumnFilter[];
|
|
14
|
-
quickFilterTrigger?: FilterOptions['quickFilterTrigger'];
|
|
15
|
-
onAddColumnFilter: (columnFilter: ColumnFilter) => FilterRedux.ColumnFilterAddAction;
|
|
16
|
-
onEditColumnFilter: (columnFilter: ColumnFilter) => FilterRedux.ColumnFilterEditAction;
|
|
17
|
-
}
|
|
18
4
|
export interface QuickFilterFormState {
|
|
19
5
|
filter: ColumnFilter;
|
|
20
6
|
distinctColumnValues: any[];
|
|
7
|
+
isDistinctColumnValuesLoading: boolean;
|
|
8
|
+
suppressClientSideFilter: boolean;
|
|
21
9
|
}
|
|
22
|
-
declare class QuickFilterFormComponent extends React.Component<QuickFilterFormProps, QuickFilterFormState> {
|
|
23
|
-
private valuesDropdown?;
|
|
24
|
-
constructor(props: QuickFilterFormProps);
|
|
25
|
-
getDistinctValues: (props?: Readonly<QuickFilterFormProps> & Readonly<{
|
|
26
|
-
children?: React.ReactNode;
|
|
27
|
-
}>) => any[];
|
|
28
|
-
updateDistinctValues(props?: Readonly<QuickFilterFormProps> & Readonly<{
|
|
29
|
-
children?: React.ReactNode;
|
|
30
|
-
}>): void;
|
|
31
|
-
UNSAFE_componentWillReceiveProps(nextProps: QuickFilterFormProps): void;
|
|
32
|
-
getFilterFromProps(props: QuickFilterFormProps): ColumnFilter;
|
|
33
|
-
render(): any;
|
|
34
|
-
renderLabel(filter: ColumnFilter, activePredicateDef: AdaptablePredicateDef): JSX.Element;
|
|
35
|
-
renderPredicateIcon(predicateDef: AdaptablePredicateDef): JSX.Element;
|
|
36
|
-
renderPredicateInput(predicateDef: AdaptablePredicateDef, filter: ColumnFilter): JSX.Element | JSX.Element[];
|
|
37
|
-
renderNoValuesDropdown(filter: ColumnFilter): JSX.Element;
|
|
38
|
-
renderValuesDropdown(filter: ColumnFilter): JSX.Element;
|
|
39
|
-
onColumnValuesChange(columnValues: any[]): void;
|
|
40
|
-
selectColumnPredicate(predicateId: string): void;
|
|
41
|
-
debouncedAddFilter: import("lodash").DebouncedFunc<() => FilterRedux.ColumnFilterAddAction>;
|
|
42
|
-
debouncedEditFilter: import("lodash").DebouncedFunc<() => FilterRedux.ColumnFilterEditAction>;
|
|
43
|
-
private updateFilter;
|
|
44
|
-
changeColumnPredicateInput(value: string, index: number): void;
|
|
45
|
-
getPredicateIdForShortcutValue(value: string): string;
|
|
46
|
-
clearFilter(): void;
|
|
47
|
-
}
|
|
48
|
-
export declare const QuickFilterForm: import("react-redux").ConnectedComponent<typeof QuickFilterFormComponent, any>;
|
|
49
10
|
export declare const QuickFilterFormReact: (FilterContext: ColumnFilterContext) => JSX.Element;
|
|
50
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.QuickFilterFormReact =
|
|
3
|
+
exports.QuickFilterFormReact = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
6
|
const debounce_1 = tslib_1.__importDefault(require("lodash-es/debounce"));
|
|
@@ -16,47 +16,74 @@ const ArrayExtensions_1 = tslib_1.__importDefault(require("../../../Utilities/Ex
|
|
|
16
16
|
const AdaptableInput_1 = tslib_1.__importDefault(require("../AdaptableInput"));
|
|
17
17
|
const renderWithAdaptableContext_1 = require("../../renderWithAdaptableContext");
|
|
18
18
|
const CheckBox_1 = require("../../../components/CheckBox");
|
|
19
|
+
const isEqual_1 = tslib_1.__importDefault(require("lodash-es/isEqual"));
|
|
20
|
+
const runIfNotResolvedIn_1 = require("../../../Utilities/runIfNotResolvedIn");
|
|
21
|
+
const getDefaultColumnFilterPredicate_1 = require("./getDefaultColumnFilterPredicate");
|
|
19
22
|
class QuickFilterFormComponent extends React.Component {
|
|
20
23
|
constructor(props) {
|
|
21
24
|
super(props);
|
|
22
|
-
this.
|
|
23
|
-
|
|
25
|
+
this._isMounted = false;
|
|
26
|
+
this.handleFilterChange = (filter) => {
|
|
27
|
+
if (this.state.suppressClientSideFilter) {
|
|
28
|
+
this.loadPermittedValues(filter);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
this.loadPermittedValues = async (filter = '') => {
|
|
32
|
+
const { values, suppressClientSideFilter } = await runIfNotResolvedIn_1.runIfNotResolvedIn(this.props.api.columnApi.getDistinctFilterDisplayValuesForColumn(this.props.currentColumn.ColumnId, filter), () => this._isMounted && this.setState({ isDistinctColumnValuesLoading: true }));
|
|
33
|
+
if (!this._isMounted) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
this.setState({
|
|
37
|
+
distinctColumnValues: values,
|
|
38
|
+
suppressClientSideFilter,
|
|
39
|
+
isDistinctColumnValuesLoading: false,
|
|
40
|
+
});
|
|
24
41
|
};
|
|
25
42
|
this.debouncedAddFilter = debounce_1.default(() => this.props.onAddColumnFilter(this.state.filter), 250);
|
|
26
43
|
this.debouncedEditFilter = debounce_1.default(() => this.props.onEditColumnFilter(this.state.filter), 250);
|
|
27
|
-
const filter = this.getFilterFromProps(
|
|
28
|
-
|
|
44
|
+
const filter = this.getFilterFromProps();
|
|
45
|
+
this._isMounted = true;
|
|
29
46
|
this.state = {
|
|
30
47
|
filter,
|
|
31
|
-
|
|
48
|
+
suppressClientSideFilter: false,
|
|
49
|
+
isDistinctColumnValuesLoading: false,
|
|
50
|
+
distinctColumnValues: [],
|
|
32
51
|
};
|
|
33
52
|
}
|
|
34
|
-
|
|
35
|
-
|
|
53
|
+
componentDidMount() {
|
|
54
|
+
var _a, _b;
|
|
55
|
+
if (((_b = (_a = this.state) === null || _a === void 0 ? void 0 : _a.filter) === null || _b === void 0 ? void 0 : _b.Predicate.PredicateId) === 'Values') {
|
|
56
|
+
this.loadPermittedValues();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
componentWillUnmount() {
|
|
60
|
+
this._isMounted = false;
|
|
36
61
|
}
|
|
37
62
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
38
63
|
const filter = this.getFilterFromProps(nextProps);
|
|
39
|
-
this.
|
|
40
|
-
|
|
41
|
-
}
|
|
64
|
+
if (isEqual_1.default(filter, this.state.filter)) {
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
this.setState({ filter });
|
|
42
68
|
if ((filter === null || filter === void 0 ? void 0 : filter.Predicate) && filter.Predicate.PredicateId === 'Values') {
|
|
43
|
-
this.
|
|
69
|
+
this.setState({ isDistinctColumnValuesLoading: true });
|
|
70
|
+
this.loadPermittedValues();
|
|
44
71
|
}
|
|
45
72
|
}
|
|
46
|
-
getFilterFromProps(props) {
|
|
73
|
+
getFilterFromProps(props = this.props) {
|
|
47
74
|
const filter = props.columnFilters.find((cf) => cf.ColumnId == props.currentColumn.ColumnId);
|
|
48
75
|
const filterOptions = props.api.internalApi.getAdaptableOptions().filterOptions;
|
|
49
76
|
if (filter) {
|
|
50
77
|
return filter;
|
|
51
78
|
}
|
|
52
79
|
if (!filter && props.currentColumn.DataType === 'Number') {
|
|
53
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(
|
|
80
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.ColumnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultNumericColumnFilter), ['']);
|
|
54
81
|
}
|
|
55
82
|
if (!filter && props.currentColumn.DataType === 'String') {
|
|
56
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(
|
|
83
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.ColumnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultStringColumnFilter), ['']);
|
|
57
84
|
}
|
|
58
85
|
if (!filter && props.currentColumn.DataType === 'Date') {
|
|
59
|
-
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(
|
|
86
|
+
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(props.currentColumn.ColumnId, getDefaultColumnFilterPredicate_1.getDefaultColumnFilterPredicate(props.currentColumn, filterOptions.defaultDateColumnFilter), ['']);
|
|
60
87
|
}
|
|
61
88
|
if (!filter && props.currentColumn.DataType === 'Boolean') {
|
|
62
89
|
return ObjectFactory_1.ObjectFactory.CreateColumnFilter(this.props.currentColumn.ColumnId, 'BooleanToggle', [
|
|
@@ -179,11 +206,25 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
179
206
|
} }, 'No Column Values'));
|
|
180
207
|
}
|
|
181
208
|
renderValuesDropdown(filter) {
|
|
182
|
-
|
|
209
|
+
let showEvent = 'mouseenter';
|
|
210
|
+
if (this.props.quickFilterValuesTrigger === 'click') {
|
|
211
|
+
showEvent = 'click';
|
|
212
|
+
}
|
|
213
|
+
return (React.createElement(OverlayTrigger_1.default, { alignHorizontal: "left", showEvent: showEvent,
|
|
214
|
+
// cannot hide on blur, because the form input receives the input when this is opened
|
|
215
|
+
hideEvent: "mouseleave", hideDelay: 300, ref: (api) => {
|
|
183
216
|
this.valuesDropdown = api;
|
|
184
217
|
}, render: () => {
|
|
185
218
|
var _a;
|
|
186
|
-
return (React.createElement(rebass_1.Flex, {
|
|
219
|
+
return (React.createElement(rebass_1.Flex, { onMouseEnter: () => {
|
|
220
|
+
var _a;
|
|
221
|
+
if (showEvent === 'click') {
|
|
222
|
+
// For showEvent=mouseneter this is not needed.
|
|
223
|
+
// When mouseenter is triggered on the overlay, onShowFn is called, the overlay is no longer hidden.
|
|
224
|
+
// But in this case because the trigger is click, another show is not triggered.
|
|
225
|
+
(_a = this.valuesDropdown) === null || _a === void 0 ? void 0 : _a.show();
|
|
226
|
+
}
|
|
227
|
+
}, "data-name": "quick-filter-form", flexDirection: "column", style: {
|
|
187
228
|
fontSize: 'var(--ab-font-size-2)',
|
|
188
229
|
border: '1px solid var(--ab-color-primarydark)',
|
|
189
230
|
background: 'var(--ab-color-defaultbackground)',
|
|
@@ -193,7 +234,7 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
193
234
|
React.createElement(SimpleButton_1.default, { onClick: () => this.clearFilter() }, "Clear Filter"),
|
|
194
235
|
((_a = this.props.api.internalApi.getAdaptableOptions().filterOptions) === null || _a === void 0 ? void 0 : _a.autoApplyFilter) ==
|
|
195
236
|
false && (React.createElement(SimpleButton_1.default, { ml: 2, onClick: () => this.updateFilter(this.state.filter) }, "Apply Filter"))),
|
|
196
|
-
React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { currentColumn: this.props.currentColumn, columns: [], columnDistinctValues: this.state.distinctColumnValues, dataType: this.props.currentColumn.DataType, uiSelectedColumnValues: this.state.filter.Predicate.Inputs, useVendorStyle: true, onColumnValueSelectedChange: (list) => this.onColumnValuesChange(list) })));
|
|
237
|
+
React.createElement(ListBoxFilterForm_1.ListBoxFilterForm, { suppressClientSideFilter: this.state.suppressClientSideFilter, isLoading: this.state.isDistinctColumnValuesLoading, onFilterChange: this.handleFilterChange, currentColumn: this.props.currentColumn, columns: [], columnDistinctValues: this.state.distinctColumnValues, dataType: this.props.currentColumn.DataType, uiSelectedColumnValues: this.state.filter.Predicate.Inputs, useVendorStyle: true, onColumnValueSelectedChange: (list) => this.onColumnValuesChange(list) })));
|
|
197
238
|
} },
|
|
198
239
|
React.createElement(SimpleButton_1.default, { style: {
|
|
199
240
|
flex: 1,
|
|
@@ -226,7 +267,7 @@ class QuickFilterFormComponent extends React.Component {
|
|
|
226
267
|
};
|
|
227
268
|
this.updateFilter(filter);
|
|
228
269
|
if (predicateId === 'Values') {
|
|
229
|
-
this.
|
|
270
|
+
this.loadPermittedValues();
|
|
230
271
|
requestAnimationFrame(() => {
|
|
231
272
|
if (this.valuesDropdown) {
|
|
232
273
|
this.valuesDropdown.show();
|
|
@@ -276,8 +317,8 @@ function mapDispatchToProps(dispatch) {
|
|
|
276
317
|
onEditColumnFilter: (columnFilter) => dispatch(FilterRedux.ColumnFilterEdit(columnFilter)),
|
|
277
318
|
};
|
|
278
319
|
}
|
|
279
|
-
|
|
320
|
+
const QuickFilterForm = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(QuickFilterFormComponent);
|
|
280
321
|
exports.QuickFilterFormReact = (FilterContext) => {
|
|
281
|
-
var _a;
|
|
282
|
-
return renderWithAdaptableContext_1.renderWithAdaptableContext(React.createElement(
|
|
322
|
+
var _a, _b;
|
|
323
|
+
return renderWithAdaptableContext_1.renderWithAdaptableContext(React.createElement(QuickFilterForm, { api: FilterContext.Adaptable.api, quickFilterTrigger: (_a = FilterContext.Adaptable.adaptableOptions.filterOptions) === null || _a === void 0 ? void 0 : _a.quickFilterTrigger, quickFilterValuesTrigger: (_b = FilterContext.Adaptable.adaptableOptions.filterOptions) === null || _b === void 0 ? void 0 : _b.quickFilterValuesTrigger, currentColumn: FilterContext.Column, teamSharingActivated: false, embedColumnMenu: FilterContext.Adaptable.embedColumnMenu }), FilterContext.Adaptable);
|
|
283
324
|
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { AdaptableColumn } from '../../../PredefinedConfig/Common/AdaptableColumn';
|
|
2
|
+
import { SystemFilterPredicateId } from '../../../PredefinedConfig/FilterState';
|
|
3
|
+
export declare const getDefaultColumnFilterPredicate: (column: AdaptableColumn, defaultColumnFilter: "After" | "Before" | "Blanks" | "NonBlanks" | "Equals" | "NotEquals" | "GreaterThan" | "LessThan" | "Positive" | "Negative" | "Zero" | "Between" | "NotBetween" | "Is" | "IsNot" | "Contains" | "NotContains" | "StartsWith" | "EndsWith" | "Regex" | "Today" | "Yesterday" | "Tomorrow" | "ThisWeek" | "ThisMonth" | "ThisQuarter" | "ThisYear" | "InPast" | "InFuture" | "On" | "NotOn" | "NextWorkDay" | "LastWorkDay" | "True" | "False" | "Values" | "InRange" | "BooleanToggle" | ((column: AdaptableColumn) => SystemFilterPredicateId)) => SystemFilterPredicateId;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDefaultColumnFilterPredicate = void 0;
|
|
4
|
+
exports.getDefaultColumnFilterPredicate = (column, defaultColumnFilter) => {
|
|
5
|
+
return typeof defaultColumnFilter === 'function'
|
|
6
|
+
? defaultColumnFilter(column)
|
|
7
|
+
: defaultColumnFilter;
|
|
8
|
+
};
|
|
@@ -4,7 +4,7 @@ import { ModuleParams } from '../SharedProps/ModuleViewPopupProps';
|
|
|
4
4
|
import { AdaptableModule } from '../../../PredefinedConfig/Common/Types';
|
|
5
5
|
import { AdaptableApi } from '../../../Api/AdaptableApi';
|
|
6
6
|
/**
|
|
7
|
-
* This is the main popup that we use - so all
|
|
7
|
+
* This is the main popup that we use - so all Module popups will appear here.
|
|
8
8
|
*/
|
|
9
9
|
export interface AdaptablePopupProps extends React.ClassAttributes<AdaptablePopup> {
|
|
10
10
|
showModal: boolean;
|
|
@@ -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,31 +20,61 @@ 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
79
|
? UIHelper_1.default.getDescriptionForDataType(this.props.selectedColumn.DataType)
|
|
48
80
|
: 'text', placeholder: this.props.selectedColumn
|
|
@@ -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) => {
|
|
@@ -11,7 +11,9 @@ const ModuleConstants_1 = require("../../Utilities/Constants/ModuleConstants");
|
|
|
11
11
|
exports.DataChangeHistoryGrid = (props) => {
|
|
12
12
|
const { changeHistoryLog, adaptableContainerId, vendorContainerId, onUndoChange } = props;
|
|
13
13
|
const mainAdaptableInstance = AdaptableContext_1.useAdaptable();
|
|
14
|
-
const [
|
|
14
|
+
const [_adaptableApi, setAdaptableApi] = react_1.useState(null);
|
|
15
|
+
const adaptableApiRef = react_1.useRef(null);
|
|
16
|
+
adaptableApiRef.current = _adaptableApi;
|
|
15
17
|
const undoChangeEnabled = mainAdaptableInstance.api.internalApi
|
|
16
18
|
.getEntitlementService()
|
|
17
19
|
.isModuleFullEntitlement(ModuleConstants_1.DataChangeHistoryModuleId);
|
|
@@ -23,46 +25,54 @@ exports.DataChangeHistoryGrid = (props) => {
|
|
|
23
25
|
const adaptableOptions = buildAdaptableOptions(mainAdaptableInstance, gridOptions, adaptableContainerId, vendorContainerId, undoChangeEnabled, onUndoChange);
|
|
24
26
|
// to avoid direct dependency to Adaptable.ts and thus creating a circular dependency;
|
|
25
27
|
const adaptableInitFn = Object.getPrototypeOf(mainAdaptableInstance).constructor.init;
|
|
26
|
-
const
|
|
27
|
-
setAdaptableApi(
|
|
28
|
+
const dataChangeHistoryAdaptableApi = await adaptableInitFn(adaptableOptions);
|
|
29
|
+
setAdaptableApi(dataChangeHistoryAdaptableApi);
|
|
28
30
|
};
|
|
29
31
|
initializeAdaptableGrid();
|
|
32
|
+
return () => {
|
|
33
|
+
var _a;
|
|
34
|
+
(_a = adaptableApiRef.current) === null || _a === void 0 ? void 0 : _a.internalApi.getAdaptableInstance().destroy({ unmount: true, destroyApi: true });
|
|
35
|
+
};
|
|
30
36
|
}, []);
|
|
31
37
|
// update row data
|
|
32
38
|
react_1.useEffect(() => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return true;
|
|
38
|
-
}
|
|
39
|
-
const addedChange = changeHistoryLog[newChangeKey];
|
|
40
|
-
return addedChange.changedAt !== previousChangeWithSameKey.changedAt;
|
|
41
|
-
});
|
|
42
|
-
const removedChangeKeys = Object.keys(previousChangeHistoryLog).filter((previousChangeKey) => {
|
|
43
|
-
const newChangeWithSameKey = changeHistoryLog[previousChangeKey];
|
|
44
|
-
if (!newChangeWithSameKey) {
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
const previousChange = previousChangeHistoryLog[previousChangeKey];
|
|
48
|
-
return previousChange.changedAt !== newChangeWithSameKey.changedAt;
|
|
49
|
-
});
|
|
50
|
-
const addedChangeHistoryLogs = filterChangeHistoryLog(changeHistoryLog, addedChangeKeys);
|
|
51
|
-
const removedChangeHistoryLogs = filterChangeHistoryLog(previousChangeHistoryLog, removedChangeKeys);
|
|
52
|
-
// here we access directly the AG Grid API, but this is OK because:
|
|
53
|
-
// 1. this method (gridAPi.applyTransaction() is NOT accessible otherwise and making it public opens other cans of worms
|
|
54
|
-
// 2. this UI will be reimplemented with Infinite Table anyway
|
|
55
|
-
const addedRows = mapChangeHistoryRowData(addedChangeHistoryLogs, mainAdaptableInstance);
|
|
56
|
-
const removedRows = mapChangeHistoryRowData(removedChangeHistoryLogs, mainAdaptableInstance);
|
|
57
|
-
adaptableApi.internalApi.getAdaptableOptions().vendorGrid.api.applyTransactionAsync({
|
|
58
|
-
add: addedRows,
|
|
59
|
-
remove: removedRows,
|
|
60
|
-
});
|
|
39
|
+
const adaptableApi = adaptableApiRef.current;
|
|
40
|
+
if (!adaptableApi) {
|
|
41
|
+
// initial render
|
|
42
|
+
return;
|
|
61
43
|
}
|
|
44
|
+
const addedChangeKeys = Object.keys(changeHistoryLog).filter((newChangeKey) => {
|
|
45
|
+
const previousChangeWithSameKey = previousChangeHistoryLog[newChangeKey];
|
|
46
|
+
if (!previousChangeWithSameKey) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
const addedChange = changeHistoryLog[newChangeKey];
|
|
50
|
+
return addedChange.changedAt !== previousChangeWithSameKey.changedAt;
|
|
51
|
+
});
|
|
52
|
+
const removedChangeKeys = Object.keys(previousChangeHistoryLog).filter((previousChangeKey) => {
|
|
53
|
+
const newChangeWithSameKey = changeHistoryLog[previousChangeKey];
|
|
54
|
+
if (!newChangeWithSameKey) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
const previousChange = previousChangeHistoryLog[previousChangeKey];
|
|
58
|
+
return previousChange.changedAt !== newChangeWithSameKey.changedAt;
|
|
59
|
+
});
|
|
60
|
+
const addedChangeHistoryLogs = filterChangeHistoryLog(changeHistoryLog, addedChangeKeys);
|
|
61
|
+
const removedChangeHistoryLogs = filterChangeHistoryLog(previousChangeHistoryLog, removedChangeKeys);
|
|
62
|
+
// here we access directly the AG Grid API, but this is OK because:
|
|
63
|
+
// 1. this method (gridAPi.applyTransaction() is NOT accessible otherwise and making it public opens other cans of worms
|
|
64
|
+
// 2. this UI will be reimplemented with Infinite Table anyway
|
|
65
|
+
const addedRows = mapChangeHistoryRowData(addedChangeHistoryLogs, mainAdaptableInstance);
|
|
66
|
+
const removedRows = mapChangeHistoryRowData(removedChangeHistoryLogs, mainAdaptableInstance);
|
|
67
|
+
adaptableApi.internalApi.getAdaptableOptions().vendorGrid.api.applyTransactionAsync({
|
|
68
|
+
add: addedRows,
|
|
69
|
+
remove: removedRows,
|
|
70
|
+
});
|
|
62
71
|
}, [changeHistoryLog]);
|
|
63
72
|
return React.createElement(React.Fragment, null);
|
|
64
73
|
};
|
|
65
74
|
const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableContainerId, vendorContainerId, undoChangeEnabled, onUndoChange) => {
|
|
75
|
+
var _a, _b;
|
|
66
76
|
const mainAdaptableOptions = mainAdaptableInstance.adaptableOptions;
|
|
67
77
|
const mainAdaptableTheme = mainAdaptableInstance.api.themeApi.getCurrentTheme();
|
|
68
78
|
const undoRowNode = (rowNode) => {
|
|
@@ -162,7 +172,7 @@ const buildAdaptableOptions = (mainAdaptableInstance, gridOptions, adaptableCont
|
|
|
162
172
|
DisplayFormat: {
|
|
163
173
|
Formatter: 'DateFormatter',
|
|
164
174
|
Options: {
|
|
165
|
-
Pattern: `${mainAdaptableOptions.userInterfaceOptions.dateInputOptions.dateFormat} HH:mm:ss`,
|
|
175
|
+
Pattern: `${(_b = (_a = mainAdaptableOptions.userInterfaceOptions) === null || _a === void 0 ? void 0 : _a.dateInputOptions) === null || _b === void 0 ? void 0 : _b.dateFormat} HH:mm:ss`,
|
|
166
176
|
},
|
|
167
177
|
},
|
|
168
178
|
},
|
|
@@ -3,6 +3,7 @@ import * as React from 'react';
|
|
|
3
3
|
import { DataChangedInfo } from '../../PredefinedConfig/Common/DataChangedInfo';
|
|
4
4
|
import { SystemDataChangeHistoryDisableAction, SystemDataChangeHistoryEnableAction, SystemDataChangeHistoryResumeAction, SystemDataChangeHistorySuspendAction } from '../../Redux/ActionsReducers/SystemRedux';
|
|
5
5
|
import { DataChangeHistoryMode } from '../../PredefinedConfig/SystemState';
|
|
6
|
+
import { AdaptableApi } from '../../Api/AdaptableApi';
|
|
6
7
|
interface DataChangeHistoryPopupProps extends ModuleViewPopupProps<DataChangeHistoryPopupComponent> {
|
|
7
8
|
changeHistoryLog: Record<string, DataChangedInfo>;
|
|
8
9
|
changeHistoryMode: DataChangeHistoryMode;
|
|
@@ -13,7 +14,10 @@ interface DataChangeHistoryPopupProps extends ModuleViewPopupProps<DataChangeHis
|
|
|
13
14
|
onChangeHistorySuspend: () => SystemDataChangeHistorySuspendAction;
|
|
14
15
|
onChangeHistoryResume: () => SystemDataChangeHistoryResumeAction;
|
|
15
16
|
}
|
|
16
|
-
|
|
17
|
+
interface DataChangeHistoryPopupState {
|
|
18
|
+
dataChangeHistoryAdaptableApi: AdaptableApi | undefined;
|
|
19
|
+
}
|
|
20
|
+
declare class DataChangeHistoryPopupComponent extends React.Component<DataChangeHistoryPopupProps, DataChangeHistoryPopupState> {
|
|
17
21
|
constructor(props: DataChangeHistoryPopupProps);
|
|
18
22
|
render(): JSX.Element;
|
|
19
23
|
}
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DataChangeHistoryPopup = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const React = tslib_1.__importStar(require("react"));
|
|
6
|
-
const UIHelper_1 = require("../UIHelper");
|
|
7
6
|
const react_redux_1 = require("react-redux");
|
|
8
7
|
const PanelWithButton_1 = require("../Components/Panels/PanelWithButton");
|
|
9
8
|
const DataChangeHistoryGrid_1 = require("./DataChangeHistoryGrid");
|
|
@@ -16,7 +15,9 @@ const FormatHelper_1 = require("../../Utilities/Helpers/FormatHelper");
|
|
|
16
15
|
class DataChangeHistoryPopupComponent extends React.Component {
|
|
17
16
|
constructor(props) {
|
|
18
17
|
super(props);
|
|
19
|
-
this.state =
|
|
18
|
+
this.state = {
|
|
19
|
+
dataChangeHistoryAdaptableApi: undefined,
|
|
20
|
+
};
|
|
20
21
|
}
|
|
21
22
|
render() {
|
|
22
23
|
const { changeHistoryMode, activationTime, suspensionTime, onChangeHistoryEnable, onChangeHistoryDisable, onChangeHistorySuspend, onChangeHistoryResume, } = this.props;
|
|
@@ -49,10 +50,12 @@ class DataChangeHistoryPopupComponent extends React.Component {
|
|
|
49
50
|
const handleChangeUndo = (changeKey) => {
|
|
50
51
|
const changeToBeUndone = this.props.changeHistoryLog[changeKey];
|
|
51
52
|
if (changeToBeUndone) {
|
|
52
|
-
this.props.api.
|
|
53
|
-
this.props.api.internalApi.dispatchReduxAction(SystemRedux_1.SystemDataChangeHistoryEntryDelete(changeToBeUndone));
|
|
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
|
}
|
|
@@ -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;
|
|
@@ -49,7 +49,9 @@ 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
|
-
|
|
52
|
+
const specialColumnsAreFilterable = this.props.api.internalApi.getAdaptableOptions()
|
|
53
|
+
.filterOptions.enableFilterOnSpecialColumns;
|
|
54
|
+
let configEntity = ObjectFactory_1.ObjectFactory.CreateEmptyFreeTextColumn(specialColumnsAreFilterable);
|
|
53
55
|
configEntity.ColumnId = this.props.summarisedColumn.ColumnId;
|
|
54
56
|
this.setState({
|
|
55
57
|
editedAdaptableObject: configEntity,
|
|
@@ -48,13 +48,16 @@ exports.GridInfoPopup = (props) => {
|
|
|
48
48
|
return props.api.columnApi.getFriendlyNameFromColumnId(gs.ColumnId) + ': ' + gs.SortOrder;
|
|
49
49
|
})
|
|
50
50
|
: null;
|
|
51
|
+
const selectedRowInfo = props.api.gridApi.getSelectedRowInfo();
|
|
51
52
|
returnRows.push(createReadOnlyColItem(colItems, 'AdapTable Version', version_1.default));
|
|
52
53
|
returnRows.push(createReadOnlyColItem(colItems, 'Sorted Columns', ArrayExtensions_1.default.IsNotNullOrEmpty(sorts) ? sorts.join('; ') : 'None'));
|
|
53
54
|
returnRows.push(createReadOnlyColItem(colItems, 'Column Filters', columnFilterDescription));
|
|
54
55
|
returnRows.push(createReadOnlyColItem(colItems, 'All Rows', props.api.gridApi.getRowCount()));
|
|
55
56
|
returnRows.push(createReadOnlyColItem(colItems, 'Visible Rows', props.api.gridApi.getVisibleRowCount()));
|
|
57
|
+
returnRows.push(createReadOnlyColItem(colItems, 'Selected Rows', selectedRowInfo === null || selectedRowInfo === void 0 ? void 0 : selectedRowInfo.gridRows.length));
|
|
58
|
+
returnRows.push(createReadOnlyColItem(colItems, 'Visible Selected Rows', selectedRowInfo === null || selectedRowInfo === void 0 ? void 0 : selectedRowInfo.gridRows.filter((gr) => { var _a; return ((_a = gr.rowNode) === null || _a === void 0 ? void 0 : _a.displayed) == true; }).length));
|
|
56
59
|
returnRows.push(createReadOnlyColItem(colItems, 'All Columns', props.api.gridApi.getColumnCount()));
|
|
57
|
-
returnRows.push(createReadOnlyColItem(colItems, 'Visible
|
|
60
|
+
returnRows.push(createReadOnlyColItem(colItems, 'Visible Columns', props.api.gridApi.getVisibleColumnCount()));
|
|
58
61
|
returnRows.push(createReadOnlyColItem(colItems, 'Calculated Columns', ArrayExtensions_1.default.IsNotNullOrEmpty(calcColumns) ? calcColumns : 'None'));
|
|
59
62
|
returnRows.push(createReadOnlyColItem(colItems, 'Free Text Columns', ArrayExtensions_1.default.IsNotNullOrEmpty(freeTextColumns) ? freeTextColumns : 'None'));
|
|
60
63
|
returnRows.push(createReadOnlyColItem(colItems, 'Action Columns', ArrayExtensions_1.default.IsNotNullOrEmpty(actionColumns) ? actionColumns : 'None'));
|