@adaptabletools/adaptable-cjs 18.0.0-canary.18 → 18.0.0-canary.19
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/package.json +1 -1
- package/src/AdaptableOptions/AdaptableOptions.d.ts +2 -2
- package/src/AdaptableOptions/CommentOptions.d.ts +9 -6
- package/src/AdaptableOptions/GroupingOptions.d.ts +0 -7
- package/src/AdaptableOptions/NoteOptions.d.ts +4 -4
- package/src/Api/Events/GridDataChanged.d.ts +1 -1
- package/src/Api/Implementation/ApiBase.d.ts +2 -1
- package/src/Api/Implementation/ApiBase.js +3 -0
- package/src/Api/Internal/ColumnFilterInternalApi.d.ts +1 -0
- package/src/Api/Internal/ColumnFilterInternalApi.js +12 -0
- package/src/PredefinedConfig/Common/DataUpdateConfig.d.ts +1 -5
- package/src/PredefinedConfig/NoteState.d.ts +1 -1
- package/src/Redux/Store/AdaptableStore.js +15 -5
- package/src/Strategy/CommentModule.js +5 -14
- package/src/Strategy/NoteModule.js +6 -9
- package/src/View/Comments/CommentsEditor.js +7 -6
- package/src/View/Comments/CommentsPopup.js +2 -1
- package/src/View/Components/Selectors/PermittedValuesSelector.js +1 -1
- package/src/View/Note/NotePopup.js +5 -3
- package/src/agGrid/AdaptableAgGrid.js +0 -20
- package/src/agGrid/defaultAdaptableOptions.js +0 -1
- package/src/components/Select/Select.d.ts +1 -1
- package/src/components/Select/Select.js +1 -1
- package/src/env.js +2 -2
- package/src/metamodel/adaptable.metamodel.d.ts +13 -10
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-cjs",
|
|
3
|
-
"version": "18.0.0-canary.
|
|
3
|
+
"version": "18.0.0-canary.19",
|
|
4
4
|
"description": "Powerful data-agnostic HTML5 AG Grid extension which provides advanced, cutting-edge functionality to meet all DataGrid requirements",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"web-components",
|
|
@@ -134,11 +134,11 @@ export interface AdaptableOptions<TData = any> {
|
|
|
134
134
|
*/
|
|
135
135
|
containerOptions?: ContainerOptions;
|
|
136
136
|
/**
|
|
137
|
-
* Options for managing Notes
|
|
137
|
+
* Options for managing personal Notes
|
|
138
138
|
*/
|
|
139
139
|
noteOptions?: NoteOptions;
|
|
140
140
|
/**
|
|
141
|
-
* Options for managing
|
|
141
|
+
* Options for managing collaborative Comments
|
|
142
142
|
*/
|
|
143
143
|
commentOptions?: CommentOptions<TData>;
|
|
144
144
|
/**
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { CommentThread, BaseContext,
|
|
1
|
+
import { CommentThread, BaseContext, GridCell } from '../types';
|
|
2
2
|
/**
|
|
3
3
|
* Options for managing Comments and Comment Threads in AdapTable
|
|
4
4
|
*/
|
|
5
5
|
export interface CommentOptions<TData = any> {
|
|
6
6
|
/**
|
|
7
|
-
* Whether a cell can
|
|
7
|
+
* Whether a cell can contain Comments
|
|
8
8
|
*/
|
|
9
9
|
isCellCommentable?: (commentableCellContext: CommentableCellContext) => boolean;
|
|
10
10
|
/**
|
|
11
|
-
* Loads
|
|
11
|
+
* Loads Comments
|
|
12
12
|
*/
|
|
13
13
|
loadCommentThreads?(commentLoadContext: CommentLoadContext): Promise<CommentThread[]>;
|
|
14
14
|
/**
|
|
15
|
-
* Called when Comments change
|
|
15
|
+
* Called when Comments change and need to be saved
|
|
16
16
|
* @param commentThreads
|
|
17
17
|
*/
|
|
18
18
|
persistCommentThreads?(commentThreads: CommentThread[]): void;
|
|
@@ -22,9 +22,12 @@ export interface CommentOptions<TData = any> {
|
|
|
22
22
|
*/
|
|
23
23
|
export interface CommentableCellContext extends BaseContext {
|
|
24
24
|
/**
|
|
25
|
-
* Cell in AdapTable which
|
|
25
|
+
* Grid Cell in AdapTable which has been clicked
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
gridCell: GridCell;
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* Context used when loading Comments
|
|
31
|
+
*/
|
|
29
32
|
export interface CommentLoadContext extends BaseContext {
|
|
30
33
|
}
|
|
@@ -4,13 +4,6 @@ import { KeyCreatorParams } from '@ag-grid-community/core';
|
|
|
4
4
|
* Options for managing Row and Column Groups in AdapTable
|
|
5
5
|
*/
|
|
6
6
|
export interface GroupingOptions<TData = any> {
|
|
7
|
-
/**
|
|
8
|
-
* Show aggregated totals row at top of Grid when row grouping
|
|
9
|
-
*
|
|
10
|
-
* @defaultValue false
|
|
11
|
-
* @gridInfoItem
|
|
12
|
-
*/
|
|
13
|
-
showGroupingTotalsAsHeader?: boolean;
|
|
14
7
|
/**
|
|
15
8
|
* Value to use for 'Balanced Groups' (string columns only)
|
|
16
9
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseContext,
|
|
1
|
+
import { BaseContext, GridCell } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Options for managing AdapTable Notes
|
|
4
4
|
*/
|
|
@@ -13,7 +13,7 @@ export interface NoteOptions<TData = any> {
|
|
|
13
13
|
*/
|
|
14
14
|
export interface NotableCellContext extends BaseContext {
|
|
15
15
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
* Grid Cell in AdapTable which has been clicked
|
|
17
|
+
*/
|
|
18
|
+
gridCell: GridCell;
|
|
19
19
|
}
|
|
@@ -13,7 +13,7 @@ export type GridDataChangeTrigger = 'Add' | 'Edit' | 'Delete' | 'Load';
|
|
|
13
13
|
*/
|
|
14
14
|
dataRows: TData[];
|
|
15
15
|
/**
|
|
16
|
-
* Trigger for row change:
|
|
16
|
+
* Trigger for row change: Load, Add, Edit, or Delete
|
|
17
17
|
*/
|
|
18
18
|
rowTrigger: GridDataChangeTrigger;
|
|
19
19
|
/**
|
|
@@ -7,7 +7,7 @@ import { ModuleInfo } from '../../Strategy/Interface/IModule';
|
|
|
7
7
|
import { AdaptableOptions } from '../../AdaptableOptions/AdaptableOptions';
|
|
8
8
|
import { AdaptableApi } from '../AdaptableApi';
|
|
9
9
|
import { ExportOptions } from '../../AdaptableOptions/ExportOptions';
|
|
10
|
-
import { ActionColumnApi, ActionColumnOptions, ActionRowApi, ActionRowOptions, AlertApi, AlertOptions, ApplicationApi, BulkUpdateApi, CalculatedColumnApi, CalendarApi, CalendarOptions, CellSummaryApi, CellSummaryOptions, ChartingApi, ChartingOptions, ColumnApi, ColumnFilterApi, ColumnFilterOptions, ColumnOptions, ConfigApi, ContainerOptions, CustomSortApi, CustomSortOptions, DashboardApi, DashboardOptions, DataChangeHistoryApi, DataChangeHistoryOptions, DataSetApi, DataSetOptions, EditOptions, EntitlementApi, EntitlementOptions, EventApi, ExportApi, ExpressionApi, ExpressionOptions, Fdc3Api, Fdc3Options, FlashingCellApi, FlashingCellOptions, FormatColumnApi, FormatColumnOptions, FreeTextColumnApi, GridApi, GridFilterApi, GroupingOptions, LayoutApi, LayoutAssociatedObject, LayoutOptions, MenuOptions, NamedQueryApi, NoteOptions, NotificationsOptions, PluginsApi, PlusMinusApi, PredicateApi, PredicateOptions, QuickSearchApi, QuickSearchOptions, ScheduleApi, ScopeApi, SettingsPanelApi, SettingsPanelOptions, ShortcutApi, SmartEditApi, StateOptions, StatusBarApi, StyledColumnApi, SystemStatusApi, TeamSharingApi, TeamSharingOptions, ThemeApi, ToolPanelApi, ToolPanelOptions, UserInterfaceApi, UserInterfaceOptions } from '../../types';
|
|
10
|
+
import { ActionColumnApi, ActionColumnOptions, ActionRowApi, ActionRowOptions, AlertApi, AlertOptions, ApplicationApi, BulkUpdateApi, CalculatedColumnApi, CalendarApi, CalendarOptions, CellSummaryApi, CellSummaryOptions, ChartingApi, ChartingOptions, ColumnApi, ColumnFilterApi, ColumnFilterOptions, ColumnOptions, CommentOptions, ConfigApi, ContainerOptions, CustomSortApi, CustomSortOptions, DashboardApi, DashboardOptions, DataChangeHistoryApi, DataChangeHistoryOptions, DataSetApi, DataSetOptions, EditOptions, EntitlementApi, EntitlementOptions, EventApi, ExportApi, ExpressionApi, ExpressionOptions, Fdc3Api, Fdc3Options, FlashingCellApi, FlashingCellOptions, FormatColumnApi, FormatColumnOptions, FreeTextColumnApi, GridApi, GridFilterApi, GroupingOptions, LayoutApi, LayoutAssociatedObject, LayoutOptions, MenuOptions, NamedQueryApi, NoteOptions, NotificationsOptions, PluginsApi, PlusMinusApi, PredicateApi, PredicateOptions, QuickSearchApi, QuickSearchOptions, ScheduleApi, ScopeApi, SettingsPanelApi, SettingsPanelOptions, ShortcutApi, SmartEditApi, StateOptions, StatusBarApi, StyledColumnApi, SystemStatusApi, TeamSharingApi, TeamSharingOptions, ThemeApi, ToolPanelApi, ToolPanelOptions, UserInterfaceApi, UserInterfaceOptions } from '../../types';
|
|
11
11
|
import { ModuleParams } from '../../View/Components/SharedProps/ModuleViewPopupProps';
|
|
12
12
|
export declare abstract class ApiBase {
|
|
13
13
|
protected adaptable: IAdaptable;
|
|
@@ -53,6 +53,7 @@ export declare abstract class ApiBase {
|
|
|
53
53
|
protected getActionColumnOptions(): ActionColumnOptions;
|
|
54
54
|
protected getActionRowOptions(): ActionRowOptions;
|
|
55
55
|
protected getColumnOptions(): ColumnOptions;
|
|
56
|
+
protected getCommentOptions(): CommentOptions;
|
|
56
57
|
protected getNoteOptions(): NoteOptions;
|
|
57
58
|
protected getCustomSortOptions(): CustomSortOptions;
|
|
58
59
|
protected getDataSetOptions(): DataSetOptions;
|
|
@@ -49,6 +49,7 @@ export declare class ColumnFilterInternalApi extends ApiBase {
|
|
|
49
49
|
* Fires Column Filter Applied Event - typically used to enable filtering on the server
|
|
50
50
|
*/
|
|
51
51
|
fireColumnFilterAppliedEvent(): void;
|
|
52
|
+
fireGridFilterAppliedEvent(): void;
|
|
52
53
|
/**
|
|
53
54
|
* Compares to sets of Column Filters to see if they are identical
|
|
54
55
|
* @param filters1
|
|
@@ -186,6 +186,18 @@ class ColumnFilterInternalApi extends ApiBase_1.ApiBase {
|
|
|
186
186
|
this.adaptable.api.eventApi.emit('ColumnFilterApplied', columnFilterAppliedInfo);
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
|
+
fireGridFilterAppliedEvent() {
|
|
190
|
+
if (this.adaptable.isReady) {
|
|
191
|
+
const adaptableApi = this.getAdaptableApi();
|
|
192
|
+
const gridFilterAppliedInfo = {
|
|
193
|
+
columnFilters: this.getColumnFilterApi().getColumnFilters(),
|
|
194
|
+
adaptableApi: adaptableApi,
|
|
195
|
+
userName: adaptableApi.optionsApi.getUserName(),
|
|
196
|
+
adaptableId: adaptableApi.optionsApi.getAdaptableId(),
|
|
197
|
+
};
|
|
198
|
+
this.adaptable.api.eventApi.emit('GridFilterApplied', gridFilterAppliedInfo);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
189
201
|
/**
|
|
190
202
|
* Compares to sets of Column Filters to see if they are identical
|
|
191
203
|
* @param filters1
|
|
@@ -7,11 +7,7 @@ export interface DataUpdateConfig {
|
|
|
7
7
|
*/
|
|
8
8
|
runAsync?: boolean;
|
|
9
9
|
/**
|
|
10
|
-
* Whether to flush async updates
|
|
11
|
-
*
|
|
12
|
-
* If `true`, any async transactions will be flushed.
|
|
13
|
-
* This flag can be true even if you runAsync is `false`.
|
|
14
|
-
* So even if the currenct transaction/operation is synchronous, this will flush existing async transactions.
|
|
10
|
+
* Whether to flush async updates
|
|
15
11
|
*/
|
|
16
12
|
flushAsync?: boolean;
|
|
17
13
|
/**
|
|
@@ -796,17 +796,27 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
796
796
|
case LayoutRedux.LAYOUT_GRID_FILTER_CLEAR:
|
|
797
797
|
case LayoutRedux.LAYOUT_GRID_FILTER_SUSPEND:
|
|
798
798
|
case LayoutRedux.LAYOUT_GRID_FILTER_UNSUSPEND: {
|
|
799
|
-
setTimeout(() => adaptable.applyGridFiltering(), 5);
|
|
800
|
-
adaptable.api.gridFilterApi.internalApi.fireGridFilterAppliedEvent();
|
|
801
|
-
adaptable.api.layoutApi.internalApi.fireLayoutChangedEvent(action.type, null, middlewareAPI.getState().Layout);
|
|
802
799
|
const currentLayout = adaptable.api.layoutApi.getCurrentLayout();
|
|
803
800
|
let returnAction;
|
|
801
|
+
// - calls GridFilterApplied - examples
|
|
802
|
+
adaptable.api.gridFilterApi.internalApi.fireGridFilterAppliedEvent();
|
|
803
|
+
// - layout change event, row summary is triggered
|
|
804
|
+
adaptable.api.layoutApi.internalApi.fireLayoutChangedEvent(action.type, null, middlewareAPI.getState().Layout);
|
|
805
|
+
setTimeout(() => {
|
|
806
|
+
// - agGridApi.onFilterChanged
|
|
807
|
+
// - internal 'AdapTableFiltersApplied' event - evaluates row summary
|
|
808
|
+
// - refresh selected cells and rows
|
|
809
|
+
adaptable.applyGridFiltering();
|
|
810
|
+
}, 5);
|
|
804
811
|
if (((_h = adaptable.adaptableOptions.layoutOptions) === null || _h === void 0 ? void 0 : _h.autoSaveLayouts) &&
|
|
805
812
|
!currentLayout.IsReadOnly) {
|
|
806
|
-
|
|
813
|
+
return next(action);
|
|
807
814
|
}
|
|
808
815
|
else {
|
|
809
|
-
|
|
816
|
+
if (!middlewareAPI.getState().Grid.CurrentLayout) {
|
|
817
|
+
const currentLayout = adaptable.api.layoutApi.getCurrentLayout();
|
|
818
|
+
middlewareAPI.dispatch(GridRedux.LayoutUpdateCurrentDraft(currentLayout));
|
|
819
|
+
}
|
|
810
820
|
switch (action.type) {
|
|
811
821
|
case LayoutRedux.LAYOUT_GRID_FILTER_SET:
|
|
812
822
|
returnAction = GridRedux.LayoutDraftGridFilterSet(Object.assign(Object.assign({}, currentLayout.GridFilter), { Expression: action.gridFilter }));
|
|
@@ -8,13 +8,12 @@ const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
|
|
|
8
8
|
class CommentModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
9
9
|
constructor(api) {
|
|
10
10
|
super(ModuleConstants.CommentModuleId, ModuleConstants.CommentFriendlyName, 'comments', 'CommentsPopup', 'comments', api);
|
|
11
|
-
this.adaptable = api.internalApi.getAdaptableInstance();
|
|
12
11
|
}
|
|
13
12
|
onAdaptableReady() {
|
|
14
13
|
this.loadComments();
|
|
15
14
|
}
|
|
16
15
|
isModuleAvailable() {
|
|
17
|
-
const options = this.
|
|
16
|
+
const options = this.api.optionsApi.getCommentOptions();
|
|
18
17
|
if (!options || !options.persistCommentThreads || !options.loadCommentThreads) {
|
|
19
18
|
return false;
|
|
20
19
|
}
|
|
@@ -26,7 +25,7 @@ class CommentModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
26
25
|
async loadComments() {
|
|
27
26
|
var _a, _b;
|
|
28
27
|
const commentThreads = await ((_b = (_a = this.api.optionsApi
|
|
29
|
-
.getCommentOptions()) === null || _a === void 0 ? void 0 : _a.loadCommentThreads) === null || _b === void 0 ? void 0 : _b.call(_a, (0, ObjectFactory_1.createBaseContext)(this.
|
|
28
|
+
.getCommentOptions()) === null || _a === void 0 ? void 0 : _a.loadCommentThreads) === null || _b === void 0 ? void 0 : _b.call(_a, (0, ObjectFactory_1.createBaseContext)(this.api)));
|
|
30
29
|
this.api.commentApi.loadCommentThreads(commentThreads);
|
|
31
30
|
}
|
|
32
31
|
addContextMenuItems(menuContext) {
|
|
@@ -35,17 +34,9 @@ class CommentModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
35
34
|
return undefined;
|
|
36
35
|
}
|
|
37
36
|
const items = [];
|
|
38
|
-
const isCellCommentable = (_b = (_a = this.
|
|
37
|
+
const isCellCommentable = (_b = (_a = this.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getCommentOptions()) === null || _b === void 0 ? void 0 : _b.isCellCommentable;
|
|
39
38
|
if (!isCellCommentable ||
|
|
40
|
-
isCellCommentable({
|
|
41
|
-
adaptableApi: this.adaptable.api,
|
|
42
|
-
cellAddress: {
|
|
43
|
-
PrimaryKeyValue: menuContext.primaryKeyValue,
|
|
44
|
-
ColumnId: menuContext.adaptableColumn.columnId,
|
|
45
|
-
},
|
|
46
|
-
userName: this.adaptable.api.optionsApi.getUserName(),
|
|
47
|
-
adaptableId: this.adaptable.adaptableOptions.adaptableId,
|
|
48
|
-
})) {
|
|
39
|
+
isCellCommentable(Object.assign({ gridCell: menuContext.gridCell }, (0, ObjectFactory_1.createBaseContext)(this.api)))) {
|
|
49
40
|
items.push(...this.getAddRemoveCommentsMenuItems(menuContext));
|
|
50
41
|
}
|
|
51
42
|
return items;
|
|
@@ -57,7 +48,7 @@ class CommentModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
57
48
|
PrimaryKeyValue: menuContext.primaryKeyValue,
|
|
58
49
|
ColumnId: menuContext.adaptableColumn.columnId,
|
|
59
50
|
};
|
|
60
|
-
const comments = this.
|
|
51
|
+
const comments = this.api.commentApi.getComments(cellAddress);
|
|
61
52
|
if (!this.api.commentApi.internalApi.areCommentsAvailable()) {
|
|
62
53
|
return items;
|
|
63
54
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.NoteModule = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
|
|
6
|
+
const ObjectFactory_1 = require("../Utilities/ObjectFactory");
|
|
6
7
|
const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
|
|
7
8
|
class NoteModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
8
9
|
constructor(api) {
|
|
@@ -18,18 +19,14 @@ class NoteModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
18
19
|
if (!this.isModuleAvailable()) {
|
|
19
20
|
return undefined;
|
|
20
21
|
}
|
|
22
|
+
const isReadOnly = this.adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(this.moduleInfo.ModuleName) === 'ReadOnly';
|
|
23
|
+
if (isReadOnly) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
21
26
|
const items = [];
|
|
22
27
|
const isCellNotable = (_b = (_a = this.adaptable.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getNoteOptions()) === null || _b === void 0 ? void 0 : _b.isCellNotable;
|
|
23
28
|
if (!isCellNotable ||
|
|
24
|
-
isCellNotable({
|
|
25
|
-
adaptableApi: this.adaptable.api,
|
|
26
|
-
address: {
|
|
27
|
-
PrimaryKeyValue: menuContext.primaryKeyValue,
|
|
28
|
-
ColumnId: menuContext.adaptableColumn.columnId,
|
|
29
|
-
},
|
|
30
|
-
userName: this.adaptable.api.optionsApi.getUserName(),
|
|
31
|
-
adaptableId: this.adaptable.adaptableOptions.adaptableId,
|
|
32
|
-
}))
|
|
29
|
+
isCellNotable(Object.assign({ gridCell: menuContext.gridCell }, (0, ObjectFactory_1.createBaseContext)(this.api))))
|
|
33
30
|
items.push(...this.getAddRemoveNoteMenuItems(menuContext));
|
|
34
31
|
return items;
|
|
35
32
|
}
|
|
@@ -28,6 +28,7 @@ const CommentsEditor = (props) => {
|
|
|
28
28
|
return adaptable.api.optionsApi.getUserName();
|
|
29
29
|
}, []);
|
|
30
30
|
const commentThread = (0, react_redux_1.useSelector)((state) => CommentsRedux.GetCellCommentSelector(state.Comment, cellAddress));
|
|
31
|
+
const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Comment') === 'ReadOnly';
|
|
31
32
|
const [activeEditingComment, setActiveEditingComment] = React.useState(() => {
|
|
32
33
|
/**
|
|
33
34
|
* When opening the popup and there is only one comment, we want to open it in edit mode.
|
|
@@ -62,14 +63,14 @@ const CommentsEditor = (props) => {
|
|
|
62
63
|
React.createElement(rebass_1.Box, { fontSize: 3, fontWeight: "bold" }, (_d = comment === null || comment === void 0 ? void 0 : comment.Author) === null || _d === void 0 ? void 0 : _d.UserName),
|
|
63
64
|
comment.Timestamp && (React.createElement(rebass_1.Box, { fontSize: 2 }, (0, dateUtils_1.formatDate)(comment.Timestamp, 'MM.DD.YYYY HH:mm')))),
|
|
64
65
|
React.createElement(rebass_1.Box, { flex: 1 }),
|
|
65
|
-
React.createElement(SimpleButton_1.default, { variant: "text", icon: "edit", disabled: !isOwnComment, onClick: () => setActiveEditingComment(comment.Uuid) }),
|
|
66
|
-
React.createElement(SimpleButton_1.default, { variant: "text", icon: "delete", disabled: !isOwnComment, onClick: () => {
|
|
66
|
+
React.createElement(SimpleButton_1.default, { variant: "text", icon: "edit", disabled: !isOwnComment || isReadOnlyModule, onClick: () => setActiveEditingComment(comment.Uuid) }),
|
|
67
|
+
React.createElement(SimpleButton_1.default, { variant: "text", icon: "delete", disabled: !isOwnComment || isReadOnlyModule, onClick: () => {
|
|
67
68
|
adaptable.api.commentApi.deleteComment(comment, cellAddress);
|
|
68
69
|
requestAnimationFrame(() => {
|
|
69
70
|
props.onRefreshContent();
|
|
70
71
|
});
|
|
71
72
|
} })),
|
|
72
|
-
React.createElement(rebass_1.Box, { onClick: () => setActiveEditingComment(comment.Uuid) }, comment.Uuid === activeEditingComment ? (React.createElement(AdaptableInput_1.default, { autoFocus: true, width: "100%", defaultValue: comment.Value, onBlur: () => {
|
|
73
|
+
React.createElement(rebass_1.Box, { onClick: () => setActiveEditingComment(comment.Uuid) }, comment.Uuid === activeEditingComment ? (React.createElement(AdaptableInput_1.default, { autoFocus: true, width: "100%", defaultValue: comment.Value, disabled: isReadOnlyModule, onBlur: () => {
|
|
73
74
|
if (comment.Uuid === activeEditingComment) {
|
|
74
75
|
setActiveEditingComment(null);
|
|
75
76
|
}
|
|
@@ -77,7 +78,7 @@ const CommentsEditor = (props) => {
|
|
|
77
78
|
adaptable.api.commentApi.editComment(Object.assign(Object.assign({}, comment), { Value: event.target.value }), cellAddress);
|
|
78
79
|
} })) : (React.createElement(rebass_1.Text, null, comment.Value)))));
|
|
79
80
|
}),
|
|
80
|
-
React.createElement(AdaptableInput_1.default, { autoFocus: !comments || comments.length === 0, value: newCommentText, onChange: (event) => {
|
|
81
|
+
React.createElement(AdaptableInput_1.default, { autoFocus: !comments || comments.length === 0, value: newCommentText, disabled: isReadOnlyModule, onChange: (event) => {
|
|
81
82
|
setNewCommentText(event.target.value);
|
|
82
83
|
}, onKeyDown: (event) => {
|
|
83
84
|
if (event.key === 'Enter') {
|
|
@@ -87,7 +88,7 @@ const CommentsEditor = (props) => {
|
|
|
87
88
|
props.onRefreshContent();
|
|
88
89
|
});
|
|
89
90
|
}
|
|
90
|
-
}, mt: 2, mb: "2", width: "100%", placeholder: "Write new
|
|
91
|
+
}, mt: 2, mb: "2", width: "100%", placeholder: "Write new Comment" }),
|
|
91
92
|
React.createElement(SimpleButton_1.default, { width: "100%", variant: "raised", onClick: () => {
|
|
92
93
|
adaptable.api.settingsPanelApi.openSettingsPanel('Comment');
|
|
93
94
|
adaptable.api.internalApi.getCellPopupService().hidePopup();
|
|
@@ -95,6 +96,6 @@ const CommentsEditor = (props) => {
|
|
|
95
96
|
React.createElement(rebass_1.Box, { mr: 2 },
|
|
96
97
|
React.createElement(icons_1.Icon, { name: "folder" })),
|
|
97
98
|
' ',
|
|
98
|
-
"Open all
|
|
99
|
+
"Open all Comments")));
|
|
99
100
|
};
|
|
100
101
|
exports.CommentsEditor = CommentsEditor;
|
|
@@ -19,6 +19,7 @@ const tableDOMProps = {
|
|
|
19
19
|
};
|
|
20
20
|
const CellComments = (props) => {
|
|
21
21
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
22
|
+
const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Comment') === 'ReadOnly';
|
|
22
23
|
const columnsMap = React.useMemo(() => {
|
|
23
24
|
const columns = {
|
|
24
25
|
author: {
|
|
@@ -69,7 +70,7 @@ const CellComments = (props) => {
|
|
|
69
70
|
PrimaryKeyValue: props.commentThread.PrimaryKeyValue,
|
|
70
71
|
}, true);
|
|
71
72
|
} }),
|
|
72
|
-
React.createElement(AdaptableButton_1.AdaptableButtonComponent, { icon: "delete", variant: "text", onClick: () => {
|
|
73
|
+
React.createElement(AdaptableButton_1.AdaptableButtonComponent, { icon: "delete", disabled: isReadOnlyModule, variant: "text", onClick: () => {
|
|
73
74
|
adaptable.api.commentApi.deleteCommentThread(props.commentThread);
|
|
74
75
|
} })) },
|
|
75
76
|
React.createElement(InfiniteTable_1.DataSource, { data: props.commentThread.Comments, primaryKey: "Uuid" },
|
|
@@ -68,6 +68,6 @@ const PermittedValuesSelector = function (props) {
|
|
|
68
68
|
handleSingleValueChange(value);
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
|
-
return (React.createElement(Select_1.Select, { isMulti: props.isMulti, className: props.className, disabled: props.disabled, "data-name": "permitted-values-selector", placeholder: props.placeholder || (props.allowNewValues ? 'Select or type new value' : 'Select value'), isCreatable: isCreatable, isClearable: true, options: options,
|
|
71
|
+
return (React.createElement(Select_1.Select, { isMulti: props.isMulti, className: props.className, disabled: props.disabled, "data-name": "permitted-values-selector", placeholder: props.placeholder || (props.allowNewValues ? 'Select or type new value' : 'Select value'), isCreatable: isCreatable, isClearable: true, options: options, isLoading: isLoading, onInputChange: setFilter, onChange: handleOnChange, value: props.value }));
|
|
72
72
|
};
|
|
73
73
|
exports.PermittedValuesSelector = PermittedValuesSelector;
|
|
@@ -20,6 +20,7 @@ const NotePopup = (props) => {
|
|
|
20
20
|
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
21
21
|
const primaryKeyHeader = adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId);
|
|
22
22
|
const allNotes = (0, react_redux_1.useSelector)((state) => (0, NoteRedux_1.GetAllNotesSelector)(state.Note));
|
|
23
|
+
const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Note') === 'ReadOnly';
|
|
23
24
|
const columnsMap = React.useMemo(() => {
|
|
24
25
|
const columns = {
|
|
25
26
|
primaryKey: {
|
|
@@ -36,19 +37,20 @@ const NotePopup = (props) => {
|
|
|
36
37
|
text: {
|
|
37
38
|
field: 'Text',
|
|
38
39
|
header: 'Text',
|
|
39
|
-
defaultEditable:
|
|
40
|
+
defaultEditable: !isReadOnlyModule,
|
|
40
41
|
defaultFlex: 3,
|
|
41
42
|
},
|
|
42
43
|
timestamp: {
|
|
43
44
|
field: 'Timestamp',
|
|
44
45
|
valueGetter: (params) => {
|
|
45
|
-
|
|
46
|
+
var _a;
|
|
47
|
+
return (_a = new Date(params.data.Timestamp)) === null || _a === void 0 ? void 0 : _a.toDateString();
|
|
46
48
|
},
|
|
47
49
|
},
|
|
48
50
|
delete: {
|
|
49
51
|
defaultWidth: 50,
|
|
50
52
|
render: (params) => {
|
|
51
|
-
return (React.createElement(AdaptableButton_1.AdaptableButtonComponent, { variant: "text", icon: "delete", onClick: () => {
|
|
53
|
+
return (React.createElement(AdaptableButton_1.AdaptableButtonComponent, { disabled: isReadOnlyModule, variant: "text", icon: "delete", onClick: () => {
|
|
52
54
|
const note = adaptable.api.noteApi.getNoteByUuid(params.data.Uuid);
|
|
53
55
|
adaptable.api.noteApi.deleteNote(note);
|
|
54
56
|
} }));
|
|
@@ -1443,26 +1443,6 @@ class AdaptableAgGrid {
|
|
|
1443
1443
|
this.onSortChanged();
|
|
1444
1444
|
this.debouncedSetSelectedCells();
|
|
1445
1445
|
}));
|
|
1446
|
-
const showGroupingTotalsAsHeader = this.adaptableOptions.groupingOptions.showGroupingTotalsAsHeader;
|
|
1447
|
-
/**
|
|
1448
|
-
* Use Case: Model has updated
|
|
1449
|
-
* Action: If user has set to see grouping totals as header create a pinned row (bit of a hack)
|
|
1450
|
-
*/
|
|
1451
|
-
this.agGridAdapter.getAgGridApi().addEventListener(core_1.Events.EVENT_MODEL_UPDATED, (this.listenerModelUpdated = (params) => {
|
|
1452
|
-
if (showGroupingTotalsAsHeader) {
|
|
1453
|
-
if (params && params.api) {
|
|
1454
|
-
const pinnedData = params.api.getPinnedTopRow(0);
|
|
1455
|
-
const model = params.api.getModel();
|
|
1456
|
-
const rootNode = model.getRootNode();
|
|
1457
|
-
if (!pinnedData) {
|
|
1458
|
-
params.api.setPinnedTopRowData([rootNode.aggData]);
|
|
1459
|
-
}
|
|
1460
|
-
else {
|
|
1461
|
-
pinnedData.updateData(rootNode.aggData);
|
|
1462
|
-
}
|
|
1463
|
-
}
|
|
1464
|
-
}
|
|
1465
|
-
}));
|
|
1466
1446
|
const eventsThatTriggerChartingChanges = [
|
|
1467
1447
|
core_1.Events.EVENT_CHART_CREATED,
|
|
1468
1448
|
/** Chart Range selection has changed */
|
|
@@ -148,7 +148,6 @@ const DefaultAdaptableOptions = {
|
|
|
148
148
|
customSortOptions: { customSortComparers: undefined },
|
|
149
149
|
dataSetOptions: { dataSets: GeneralConstants_1.EMPTY_ARRAY },
|
|
150
150
|
groupingOptions: {
|
|
151
|
-
showGroupingTotalsAsHeader: false,
|
|
152
151
|
balancedGroupsKey: undefined,
|
|
153
152
|
restoreUngroupedColumns: false,
|
|
154
153
|
autoOrderGroupedColumns: true,
|
|
@@ -21,7 +21,7 @@ export type SelectProps<SelectValue extends unknown, IsMulti extends boolean = f
|
|
|
21
21
|
'data-id'?: string;
|
|
22
22
|
renderSingleValue?: (option: SelectOption<SelectValue>) => React.ReactNode;
|
|
23
23
|
className?: string;
|
|
24
|
-
|
|
24
|
+
isLoading?: boolean;
|
|
25
25
|
onFocus?: () => void;
|
|
26
26
|
accessLevel?: AccessLevel;
|
|
27
27
|
style?: React.CSSProperties;
|
|
@@ -84,7 +84,7 @@ const Select = function (props) {
|
|
|
84
84
|
React.createElement(icons_1.Icon, { name: "triangle-down", style: { height: 20, width: 20 } })));
|
|
85
85
|
};
|
|
86
86
|
}, []);
|
|
87
|
-
return (React.createElement(SelectComponent, { onInputChange: props.onInputChange, onFocus: props.onFocus, isLoading: props.
|
|
87
|
+
return (React.createElement(SelectComponent, { onInputChange: props.onInputChange, onFocus: props.onFocus, isLoading: props.isLoading, options: props.options, className: props.className, isDisabled: disabled, menuPlacement: (_g = props.menuPlacement) !== null && _g !== void 0 ? _g : 'auto', isSearchable: props.searchable, isMulti: props.isMulti, value: selectedOption, menuPosition: (_h = props.menuPosition) !== null && _h !== void 0 ? _h : 'absolute',
|
|
88
88
|
// This needed so the menu is not clipped by overflow: hidden
|
|
89
89
|
menuPortalTarget: document.body, isClearable: props.isClearable, onChange: (option) => {
|
|
90
90
|
if (props.isMulti) {
|
package/src/env.js
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = {
|
|
4
4
|
INFINITE_TABLE_LICENSE_KEY: "StartDate=2021-06-29|EndDate=2030-01-01|Owner=Adaptable|Type=distribution|TS=1624971462479|C=137829811,1004007071,2756196225,1839832928,3994409405,636616862" || '',
|
|
5
|
-
PUBLISH_TIMESTAMP:
|
|
6
|
-
VERSION: "18.0.0-canary.
|
|
5
|
+
PUBLISH_TIMESTAMP: 1711969937271 || Date.now(),
|
|
6
|
+
VERSION: "18.0.0-canary.19" || '--current-version--',
|
|
7
7
|
};
|
|
@@ -595,11 +595,17 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
595
595
|
name: string;
|
|
596
596
|
kind: string;
|
|
597
597
|
desc: string;
|
|
598
|
-
props: {
|
|
598
|
+
props: ({
|
|
599
599
|
name: string;
|
|
600
600
|
kind: string;
|
|
601
601
|
desc: string;
|
|
602
|
-
|
|
602
|
+
isOpt?: undefined;
|
|
603
|
+
} | {
|
|
604
|
+
name: string;
|
|
605
|
+
kind: string;
|
|
606
|
+
desc: string;
|
|
607
|
+
isOpt: boolean;
|
|
608
|
+
})[];
|
|
603
609
|
};
|
|
604
610
|
AdaptableNotes: {
|
|
605
611
|
name: string;
|
|
@@ -1959,6 +1965,11 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
1959
1965
|
ref: string;
|
|
1960
1966
|
}[];
|
|
1961
1967
|
};
|
|
1968
|
+
CommentLoadContext: {
|
|
1969
|
+
name: string;
|
|
1970
|
+
kind: string;
|
|
1971
|
+
desc: string;
|
|
1972
|
+
};
|
|
1962
1973
|
CommentOptions: {
|
|
1963
1974
|
name: string;
|
|
1964
1975
|
kind: string;
|
|
@@ -3644,14 +3655,6 @@ export declare const ADAPTABLE_METAMODEL: {
|
|
|
3644
3655
|
noCode: string;
|
|
3645
3656
|
defVal: string;
|
|
3646
3657
|
gridInfo?: undefined;
|
|
3647
|
-
} | {
|
|
3648
|
-
name: string;
|
|
3649
|
-
kind: string;
|
|
3650
|
-
desc: string;
|
|
3651
|
-
isOpt: boolean;
|
|
3652
|
-
gridInfo: string;
|
|
3653
|
-
defVal: string;
|
|
3654
|
-
noCode?: undefined;
|
|
3655
3658
|
})[];
|
|
3656
3659
|
};
|
|
3657
3660
|
HandleFdc3Context: {
|