@adaptabletools/adaptable 16.0.0-canary.7 → 16.0.0-canary.9
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 +24 -0
- package/base.css.map +1 -1
- package/bundle.cjs.js +204 -177
- package/index.css +32 -0
- package/index.css.map +1 -1
- package/package.json +1 -1
- package/publishTimestamp.d.ts +1 -1
- package/publishTimestamp.js +1 -1
- package/src/AdaptableInterfaces/IAdaptable.d.ts +3 -0
- package/src/AdaptableOptions/UserInterfaceOptions.d.ts +17 -0
- package/src/Api/AdaptableApi.d.ts +5 -0
- package/src/Api/CommentsApi.d.ts +50 -0
- package/src/Api/CommentsApi.js +2 -0
- package/src/Api/EntitlementApi.d.ts +1 -1
- package/src/Api/Fdc3Api.d.ts +1 -1
- package/src/Api/GridApi.d.ts +0 -7
- package/src/Api/Implementation/AdaptableApiImpl.d.ts +2 -0
- package/src/Api/Implementation/AdaptableApiImpl.js +2 -0
- package/src/Api/Implementation/CommentsApiImpl.d.ts +20 -0
- package/src/Api/Implementation/CommentsApiImpl.js +59 -0
- package/src/Api/Implementation/GridApiImpl.d.ts +0 -3
- package/src/Api/Implementation/GridApiImpl.js +0 -3
- package/src/PredefinedConfig/AdaptableState.d.ts +2 -2
- package/src/PredefinedConfig/CommentsState.d.ts +29 -0
- package/src/PredefinedConfig/CommentsState.js +2 -0
- package/src/PredefinedConfig/Common/AdaptableObject.d.ts +2 -2
- package/src/PredefinedConfig/Common/FDC3Context_DEPR.d.ts +3 -3
- package/src/PredefinedConfig/Common/Types.d.ts +2 -2
- package/src/PredefinedConfig/Common/Types.js +1 -0
- package/src/PredefinedConfig/PredefinedConfig.d.ts +2 -0
- package/src/PredefinedConfig/SystemState.d.ts +5 -0
- package/src/Redux/ActionsReducers/CommentsRedux.d.ts +31 -0
- package/src/Redux/ActionsReducers/CommentsRedux.js +83 -0
- package/src/Redux/ActionsReducers/SystemRedux.d.ts +13 -1
- package/src/Redux/ActionsReducers/SystemRedux.js +37 -2
- package/src/Redux/Store/AdaptableStore.js +20 -6
- package/src/Strategy/CommentsModule.d.ts +23 -0
- package/src/Strategy/CommentsModule.js +141 -0
- package/src/Strategy/FormatColumnModule.d.ts +0 -1
- package/src/Strategy/FormatColumnModule.js +4 -28
- package/src/Utilities/Constants/ModuleConstants.d.ts +3 -0
- package/src/Utilities/Constants/ModuleConstants.js +5 -2
- package/src/Utilities/Defaults/DefaultSettingsPanel.js +1 -0
- package/src/Utilities/Helpers/AdaptableHelper.d.ts +2 -2
- package/src/Utilities/Helpers/AdaptableHelper.js +4 -4
- package/src/View/AdaptableView.js +2 -0
- package/src/View/AdaptableViewFactory.js +2 -0
- package/src/View/Comments/CommentListing.d.ts +2 -0
- package/src/View/Comments/CommentListing.js +89 -0
- package/src/View/Comments/CommentPopup.d.ts +2 -0
- package/src/View/Comments/CommentPopup.js +65 -0
- package/src/View/Components/CellPopup/index.d.ts +12 -0
- package/src/View/Components/CellPopup/index.js +69 -0
- package/src/agGrid/Adaptable.d.ts +4 -1
- package/src/agGrid/Adaptable.js +57 -17
- package/src/agGrid/agGridHelper.js +2 -0
- package/src/components/OverlayTrigger/utils.d.ts +1 -1
- package/src/metamodel/adaptable.metamodel.d.ts +27 -0
- package/src/metamodel/adaptable.metamodel.js +1 -1
- package/src/types.d.ts +4 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
|
@@ -3,7 +3,6 @@ import { GridState } from './GridState';
|
|
|
3
3
|
import { SystemState } from './SystemState';
|
|
4
4
|
import { AlertState } from './AlertState';
|
|
5
5
|
import { CalculatedColumnState } from './CalculatedColumnState';
|
|
6
|
-
import { ConditionalStyleState } from './ConditionalStyleState';
|
|
7
6
|
import { CustomSortState } from './CustomSortState';
|
|
8
7
|
import { DashboardState } from './DashboardState';
|
|
9
8
|
import { ExportState } from './ExportState';
|
|
@@ -24,6 +23,7 @@ import { FlashingCellState } from './FlashingCellState';
|
|
|
24
23
|
import { StatusBarState } from './StatusBarState';
|
|
25
24
|
import { ChartingState } from './ChartingState';
|
|
26
25
|
import { StyledColumnState } from './StyledColumnState';
|
|
26
|
+
import { CommentsState } from './CommentsState';
|
|
27
27
|
/**
|
|
28
28
|
* The main state object of Adaptable
|
|
29
29
|
*/
|
|
@@ -38,7 +38,6 @@ export interface AdaptablePersistentState {
|
|
|
38
38
|
Alert: AlertState;
|
|
39
39
|
FlashingCell: FlashingCellState;
|
|
40
40
|
CalculatedColumn: CalculatedColumnState;
|
|
41
|
-
ConditionalStyle: ConditionalStyleState;
|
|
42
41
|
CustomSort: CustomSortState;
|
|
43
42
|
Dashboard: DashboardState;
|
|
44
43
|
Export: ExportState;
|
|
@@ -56,6 +55,7 @@ export interface AdaptablePersistentState {
|
|
|
56
55
|
Theme: ThemeState;
|
|
57
56
|
ToolPanel: ToolPanelState;
|
|
58
57
|
Charting: ChartingState;
|
|
58
|
+
Comments: CommentsState;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* The state which is available in the internal Redux store but never persisted
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AdaptableObject } from '../types';
|
|
2
|
+
import { ConfigState } from './ConfigState';
|
|
3
|
+
/**
|
|
4
|
+
* Comment that can be applied to a Cell in AdapTable
|
|
5
|
+
*/
|
|
6
|
+
export interface AdaptableComment extends AdaptableObject {
|
|
7
|
+
Timestamp: number;
|
|
8
|
+
Value: string;
|
|
9
|
+
Author: {
|
|
10
|
+
UserName: string;
|
|
11
|
+
};
|
|
12
|
+
PrimaryKeyValue: any;
|
|
13
|
+
ColumnId: string;
|
|
14
|
+
AdaptableId: string;
|
|
15
|
+
}
|
|
16
|
+
export declare type AdaptableComments = AdaptableComment[];
|
|
17
|
+
/**
|
|
18
|
+
* Predefined Configuration for Styled Column Module
|
|
19
|
+
*/
|
|
20
|
+
export interface CommentsState extends ConfigState {
|
|
21
|
+
/**
|
|
22
|
+
* Collection of Special Column Styles
|
|
23
|
+
*/
|
|
24
|
+
Comments?: AdaptableComments;
|
|
25
|
+
}
|
|
26
|
+
export declare type CommentPosition = {
|
|
27
|
+
PrimaryKeyValue: string | number;
|
|
28
|
+
ColumnId: string;
|
|
29
|
+
};
|
|
@@ -22,11 +22,11 @@ export interface AdaptableObject {
|
|
|
22
22
|
Tags?: AdaptableObjectTag[];
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
|
-
* AdaptableObjectTag Object Tag - currently supporting only plain string values, but open for future extensions, if
|
|
25
|
+
* AdaptableObjectTag Object Tag - currently supporting only plain string values, but open for future extensions, if needed
|
|
26
26
|
*/
|
|
27
27
|
export declare type AdaptableObjectTag = string;
|
|
28
28
|
/**
|
|
29
|
-
* Lookup criteria for finding specific
|
|
29
|
+
* Lookup criteria for finding specific Adaptable Objects; all given criteria will be composed with an AND operator
|
|
30
30
|
*/
|
|
31
31
|
export interface AdaptableObjectLookupCriteria {
|
|
32
32
|
/**
|
|
@@ -3,9 +3,9 @@ import { BaseEventInfo } from '../../Api/Events/BaseEventInfo';
|
|
|
3
3
|
import { FDC3Intent_Depr } from '../../types';
|
|
4
4
|
/**
|
|
5
5
|
* General-purpose context type, as defined by [FDC3](https://fdc3.finos.org/docs/1.0/context-intro).
|
|
6
|
-
* A context object is a well-understood datum that is streamable between FDC3 participants.
|
|
7
|
-
* it has a field describing what type it is, and data indicating its identity.
|
|
8
|
-
* to derive your own with any custom properties or metadata.
|
|
6
|
+
* A context object is a well-understood datum that is streamable between FDC3 participants.
|
|
7
|
+
* As a result it has a field describing what type it is, and data indicating its identity.
|
|
8
|
+
* Use this as a base to derive your own with any custom properties or metadata.
|
|
9
9
|
*/
|
|
10
10
|
/**
|
|
11
11
|
* General-purpose context type, as defined by FDC3
|
|
@@ -34,12 +34,12 @@ export declare type AdaptableStateKey = keyof AdaptablePersistentState | 'OpenFi
|
|
|
34
34
|
/**
|
|
35
35
|
* Modules provided by AdapTable, subject to Entitlements and usually have Predefined Config
|
|
36
36
|
*/
|
|
37
|
-
export declare type AdaptableModule = 'Alert' | 'BulkUpdate' | 'CalculatedColumn' | 'CellSummary' | 'Charting' | 'CustomSort' | 'Dashboard' | 'DataChangeHistory' | 'DataSet' | 'Export' | 'Fdc3' | 'Filter' | 'FlashingCell' | 'FormatColumn' | 'FreeTextColumn' | 'Glue42' | 'GridInfo' | 'IPushPull' | 'Layout' | 'OpenFin' | 'PlusMinus' | 'Query' | 'QuickSearch' | 'Schedule' | 'SettingsPanel' | 'Shortcut' | 'SmartEdit' | 'StyledColumn' | 'StateManagement' | 'StatusBar' | 'SystemStatus' | 'TeamSharing' | 'Theme' | 'ToolPanel';
|
|
37
|
+
export declare type AdaptableModule = 'Alert' | 'BulkUpdate' | 'CalculatedColumn' | 'CellSummary' | 'Charting' | 'CustomSort' | 'Dashboard' | 'DataChangeHistory' | 'DataSet' | 'Export' | 'Fdc3' | 'Filter' | 'FlashingCell' | 'FormatColumn' | 'FreeTextColumn' | 'Glue42' | 'GridInfo' | 'IPushPull' | 'Layout' | 'OpenFin' | 'PlusMinus' | 'Query' | 'QuickSearch' | 'Schedule' | 'SettingsPanel' | 'Shortcut' | 'SmartEdit' | 'StyledColumn' | 'StateManagement' | 'StatusBar' | 'SystemStatus' | 'TeamSharing' | 'Theme' | 'ToolPanel' | 'Comments';
|
|
38
38
|
export declare const ALL_MODULES: AdaptableModule[];
|
|
39
39
|
/**
|
|
40
40
|
* Modules which can appear in the Settings Panel
|
|
41
41
|
*/
|
|
42
|
-
export declare type AdaptableSettingsPanel = 'Alert' | 'CalculatedColumn' | 'Charting' | 'CustomSort' | 'Dashboard' | 'DataChangeHistory' | 'DataSet' | 'Export' | 'Filter' | 'FlashingCell' | 'FormatColumn' | 'FreeTextColumn' | 'GridInfo' | 'Layout' | 'PlusMinus' | 'Query' | 'QuickSearch' | 'Schedule' | 'Shortcut' | 'StateManagement' | 'StatusBar' | 'StyledColumn' | 'SystemStatus' | 'TeamSharing' | 'Theme' | 'ToolPanel';
|
|
42
|
+
export declare type AdaptableSettingsPanel = 'Alert' | 'CalculatedColumn' | 'Charting' | 'CustomSort' | 'Dashboard' | 'DataChangeHistory' | 'DataSet' | 'Export' | 'Filter' | 'FlashingCell' | 'FormatColumn' | 'FreeTextColumn' | 'GridInfo' | 'Layout' | 'PlusMinus' | 'Query' | 'QuickSearch' | 'Schedule' | 'Shortcut' | 'StateManagement' | 'StatusBar' | 'StyledColumn' | 'SystemStatus' | 'TeamSharing' | 'Theme' | 'ToolPanel' | 'Comments';
|
|
43
43
|
export declare type TypeHint<Base, Literals> = (Base & {
|
|
44
44
|
__subType?: true;
|
|
45
45
|
}) | Literals;
|
|
@@ -81,6 +81,7 @@ exports.ALL_MODULES = [
|
|
|
81
81
|
ModuleConstants.BulkUpdateModuleId,
|
|
82
82
|
ModuleConstants.CalculatedColumnModuleId,
|
|
83
83
|
ModuleConstants.CellSummaryModuleId,
|
|
84
|
+
ModuleConstants.CommentsModuleId,
|
|
84
85
|
ModuleConstants.ChartingModuleId,
|
|
85
86
|
ModuleConstants.CustomSortModuleId,
|
|
86
87
|
ModuleConstants.DashboardModuleId,
|
|
@@ -19,6 +19,7 @@ import { QueryState } from './QueryState';
|
|
|
19
19
|
import { StatusBarState } from './StatusBarState';
|
|
20
20
|
import { ChartingState } from './ChartingState';
|
|
21
21
|
import { StyledColumnState } from './StyledColumnState';
|
|
22
|
+
import { CommentsState } from './CommentsState';
|
|
22
23
|
/**
|
|
23
24
|
* This is the main Predefined Config interface which developers will populate at design-time
|
|
24
25
|
*/
|
|
@@ -47,6 +48,7 @@ export interface PredefinedConfig {
|
|
|
47
48
|
* Supplies a collection of *Custom Sort* objects to allow some columns to be sorted in non-standard (e.g. non alphabetical) ways
|
|
48
49
|
*/
|
|
49
50
|
CustomSort?: CustomSortState;
|
|
51
|
+
Comments?: CommentsState;
|
|
50
52
|
/**
|
|
51
53
|
* Large series of properties to give users full control over the look and feel of the *Dashboard* - the section above the grid with toolbars and buttons
|
|
52
54
|
*/
|
|
@@ -14,6 +14,7 @@ import { AdaptableFlashingCell } from './Common/AdaptableFlashingCell';
|
|
|
14
14
|
import { TypeUuid } from './Uuid';
|
|
15
15
|
import { SummaryOperation } from './Common/Enums';
|
|
16
16
|
import { ChartModel } from '@ag-grid-community/core';
|
|
17
|
+
import { CommentPosition } from './CommentsState';
|
|
17
18
|
export type { IPushPullReport, IPushPullDomain };
|
|
18
19
|
export type { Glue42Report };
|
|
19
20
|
export type { OpenFinReport };
|
|
@@ -97,6 +98,10 @@ export interface SystemState extends InternalState, IPushPullState, Glue42State,
|
|
|
97
98
|
QuickSearch?: {
|
|
98
99
|
floatingVisible?: boolean;
|
|
99
100
|
};
|
|
101
|
+
Comments?: {
|
|
102
|
+
editMode?: boolean;
|
|
103
|
+
popupPosition?: CommentPosition | null;
|
|
104
|
+
};
|
|
100
105
|
}
|
|
101
106
|
export interface ProgressIndicator {
|
|
102
107
|
active: boolean;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AdaptableComment, CommentsState } from '../../PredefinedConfig/CommentsState';
|
|
2
|
+
import * as Redux from 'redux';
|
|
3
|
+
/**
|
|
4
|
+
* @ReduxAction A Comment has been added
|
|
5
|
+
*/
|
|
6
|
+
export declare const COMMENTS_ADD = "COMMENTS_ADD";
|
|
7
|
+
/**
|
|
8
|
+
* @ReduxAction A Comment has been edited
|
|
9
|
+
*/
|
|
10
|
+
export declare const COMMENTS_EDIT = "COMMENTS_EDIT";
|
|
11
|
+
/**
|
|
12
|
+
* @ReduxAction A Comment has been deleted
|
|
13
|
+
*/
|
|
14
|
+
export declare const COMMENTS_DELETE = "COMMENTS_DELETE";
|
|
15
|
+
export interface AdaptableCommentAction extends Redux.Action {
|
|
16
|
+
adaptableComment: AdaptableComment;
|
|
17
|
+
}
|
|
18
|
+
export interface AdaptableCommentAddAction extends AdaptableCommentAction {
|
|
19
|
+
}
|
|
20
|
+
export interface AdaptableCommentEditAction extends AdaptableCommentAction {
|
|
21
|
+
}
|
|
22
|
+
export interface AdaptableCommentDeleteAction extends AdaptableCommentAction {
|
|
23
|
+
}
|
|
24
|
+
export declare const CommentsAdd: (adaptableComment: AdaptableComment) => AdaptableCommentAddAction;
|
|
25
|
+
export declare const CommentsEdit: (adaptableComment: AdaptableComment) => AdaptableCommentEditAction;
|
|
26
|
+
export declare const CommentsDelete: (adaptableComment: AdaptableComment) => AdaptableCommentDeleteAction;
|
|
27
|
+
export declare const GetCommentsSelector: (state: CommentsState, config?: {
|
|
28
|
+
PrimaryKeyValue: string | number;
|
|
29
|
+
ColumnId: string;
|
|
30
|
+
}) => import("../../PredefinedConfig/CommentsState").AdaptableComments;
|
|
31
|
+
export declare const CommentsReducer: Redux.Reducer<CommentsState>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommentsReducer = exports.GetCommentsSelector = exports.CommentsDelete = exports.CommentsEdit = exports.CommentsAdd = exports.COMMENTS_DELETE = exports.COMMENTS_EDIT = exports.COMMENTS_ADD = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const AdaptableHelper_1 = tslib_1.__importDefault(require("../../Utilities/Helpers/AdaptableHelper"));
|
|
6
|
+
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
7
|
+
/**
|
|
8
|
+
* @ReduxAction A Comment has been added
|
|
9
|
+
*/
|
|
10
|
+
exports.COMMENTS_ADD = 'COMMENTS_ADD';
|
|
11
|
+
/**
|
|
12
|
+
* @ReduxAction A Comment has been edited
|
|
13
|
+
*/
|
|
14
|
+
exports.COMMENTS_EDIT = 'COMMENTS_EDIT';
|
|
15
|
+
/**
|
|
16
|
+
* @ReduxAction A Comment has been deleted
|
|
17
|
+
*/
|
|
18
|
+
exports.COMMENTS_DELETE = 'COMMENTS_DELETE';
|
|
19
|
+
const CommentsAdd = (adaptableComment) => ({
|
|
20
|
+
type: exports.COMMENTS_ADD,
|
|
21
|
+
adaptableComment,
|
|
22
|
+
});
|
|
23
|
+
exports.CommentsAdd = CommentsAdd;
|
|
24
|
+
const CommentsEdit = (adaptableComment) => ({
|
|
25
|
+
type: exports.COMMENTS_EDIT,
|
|
26
|
+
adaptableComment,
|
|
27
|
+
});
|
|
28
|
+
exports.CommentsEdit = CommentsEdit;
|
|
29
|
+
const CommentsDelete = (adaptableComment) => ({
|
|
30
|
+
type: exports.COMMENTS_DELETE,
|
|
31
|
+
adaptableComment,
|
|
32
|
+
});
|
|
33
|
+
exports.CommentsDelete = CommentsDelete;
|
|
34
|
+
const GetCommentsSelector = (state, config) => {
|
|
35
|
+
var _a, _b;
|
|
36
|
+
if (!config) {
|
|
37
|
+
return (_a = state === null || state === void 0 ? void 0 : state.Comments) !== null && _a !== void 0 ? _a : [];
|
|
38
|
+
}
|
|
39
|
+
return ((_b = state === null || state === void 0 ? void 0 : state.Comments) !== null && _b !== void 0 ? _b : []).filter((comment) => {
|
|
40
|
+
if (comment.PrimaryKeyValue === config.PrimaryKeyValue &&
|
|
41
|
+
comment.ColumnId === config.ColumnId) {
|
|
42
|
+
// happy check
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
// Primary keys retreived from the grid dom are always strings, so we must also consider them strings
|
|
46
|
+
if ((typeof config.PrimaryKeyValue === 'number' && typeof comment.PrimaryKeyValue === 'string') ||
|
|
47
|
+
(typeof config.PrimaryKeyValue === 'string' && typeof comment.PrimaryKeyValue === 'number')) {
|
|
48
|
+
return (comment.PrimaryKeyValue.toString() === config.PrimaryKeyValue.toString() &&
|
|
49
|
+
comment.ColumnId === config.ColumnId);
|
|
50
|
+
}
|
|
51
|
+
return false;
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
exports.GetCommentsSelector = GetCommentsSelector;
|
|
55
|
+
const initialState = {
|
|
56
|
+
Comments: GeneralConstants_1.EMPTY_ARRAY,
|
|
57
|
+
};
|
|
58
|
+
const CommentsReducer = (state = initialState, action) => {
|
|
59
|
+
let adaptableComments;
|
|
60
|
+
switch (action.type) {
|
|
61
|
+
case exports.COMMENTS_ADD: {
|
|
62
|
+
const actionAdaptableComment = action
|
|
63
|
+
.adaptableComment;
|
|
64
|
+
AdaptableHelper_1.default.addUuidAndSource(actionAdaptableComment);
|
|
65
|
+
adaptableComments = [].concat(state.Comments);
|
|
66
|
+
adaptableComments.push(actionAdaptableComment);
|
|
67
|
+
return Object.assign(Object.assign({}, state), { Comments: adaptableComments });
|
|
68
|
+
}
|
|
69
|
+
case exports.COMMENTS_EDIT: {
|
|
70
|
+
const actionAdaptableComment = action
|
|
71
|
+
.adaptableComment;
|
|
72
|
+
return Object.assign(Object.assign({}, state), { Comments: state.Comments.map((abObject) => abObject.Uuid === actionAdaptableComment.Uuid ? actionAdaptableComment : abObject) });
|
|
73
|
+
}
|
|
74
|
+
case exports.COMMENTS_DELETE: {
|
|
75
|
+
const actionAdaptableComment = action
|
|
76
|
+
.adaptableComment;
|
|
77
|
+
return Object.assign(Object.assign({}, state), { Comments: state.Comments.filter((abObject) => abObject.Uuid !== actionAdaptableComment.Uuid) });
|
|
78
|
+
}
|
|
79
|
+
default:
|
|
80
|
+
return state;
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
exports.CommentsReducer = CommentsReducer;
|
|
@@ -14,7 +14,7 @@ import { SummaryOperation } from '../../PredefinedConfig/Common/Enums';
|
|
|
14
14
|
import { CellDataChangedInfo } from '../../PredefinedConfig/Common/CellDataChangedInfo';
|
|
15
15
|
import { RowsHighlightInfo } from '../../PredefinedConfig/Common/RowsHighlightInfo';
|
|
16
16
|
import { SmartEditOperation } from '../../AdaptableOptions/EditOptions';
|
|
17
|
-
import { DataSet } from '../../types';
|
|
17
|
+
import { CommentPosition, DataSet } from '../../types';
|
|
18
18
|
import { ChartModel } from '@ag-grid-community/core';
|
|
19
19
|
export declare const FLASHING_CELL_ROW_KEY = "__ROW";
|
|
20
20
|
export declare const SYSTEM_ALERT_ADD = "SYSTEM_ALERT_ADD";
|
|
@@ -74,6 +74,8 @@ export declare const SYSTEM_SET_PREVIOUS_GROUPED_COLUMN_INDEX = "SYSTEM_SET_PREV
|
|
|
74
74
|
export declare const SYSTEM_SET_QUICK_SEARCH_FLOATING_VISIBILITY = "SYSTEM_SET_QUICK_SEARCH_FLOATING_VISIBILITY";
|
|
75
75
|
export declare const SYSTEM_VISUAL_EXPORT_BEGIN = "SYSTEM_VISUAL_EXPORT_BEGIN";
|
|
76
76
|
export declare const SYSTEM_VISUAL_EXPORT_END = "SYSTEM_VISUAL_EXPORT_END";
|
|
77
|
+
export declare const SYSTEM_COMMENTS_SHOW = "SYSTEM_COMMENTS_SHOW";
|
|
78
|
+
export declare const SYSTEM_COMMENTS_HIDE = "SYSTEM_COMMENTS_HIDE";
|
|
77
79
|
export interface SystemHighlightCellAddAction extends Redux.Action {
|
|
78
80
|
cellHighlightInfo: CellHighlightInfo;
|
|
79
81
|
}
|
|
@@ -253,6 +255,12 @@ export interface SystemVisualExportEndAction extends Redux.Action {
|
|
|
253
255
|
export interface SystemQuickSearchFloatingVisibilityAction extends Redux.Action {
|
|
254
256
|
visible: boolean;
|
|
255
257
|
}
|
|
258
|
+
export interface SystemCommentsShowAction extends Redux.Action {
|
|
259
|
+
cellPosition: CommentPosition;
|
|
260
|
+
editMode?: boolean;
|
|
261
|
+
}
|
|
262
|
+
export interface SystemCommentsHideAction extends Redux.Action {
|
|
263
|
+
}
|
|
256
264
|
export declare const SystemHighlightCellAdd: (cellHighlightInfo: CellHighlightInfo) => SystemHighlightCellAddAction;
|
|
257
265
|
export declare const SystemHighlightCellDelete: (primaryKeyValue: CellHighlightInfo['primaryKeyValue'], columnId: CellHighlightInfo['columnId']) => SystemHighlightCellDeleteAction;
|
|
258
266
|
export declare const SystemHighlightCellDeleteAll: () => SystemHighlightCellDeleteAllAction;
|
|
@@ -310,7 +318,11 @@ export declare const SystemDisableDeleteConfirmation: () => SystemDisableDeleteC
|
|
|
310
318
|
export declare const SystemVisualExportBegin: () => SystemVisualExportBeginAction;
|
|
311
319
|
export declare const SystemVisualExportEnd: () => SystemVisualExportEndAction;
|
|
312
320
|
export declare const SystemQuickSearchFloatingVisibility: (visible: boolean) => SystemQuickSearchFloatingVisibilityAction;
|
|
321
|
+
export declare const SystemCommentsShow: (cellPosition: CommentPosition, editMode?: boolean) => SystemCommentsShowAction;
|
|
322
|
+
export declare const SystemCommentsHide: () => SystemCommentsHideAction;
|
|
313
323
|
export declare const SystemDisableDeleteConfirmationSelector: (state: SystemState) => boolean;
|
|
314
324
|
export declare const SystemPreviousGroupedColumnsSelector: (state: SystemState) => Record<string, Record<string, number>>;
|
|
315
325
|
export declare const SystemQuickSearchFloatingVisibilitySelector: (state: SystemState) => boolean;
|
|
326
|
+
export declare const SystemCommentsSelector: (state: SystemState) => CommentPosition;
|
|
327
|
+
export declare const SystemCommentsEditModeSelector: (state: SystemState) => boolean;
|
|
316
328
|
export declare const SystemReducer: Redux.Reducer<SystemState>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SYSTEM_DISABLE_DELETE_CONFIRMATION = exports.SYSTEM_FILTER_FORM_HIDE = exports.SYSTEM_QUICK_FILTER_BAR_HIDE = exports.SYSTEM_QUICK_FILTER_BAR_SHOW = exports.SYSTEM_SETTINGS_PANEL_SET = exports.SYSTEM_DATA_CHANGE_HISTORY_RESUME = exports.SYSTEM_DATA_CHANGE_HISTORY_SUSPEND = exports.SYSTEM_DATA_CHANGE_HISTORY_DISABLE = exports.SYSTEM_DATA_CHANGE_HISTORY_ENABLE = exports.SYSTEM_DATA_CHANGE_HISTORY_CLEAR_ROW = exports.SYSTEM_DATA_CHANGE_HISTORY_UNDO = exports.SYSTEM_DATA_CHANGE_HISTORY_ADD = exports.SYSTEM_LICENSE_DISABLE_PERSISTENCE = exports.SYSTEM_LICENSE_SHOW_WATERMARK = exports.SYSTEM_PROGRESS_INDICATOR_HIDE = exports.SYSTEM_PROGRESS_INDICATOR_SHOW = exports.SYSTEM_CELL_SUMMARY_CHANGE_OPERATION = exports.SYSTEM_CACHED_QUERY_ADD = exports.SYSTEM_SET_LAST_APPLIED_SHORTCUT = exports.SYSTEM_SET_NEW_COLUMN_LIST_ORDER = exports.SYSTEM_HIGHLIGHT_ROW_DELETE_ALL = exports.SYSTEM_HIGHLIGHT_ROWS_DELETE = exports.SYSTEM_HIGHLIGHT_ROW_DELETE = exports.SYSTEM_HIGHLIGHT_ROWS_ADD = exports.SYSTEM_HIGHLIGHT_ROW_ADD = exports.SYSTEM_HIGHLIGHT_CELL_DELETE_ALL = exports.SYSTEM_HIGHLIGHT_CELL_DELETE = exports.SYSTEM_HIGHLIGHT_CELL_ADD = exports.SYSTEM_BULK_UPDATE_CHANGE_VALUE = exports.SYSTEM_BULK_UPDATE_SET_PREVIEW = exports.SYSTEM_BULK_UPDATE_SET_VALID_SELECTION = exports.SYSTEM_BULK_UPDATE_CHECK_CELL_SELECTION = exports.SYSTEM_SMART_EDIT_CHANGE_OPERATION = exports.SYSTEM_SMART_EDIT_CHANGE_VALUE = exports.SYSTEM_SMARTEDIT_SET_PREVIEW = exports.SYSTEM_SMARTEDIT_SET_VALID_SELECTION = exports.SYSTEM_SMARTEDIT_FETCH_PREVIEW = exports.SYSTEM_SMARTEDIT_CHECK_CELL_SELECTION = exports.SYSTEM_STATUS_MESSAGE_INFO_DELETE_ALL = exports.SYSTEM_STATUS_MESSAGE_INFO_DELETE = exports.SYSTEM_STATUS_MESSAGE_INFO_ADD = exports.SYSTEM_FLASHING_CELL_DELETE_ALL = exports.SYSTEM_FLASHING_CELL_DELETE = exports.SYSTEM_FLASHING_CELL_ADD = exports.SYSTEM_ALERT_REMOVE_ROW_HIGHLIGHT = exports.SYSTEM_ALERT_REMOVE_CELL_HIGHLIGHT = exports.SYSTEM_ALERT_DELETE_ALL = exports.SYSTEM_ALERT_DELETE = exports.SYSTEM_ALERT_ADD = exports.FLASHING_CELL_ROW_KEY = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.SystemReducer = exports.SystemQuickSearchFloatingVisibilitySelector = exports.SystemPreviousGroupedColumnsSelector = exports.SystemDisableDeleteConfirmationSelector = exports.SystemQuickSearchFloatingVisibility = exports.SystemVisualExportEnd = exports.SystemVisualExportBegin = exports.SystemDisableDeleteConfirmation = exports.SystemSetPreviousGroupedColumnsIndex = exports.SystemChartingCurrentChartModelsSelector = exports.SystemChartingSetCurrentChartModels = exports.SystemDataSetSelect = exports.SystemDashboardRefresh = exports.SystemLayoutShowNotAssociatedObjects = exports.SystemFilterFormHide = exports.SystemQuickFilterBarHide = exports.SystemQuickFilterBarShow = exports.SystemSettingsPanelSet = exports.SystemDataChangeHistoryResume = void 0;
|
|
4
|
+
exports.SystemDataChangeHistoryEnable = exports.SystemDataChangeHistoryClearRow = exports.SystemDataChangeHistoryUndo = exports.SystemDataChangeHistoryAdd = exports.SystemLicenseDisablePersistence = exports.SystemLicenseShowWatermark = exports.SystemProgressIndicatorHide = exports.SystemProgressIndicatorShow = exports.SystemCellSummaryChangeOperation = exports.SystemCachedQueryAdd = exports.SetLastAppliedShortcut = exports.SetNewColumnListOrder = exports.BulkUpdateChangeValue = exports.BulkUpdateSetPreview = exports.BulkUpdateSetValidSelection = exports.BulkUpdateCheckCellSelection = exports.SmartEditSetPreview = exports.SmartEditSetValidSelection = exports.SmartEditCheckCellSelection = exports.SmartEditChangeOperation = exports.SmartEditChangeValue = exports.SystemStatusMessageInfoDeleteAll = exports.SystemStatusMessageInfoDelete = exports.SystemStatusMessageInfoAdd = exports.SystemFlashingCellDeleteAll = exports.SystemFlashingCellDelete = exports.SystemFlashingCellAdd = exports.SystemAlertRemoveRowHighlight = exports.SystemAlertRemoveCellHighlight = exports.SystemAlertDeleteAll = exports.SystemAlertDelete = exports.SystemAlertAdd = exports.SystemHighlightRowDeleteAll = exports.SystemHighlightRowsDelete = exports.SystemHighlightRowDelete = exports.SystemHighlightRowsAdd = exports.SystemHighlightRowAdd = exports.SystemHighlightCellDeleteAll = exports.SystemHighlightCellDelete = exports.SystemHighlightCellAdd = exports.SYSTEM_COMMENTS_HIDE = exports.SYSTEM_COMMENTS_SHOW = exports.SYSTEM_VISUAL_EXPORT_END = exports.SYSTEM_VISUAL_EXPORT_BEGIN = exports.SYSTEM_SET_QUICK_SEARCH_FLOATING_VISIBILITY = exports.SYSTEM_SET_PREVIOUS_GROUPED_COLUMN_INDEX = exports.SYSTEM_CHARTING_SET_CURRENT_CHART_MODELS = exports.SYSTEM_DATA_SET_SELECT = exports.DASHBOARD_REFRESH = exports.SYSTEM_LAYOUT_SHOW_NOT_ASSOCIATED_OBJECTS = void 0;
|
|
5
|
+
exports.SystemReducer = exports.SystemCommentsEditModeSelector = exports.SystemCommentsSelector = exports.SystemQuickSearchFloatingVisibilitySelector = exports.SystemPreviousGroupedColumnsSelector = exports.SystemDisableDeleteConfirmationSelector = exports.SystemCommentsHide = exports.SystemCommentsShow = exports.SystemQuickSearchFloatingVisibility = exports.SystemVisualExportEnd = exports.SystemVisualExportBegin = exports.SystemDisableDeleteConfirmation = exports.SystemSetPreviousGroupedColumnsIndex = exports.SystemChartingCurrentChartModelsSelector = exports.SystemChartingSetCurrentChartModels = exports.SystemDataSetSelect = exports.SystemDashboardRefresh = exports.SystemLayoutShowNotAssociatedObjects = exports.SystemFilterFormHide = exports.SystemQuickFilterBarHide = exports.SystemQuickFilterBarShow = exports.SystemSettingsPanelSet = exports.SystemDataChangeHistoryResume = exports.SystemDataChangeHistorySuspend = exports.SystemDataChangeHistoryDisable = void 0;
|
|
6
6
|
const GeneralConstants_1 = require("../../Utilities/Constants/GeneralConstants");
|
|
7
7
|
const Enums_1 = require("../../PredefinedConfig/Common/Enums");
|
|
8
8
|
const Helper_1 = require("../../Utilities/Helpers/Helper");
|
|
@@ -91,6 +91,9 @@ exports.SYSTEM_SET_QUICK_SEARCH_FLOATING_VISIBILITY = 'SYSTEM_SET_QUICK_SEARCH_F
|
|
|
91
91
|
// Data Export (Report)
|
|
92
92
|
exports.SYSTEM_VISUAL_EXPORT_BEGIN = 'SYSTEM_VISUAL_EXPORT_BEGIN';
|
|
93
93
|
exports.SYSTEM_VISUAL_EXPORT_END = 'SYSTEM_VISUAL_EXPORT_END';
|
|
94
|
+
// Comments
|
|
95
|
+
exports.SYSTEM_COMMENTS_SHOW = 'SYSTEM_COMMENTS_SHOW';
|
|
96
|
+
exports.SYSTEM_COMMENTS_HIDE = 'SYSTEM_COMMENTS_HIDE';
|
|
94
97
|
const SystemHighlightCellAdd = (cellHighlightInfo) => ({
|
|
95
98
|
type: exports.SYSTEM_HIGHLIGHT_CELL_ADD,
|
|
96
99
|
cellHighlightInfo: cellHighlightInfo,
|
|
@@ -362,6 +365,16 @@ const SystemQuickSearchFloatingVisibility = (visible) => ({
|
|
|
362
365
|
visible,
|
|
363
366
|
});
|
|
364
367
|
exports.SystemQuickSearchFloatingVisibility = SystemQuickSearchFloatingVisibility;
|
|
368
|
+
const SystemCommentsShow = (cellPosition, editMode) => ({
|
|
369
|
+
type: exports.SYSTEM_COMMENTS_SHOW,
|
|
370
|
+
editMode,
|
|
371
|
+
cellPosition,
|
|
372
|
+
});
|
|
373
|
+
exports.SystemCommentsShow = SystemCommentsShow;
|
|
374
|
+
const SystemCommentsHide = () => ({
|
|
375
|
+
type: exports.SYSTEM_COMMENTS_HIDE,
|
|
376
|
+
});
|
|
377
|
+
exports.SystemCommentsHide = SystemCommentsHide;
|
|
365
378
|
const SystemDisableDeleteConfirmationSelector = (state) => {
|
|
366
379
|
return state.DisableDeleteConfirmation;
|
|
367
380
|
};
|
|
@@ -375,6 +388,16 @@ const SystemQuickSearchFloatingVisibilitySelector = (state) => {
|
|
|
375
388
|
return (_a = state === null || state === void 0 ? void 0 : state.QuickSearch) === null || _a === void 0 ? void 0 : _a.floatingVisible;
|
|
376
389
|
};
|
|
377
390
|
exports.SystemQuickSearchFloatingVisibilitySelector = SystemQuickSearchFloatingVisibilitySelector;
|
|
391
|
+
const SystemCommentsSelector = (state) => {
|
|
392
|
+
var _a;
|
|
393
|
+
return (_a = state === null || state === void 0 ? void 0 : state.Comments) === null || _a === void 0 ? void 0 : _a.popupPosition;
|
|
394
|
+
};
|
|
395
|
+
exports.SystemCommentsSelector = SystemCommentsSelector;
|
|
396
|
+
const SystemCommentsEditModeSelector = (state) => {
|
|
397
|
+
var _a;
|
|
398
|
+
return (_a = state === null || state === void 0 ? void 0 : state.Comments) === null || _a === void 0 ? void 0 : _a.editMode;
|
|
399
|
+
};
|
|
400
|
+
exports.SystemCommentsEditModeSelector = SystemCommentsEditModeSelector;
|
|
378
401
|
const initialState = {
|
|
379
402
|
AdaptableAlerts: GeneralConstants_1.EMPTY_ARRAY,
|
|
380
403
|
AdaptableFlashingCells: {},
|
|
@@ -762,6 +785,18 @@ const SystemReducer = (state = initialState, action) => {
|
|
|
762
785
|
const typedAction = action;
|
|
763
786
|
return Object.assign(Object.assign({}, state), { QuickSearch: Object.assign(Object.assign({}, state.QuickSearch), { floatingVisible: typedAction.visible }) });
|
|
764
787
|
}
|
|
788
|
+
case exports.SYSTEM_COMMENTS_SHOW: {
|
|
789
|
+
const typedAction = action;
|
|
790
|
+
return Object.assign(Object.assign({}, state), { Comments: {
|
|
791
|
+
editMode: typedAction.editMode,
|
|
792
|
+
popupPosition: typedAction.cellPosition
|
|
793
|
+
} });
|
|
794
|
+
}
|
|
795
|
+
case exports.SYSTEM_COMMENTS_HIDE: {
|
|
796
|
+
return Object.assign(Object.assign({}, state), { Comments: {
|
|
797
|
+
popupPosition: null,
|
|
798
|
+
} });
|
|
799
|
+
}
|
|
765
800
|
default:
|
|
766
801
|
return state;
|
|
767
802
|
}
|
|
@@ -11,7 +11,6 @@ const PopupRedux_1 = require("../ActionsReducers/PopupRedux");
|
|
|
11
11
|
const PluginsRedux = tslib_1.__importStar(require("../ActionsReducers/PluginsRedux"));
|
|
12
12
|
const AlertRedux = tslib_1.__importStar(require("../ActionsReducers/AlertRedux"));
|
|
13
13
|
const FlashingCellRedux = tslib_1.__importStar(require("../ActionsReducers/FlashingCellRedux"));
|
|
14
|
-
const DeadRedux = tslib_1.__importStar(require("../DeadRedux"));
|
|
15
14
|
const SmartEditRedux = tslib_1.__importStar(require("../ActionsReducers/SmartEditRedux"));
|
|
16
15
|
const BulkUpdateRedux = tslib_1.__importStar(require("../ActionsReducers/BulkUpdateRedux"));
|
|
17
16
|
const CustomSortRedux = tslib_1.__importStar(require("../ActionsReducers/CustomSortRedux"));
|
|
@@ -26,6 +25,7 @@ const QuickSearchRedux = tslib_1.__importStar(require("../ActionsReducers/QuickS
|
|
|
26
25
|
const ThemeRedux = tslib_1.__importStar(require("../ActionsReducers/ThemeRedux"));
|
|
27
26
|
const FormatColumnRedux = tslib_1.__importStar(require("../ActionsReducers/FormatColumnRedux"));
|
|
28
27
|
const StyledColumnRedux = tslib_1.__importStar(require("../ActionsReducers/StyledColumnRedux"));
|
|
28
|
+
const CommentsRedux = tslib_1.__importStar(require("../ActionsReducers/CommentsRedux"));
|
|
29
29
|
const ApplicationRedux = tslib_1.__importStar(require("../ActionsReducers/ApplicationRedux"));
|
|
30
30
|
const FreeTextColumnRedux = tslib_1.__importStar(require("../ActionsReducers/FreeTextColumnRedux"));
|
|
31
31
|
const LayoutRedux = tslib_1.__importStar(require("../ActionsReducers/LayoutRedux"));
|
|
@@ -148,11 +148,7 @@ class AdaptableStore {
|
|
|
148
148
|
Query: QueryRedux.QueryReducer,
|
|
149
149
|
Charting: ChartingRedux.ChartingReducer,
|
|
150
150
|
StyledColumn: StyledColumnRedux.StyledColumnReducer,
|
|
151
|
-
|
|
152
|
-
PercentBar: DeadRedux.PercentBarReducer,
|
|
153
|
-
UpdatedRow: DeadRedux.UpdatedRowReducer,
|
|
154
|
-
GradientColumn: DeadRedux.GradientColumnReducer,
|
|
155
|
-
ConditionalStyle: DeadRedux.ConditionalStyleReducer,
|
|
151
|
+
Comments: CommentsRedux.CommentsReducer,
|
|
156
152
|
};
|
|
157
153
|
// allow plugins to participate in the root reducer
|
|
158
154
|
adaptable.forPlugins((plugin) => {
|
|
@@ -841,6 +837,24 @@ const adaptableMiddleware = (adaptable) => function (middlewareAPI) {
|
|
|
841
837
|
adaptable.api.themeApi.applyCurrentTheme();
|
|
842
838
|
return returnAction;
|
|
843
839
|
}
|
|
840
|
+
/*******************
|
|
841
|
+
* Comments ACTIONS
|
|
842
|
+
*******************/
|
|
843
|
+
/**
|
|
844
|
+
* Use Case: Comment has been edited/deleted/added
|
|
845
|
+
* Action: Triangle can be removed/added
|
|
846
|
+
*/
|
|
847
|
+
case CommentsRedux.COMMENTS_ADD:
|
|
848
|
+
case CommentsRedux.COMMENTS_EDIT:
|
|
849
|
+
case CommentsRedux.COMMENTS_DELETE: {
|
|
850
|
+
let returnAction = next(action);
|
|
851
|
+
const node = adaptable.api.gridApi.getRowNodeForPrimaryKey(returnAction.adaptableComment.PrimaryKeyValue);
|
|
852
|
+
adaptable.refreshCells([node], [returnAction.adaptableComment.ColumnId], true);
|
|
853
|
+
if (action.type == CommentsRedux.COMMENTS_DELETE) {
|
|
854
|
+
adaptable.api.commentsApi.hideComment();
|
|
855
|
+
}
|
|
856
|
+
return returnAction;
|
|
857
|
+
}
|
|
844
858
|
/*******************
|
|
845
859
|
* SCHEDULE ACTIONS
|
|
846
860
|
*******************/
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { AdaptableApi } from '../Api/AdaptableApi';
|
|
2
|
+
import { AdaptableMenuItem, ContextMenuContext } from '../PredefinedConfig/Common/Menu';
|
|
3
|
+
import { CommentPosition } from '../types';
|
|
4
|
+
import { AdaptableModuleBase } from './AdaptableModuleBase';
|
|
5
|
+
import { IModule } from './Interface/IModule';
|
|
6
|
+
/**
|
|
7
|
+
* In the first iteration a cell can have only one comment, the
|
|
8
|
+
* comments is a list to allow further development.
|
|
9
|
+
*/
|
|
10
|
+
export declare class CommentsModule extends AdaptableModuleBase implements IModule {
|
|
11
|
+
private adaptable;
|
|
12
|
+
constructor(api: AdaptableApi);
|
|
13
|
+
isModuleAvailable(): boolean;
|
|
14
|
+
handleAdaptableReady(): void;
|
|
15
|
+
addContextMenuItems(menuContext: ContextMenuContext): AdaptableMenuItem[] | undefined;
|
|
16
|
+
private getAddRemoveCommentMenuItems;
|
|
17
|
+
getCellPositionFromEvent(event: MouseEvent): null | {
|
|
18
|
+
PrimaryKeyValue: string | number;
|
|
19
|
+
ColumnId: string;
|
|
20
|
+
};
|
|
21
|
+
handleMouseEnter(event: MouseEvent): void;
|
|
22
|
+
handleCellSelected(cellPosition: CommentPosition): void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CommentsModule = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const ModuleConstants = tslib_1.__importStar(require("../Utilities/Constants/ModuleConstants"));
|
|
6
|
+
const AdaptableModuleBase_1 = require("./AdaptableModuleBase");
|
|
7
|
+
/**
|
|
8
|
+
* In the first iteration a cell can have only one comment, the
|
|
9
|
+
* comments is a list to allow further development.
|
|
10
|
+
*/
|
|
11
|
+
class CommentsModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
12
|
+
constructor(api) {
|
|
13
|
+
super(ModuleConstants.CommentsModuleId, ModuleConstants.CommentsFriendlyName, 'comment', 'CommentsPopup', 'Comments', api);
|
|
14
|
+
this.adaptable = api.internalApi.getAdaptableInstance();
|
|
15
|
+
this.adaptable.api.eventApi.on('AdaptableReady', () => this.handleAdaptableReady());
|
|
16
|
+
}
|
|
17
|
+
isModuleAvailable() {
|
|
18
|
+
// FIXME remove this once Comments feature is public
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
handleAdaptableReady() {
|
|
22
|
+
if (!this.isModuleAvailable()) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
this.adaptable._on('MouseEnter', (event) => this.handleMouseEnter(event));
|
|
26
|
+
this.api.eventApi.on('SelectionChanged', (params) => {
|
|
27
|
+
const cells = params.selectedCellInfo.gridCells;
|
|
28
|
+
if ((cells === null || cells === void 0 ? void 0 : cells.length) === 1) {
|
|
29
|
+
const selectedCell = cells[0];
|
|
30
|
+
const cellSelected = {
|
|
31
|
+
PrimaryKeyValue: selectedCell.primaryKeyValue,
|
|
32
|
+
ColumnId: selectedCell.column.columnId,
|
|
33
|
+
};
|
|
34
|
+
this.handleCellSelected(cellSelected);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
addContextMenuItems(menuContext) {
|
|
39
|
+
var _a, _b;
|
|
40
|
+
if (!this.isModuleAvailable()) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
const items = [];
|
|
44
|
+
const isCellCommentable = (_b = (_a = this.adaptable.api.optionsApi) === null || _a === void 0 ? void 0 : _a.getUserInterfaceOptions()) === null || _b === void 0 ? void 0 : _b.isCellCommentable;
|
|
45
|
+
if (!isCellCommentable ||
|
|
46
|
+
isCellCommentable({
|
|
47
|
+
adaptableApi: this.adaptable.api,
|
|
48
|
+
primaryKeyValue: menuContext.primaryKeyValue,
|
|
49
|
+
columnId: menuContext.adaptableColumn.columnId,
|
|
50
|
+
userName: this.adaptable.api.optionsApi.getUserName(),
|
|
51
|
+
adaptableId: this.adaptable.adaptableOptions.adaptableId,
|
|
52
|
+
}))
|
|
53
|
+
items.push(...this.getAddRemoveCommentMenuItems(menuContext));
|
|
54
|
+
return items;
|
|
55
|
+
}
|
|
56
|
+
getAddRemoveCommentMenuItems(menuContext) {
|
|
57
|
+
var _a;
|
|
58
|
+
const items = [];
|
|
59
|
+
// does not have comment
|
|
60
|
+
const [comment] = (_a = this.adaptable.api.commentsApi.getCellComments({
|
|
61
|
+
PrimaryKeyValue: menuContext.primaryKeyValue,
|
|
62
|
+
ColumnId: menuContext.adaptableColumn.columnId,
|
|
63
|
+
})) !== null && _a !== void 0 ? _a : [];
|
|
64
|
+
if (comment) {
|
|
65
|
+
items.push(this.createColumnMenuItemClickFunction('Remove Comment', this.moduleInfo.Glyph, () => {
|
|
66
|
+
this.api.commentsApi.deleteComment(comment);
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
items.push(this.createColumnMenuItemClickFunction('Add Comment', this.moduleInfo.Glyph, () => {
|
|
71
|
+
// add an empty one
|
|
72
|
+
this.api.commentsApi.addComment('', menuContext.primaryKeyValue, menuContext.adaptableColumn.columnId);
|
|
73
|
+
this.api.commentsApi.showComment({
|
|
74
|
+
PrimaryKeyValue: menuContext.primaryKeyValue,
|
|
75
|
+
ColumnId: menuContext.adaptableColumn.columnId,
|
|
76
|
+
}, true);
|
|
77
|
+
}));
|
|
78
|
+
}
|
|
79
|
+
return items;
|
|
80
|
+
}
|
|
81
|
+
getCellPositionFromEvent(event) {
|
|
82
|
+
var _a, _b;
|
|
83
|
+
const target = event.target;
|
|
84
|
+
if (!((_b = (_a = target === null || target === void 0 ? void 0 : target.classList) === null || _a === void 0 ? void 0 : _a.contains) === null || _b === void 0 ? void 0 : _b.call(_a, 'ag-cell'))) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
try {
|
|
88
|
+
return {
|
|
89
|
+
PrimaryKeyValue: target.parentElement.getAttribute('row-id'),
|
|
90
|
+
ColumnId: target.getAttribute('col-id'),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
catch (e) {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
handleMouseEnter(event) {
|
|
98
|
+
var _a;
|
|
99
|
+
const editMode = this.adaptable.api.commentsApi.getCommentPopupEditMode();
|
|
100
|
+
if (editMode) {
|
|
101
|
+
// ignore
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
const cellPosition = this.getCellPositionFromEvent(event);
|
|
105
|
+
const openCommentPosition = this.adaptable.api.commentsApi.getOpenCommentPosition();
|
|
106
|
+
// Hovering over someting that is not a cell and there is no open comment
|
|
107
|
+
if (!cellPosition && openCommentPosition) {
|
|
108
|
+
// need to close if the new cell does not have a comment
|
|
109
|
+
this.adaptable.api.commentsApi.hideComment();
|
|
110
|
+
}
|
|
111
|
+
else if ((_a = this.adaptable.api.commentsApi.getCellComments(cellPosition)) === null || _a === void 0 ? void 0 : _a.length) {
|
|
112
|
+
this.adaptable.api.commentsApi.showComment(cellPosition, false);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
handleCellSelected(cellPosition) {
|
|
116
|
+
// if already opened - do nothing
|
|
117
|
+
const openCommentPosition = this.adaptable.api.commentsApi.getOpenCommentPosition();
|
|
118
|
+
if ((openCommentPosition === null || openCommentPosition === void 0 ? void 0 : openCommentPosition.PrimaryKeyValue) === cellPosition.PrimaryKeyValue &&
|
|
119
|
+
(openCommentPosition === null || openCommentPosition === void 0 ? void 0 : openCommentPosition.ColumnId) === cellPosition.ColumnId) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
// if open but this has no comment, close
|
|
123
|
+
const cellComments = this.adaptable.api.commentsApi.getCellComments(cellPosition);
|
|
124
|
+
if (openCommentPosition && !(cellComments === null || cellComments === void 0 ? void 0 : cellComments.length)) {
|
|
125
|
+
// hide only if in edit mode
|
|
126
|
+
// because if you select a cell and move the mouse fast over another cell
|
|
127
|
+
// with a comment, you do not want to close that comment
|
|
128
|
+
// the selection is debounced, so the moment goes over the new cell this event is triggered
|
|
129
|
+
if (this.adaptable.api.commentsApi.getCommentPopupEditMode()) {
|
|
130
|
+
this.adaptable.api.commentsApi.hideComment();
|
|
131
|
+
}
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
// if open but the new selection has a comment open that one in edit mode (because of click)
|
|
135
|
+
if (openCommentPosition && (cellComments === null || cellComments === void 0 ? void 0 : cellComments.length)) {
|
|
136
|
+
this.adaptable.api.commentsApi.showComment(cellPosition, true);
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
exports.CommentsModule = CommentsModule;
|
|
@@ -15,7 +15,6 @@ export declare class FormatColumnModule extends AdaptableModuleBase implements I
|
|
|
15
15
|
getReferencedNamedQueryNames(formatColumn: FormatColumn): string[];
|
|
16
16
|
updateOldConfig(): void;
|
|
17
17
|
private updateFormatColumnSingleToMultiplePredicates;
|
|
18
|
-
private updateConditionalStylesColumnsOldConfig;
|
|
19
18
|
addColumnMenuItems(column: AdaptableColumn): AdaptableMenuItem[] | undefined;
|
|
20
19
|
getTeamSharingAction(): TeamSharingImportInfo<FormatColumn>;
|
|
21
20
|
toView(formatColumn: FormatColumn): AdaptableObjectView;
|