@adaptabletools/adaptable 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.esm.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable",
|
|
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
|
|
@@ -182,6 +182,18 @@ export class ColumnFilterInternalApi extends ApiBase {
|
|
|
182
182
|
this.adaptable.api.eventApi.emit('ColumnFilterApplied', columnFilterAppliedInfo);
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
+
fireGridFilterAppliedEvent() {
|
|
186
|
+
if (this.adaptable.isReady) {
|
|
187
|
+
const adaptableApi = this.getAdaptableApi();
|
|
188
|
+
const gridFilterAppliedInfo = {
|
|
189
|
+
columnFilters: this.getColumnFilterApi().getColumnFilters(),
|
|
190
|
+
adaptableApi: adaptableApi,
|
|
191
|
+
userName: adaptableApi.optionsApi.getUserName(),
|
|
192
|
+
adaptableId: adaptableApi.optionsApi.getAdaptableId(),
|
|
193
|
+
};
|
|
194
|
+
this.adaptable.api.eventApi.emit('GridFilterApplied', gridFilterAppliedInfo);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
185
197
|
/**
|
|
186
198
|
* Compares to sets of Column Filters to see if they are identical
|
|
187
199
|
* @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
|
/**
|
|
@@ -789,17 +789,27 @@ const adaptableMiddleware = (adaptable) => (function(middlewareAPI) {
|
|
|
789
789
|
case LayoutRedux.LAYOUT_GRID_FILTER_CLEAR:
|
|
790
790
|
case LayoutRedux.LAYOUT_GRID_FILTER_SUSPEND:
|
|
791
791
|
case LayoutRedux.LAYOUT_GRID_FILTER_UNSUSPEND: {
|
|
792
|
-
setTimeout(() => adaptable.applyGridFiltering(), 5);
|
|
793
|
-
adaptable.api.gridFilterApi.internalApi.fireGridFilterAppliedEvent();
|
|
794
|
-
adaptable.api.layoutApi.internalApi.fireLayoutChangedEvent(action.type, null, middlewareAPI.getState().Layout);
|
|
795
792
|
const currentLayout = adaptable.api.layoutApi.getCurrentLayout();
|
|
796
793
|
let returnAction;
|
|
794
|
+
// - calls GridFilterApplied - examples
|
|
795
|
+
adaptable.api.gridFilterApi.internalApi.fireGridFilterAppliedEvent();
|
|
796
|
+
// - layout change event, row summary is triggered
|
|
797
|
+
adaptable.api.layoutApi.internalApi.fireLayoutChangedEvent(action.type, null, middlewareAPI.getState().Layout);
|
|
798
|
+
setTimeout(() => {
|
|
799
|
+
// - agGridApi.onFilterChanged
|
|
800
|
+
// - internal 'AdapTableFiltersApplied' event - evaluates row summary
|
|
801
|
+
// - refresh selected cells and rows
|
|
802
|
+
adaptable.applyGridFiltering();
|
|
803
|
+
}, 5);
|
|
797
804
|
if (((_h = adaptable.adaptableOptions.layoutOptions) === null || _h === void 0 ? void 0 : _h.autoSaveLayouts) &&
|
|
798
805
|
!currentLayout.IsReadOnly) {
|
|
799
|
-
|
|
806
|
+
return next(action);
|
|
800
807
|
}
|
|
801
808
|
else {
|
|
802
|
-
|
|
809
|
+
if (!middlewareAPI.getState().Grid.CurrentLayout) {
|
|
810
|
+
const currentLayout = adaptable.api.layoutApi.getCurrentLayout();
|
|
811
|
+
middlewareAPI.dispatch(GridRedux.LayoutUpdateCurrentDraft(currentLayout));
|
|
812
|
+
}
|
|
803
813
|
switch (action.type) {
|
|
804
814
|
case LayoutRedux.LAYOUT_GRID_FILTER_SET:
|
|
805
815
|
returnAction = GridRedux.LayoutDraftGridFilterSet(Object.assign(Object.assign({}, currentLayout.GridFilter), { Expression: action.gridFilter }));
|
|
@@ -4,13 +4,12 @@ import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
|
4
4
|
export class CommentModule extends AdaptableModuleBase {
|
|
5
5
|
constructor(api) {
|
|
6
6
|
super(ModuleConstants.CommentModuleId, ModuleConstants.CommentFriendlyName, 'comments', 'CommentsPopup', 'comments', api);
|
|
7
|
-
this.adaptable = api.internalApi.getAdaptableInstance();
|
|
8
7
|
}
|
|
9
8
|
onAdaptableReady() {
|
|
10
9
|
this.loadComments();
|
|
11
10
|
}
|
|
12
11
|
isModuleAvailable() {
|
|
13
|
-
const options = this.
|
|
12
|
+
const options = this.api.optionsApi.getCommentOptions();
|
|
14
13
|
if (!options || !options.persistCommentThreads || !options.loadCommentThreads) {
|
|
15
14
|
return false;
|
|
16
15
|
}
|
|
@@ -22,7 +21,7 @@ export class CommentModule extends AdaptableModuleBase {
|
|
|
22
21
|
async loadComments() {
|
|
23
22
|
var _a, _b;
|
|
24
23
|
const commentThreads = await ((_b = (_a = this.api.optionsApi
|
|
25
|
-
.getCommentOptions()) === null || _a === void 0 ? void 0 : _a.loadCommentThreads) === null || _b === void 0 ? void 0 : _b.call(_a, createBaseContext(this.
|
|
24
|
+
.getCommentOptions()) === null || _a === void 0 ? void 0 : _a.loadCommentThreads) === null || _b === void 0 ? void 0 : _b.call(_a, createBaseContext(this.api)));
|
|
26
25
|
this.api.commentApi.loadCommentThreads(commentThreads);
|
|
27
26
|
}
|
|
28
27
|
addContextMenuItems(menuContext) {
|
|
@@ -31,17 +30,9 @@ export class CommentModule extends AdaptableModuleBase {
|
|
|
31
30
|
return undefined;
|
|
32
31
|
}
|
|
33
32
|
const items = [];
|
|
34
|
-
const isCellCommentable = (_b = (_a = this.
|
|
33
|
+
const isCellCommentable = (_b = (_a = this.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getCommentOptions()) === null || _b === void 0 ? void 0 : _b.isCellCommentable;
|
|
35
34
|
if (!isCellCommentable ||
|
|
36
|
-
isCellCommentable({
|
|
37
|
-
adaptableApi: this.adaptable.api,
|
|
38
|
-
cellAddress: {
|
|
39
|
-
PrimaryKeyValue: menuContext.primaryKeyValue,
|
|
40
|
-
ColumnId: menuContext.adaptableColumn.columnId,
|
|
41
|
-
},
|
|
42
|
-
userName: this.adaptable.api.optionsApi.getUserName(),
|
|
43
|
-
adaptableId: this.adaptable.adaptableOptions.adaptableId,
|
|
44
|
-
})) {
|
|
35
|
+
isCellCommentable(Object.assign({ gridCell: menuContext.gridCell }, createBaseContext(this.api)))) {
|
|
45
36
|
items.push(...this.getAddRemoveCommentsMenuItems(menuContext));
|
|
46
37
|
}
|
|
47
38
|
return items;
|
|
@@ -53,7 +44,7 @@ export class CommentModule extends AdaptableModuleBase {
|
|
|
53
44
|
PrimaryKeyValue: menuContext.primaryKeyValue,
|
|
54
45
|
ColumnId: menuContext.adaptableColumn.columnId,
|
|
55
46
|
};
|
|
56
|
-
const comments = this.
|
|
47
|
+
const comments = this.api.commentApi.getComments(cellAddress);
|
|
57
48
|
if (!this.api.commentApi.internalApi.areCommentsAvailable()) {
|
|
58
49
|
return items;
|
|
59
50
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as ModuleConstants from '../Utilities/Constants/ModuleConstants';
|
|
2
|
+
import { createBaseContext } from '../Utilities/ObjectFactory';
|
|
2
3
|
import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
3
4
|
export class NoteModule extends AdaptableModuleBase {
|
|
4
5
|
constructor(api) {
|
|
@@ -14,18 +15,14 @@ export class NoteModule extends AdaptableModuleBase {
|
|
|
14
15
|
if (!this.isModuleAvailable()) {
|
|
15
16
|
return undefined;
|
|
16
17
|
}
|
|
18
|
+
const isReadOnly = this.adaptable.api.entitlementApi.getEntitlementAccessLevelForModule(this.moduleInfo.ModuleName) === 'ReadOnly';
|
|
19
|
+
if (isReadOnly) {
|
|
20
|
+
return undefined;
|
|
21
|
+
}
|
|
17
22
|
const items = [];
|
|
18
23
|
const isCellNotable = (_b = (_a = this.adaptable.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getNoteOptions()) === null || _b === void 0 ? void 0 : _b.isCellNotable;
|
|
19
24
|
if (!isCellNotable ||
|
|
20
|
-
isCellNotable({
|
|
21
|
-
adaptableApi: this.adaptable.api,
|
|
22
|
-
address: {
|
|
23
|
-
PrimaryKeyValue: menuContext.primaryKeyValue,
|
|
24
|
-
ColumnId: menuContext.adaptableColumn.columnId,
|
|
25
|
-
},
|
|
26
|
-
userName: this.adaptable.api.optionsApi.getUserName(),
|
|
27
|
-
adaptableId: this.adaptable.adaptableOptions.adaptableId,
|
|
28
|
-
}))
|
|
25
|
+
isCellNotable(Object.assign({ gridCell: menuContext.gridCell }, createBaseContext(this.api))))
|
|
29
26
|
items.push(...this.getAddRemoveNoteMenuItems(menuContext));
|
|
30
27
|
return items;
|
|
31
28
|
}
|
|
@@ -24,6 +24,7 @@ export const CommentsEditor = (props) => {
|
|
|
24
24
|
return adaptable.api.optionsApi.getUserName();
|
|
25
25
|
}, []);
|
|
26
26
|
const commentThread = useSelector((state) => CommentsRedux.GetCellCommentSelector(state.Comment, cellAddress));
|
|
27
|
+
const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Comment') === 'ReadOnly';
|
|
27
28
|
const [activeEditingComment, setActiveEditingComment] = React.useState(() => {
|
|
28
29
|
/**
|
|
29
30
|
* When opening the popup and there is only one comment, we want to open it in edit mode.
|
|
@@ -58,14 +59,14 @@ export const CommentsEditor = (props) => {
|
|
|
58
59
|
React.createElement(Box, { fontSize: 3, fontWeight: "bold" }, (_d = comment === null || comment === void 0 ? void 0 : comment.Author) === null || _d === void 0 ? void 0 : _d.UserName),
|
|
59
60
|
comment.Timestamp && (React.createElement(Box, { fontSize: 2 }, formatDate(comment.Timestamp, 'MM.DD.YYYY HH:mm')))),
|
|
60
61
|
React.createElement(Box, { flex: 1 }),
|
|
61
|
-
React.createElement(SimpleButton, { variant: "text", icon: "edit", disabled: !isOwnComment, onClick: () => setActiveEditingComment(comment.Uuid) }),
|
|
62
|
-
React.createElement(SimpleButton, { variant: "text", icon: "delete", disabled: !isOwnComment, onClick: () => {
|
|
62
|
+
React.createElement(SimpleButton, { variant: "text", icon: "edit", disabled: !isOwnComment || isReadOnlyModule, onClick: () => setActiveEditingComment(comment.Uuid) }),
|
|
63
|
+
React.createElement(SimpleButton, { variant: "text", icon: "delete", disabled: !isOwnComment || isReadOnlyModule, onClick: () => {
|
|
63
64
|
adaptable.api.commentApi.deleteComment(comment, cellAddress);
|
|
64
65
|
requestAnimationFrame(() => {
|
|
65
66
|
props.onRefreshContent();
|
|
66
67
|
});
|
|
67
68
|
} })),
|
|
68
|
-
React.createElement(Box, { onClick: () => setActiveEditingComment(comment.Uuid) }, comment.Uuid === activeEditingComment ? (React.createElement(AdaptableInput, { autoFocus: true, width: "100%", defaultValue: comment.Value, onBlur: () => {
|
|
69
|
+
React.createElement(Box, { onClick: () => setActiveEditingComment(comment.Uuid) }, comment.Uuid === activeEditingComment ? (React.createElement(AdaptableInput, { autoFocus: true, width: "100%", defaultValue: comment.Value, disabled: isReadOnlyModule, onBlur: () => {
|
|
69
70
|
if (comment.Uuid === activeEditingComment) {
|
|
70
71
|
setActiveEditingComment(null);
|
|
71
72
|
}
|
|
@@ -73,7 +74,7 @@ export const CommentsEditor = (props) => {
|
|
|
73
74
|
adaptable.api.commentApi.editComment(Object.assign(Object.assign({}, comment), { Value: event.target.value }), cellAddress);
|
|
74
75
|
} })) : (React.createElement(Text, null, comment.Value)))));
|
|
75
76
|
}),
|
|
76
|
-
React.createElement(AdaptableInput, { autoFocus: !comments || comments.length === 0, value: newCommentText, onChange: (event) => {
|
|
77
|
+
React.createElement(AdaptableInput, { autoFocus: !comments || comments.length === 0, value: newCommentText, disabled: isReadOnlyModule, onChange: (event) => {
|
|
77
78
|
setNewCommentText(event.target.value);
|
|
78
79
|
}, onKeyDown: (event) => {
|
|
79
80
|
if (event.key === 'Enter') {
|
|
@@ -83,7 +84,7 @@ export const CommentsEditor = (props) => {
|
|
|
83
84
|
props.onRefreshContent();
|
|
84
85
|
});
|
|
85
86
|
}
|
|
86
|
-
}, mt: 2, mb: "2", width: "100%", placeholder: "Write new
|
|
87
|
+
}, mt: 2, mb: "2", width: "100%", placeholder: "Write new Comment" }),
|
|
87
88
|
React.createElement(SimpleButton, { width: "100%", variant: "raised", onClick: () => {
|
|
88
89
|
adaptable.api.settingsPanelApi.openSettingsPanel('Comment');
|
|
89
90
|
adaptable.api.internalApi.getCellPopupService().hidePopup();
|
|
@@ -91,5 +92,5 @@ export const CommentsEditor = (props) => {
|
|
|
91
92
|
React.createElement(Box, { mr: 2 },
|
|
92
93
|
React.createElement(Icon, { name: "folder" })),
|
|
93
94
|
' ',
|
|
94
|
-
"Open all
|
|
95
|
+
"Open all Comments")));
|
|
95
96
|
};
|
|
@@ -15,6 +15,7 @@ const tableDOMProps = {
|
|
|
15
15
|
};
|
|
16
16
|
const CellComments = (props) => {
|
|
17
17
|
const adaptable = useAdaptable();
|
|
18
|
+
const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Comment') === 'ReadOnly';
|
|
18
19
|
const columnsMap = React.useMemo(() => {
|
|
19
20
|
const columns = {
|
|
20
21
|
author: {
|
|
@@ -65,7 +66,7 @@ const CellComments = (props) => {
|
|
|
65
66
|
PrimaryKeyValue: props.commentThread.PrimaryKeyValue,
|
|
66
67
|
}, true);
|
|
67
68
|
} }),
|
|
68
|
-
React.createElement(AdaptableButtonComponent, { icon: "delete", variant: "text", onClick: () => {
|
|
69
|
+
React.createElement(AdaptableButtonComponent, { icon: "delete", disabled: isReadOnlyModule, variant: "text", onClick: () => {
|
|
69
70
|
adaptable.api.commentApi.deleteCommentThread(props.commentThread);
|
|
70
71
|
} })) },
|
|
71
72
|
React.createElement(DataSource, { data: props.commentThread.Comments, primaryKey: "Uuid" },
|
|
@@ -64,5 +64,5 @@ export const PermittedValuesSelector = function (props) {
|
|
|
64
64
|
handleSingleValueChange(value);
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
|
-
return (React.createElement(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,
|
|
67
|
+
return (React.createElement(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 }));
|
|
68
68
|
};
|
|
@@ -16,6 +16,7 @@ export const NotePopup = (props) => {
|
|
|
16
16
|
const adaptable = useAdaptable();
|
|
17
17
|
const primaryKeyHeader = adaptable.api.columnApi.getFriendlyNameForColumnId(adaptable.api.columnApi.getPrimaryKeyColumn().columnId);
|
|
18
18
|
const allNotes = useSelector((state) => GetAllNotesSelector(state.Note));
|
|
19
|
+
const isReadOnlyModule = adaptable.api.entitlementApi.getEntitlementAccessLevelForModule('Note') === 'ReadOnly';
|
|
19
20
|
const columnsMap = React.useMemo(() => {
|
|
20
21
|
const columns = {
|
|
21
22
|
primaryKey: {
|
|
@@ -32,19 +33,20 @@ export const NotePopup = (props) => {
|
|
|
32
33
|
text: {
|
|
33
34
|
field: 'Text',
|
|
34
35
|
header: 'Text',
|
|
35
|
-
defaultEditable:
|
|
36
|
+
defaultEditable: !isReadOnlyModule,
|
|
36
37
|
defaultFlex: 3,
|
|
37
38
|
},
|
|
38
39
|
timestamp: {
|
|
39
40
|
field: 'Timestamp',
|
|
40
41
|
valueGetter: (params) => {
|
|
41
|
-
|
|
42
|
+
var _a;
|
|
43
|
+
return (_a = new Date(params.data.Timestamp)) === null || _a === void 0 ? void 0 : _a.toDateString();
|
|
42
44
|
},
|
|
43
45
|
},
|
|
44
46
|
delete: {
|
|
45
47
|
defaultWidth: 50,
|
|
46
48
|
render: (params) => {
|
|
47
|
-
return (React.createElement(AdaptableButtonComponent, { variant: "text", icon: "delete", onClick: () => {
|
|
49
|
+
return (React.createElement(AdaptableButtonComponent, { disabled: isReadOnlyModule, variant: "text", icon: "delete", onClick: () => {
|
|
48
50
|
const note = adaptable.api.noteApi.getNoteByUuid(params.data.Uuid);
|
|
49
51
|
adaptable.api.noteApi.deleteNote(note);
|
|
50
52
|
} }));
|
|
@@ -1439,26 +1439,6 @@ export class AdaptableAgGrid {
|
|
|
1439
1439
|
this.onSortChanged();
|
|
1440
1440
|
this.debouncedSetSelectedCells();
|
|
1441
1441
|
}));
|
|
1442
|
-
const showGroupingTotalsAsHeader = this.adaptableOptions.groupingOptions.showGroupingTotalsAsHeader;
|
|
1443
|
-
/**
|
|
1444
|
-
* Use Case: Model has updated
|
|
1445
|
-
* Action: If user has set to see grouping totals as header create a pinned row (bit of a hack)
|
|
1446
|
-
*/
|
|
1447
|
-
this.agGridAdapter.getAgGridApi().addEventListener(Events.EVENT_MODEL_UPDATED, (this.listenerModelUpdated = (params) => {
|
|
1448
|
-
if (showGroupingTotalsAsHeader) {
|
|
1449
|
-
if (params && params.api) {
|
|
1450
|
-
const pinnedData = params.api.getPinnedTopRow(0);
|
|
1451
|
-
const model = params.api.getModel();
|
|
1452
|
-
const rootNode = model.getRootNode();
|
|
1453
|
-
if (!pinnedData) {
|
|
1454
|
-
params.api.setPinnedTopRowData([rootNode.aggData]);
|
|
1455
|
-
}
|
|
1456
|
-
else {
|
|
1457
|
-
pinnedData.updateData(rootNode.aggData);
|
|
1458
|
-
}
|
|
1459
|
-
}
|
|
1460
|
-
}
|
|
1461
|
-
}));
|
|
1462
1442
|
const eventsThatTriggerChartingChanges = [
|
|
1463
1443
|
Events.EVENT_CHART_CREATED,
|
|
1464
1444
|
/** Chart Range selection has changed */
|
|
@@ -144,7 +144,6 @@ const DefaultAdaptableOptions = {
|
|
|
144
144
|
customSortOptions: { customSortComparers: undefined },
|
|
145
145
|
dataSetOptions: { dataSets: EMPTY_ARRAY },
|
|
146
146
|
groupingOptions: {
|
|
147
|
-
showGroupingTotalsAsHeader: false,
|
|
148
147
|
balancedGroupsKey: undefined,
|
|
149
148
|
restoreUngroupedColumns: false,
|
|
150
149
|
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;
|
|
@@ -80,7 +80,7 @@ export const Select = function (props) {
|
|
|
80
80
|
React.createElement(Icon, { name: "triangle-down", style: { height: 20, width: 20 } })));
|
|
81
81
|
};
|
|
82
82
|
}, []);
|
|
83
|
-
return (React.createElement(SelectComponent, { onInputChange: props.onInputChange, onFocus: props.onFocus, isLoading: props.
|
|
83
|
+
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',
|
|
84
84
|
// This needed so the menu is not clipped by overflow: hidden
|
|
85
85
|
menuPortalTarget: document.body, isClearable: props.isClearable, onChange: (option) => {
|
|
86
86
|
if (props.isMulti) {
|
package/src/env.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
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" || '',
|
|
3
|
-
PUBLISH_TIMESTAMP:
|
|
4
|
-
VERSION: "18.0.0-canary.
|
|
3
|
+
PUBLISH_TIMESTAMP: 1711969907121 || Date.now(),
|
|
4
|
+
VERSION: "18.0.0-canary.19" || '--current-version--',
|
|
5
5
|
};
|
|
@@ -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: {
|