@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
|
@@ -89,7 +89,7 @@ exports.scalarExpressionFunctions = {
|
|
|
89
89
|
if (!column) {
|
|
90
90
|
throw new ExpressionEvaluationError_1.ExpressionEvaluationError('COL', `Column name "${columnId}" is not found`);
|
|
91
91
|
}
|
|
92
|
-
if (!column.
|
|
92
|
+
if (!column.queryable) {
|
|
93
93
|
throw new ExpressionEvaluationError_1.ExpressionEvaluationError('COL', `Column name "${columnId}" is not queryable`);
|
|
94
94
|
}
|
|
95
95
|
return (_b = context.api) === null || _b === void 0 ? void 0 : _b.gridApi.getNormalisedValueFromRowNode(context.node, columnId);
|
|
@@ -6,5 +6,5 @@ export declare const isValidDate: (date: Date) => boolean;
|
|
|
6
6
|
*/
|
|
7
7
|
export declare const isValueValidDate: (data: any) => boolean;
|
|
8
8
|
export declare const dateToISO: (date: Date | number | string) => string;
|
|
9
|
-
export declare const parseToISO: (date: string | Date | number, dateFormat
|
|
10
|
-
export declare const
|
|
9
|
+
export declare const parseToISO: (date: string | Date | number, dateFormat?: string) => string;
|
|
10
|
+
export declare const parseDateValue: (dateValue: string | Date | number, dateFormat?: string) => Date | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.parseDateValue = exports.parseToISO = exports.dateToISO = exports.isValueValidDate = exports.isValidDate = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const parseISO_1 = tslib_1.__importDefault(require("date-fns/parseISO"));
|
|
6
6
|
const parse_1 = tslib_1.__importDefault(require("date-fns/parse"));
|
|
@@ -25,26 +25,36 @@ exports.dateToISO = (date) => {
|
|
|
25
25
|
return FormatHelper_1.DateFormatter(date, { Pattern: 'yyyy-MM-dd' });
|
|
26
26
|
};
|
|
27
27
|
exports.parseToISO = (date, dateFormat) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
: typeof date === 'number'
|
|
31
|
-
? new Date(date)
|
|
32
|
-
: exports.parseDate(date, dateFormat);
|
|
33
|
-
let valid = dateInstance && exports.isValidDate(dateInstance);
|
|
34
|
-
if (!valid) {
|
|
35
|
-
dateInstance = new Date(date);
|
|
36
|
-
valid = exports.isValidDate(dateInstance);
|
|
37
|
-
}
|
|
38
|
-
return valid ? exports.dateToISO(dateInstance) : '';
|
|
28
|
+
const dateInstance = exports.parseDateValue(date, dateFormat);
|
|
29
|
+
return exports.isValidDate(dateInstance) ? exports.dateToISO(dateInstance) : '';
|
|
39
30
|
};
|
|
40
|
-
exports.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
exports.parseDateValue = (dateValue, dateFormat) => {
|
|
32
|
+
if (dateValue == undefined) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
if (dateValue instanceof Date) {
|
|
36
|
+
return !isNaN(dateValue.getTime()) ? dateValue : undefined;
|
|
37
|
+
}
|
|
38
|
+
let dateInstance;
|
|
39
|
+
if (typeof dateValue === 'number') {
|
|
40
|
+
dateInstance = new Date(dateValue);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
// typeof dateValue === 'string'
|
|
44
|
+
if (dateFormat) {
|
|
45
|
+
dateInstance = parse_1.default(dateValue, dateFormat, new Date());
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
dateInstance = parseISO_1.default(dateValue);
|
|
49
|
+
}
|
|
50
|
+
if (!exports.isValidDate(dateInstance)) {
|
|
51
|
+
// last chance: try to use the native Date.parse(), https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse
|
|
52
|
+
dateInstance = new Date(Date.parse(dateValue));
|
|
53
|
+
}
|
|
44
54
|
}
|
|
45
|
-
if (!exports.isValidDate(
|
|
46
|
-
LoggingHelper_1.LogAdaptableError(`Invalid date value "${
|
|
47
|
-
|
|
55
|
+
if (!exports.isValidDate(dateInstance)) {
|
|
56
|
+
LoggingHelper_1.LogAdaptableError(`Invalid date value "${dateValue}" - cannot be converted to a Date instance. Please make sure you specify adaptableOptions.userInterfaceOptions.dateInputOptions.dateFormat correctly.`);
|
|
57
|
+
dateInstance = undefined;
|
|
48
58
|
}
|
|
49
|
-
return
|
|
59
|
+
return dateInstance;
|
|
50
60
|
};
|
|
@@ -39,11 +39,11 @@ function GetCellInfosFromPreview(previewInfo, bypassValidationWarnings) {
|
|
|
39
39
|
if (previewResult.validationRules.length == 0) {
|
|
40
40
|
newValues.push({
|
|
41
41
|
primaryKeyValue: previewResult.id,
|
|
42
|
-
columnId: previewInfo.columnId,
|
|
43
42
|
rawValue: previewResult.computedValue,
|
|
44
43
|
displayValue: previewResult.computedValue,
|
|
45
44
|
normalisedValue: previewResult.computedValue,
|
|
46
45
|
rowNode: previewResult.rowNode,
|
|
46
|
+
column: this.adaptable.api.columnApi.getColumnFromId(previewInfo.columnId),
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -54,7 +54,7 @@ function GetCellInfosFromPreview(previewInfo, bypassValidationWarnings) {
|
|
|
54
54
|
.forEach((pr) => {
|
|
55
55
|
newValues.push({
|
|
56
56
|
primaryKeyValue: pr.id,
|
|
57
|
-
|
|
57
|
+
column: this.adaptable.api.columnApi.getColumnFromId(previewInfo.columnId),
|
|
58
58
|
rawValue: pr.computedValue,
|
|
59
59
|
displayValue: pr.computedValue,
|
|
60
60
|
normalisedValue: pr.computedValue,
|
|
@@ -61,7 +61,7 @@ export declare function CreateEmptySchedule(): Schedule;
|
|
|
61
61
|
export declare function CreateEmptyShortcut(): Shortcut;
|
|
62
62
|
export declare function CreateEmptyConditionalStyle(): ConditionalStyle;
|
|
63
63
|
export declare function CreateEmptyFormatColumn(): FormatColumn;
|
|
64
|
-
export declare function CreateEmptyFreeTextColumn(): FreeTextColumn;
|
|
64
|
+
export declare function CreateEmptyFreeTextColumn(isFilterable: boolean): FreeTextColumn;
|
|
65
65
|
export declare function CreateEmptyLayout(layout?: Partial<Layout> & {
|
|
66
66
|
Name: string;
|
|
67
67
|
}, adaptableColumns?: AdaptableColumn[]): Layout;
|
|
@@ -74,6 +74,8 @@ function CreateEmptyCalculatedColumn(isFilterable) {
|
|
|
74
74
|
Sortable: true,
|
|
75
75
|
Pivotable: true,
|
|
76
76
|
Aggregatable: true,
|
|
77
|
+
SuppressMenu: false,
|
|
78
|
+
SuppressMovable: false,
|
|
77
79
|
},
|
|
78
80
|
};
|
|
79
81
|
}
|
|
@@ -334,13 +336,23 @@ function CreateEmptyFormatColumn() {
|
|
|
334
336
|
};
|
|
335
337
|
}
|
|
336
338
|
exports.CreateEmptyFormatColumn = CreateEmptyFormatColumn;
|
|
337
|
-
function CreateEmptyFreeTextColumn() {
|
|
339
|
+
function CreateEmptyFreeTextColumn(isFilterable) {
|
|
338
340
|
return {
|
|
339
341
|
Uuid: Uuid_1.createUuid(),
|
|
340
342
|
ColumnId: GeneralConstants_1.EMPTY_STRING,
|
|
341
343
|
DefaultValue: GeneralConstants_1.EMPTY_STRING,
|
|
342
344
|
FreeTextStoredValues: [],
|
|
343
345
|
TextEditor: 'Inline',
|
|
346
|
+
FreeTextColumnSettings: {
|
|
347
|
+
Filterable: isFilterable,
|
|
348
|
+
Resizable: true,
|
|
349
|
+
Groupable: true,
|
|
350
|
+
Sortable: true,
|
|
351
|
+
Pivotable: true,
|
|
352
|
+
Aggregatable: true,
|
|
353
|
+
SuppressMenu: false,
|
|
354
|
+
SuppressMovable: false,
|
|
355
|
+
},
|
|
344
356
|
};
|
|
345
357
|
}
|
|
346
358
|
exports.CreateEmptyFreeTextColumn = CreateEmptyFreeTextColumn;
|
|
@@ -348,7 +360,7 @@ function CreateEmptyLayout(layout, adaptableColumns) {
|
|
|
348
360
|
return Object.assign(Object.assign({}, layout), { Uuid: Uuid_1.createUuid(), Columns: layout.Columns || [], ColumnSorts: layout.ColumnSorts || [],
|
|
349
361
|
// ColumnFlexMap: layout.ColumnFlexMap || {},
|
|
350
362
|
ColumnWidthMap: layout.ColumnWidthMap || {}, RowGroupedColumns: layout.RowGroupedColumns ||
|
|
351
|
-
(adaptableColumns ? adaptableColumns.filter((c) => c.
|
|
363
|
+
(adaptableColumns ? adaptableColumns.filter((c) => c.isGrouped).map((c) => c.columnId) : []) });
|
|
352
364
|
}
|
|
353
365
|
exports.CreateEmptyLayout = CreateEmptyLayout;
|
|
354
366
|
function CreateEmptyStyle() {
|
|
@@ -30,8 +30,8 @@ class DataService {
|
|
|
30
30
|
// we need this temporary "shared memory" because the value change and the AG Grid cellChanged event are asynchronous
|
|
31
31
|
// in the first phase we keep the undone change
|
|
32
32
|
logUndoChange(change) {
|
|
33
|
-
const { primaryKeyValue,
|
|
34
|
-
const undoChangeKey = this.getUndoChangeKey(primaryKeyValue, columnId, oldValue, newValue);
|
|
33
|
+
const { primaryKeyValue, column, oldValue, newValue } = change;
|
|
34
|
+
const undoChangeKey = this.getUndoChangeKey(primaryKeyValue, column.columnId, oldValue, newValue);
|
|
35
35
|
this.undoChangeLog.set(undoChangeKey, change);
|
|
36
36
|
// normally the extractUndoChange() should be executed right after this method
|
|
37
37
|
// just to be sure that no 'zombie' undo change remains here (if something goes wrong with the undo value change)
|
|
@@ -39,16 +39,16 @@ class DataService {
|
|
|
39
39
|
// why 2 and not 3 or 1? no good reason, only seems like a reasonable waiting time :)
|
|
40
40
|
const UNDO_WAIT = 2000;
|
|
41
41
|
const timeoutId = setTimeout(() => {
|
|
42
|
-
LoggingHelper_1.LogAdaptableInfo(`Undo change was NOT handled, this should NOT happen: PK(${change.primaryKeyValue}) Col(${change.
|
|
42
|
+
LoggingHelper_1.LogAdaptableInfo(`Undo change was NOT handled, this should NOT happen: PK(${change.primaryKeyValue}) Col(${change.column}) RevertedValue(${change.newValue}) NewValue(${change.oldValue})`);
|
|
43
43
|
this.extractUndoChange(change);
|
|
44
44
|
}, UNDO_WAIT);
|
|
45
45
|
this.undoChangeTimers.set(undoChangeKey, timeoutId);
|
|
46
46
|
}
|
|
47
47
|
// in the second phase, when AG-Grid triggers the cellChange event, we check if it corresponds to an undone change
|
|
48
48
|
extractUndoChange(change) {
|
|
49
|
-
const { primaryKeyValue,
|
|
49
|
+
const { primaryKeyValue, column, oldValue, newValue } = change;
|
|
50
50
|
// this is post-undo, so we have to swap the new& old values
|
|
51
|
-
const undoChangeKey = this.getUndoChangeKey(primaryKeyValue, columnId, newValue, oldValue);
|
|
51
|
+
const undoChangeKey = this.getUndoChangeKey(primaryKeyValue, column.columnId, newValue, oldValue);
|
|
52
52
|
const result = this.undoChangeLog.get(undoChangeKey);
|
|
53
53
|
this.undoChangeLog.delete(undoChangeKey);
|
|
54
54
|
const timeoutId = this.undoChangeTimers.get(undoChangeKey);
|
|
@@ -160,14 +160,14 @@ class ReportService {
|
|
|
160
160
|
reportColumns = gridColumns;
|
|
161
161
|
break;
|
|
162
162
|
case Enums_1.ReportColumnScope.VisibleColumns:
|
|
163
|
-
reportColumns = gridColumns.filter((c) => c.
|
|
163
|
+
reportColumns = gridColumns.filter((c) => c.visible);
|
|
164
164
|
break;
|
|
165
165
|
case Enums_1.ReportColumnScope.SelectedColumns:
|
|
166
166
|
// we extract the selected columns from the grid columns to preserve the grid column order
|
|
167
167
|
const selectedColumnIds = this.adaptable.api.gridApi
|
|
168
168
|
.getSelectedCellInfo()
|
|
169
|
-
.columns.map((column) => column.
|
|
170
|
-
reportColumns = gridColumns.filter((gridColumn) => selectedColumnIds.includes(gridColumn.
|
|
169
|
+
.columns.map((column) => column.columnId);
|
|
170
|
+
reportColumns = gridColumns.filter((gridColumn) => selectedColumnIds.includes(gridColumn.columnId));
|
|
171
171
|
break;
|
|
172
172
|
case Enums_1.ReportColumnScope.ScopeColumns:
|
|
173
173
|
if ('ColumnIds' in report.Scope) {
|
|
@@ -182,7 +182,7 @@ class ReportService {
|
|
|
182
182
|
break;
|
|
183
183
|
}
|
|
184
184
|
if (includePrimaryKey) {
|
|
185
|
-
const pkColumn = reportColumns.find((column) => column.
|
|
185
|
+
const pkColumn = reportColumns.find((column) => column.columnId === this.adaptable.adaptableOptions.primaryKey);
|
|
186
186
|
// TODO simplify after we fix the IsPrimaryKey bug
|
|
187
187
|
// const pkColumn = reportColumns.find(column => column.IsPrimaryKey);
|
|
188
188
|
if (!pkColumn && !!this.adaptable.api.columnApi.getPrimaryKeyColumn()) {
|
|
@@ -194,16 +194,16 @@ class ReportService {
|
|
|
194
194
|
getReportData(report, includePrimaryKey = false) {
|
|
195
195
|
var _a, _b;
|
|
196
196
|
const columns = this.GetReportColumnsForReport(report, includePrimaryKey).map((column) => ({
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
197
|
+
columnId: column.columnId,
|
|
198
|
+
friendlyName: column.friendlyName,
|
|
199
|
+
dataType: column.dataType,
|
|
200
200
|
}));
|
|
201
201
|
if (ArrayExtensions_1.default.IsNullOrEmpty(columns) &&
|
|
202
202
|
report.ReportRowScope !== Enums_1.ReportRowScope.CustomRows) {
|
|
203
203
|
return { columns: [], rows: [] };
|
|
204
204
|
}
|
|
205
205
|
const data = { columns, rows: [] };
|
|
206
|
-
const columnIds = columns.map((column) => column.
|
|
206
|
+
const columnIds = columns.map((column) => column.columnId);
|
|
207
207
|
switch (report.ReportRowScope) {
|
|
208
208
|
case Enums_1.ReportRowScope.AllRows:
|
|
209
209
|
this.adaptable.forAllRowNodesDo((rowNode) => {
|
|
@@ -240,7 +240,7 @@ class ReportService {
|
|
|
240
240
|
const rowPrimaryKeyValue = this.adaptable.getPrimaryKeyValueFromRowNode(rowNode);
|
|
241
241
|
const selectedRowCells = selectedCellsByPrimaryKey[rowPrimaryKeyValue];
|
|
242
242
|
if (selectedRowCells) {
|
|
243
|
-
const selectedRowColumnIds = selectedRowCells.map((rowCell) => rowCell.columnId);
|
|
243
|
+
const selectedRowColumnIds = selectedRowCells.map((rowCell) => rowCell.column.columnId);
|
|
244
244
|
const selectedColumnIds = columnIds.filter((columnId) => selectedRowColumnIds.includes(columnId));
|
|
245
245
|
const row = this.getRowObjectForColumnIds(rowNode, selectedColumnIds);
|
|
246
246
|
if (includePrimaryKey) {
|
|
@@ -275,8 +275,8 @@ class ReportService {
|
|
|
275
275
|
}
|
|
276
276
|
convertReportDataToArray(reportData) {
|
|
277
277
|
return [
|
|
278
|
-
reportData.columns.map((column) => column.
|
|
279
|
-
...reportData.rows.map((row) => reportData.columns.map((column) => row[column.
|
|
278
|
+
reportData.columns.map((column) => column.friendlyName),
|
|
279
|
+
...reportData.rows.map((row) => reportData.columns.map((column) => row[column.columnId])),
|
|
280
280
|
];
|
|
281
281
|
}
|
|
282
282
|
getRowObjectForColumnIds(rowNode, columnIds) {
|
|
@@ -287,6 +287,7 @@ class ReportService {
|
|
|
287
287
|
}
|
|
288
288
|
PublishLiveLiveDataChangedEvent(reportDestination, liveDataTrigger, liveReport) {
|
|
289
289
|
const liveDataChangedInfo = {
|
|
290
|
+
adaptableApi: this.adaptable.api,
|
|
290
291
|
reportDestination: reportDestination,
|
|
291
292
|
liveDataTrigger: liveDataTrigger,
|
|
292
293
|
liveReport: liveReport,
|
|
@@ -329,7 +330,7 @@ class ReportService {
|
|
|
329
330
|
return type === 'rawValue'
|
|
330
331
|
? cellRawValue
|
|
331
332
|
: // type === formattedValue
|
|
332
|
-
this.adaptable.
|
|
333
|
+
this.adaptable.getDisplayValueFromRawValue(columnId, cellRawValue);
|
|
333
334
|
}
|
|
334
335
|
computeCellExportValueFormat(columnType) {
|
|
335
336
|
if (this.adaptable.adaptableOptions.exportOptions.exportFormatType === 'rawValue' ||
|
|
@@ -18,7 +18,7 @@ class ValidationService {
|
|
|
18
18
|
}
|
|
19
19
|
let editingRules = this.adaptable.api.alertApi
|
|
20
20
|
.getAlertDefinitionsWithPreventEdit()
|
|
21
|
-
.filter((v) => this.adaptable.api.scopeApi.isColumnInScope(
|
|
21
|
+
.filter((v) => this.adaptable.api.scopeApi.isColumnInScope(dataChangedInfo.column, v.Scope));
|
|
22
22
|
let failedValidations = [];
|
|
23
23
|
if (ArrayExtensions_1.ArrayExtensions.IsNotEmpty(editingRules)) {
|
|
24
24
|
editingRules.forEach((alertDefinition) => {
|
|
@@ -55,13 +55,12 @@ class ValidationService {
|
|
|
55
55
|
return true;
|
|
56
56
|
}
|
|
57
57
|
IsAlertDefinitionTriggered(alertDefinition, dataChangedEvent) {
|
|
58
|
-
const column = this.adaptable.api.columnApi.getColumnFromId(dataChangedEvent.columnId);
|
|
59
58
|
return this.adaptable.api.predicateApi.handlePredicate(alertDefinition.Rule.Predicate, {
|
|
60
59
|
value: dataChangedEvent.newValue,
|
|
61
60
|
oldValue: dataChangedEvent.oldValue,
|
|
62
|
-
displayValue: this.adaptable.getDisplayValueFromRowNode(dataChangedEvent.rowNode, dataChangedEvent.columnId),
|
|
61
|
+
displayValue: this.adaptable.getDisplayValueFromRowNode(dataChangedEvent.rowNode, dataChangedEvent.column.columnId),
|
|
63
62
|
node: dataChangedEvent.rowNode,
|
|
64
|
-
column,
|
|
63
|
+
column: dataChangedEvent.column,
|
|
65
64
|
}, false);
|
|
66
65
|
}
|
|
67
66
|
performServerValidation(dataChangedInfo, config) {
|
|
@@ -82,7 +81,7 @@ class ValidationService {
|
|
|
82
81
|
if (!row) {
|
|
83
82
|
return;
|
|
84
83
|
}
|
|
85
|
-
row[(_b = this.adaptable.api.columnApi.getVendorGridColumnFieldForColumn(dataChangedInfo.columnId)) !== null && _b !== void 0 ? _b : dataChangedInfo.columnId] = validationResult.NewValue;
|
|
84
|
+
row[(_b = this.adaptable.api.columnApi.getVendorGridColumnFieldForColumn(dataChangedInfo.column.columnId)) !== null && _b !== void 0 ? _b : dataChangedInfo.column.columnId] = validationResult.NewValue;
|
|
86
85
|
this.adaptable.api.gridApi.updateGridData([row]);
|
|
87
86
|
if (StringExtensions_1.default.IsNotNullOrEmpty(validationResult.ValidationMessage) &&
|
|
88
87
|
this.adaptable.adaptableOptions.editOptions.displayServerValidationMessages) {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Calls the callback if the promise does not resolve in a amount of time.
|
|
3
|
+
*
|
|
4
|
+
* @param promise
|
|
5
|
+
* @param callback Called if promise does not resolve in the time defined by 'delay'
|
|
6
|
+
* @param delay Time after which if the promise was not resolved the callback (fn) is called.
|
|
7
|
+
*/
|
|
8
|
+
export declare const runIfNotResolvedIn: <T>(promise: Promise<T>, callback: () => void, delay?: number) => Promise<T>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runIfNotResolvedIn = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Calls the callback if the promise does not resolve in a amount of time.
|
|
6
|
+
*
|
|
7
|
+
* @param promise
|
|
8
|
+
* @param callback Called if promise does not resolve in the time defined by 'delay'
|
|
9
|
+
* @param delay Time after which if the promise was not resolved the callback (fn) is called.
|
|
10
|
+
*/
|
|
11
|
+
exports.runIfNotResolvedIn = async (promise, callback, delay = 100) => {
|
|
12
|
+
let isFulfilled = false;
|
|
13
|
+
promise === null || promise === void 0 ? void 0 : promise.then(() => {
|
|
14
|
+
isFulfilled = true;
|
|
15
|
+
});
|
|
16
|
+
(async () => {
|
|
17
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
18
|
+
if (!isFulfilled) {
|
|
19
|
+
callback();
|
|
20
|
+
}
|
|
21
|
+
})();
|
|
22
|
+
return promise;
|
|
23
|
+
};
|
|
@@ -15,9 +15,9 @@ const ChartEnums_1 = require("../PredefinedConfig/Common/ChartEnums");
|
|
|
15
15
|
const AdaptableLoadingScreen_1 = require("./Components/Popups/AdaptableLoadingScreen");
|
|
16
16
|
const Toastify_1 = require("../components/Toastify");
|
|
17
17
|
const renderWithAdaptableContext_1 = require("./renderWithAdaptableContext");
|
|
18
|
-
const ProgressIndicator_1 = require("./Export/ProgressIndicator");
|
|
19
18
|
const License_1 = require("./License");
|
|
20
19
|
const ExportCustomDestinationFormPopups_1 = require("./Export/ExportCustomDestinationFormPopups");
|
|
20
|
+
const ProgressIndicator_1 = require("../components/ProgressIndicator/ProgressIndicator");
|
|
21
21
|
class AdaptableView extends React.Component {
|
|
22
22
|
render() {
|
|
23
23
|
var _a, _b, _c, _d, _e;
|
|
@@ -64,7 +64,7 @@ class AlertPopupComponent extends React.Component {
|
|
|
64
64
|
if (this.props.popupParams.action == 'New') {
|
|
65
65
|
let alertDefinition = ObjectFactory_1.ObjectFactory.CreateEmptyAlertDefinition();
|
|
66
66
|
alertDefinition.Scope = {
|
|
67
|
-
ColumnIds: [this.props.popupParams.column.
|
|
67
|
+
ColumnIds: [this.props.popupParams.column.columnId],
|
|
68
68
|
};
|
|
69
69
|
this.setState({
|
|
70
70
|
editedAdaptableObject: alertDefinition,
|
|
@@ -11,6 +11,7 @@ const rebass_1 = require("rebass");
|
|
|
11
11
|
const AdaptablePopupAlert_1 = require("../../Components/Popups/AdaptablePopupAlert");
|
|
12
12
|
const AlertButtonsEditor_1 = require("./AlertButtonsEditor");
|
|
13
13
|
const CodeBlock_1 = require("../../../components/CodeBlock");
|
|
14
|
+
const AdaptableInput_1 = tslib_1.__importDefault(require("../../Components/AdaptableInput"));
|
|
14
15
|
const DEFAULT_BUTTONS = [
|
|
15
16
|
{
|
|
16
17
|
Label: 'OK',
|
|
@@ -58,22 +59,35 @@ exports.AlertDisplayWizardSection = (props) => {
|
|
|
58
59
|
var _a, _b, _c, _d;
|
|
59
60
|
const { data, api } = OnePageAdaptableWizard_1.useOnePageWizardContext();
|
|
60
61
|
const messageType = data.MessageType;
|
|
62
|
+
const messageText = api.alertApi.getAlertDescription(data);
|
|
61
63
|
const adaptableAlert = {
|
|
62
64
|
header: data.MessageType,
|
|
63
65
|
message: '',
|
|
64
66
|
alertDefinition: data,
|
|
65
67
|
};
|
|
68
|
+
const onMessageTextChange = (e) => {
|
|
69
|
+
const { value } = e.target;
|
|
70
|
+
props.onChange(Object.assign(Object.assign({}, data), { MessageText: value }));
|
|
71
|
+
};
|
|
66
72
|
return (React.createElement(React.Fragment, null,
|
|
67
73
|
React.createElement(Tabs_1.Tabs, null,
|
|
68
74
|
React.createElement(Tabs_1.Tabs.Tab, null, "Message Type"),
|
|
69
75
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
70
|
-
React.createElement(Radio_1.RadioGroup, { value: messageType, name: "messageType", orientation: "
|
|
76
|
+
React.createElement(Radio_1.RadioGroup, { value: messageType, name: "messageType", orientation: "horizontal", onRadioChange: (MessageType) => {
|
|
71
77
|
props.onChange(Object.assign(Object.assign({}, data), { MessageType }));
|
|
72
78
|
} },
|
|
73
|
-
React.createElement(Radio_1.default, { value: "Info" }, "Info"),
|
|
74
|
-
React.createElement(Radio_1.default, { value: "Success" }, "Success"),
|
|
75
|
-
React.createElement(Radio_1.default, { value: "Warning" }, "Warning"),
|
|
76
|
-
React.createElement(Radio_1.default, { value: "Error" }, "Error")))),
|
|
79
|
+
React.createElement(Radio_1.default, { marginLeft: 1, value: "Info" }, "Info"),
|
|
80
|
+
React.createElement(Radio_1.default, { marginLeft: 4, value: "Success" }, "Success"),
|
|
81
|
+
React.createElement(Radio_1.default, { marginLeft: 4, value: "Warning" }, "Warning"),
|
|
82
|
+
React.createElement(Radio_1.default, { marginLeft: 4, value: "Error" }, "Error")))),
|
|
83
|
+
React.createElement(Tabs_1.Tabs, { mt: 2, mb: 3, autoFocus: false },
|
|
84
|
+
React.createElement(Tabs_1.Tabs.Tab, null, "Message Text"),
|
|
85
|
+
React.createElement(Tabs_1.Tabs.Content, null,
|
|
86
|
+
React.createElement(rebass_1.Text, { fontSize: 2, mt: 3, mb: 2 }, "The text to display as the Alert Message (leave blank to show automated Message based on Trigger and Condition)"),
|
|
87
|
+
' ',
|
|
88
|
+
React.createElement(AdaptableInput_1.default, { marginTop: 2, type: 'text', autoFocus: false, value: messageText,
|
|
89
|
+
// onChange={(e: any) => onPredicateInputChange(e, index)}
|
|
90
|
+
onChange: (e) => onMessageTextChange(e) }))),
|
|
77
91
|
React.createElement(Tabs_1.Tabs, { mt: 2, mb: 3, autoFocus: false },
|
|
78
92
|
React.createElement(Tabs_1.Tabs.Tab, null, "Display options"),
|
|
79
93
|
React.createElement(Tabs_1.Tabs.Content, null,
|
|
@@ -49,7 +49,7 @@ exports.renderBaseAlertScopeSummary = (data) => {
|
|
|
49
49
|
: null)),
|
|
50
50
|
React.createElement(rebass_1.Box, { style: { overflow: 'hidden' } }, 'ColumnIds' in data.Scope ? (React.createElement(React.Fragment, null,
|
|
51
51
|
React.createElement(rebass_1.Text, { fontSize: 2, mb: columnsInScope.length ? 2 : 0 }, "Changes in selected columns will trigger an alert"),
|
|
52
|
-
columnsInScope.length ? (React.createElement(ValueSelector_1.ValueOptionsTags, { options: columnsInScope, value: columnsInScope.map((c) => c.
|
|
52
|
+
columnsInScope.length ? (React.createElement(ValueSelector_1.ValueOptionsTags, { options: columnsInScope, value: columnsInScope.map((c) => c.columnId), toLabel: (c) => c.friendlyName, allowWrap: true, readOnly: true, renderLabel: (c) => React.createElement(rebass_1.Text, { fontSize: 2 }, c), toIdentifier: (c) => c.columnId })) : null)) : null),
|
|
53
53
|
React.createElement(rebass_1.Box, null, 'DataTypes' in data.Scope ? (React.createElement(React.Fragment, null,
|
|
54
54
|
React.createElement(rebass_1.Text, { fontSize: 2, mb: 2 }, "Changes in columns of the selected data-types trigger an alert"),
|
|
55
55
|
React.createElement(ValueSelector_1.ValueOptionsTags, { readOnly: true, options: data.Scope.DataTypes, value: data.Scope.DataTypes, toLabel: (c) => c, allowWrap: true, renderLabel: (c) => React.createElement(rebass_1.Text, { fontSize: 2 }, `DataType: ${c}`), toIdentifier: (c) => c }))) : null)));
|
|
@@ -4,6 +4,7 @@ import * as SystemRedux from '../../Redux/ActionsReducers/SystemRedux';
|
|
|
4
4
|
import { ModuleViewPopupProps } from '../Components/SharedProps/ModuleViewPopupProps';
|
|
5
5
|
import { PreviewInfo } from '../../Utilities/Interface/Preview';
|
|
6
6
|
import { BulkUpdateValidationResult } from '../../Strategy/Interface/IBulkUpdateModule';
|
|
7
|
+
import { GridCell } from '../../types';
|
|
7
8
|
interface BulkUpdatePopupProps extends ModuleViewPopupProps<BulkUpdatePopupComponent> {
|
|
8
9
|
BulkUpdateValue: string;
|
|
9
10
|
BulkUpdateValidationResult: BulkUpdateValidationResult;
|
|
@@ -11,6 +12,7 @@ interface BulkUpdatePopupProps extends ModuleViewPopupProps<BulkUpdatePopupCompo
|
|
|
11
12
|
onBulkUpdateValueChange: (value: string) => SystemRedux.BulkUpdateChangeValueAction;
|
|
12
13
|
onBulkUpdateCheckSelectedCells: () => SystemRedux.BulkUpdateCheckCellSelectionAction;
|
|
13
14
|
onRunBulkUpdate: () => BulkUpdateRedux.BulkUpdateCompleteAction;
|
|
15
|
+
SelectedGridCells: GridCell[];
|
|
14
16
|
}
|
|
15
17
|
export interface BulkUpdatePopupState {
|
|
16
18
|
isShowingError: boolean;
|
|
@@ -34,7 +34,7 @@ class BulkUpdatePopupComponent extends React.Component {
|
|
|
34
34
|
let dataTypeErrorMessage = '';
|
|
35
35
|
if (col && StringExtensions_1.StringExtensions.IsNotNullOrEmpty(this.props.BulkUpdateValue)) {
|
|
36
36
|
// check that the update value is a number for a numeric column. not issue for dates as we dont allow free text
|
|
37
|
-
if (col.
|
|
37
|
+
if (col.dataType == Enums_1.DataType.Number) {
|
|
38
38
|
if (isNaN(Number(this.props.BulkUpdateValue))) {
|
|
39
39
|
hasDataTypeError = true;
|
|
40
40
|
dataTypeErrorMessage = 'This column only accepts numbers';
|
|
@@ -50,14 +50,14 @@ class BulkUpdatePopupComponent extends React.Component {
|
|
|
50
50
|
return null;
|
|
51
51
|
}
|
|
52
52
|
return (React.createElement(PanelWithImage_1.PanelWithImage, { header: this.props.moduleInfo.FriendlyName, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed(), variant: "primary", bodyProps: { padding: 2 }, style: { height: '100%' } },
|
|
53
|
-
col.
|
|
53
|
+
col.dataType == Enums_1.DataType.Date ? (React.createElement(React.Fragment, null,
|
|
54
54
|
React.createElement(HelpBlock_1.default, { marginTop: 2, marginBottom: 2 }, "Enter a date value. Alternatively, tick the checkbox and select from an existing column value."),
|
|
55
55
|
React.createElement(rebass_1.Box, null,
|
|
56
56
|
React.createElement(CheckBox_1.CheckBox, { marginLeft: 2, onChange: (checked) => this.onUseColumnValuesSelectorChanged(checked), checked: this.state.useSelector },
|
|
57
57
|
' ',
|
|
58
58
|
"Select from existing column values")),
|
|
59
59
|
React.createElement(rebass_1.Flex, { padding: 2, flexDirection: "row", alignItems: "center" },
|
|
60
|
-
React.createElement(rebass_1.Flex, { alignItems: "center", flexDirection: "row", flex: 1, marginRight: 2 }, this.state.useSelector ? (React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: col, api: this.props.api, onColumnValueChange: (values) => this.onColumnValueSelectedChanged(values), allowNew: false, style: { width: '100%', maxWidth: 'inherit' } })) : (React.createElement(AdaptableInput_1.default, { style: { width: '100%' }, value: String(this.props.BulkUpdateValue), type: UIHelper_1.UIHelper.getDescriptionForDataType(col.
|
|
60
|
+
React.createElement(rebass_1.Flex, { alignItems: "center", flexDirection: "row", flex: 1, marginRight: 2 }, this.state.useSelector ? (React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedGridCells: this.props.SelectedGridCells, selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: col, api: this.props.api, onColumnValueChange: (values) => this.onColumnValueSelectedChanged(values), allowNew: false, style: { width: '100%', maxWidth: 'inherit' } })) : (React.createElement(AdaptableInput_1.default, { style: { width: '100%' }, value: String(this.props.BulkUpdateValue), type: UIHelper_1.UIHelper.getDescriptionForDataType(col.dataType), placeholder: UIHelper_1.UIHelper.getPlaceHolderforDataType(col.dataType), onChange: (e) => this.onBulkUpdateValueChange(e) }))),
|
|
61
61
|
React.createElement(SimpleButton_1.default, { disabled: StringExtensions_1.StringExtensions.IsNullOrEmpty(this.props.BulkUpdateValue) ||
|
|
62
62
|
this.props.PreviewInfo.previewValidationSummary.validationResult == 'All', onClick: () => {
|
|
63
63
|
this.onApplyClick();
|
|
@@ -65,7 +65,7 @@ class BulkUpdatePopupComponent extends React.Component {
|
|
|
65
65
|
React.createElement(HelpBlock_1.default, { marginTop: 2, marginBottom: 2 }, "Select an existing column value from the dropdown, or enter a new value"),
|
|
66
66
|
React.createElement(rebass_1.Flex, { marginTop: 2, flexDirection: "row", alignItems: "center" },
|
|
67
67
|
React.createElement(rebass_1.Flex, { alignItems: "center", flexDirection: "row", flex: 1, marginRight: 2 },
|
|
68
|
-
React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: col, api: this.props.api, onColumnValueChange: (columns) => this.onColumnValueSelectedChanged(columns), style: { width: '100%', maxWidth: 'inherit' } })),
|
|
68
|
+
React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedGridCells: this.props.SelectedGridCells, selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: col, api: this.props.api, onColumnValueChange: (columns) => this.onColumnValueSelectedChanged(columns), style: { width: '100%', maxWidth: 'inherit' } })),
|
|
69
69
|
React.createElement(SimpleButton_1.default, { disabled: StringExtensions_1.StringExtensions.IsNullOrEmpty(this.props.BulkUpdateValue) ||
|
|
70
70
|
this.props.PreviewInfo.previewValidationSummary.validationResult == 'All' ||
|
|
71
71
|
hasDataTypeError, variant: "raised", tone: "accent", marginRight: 2, onClick: () => {
|
|
@@ -96,10 +96,12 @@ class BulkUpdatePopupComponent extends React.Component {
|
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
function mapStateToProps(state, ownProps) {
|
|
99
|
+
var _a;
|
|
99
100
|
return {
|
|
100
101
|
BulkUpdateValue: state.System.BulkUpdateValue,
|
|
101
102
|
PreviewInfo: state.System.BulkUpdatePreviewInfo,
|
|
102
103
|
BulkUpdateValidationResult: state.System.BulkUpdateValidationResult,
|
|
104
|
+
SelectedGridCells: (_a = state.Grid.SelectedCellInfo) === null || _a === void 0 ? void 0 : _a.gridCells,
|
|
103
105
|
};
|
|
104
106
|
}
|
|
105
107
|
function mapDispatchToProps(dispatch) {
|
|
@@ -4,6 +4,7 @@ import * as SystemRedux from '../../Redux/ActionsReducers/SystemRedux';
|
|
|
4
4
|
import * as BulkUpdateRedux from '../../Redux/ActionsReducers/BulkUpdateRedux';
|
|
5
5
|
import { BulkUpdateValidationResult } from '../../Strategy/Interface/IBulkUpdateModule';
|
|
6
6
|
import { PreviewInfo } from '../../Utilities/Interface/Preview';
|
|
7
|
+
import { GridCell } from '../../types';
|
|
7
8
|
export interface BulkUpdateViewPanelComponentProps extends ViewPanelProps {
|
|
8
9
|
BulkUpdateValue: string;
|
|
9
10
|
BulkUpdateValidationResult: BulkUpdateValidationResult;
|
|
@@ -12,6 +13,7 @@ export interface BulkUpdateViewPanelComponentProps extends ViewPanelProps {
|
|
|
12
13
|
onBulkUpdateValueChange: (value: string) => SystemRedux.BulkUpdateChangeValueAction;
|
|
13
14
|
onBulkUpdateCheckSelectedCells: () => SystemRedux.BulkUpdateCheckCellSelectionAction;
|
|
14
15
|
onRunBulkUpdate: () => BulkUpdateRedux.BulkUpdateCompleteAction;
|
|
16
|
+
SelectedGridCells: GridCell[];
|
|
15
17
|
}
|
|
16
18
|
declare class BulkUpdateViewPanelComponent extends React.Component<BulkUpdateViewPanelComponentProps, {}> {
|
|
17
19
|
private cleanupEvent?;
|
|
@@ -52,7 +52,7 @@ class BulkUpdateViewPanelComponent extends React.Component {
|
|
|
52
52
|
const elementType = this.props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
53
53
|
return (React.createElement(rebass_1.Flex, { flexDirection: "row", className: join_1.default(shouldDisable ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__BulkUpdate__wrap`), flexWrap: this.props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
54
54
|
React.createElement(rebass_1.Flex, null,
|
|
55
|
-
React.createElement(ColumnValueSelector_1.ColumnValueSelector, { newLabel: "New", existingLabel: "Existing", dropdownButtonProps: {
|
|
55
|
+
React.createElement(ColumnValueSelector_1.ColumnValueSelector, { selectedGridCells: this.props.SelectedGridCells, newLabel: "New", existingLabel: "Existing", dropdownButtonProps: {
|
|
56
56
|
listMinWidth: 160,
|
|
57
57
|
}, className: `ab-${elementType}__BulkUpdate__select`, disabled: shouldDisable, selectedColumnValue: this.props.BulkUpdateValue, selectedColumn: selectedColumn, api: this.props.api, onColumnValueChange: (columns) => this.onColumnValueSelectedChanged(columns) })),
|
|
58
58
|
React.createElement(rebass_1.Flex, null,
|
|
@@ -90,7 +90,9 @@ class BulkUpdateViewPanelComponent extends React.Component {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
function mapStateToProps(state, ownProps) {
|
|
93
|
+
var _a;
|
|
93
94
|
return {
|
|
95
|
+
SelectedGridCells: (_a = state.Grid.SelectedCellInfo) === null || _a === void 0 ? void 0 : _a.gridCells,
|
|
94
96
|
BulkUpdateValue: state.System.BulkUpdateValue,
|
|
95
97
|
BulkUpdateValidationResult: state.System.BulkUpdateValidationResult,
|
|
96
98
|
PreviewInfo: state.System.BulkUpdatePreviewInfo,
|
|
@@ -46,7 +46,7 @@ class CalculatedColumnPopupComponent extends React.Component {
|
|
|
46
46
|
if (this.props.popupParams.action && this.props.popupParams.column) {
|
|
47
47
|
if (this.props.popupParams.action == 'Edit') {
|
|
48
48
|
// only editing is possible - you cannot create a new calc column from the column menu
|
|
49
|
-
let calculatedColumn = this.props.CalculatedColumns.find((x) => x.ColumnId == this.props.popupParams.column.
|
|
49
|
+
let calculatedColumn = this.props.CalculatedColumns.find((x) => x.ColumnId == this.props.popupParams.column.columnId);
|
|
50
50
|
this.onEdit(calculatedColumn);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -29,7 +29,7 @@ class CalculatedColumnSummaryComponent extends React.Component {
|
|
|
29
29
|
let sharing = this.props.teamSharingActivated;
|
|
30
30
|
this.props.CalculatedColumns.map((item, index) => {
|
|
31
31
|
var _a;
|
|
32
|
-
if (item.ColumnId == this.props.summarisedColumn.
|
|
32
|
+
if (item.ColumnId == this.props.summarisedColumn.columnId) {
|
|
33
33
|
detailRow = (React.createElement(ModuleDetail_1.ModuleDetail, { key: 'UF' + index, item1: this.props.moduleInfo.FriendlyName, item2: (_a = item.Query) === null || _a === void 0 ? void 0 : _a.ScalarExpression, configEnity: item, showShare: this.props.teamSharingActivated, moduleInfo: this.props.moduleInfo, onEdit: () => this.onEdit(item), onShare: (config) => this.props.onShare(item, config), onDelete: CalculatedColumnRedux.CalculatedColumnDelete(item), showBold: true, accessLevel: this.props.accessLevel }));
|
|
34
34
|
}
|
|
35
35
|
});
|
|
@@ -48,7 +48,7 @@ exports.isValidCalculatedColumnSettings = (data, api) => {
|
|
|
48
48
|
if (!((_a = data.CalculatedColumnSettings) === null || _a === void 0 ? void 0 : _a.DataType)) {
|
|
49
49
|
return 'No data type specified for column';
|
|
50
50
|
}
|
|
51
|
-
const columnsWithSameIdCount = columns.filter((c) => c.
|
|
51
|
+
const columnsWithSameIdCount = columns.filter((c) => c.columnId === data.ColumnId).length;
|
|
52
52
|
const hasAlreadyExistingId = data.Uuid ? columnsWithSameIdCount > 1 : columnsWithSameIdCount > 0;
|
|
53
53
|
return hasAlreadyExistingId ? 'A Column already exists with that id' : true;
|
|
54
54
|
};
|
|
@@ -9,7 +9,7 @@ exports.NewColumnSelector = (props) => {
|
|
|
9
9
|
const { columnFilterText, availableColumns, selected, onChange, singleSelect } = props;
|
|
10
10
|
const filterFn = react_1.useMemo(() => {
|
|
11
11
|
return columnFilterText
|
|
12
|
-
? (c) => c.
|
|
12
|
+
? (c) => c.friendlyName.toLowerCase().indexOf(columnFilterText.toLowerCase()) != -1
|
|
13
13
|
: null;
|
|
14
14
|
}, [columnFilterText]);
|
|
15
15
|
return (React.createElement(ValueSelector_1.ValueSelector, { value: selected, options: availableColumns, filter: filterFn, singleSelect: singleSelect, allowReorder: false, onChange: (colIds) => {
|
|
@@ -19,7 +19,7 @@ exports.NewColumnSelector = (props) => {
|
|
|
19
19
|
else {
|
|
20
20
|
onChange(colIds);
|
|
21
21
|
}
|
|
22
|
-
}, toIdentifier: (c) => c.
|
|
22
|
+
}, toIdentifier: (c) => c.columnId, toLabel: (c) => c.friendlyName, noSelectionLabel: singleSelect ? 'Please select a column' : 'You have not selected any columns.', xSelectedLabel: singleSelect
|
|
23
23
|
? () => null
|
|
24
24
|
: (count) => (count > 1 ? `You selected ${count} columns.` : 'You selected one column.') }));
|
|
25
25
|
};
|