@adaptabletools/adaptable-plugin-openfin 19.2.3 → 20.0.0-canary.0
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 +6 -6
- package/src/Module/OpenFinModule.d.ts +1 -2
- package/src/Module/OpenFinModule.js +15 -21
- package/src/OpenFinApiImpl.d.ts +1 -3
- package/src/OpenFinApiImpl.js +11 -21
- package/src/View/OpenFinPopup.d.ts +2 -10
- package/src/View/OpenFinPopup.js +12 -19
- package/src/View/OpenFinViewPanel.js +3 -4
- package/src/index.d.ts +2 -2
- package/src/index.js +15 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-plugin-openfin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.0.0-canary.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "http://www.adaptabletools.com/",
|
|
6
6
|
"author": {
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"lodash": "^4.17.15",
|
|
13
13
|
"openfin-notifications": "^0.12.6",
|
|
14
14
|
"prop-types": "^15.6.2",
|
|
15
|
-
"react": "^
|
|
16
|
-
"react-redux": "
|
|
15
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
16
|
+
"react-redux": "^9.2.0",
|
|
17
17
|
"rebass": "^3.2.2",
|
|
18
|
-
"redux": "
|
|
18
|
+
"redux": "^5.0.1",
|
|
19
19
|
"styled-components": "^4.4.1",
|
|
20
|
-
"tslib": "^2.
|
|
21
|
-
"@adaptabletools/adaptable": "
|
|
20
|
+
"tslib": "^2.8.1",
|
|
21
|
+
"@adaptabletools/adaptable": "20.0.0-canary.0"
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
24
|
"module": "src/index.js"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AdaptableModuleBase } from '@adaptabletools/adaptable/src/Strategy/AdaptableModuleBase';
|
|
2
2
|
import { IOpenFinModule } from './Interface/IOpenFinModule';
|
|
3
3
|
import { OpenFinApi } from '@adaptabletools/adaptable/src/Api/OpenFinApi';
|
|
4
|
-
import { OpenFinReport } from '@adaptabletools/adaptable/src/PredefinedConfig/
|
|
4
|
+
import { OpenFinReport } from '@adaptabletools/adaptable/src/PredefinedConfig/InternalState';
|
|
5
5
|
import { AdaptableApi, AccessLevel } from '@adaptabletools/adaptable/types';
|
|
6
6
|
export declare const EXCEL_VALIDATION_FAILED = "excelValidationFailed";
|
|
7
7
|
export declare class OpenFinModule extends AdaptableModuleBase implements IOpenFinModule {
|
|
@@ -13,7 +13,6 @@ export declare class OpenFinModule extends AdaptableModuleBase implements IOpenF
|
|
|
13
13
|
private removeDataChangedListener;
|
|
14
14
|
private removeGridRefreshedListener;
|
|
15
15
|
private removeGridFilteredListener;
|
|
16
|
-
private removeGridSortChangedListener;
|
|
17
16
|
private removeCellSelectionChangedListener;
|
|
18
17
|
private removeRowSelectionChangedListener;
|
|
19
18
|
private removeSheetChangedListener;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AdaptableModuleBase } from '@adaptabletools/adaptable/src/Strategy/AdaptableModuleBase';
|
|
2
2
|
import * as ModuleConstants from '@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants';
|
|
3
3
|
import throttle from 'lodash/throttle';
|
|
4
|
-
import {
|
|
4
|
+
import { DEFAULT_LIVE_REPORT_THROTTLE_TIME, ALL_DATA_REPORT, SELECTED_DATA_REPORT, } from '@adaptabletools/adaptable/src/Utilities/Constants/GeneralConstants';
|
|
5
5
|
export const EXCEL_VALIDATION_FAILED = 'excelValidationFailed';
|
|
6
6
|
export class OpenFinModule extends AdaptableModuleBase {
|
|
7
7
|
constructor(api) {
|
|
@@ -22,8 +22,7 @@ export class OpenFinModule extends AdaptableModuleBase {
|
|
|
22
22
|
this.AccessLevel = 'Hidden';
|
|
23
23
|
}
|
|
24
24
|
else {
|
|
25
|
-
this.AccessLevel = this.api.entitlementApi
|
|
26
|
-
.getEntitlementAccessLevelForModule(this.moduleInfo.ModuleName);
|
|
25
|
+
this.AccessLevel = this.api.entitlementApi.getEntitlementAccessLevelForModule(this.moduleInfo.ModuleName);
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
getOpenFinApi() {
|
|
@@ -75,8 +74,7 @@ export class OpenFinModule extends AdaptableModuleBase {
|
|
|
75
74
|
this.sendInitialLiveData();
|
|
76
75
|
}, 500); // for whatever strange excel reason, the timeout is needed
|
|
77
76
|
const isSelectionReport = (report) => {
|
|
78
|
-
return
|
|
79
|
-
(report.ReportName === SELECTED_CELLS_REPORT || report.ReportName === SELECTED_ROWS_REPORT));
|
|
77
|
+
return report && report.ReportName === SELECTED_DATA_REPORT;
|
|
80
78
|
};
|
|
81
79
|
const resendLiveDataNoSelectionReport = () => {
|
|
82
80
|
// Rerun all reports except selected cells / rows
|
|
@@ -108,7 +106,7 @@ export class OpenFinModule extends AdaptableModuleBase {
|
|
|
108
106
|
// if the grid has refreshed then update all live reports
|
|
109
107
|
this.removeGridRefreshedListener = this.adaptable._on('GridRefreshed', resendLiveDataNoSelectionReport);
|
|
110
108
|
if (iOpenFinReport.ReportName !== ALL_DATA_REPORT) {
|
|
111
|
-
this.removeGridSortChangedListener = this.adaptable._on('SortChanged', resendLiveData);
|
|
109
|
+
// this.removeGridSortChangedListener = this.adaptable._on('SortChanged', resendLiveData);
|
|
112
110
|
// if the grid filters have changed then update any live reports except cell or row selected
|
|
113
111
|
this.removeGridFilteredListener = this.adaptable._on('AdapTableFiltersApplied', resendLiveDataNoSelectionReport);
|
|
114
112
|
}
|
|
@@ -116,14 +114,14 @@ export class OpenFinModule extends AdaptableModuleBase {
|
|
|
116
114
|
this.removeCellSelectionChangedListener = this.api.eventApi.on('CellSelectionChanged', () => {
|
|
117
115
|
const currentLiveIOpenFinReport = this.getOpenFinApi().getCurrentLiveOpenFinReport();
|
|
118
116
|
if (currentLiveIOpenFinReport &&
|
|
119
|
-
currentLiveIOpenFinReport.ReportName ===
|
|
117
|
+
currentLiveIOpenFinReport.ReportName === SELECTED_DATA_REPORT) {
|
|
120
118
|
this.throttledRecomputeAndSendLiveDataEvent();
|
|
121
119
|
}
|
|
122
120
|
});
|
|
123
121
|
this.removeRowSelectionChangedListener = this.api.eventApi.on('RowSelectionChanged', () => {
|
|
124
122
|
const currentLiveIOpenFinReport = this.getOpenFinApi().getCurrentLiveOpenFinReport();
|
|
125
123
|
if (currentLiveIOpenFinReport &&
|
|
126
|
-
currentLiveIOpenFinReport.ReportName ===
|
|
124
|
+
currentLiveIOpenFinReport.ReportName === SELECTED_DATA_REPORT) {
|
|
127
125
|
this.throttledRecomputeAndSendLiveDataEvent();
|
|
128
126
|
}
|
|
129
127
|
});
|
|
@@ -182,7 +180,7 @@ export class OpenFinModule extends AdaptableModuleBase {
|
|
|
182
180
|
return reject(msg);
|
|
183
181
|
// return resolve({ ignore: true });
|
|
184
182
|
}
|
|
185
|
-
const cellDataChangedInfo = this.api.internalApi.
|
|
183
|
+
const cellDataChangedInfo = this.api.internalApi.buildCellDataChangedInfo({
|
|
186
184
|
oldValue,
|
|
187
185
|
newValue,
|
|
188
186
|
column: this.api.columnApi.getColumnWithColumnId(columnId),
|
|
@@ -237,7 +235,6 @@ export class OpenFinModule extends AdaptableModuleBase {
|
|
|
237
235
|
}, { success: true, dataChangedInfos, failedValidationRules });
|
|
238
236
|
})
|
|
239
237
|
.then(({ success, dataChangedInfos, failedValidationRules }) => {
|
|
240
|
-
var _a, _b, _c;
|
|
241
238
|
const api = this.getOpenFinApi();
|
|
242
239
|
const pluginOptions = api.getPluginOptions();
|
|
243
240
|
if (!success) {
|
|
@@ -258,14 +255,14 @@ export class OpenFinModule extends AdaptableModuleBase {
|
|
|
258
255
|
pluginOptions.onValidationFailureInExcel === 'show-undo-notification') {
|
|
259
256
|
const textPredicate = this.adaptable.api.columnScopeApi.getScopeDescription(failedValidationRules[0].Scope) +
|
|
260
257
|
' ' +
|
|
261
|
-
|
|
262
|
-
const info =
|
|
258
|
+
failedValidationRules[0].Rule?.Predicates.map((predicate) => this.adaptable.api.predicateApi.predicateToString(predicate)).join(' AND ');
|
|
259
|
+
const info = { ...dataChangedInfos[0] };
|
|
263
260
|
delete info.rowNode;
|
|
264
261
|
const alertOptions = this.api.optionsApi.getAlertOptions();
|
|
265
|
-
alertOptions.
|
|
262
|
+
alertOptions.commandHandlers = alertOptions.commandHandlers ?? [];
|
|
266
263
|
if (pluginOptions.onValidationFailureInExcel === 'show-undo-notification' &&
|
|
267
|
-
!alertOptions.
|
|
268
|
-
alertOptions.
|
|
264
|
+
!alertOptions.commandHandlers.find((handler) => handler.name === 'openfin-plugin:excel-undo')) {
|
|
265
|
+
alertOptions.commandHandlers.push({
|
|
269
266
|
name: 'openfin-plugin:excel-undo',
|
|
270
267
|
handler: (button, context) => {
|
|
271
268
|
try {
|
|
@@ -278,7 +275,7 @@ export class OpenFinModule extends AdaptableModuleBase {
|
|
|
278
275
|
},
|
|
279
276
|
});
|
|
280
277
|
}
|
|
281
|
-
this.adaptable.api.alertApi.
|
|
278
|
+
this.adaptable.api.alertApi.displayAdaptableAlert({
|
|
282
279
|
alertType: 'cellChanged',
|
|
283
280
|
cellDataChangedInfo: info,
|
|
284
281
|
alertDefinition: {
|
|
@@ -289,13 +286,13 @@ export class OpenFinModule extends AdaptableModuleBase {
|
|
|
289
286
|
Scope: {
|
|
290
287
|
All: true,
|
|
291
288
|
},
|
|
292
|
-
Rule: { Predicates:
|
|
289
|
+
Rule: { Predicates: failedValidationRules[0].Rule?.Predicates },
|
|
293
290
|
AlertForm: {
|
|
294
291
|
Buttons: pluginOptions.onValidationFailureInExcel === 'show-undo-notification'
|
|
295
292
|
? [
|
|
296
293
|
{
|
|
297
294
|
Label: 'Undo change',
|
|
298
|
-
|
|
295
|
+
Command: 'openfin-plugin:excel-undo',
|
|
299
296
|
},
|
|
300
297
|
]
|
|
301
298
|
: [],
|
|
@@ -334,9 +331,6 @@ export class OpenFinModule extends AdaptableModuleBase {
|
|
|
334
331
|
if (this.removeGridRefreshedListener) {
|
|
335
332
|
this.removeGridRefreshedListener();
|
|
336
333
|
}
|
|
337
|
-
if (this.removeGridSortChangedListener) {
|
|
338
|
-
this.removeGridSortChangedListener();
|
|
339
|
-
}
|
|
340
334
|
if (this.removeGridFilteredListener) {
|
|
341
335
|
this.removeGridFilteredListener();
|
|
342
336
|
}
|
package/src/OpenFinApiImpl.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ApiBase } from '@adaptabletools/adaptable/src/Api/Implementation/ApiBase';
|
|
2
2
|
import { OpenFinApi } from '@adaptabletools/adaptable/src/Api/OpenFinApi';
|
|
3
3
|
import { OpenFinPluginOptions } from '@adaptabletools/adaptable/src/AdaptableOptions/OpenFinPluginOptions';
|
|
4
|
-
import { AdaptableAlert
|
|
4
|
+
import { AdaptableAlert } from '@adaptabletools/adaptable/types';
|
|
5
5
|
import { OpenFinReport, OpenFinSchedule, OpenFinState } from '@adaptabletools/adaptable/src/PredefinedConfig/OpenFinState';
|
|
6
6
|
import { IAdaptable } from '@adaptabletools/adaptable/src/AdaptableInterfaces/IAdaptable';
|
|
7
7
|
export declare class OpenFinApiImpl extends ApiBase implements OpenFinApi {
|
|
@@ -18,8 +18,6 @@ export declare class OpenFinApiImpl extends ApiBase implements OpenFinApi {
|
|
|
18
18
|
getOpenFinThrottleTime(): number | undefined;
|
|
19
19
|
getCurrentLiveOpenFinReport(): OpenFinReport | undefined;
|
|
20
20
|
getOpenFinSchedules(): OpenFinSchedule[];
|
|
21
|
-
getNotificationsOptions(): NotificationsOptions;
|
|
22
|
-
getAlertOptions(): AlertOptions;
|
|
23
21
|
startLiveData(OpenFinReport: OpenFinReport): void;
|
|
24
22
|
stopLiveData(): void;
|
|
25
23
|
}
|
package/src/OpenFinApiImpl.js
CHANGED
|
@@ -22,9 +22,8 @@ export class OpenFinApiImpl extends ApiBase {
|
|
|
22
22
|
this.options = options;
|
|
23
23
|
if (isRunningInOpenfin()) {
|
|
24
24
|
addEventListener('notification-action', (event) => {
|
|
25
|
-
var _a, _b, _c, _d, _e;
|
|
26
25
|
if (this.options.onValidationFailureInExcel === 'show-undo-notification' &&
|
|
27
|
-
|
|
26
|
+
event.notification.customData?.name === 'validation-failed') {
|
|
28
27
|
if (this.getCurrentLiveOpenFinReport()) {
|
|
29
28
|
try {
|
|
30
29
|
let openFinModule = (this.getAdaptableInternalApi().getModules().get(ModuleConstants.OpenFinModuleId));
|
|
@@ -36,7 +35,7 @@ export class OpenFinApiImpl extends ApiBase {
|
|
|
36
35
|
}
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
|
-
const alertId =
|
|
38
|
+
const alertId = event.notification.customData?.AlertId ?? '';
|
|
40
39
|
const alert = this.getAlertApi()
|
|
41
40
|
.internalApi.getAdaptableAlerts()
|
|
42
41
|
.find((alert) => alert.Uuid === alertId);
|
|
@@ -45,16 +44,14 @@ export class OpenFinApiImpl extends ApiBase {
|
|
|
45
44
|
if (clickedButton) {
|
|
46
45
|
const context = {
|
|
47
46
|
alert: alert,
|
|
48
|
-
adaptableApi: this.getAdaptableApi(),
|
|
49
|
-
userName: this.getOptions().userName,
|
|
50
|
-
adaptableId: this.getOptions().adaptableId,
|
|
51
47
|
formData: undefined,
|
|
48
|
+
...this.getAdaptableInternalApi().buildBaseContext(),
|
|
52
49
|
};
|
|
53
50
|
this.getAlertApi().internalApi.executeAlertButton(clickedButton, context);
|
|
54
51
|
}
|
|
55
52
|
}
|
|
56
53
|
event.notification.alert = alert;
|
|
57
|
-
|
|
54
|
+
this.options.onNotificationAction?.(event);
|
|
58
55
|
});
|
|
59
56
|
}
|
|
60
57
|
}
|
|
@@ -83,13 +80,13 @@ export class OpenFinApiImpl extends ApiBase {
|
|
|
83
80
|
? null
|
|
84
81
|
: alert.alertDefinition.AlertForm ||
|
|
85
82
|
this.getAlertApi().internalApi.getDefaultAlertNotificationForm();
|
|
86
|
-
if (alertForm &&
|
|
83
|
+
if (alertForm && alertForm?.Buttons) {
|
|
87
84
|
notification.buttons = alertForm.Buttons.map((button) => {
|
|
88
85
|
const { ButtonStyle: buttonStyle } = button;
|
|
89
86
|
return {
|
|
90
87
|
title: button.Label,
|
|
91
88
|
type: 'button',
|
|
92
|
-
cta:
|
|
89
|
+
cta: buttonStyle?.variant === 'raised',
|
|
93
90
|
onClick: {
|
|
94
91
|
customData: button,
|
|
95
92
|
task: CLICK_ALERT_BUTTON,
|
|
@@ -100,13 +97,12 @@ export class OpenFinApiImpl extends ApiBase {
|
|
|
100
97
|
this.showNotification(notification, alert);
|
|
101
98
|
}
|
|
102
99
|
showNotification(notification, alert) {
|
|
103
|
-
var _a;
|
|
104
100
|
notification = notification || {};
|
|
105
101
|
if (notification.expires === undefined && this.options.notificationTimeout) {
|
|
106
102
|
notification.expires = new Date(Date.now() + this.options.notificationTimeout);
|
|
107
103
|
}
|
|
108
104
|
const showIcon = this.options.showAppIconInNotifications;
|
|
109
|
-
const appIcon =
|
|
105
|
+
const appIcon = this.getUserInterfaceOptions()?.applicationIcon;
|
|
110
106
|
if (!notification.icon && showIcon && isAdaptableCustomIcon(appIcon)) {
|
|
111
107
|
notification.icon = appIcon.src;
|
|
112
108
|
}
|
|
@@ -118,7 +114,7 @@ export class OpenFinApiImpl extends ApiBase {
|
|
|
118
114
|
create(notification);
|
|
119
115
|
}
|
|
120
116
|
getOpenFinState() {
|
|
121
|
-
return this.getAdaptableState().
|
|
117
|
+
return this.getAdaptableState().Internal;
|
|
122
118
|
}
|
|
123
119
|
isOpenFinRunning() {
|
|
124
120
|
let OpenFinState = this.getOpenFinState();
|
|
@@ -137,27 +133,21 @@ export class OpenFinApiImpl extends ApiBase {
|
|
|
137
133
|
return this.options.throttleTime;
|
|
138
134
|
}
|
|
139
135
|
getCurrentLiveOpenFinReport() {
|
|
140
|
-
return this.getAdaptableState().
|
|
136
|
+
return this.getAdaptableState().Internal.CurrentLiveOpenFinReport;
|
|
141
137
|
}
|
|
142
138
|
getOpenFinSchedules() {
|
|
143
139
|
return this.getAdaptableState().Schedule.OpenFinSchedules || [];
|
|
144
140
|
}
|
|
145
|
-
getNotificationsOptions() {
|
|
146
|
-
return this.getAdaptableApi().optionsApi.getNotificationsOptions();
|
|
147
|
-
}
|
|
148
|
-
getAlertOptions() {
|
|
149
|
-
return this.getAdaptableApi().optionsApi.getAlertOptions();
|
|
150
|
-
}
|
|
151
141
|
startLiveData(OpenFinReport) {
|
|
152
142
|
if (this.checkItemExists(OpenFinReport, OpenFinReport.ReportName, 'OpenFin Report')) {
|
|
153
143
|
this.dispatchAction(OpenFinRedux.OpenFinStartLiveData(OpenFinReport));
|
|
154
|
-
this.
|
|
144
|
+
this.getExportApi().internalApi.publishLiveLiveDataChangedEvent('OpenFin', 'LiveDataStarted', OpenFinReport);
|
|
155
145
|
}
|
|
156
146
|
}
|
|
157
147
|
stopLiveData() {
|
|
158
148
|
let currentLiveReport = this.getCurrentLiveOpenFinReport();
|
|
159
149
|
this.dispatchAction(OpenFinRedux.OpenFinStopLiveData(currentLiveReport));
|
|
160
150
|
// fire the Live Report event for Export Stopped
|
|
161
|
-
this.
|
|
151
|
+
this.getExportApi().internalApi.publishLiveLiveDataChangedEvent('OpenFin', 'LiveDataStopped', currentLiveReport);
|
|
162
152
|
}
|
|
163
153
|
}
|
|
@@ -3,20 +3,12 @@ import { ConnectedComponent } from 'react-redux';
|
|
|
3
3
|
import * as OpenFinRedux from '../Redux/ActionReducers/OpenFinRedux';
|
|
4
4
|
import { ModuleViewPopupProps } from '@adaptabletools/adaptable/src/View/Components/SharedProps/ModuleViewPopupProps';
|
|
5
5
|
import * as TeamSharingRedux from '@adaptabletools/adaptable/src/Redux/ActionsReducers/TeamSharingRedux';
|
|
6
|
-
import { EditableConfigEntityState } from '@adaptabletools/adaptable/src/View/Components/SharedProps/EditableConfigEntityState';
|
|
7
6
|
import { AdaptableObject } from '@adaptabletools/adaptable/src/PredefinedConfig/Common/AdaptableObject';
|
|
8
7
|
import { OpenFinReport } from '@adaptabletools/adaptable/src/PredefinedConfig/OpenFinState';
|
|
9
8
|
import { AdaptableSharedEntityConfig } from '@adaptabletools/adaptable/src/PredefinedConfig/TeamSharingState';
|
|
10
|
-
interface OpenFinPopupProps extends ModuleViewPopupProps<
|
|
9
|
+
interface OpenFinPopupProps extends ModuleViewPopupProps<any> {
|
|
11
10
|
onOpenFinSendSnapshot: (OpenFineport: OpenFinReport) => OpenFinRedux.OpenFinSendSnapshotAction;
|
|
12
11
|
onShare: (entity: AdaptableObject, config: AdaptableSharedEntityConfig) => TeamSharingRedux.TeamSharingShareAction;
|
|
13
12
|
}
|
|
14
|
-
declare
|
|
15
|
-
constructor(props: OpenFinPopupProps);
|
|
16
|
-
shouldClosePopupOnFinishWizard: boolean;
|
|
17
|
-
componentDidMount(): void;
|
|
18
|
-
render(): JSX.Element;
|
|
19
|
-
onApplyExport(OpenFinReport: OpenFinReport): void;
|
|
20
|
-
}
|
|
21
|
-
export declare const OpenFinPopup: ConnectedComponent<typeof OpenFinPopupComponent, Pick<React.ClassAttributes<OpenFinPopupComponent> & OpenFinPopupProps, never>>;
|
|
13
|
+
export declare const OpenFinPopup: ConnectedComponent<React.FC<OpenFinPopupProps>, Pick<OpenFinPopupProps, never>>;
|
|
22
14
|
export {};
|
package/src/View/OpenFinPopup.js
CHANGED
|
@@ -3,26 +3,19 @@ import { connect } from 'react-redux';
|
|
|
3
3
|
import { PanelWithButton } from '@adaptabletools/adaptable/src/View/Components/Panels/PanelWithButton';
|
|
4
4
|
import * as TeamSharingRedux from '@adaptabletools/adaptable/src/Redux/ActionsReducers/TeamSharingRedux';
|
|
5
5
|
import * as ModuleConstants from '@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
componentDidMount() {
|
|
14
|
-
if (this.props.popupParams) {
|
|
15
|
-
this.shouldClosePopupOnFinishWizard =
|
|
16
|
-
this.props.popupParams.source && this.props.popupParams.source == 'Toolbar';
|
|
6
|
+
const OpenFinPopupComponent = (props) => {
|
|
7
|
+
const shouldClosePopupOnFinishWizardRef = React.useRef(false);
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
if (props.popupParams) {
|
|
10
|
+
shouldClosePopupOnFinishWizardRef.current =
|
|
11
|
+
props.popupParams.source && props.popupParams.source == 'Toolbar';
|
|
17
12
|
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
}
|
|
13
|
+
}, [props.popupParams]);
|
|
14
|
+
// const onApplyExport = (OpenFinReport: OpenFinReport) => {
|
|
15
|
+
// props.onOpenFinSendSnapshot(OpenFinReport);
|
|
16
|
+
// };
|
|
17
|
+
return (React.createElement(PanelWithButton, { headerText: props.moduleInfo.FriendlyName, bodyProps: { padding: 0 }, glyphicon: props.moduleInfo.Glyph, infoLink: props.moduleInfo.HelpPage, infoLinkDisabled: !props.api.internalApi.isDocumentationLinksDisplayed() }));
|
|
18
|
+
};
|
|
26
19
|
function mapStateToProps(state) {
|
|
27
20
|
return {};
|
|
28
21
|
}
|
|
@@ -38,7 +38,6 @@ class OpenFinViewPanelComponent extends React.Component {
|
|
|
38
38
|
let allReports = this.props.api.exportApi
|
|
39
39
|
.getAvailableSystemReports()
|
|
40
40
|
.filter((s) => this.props.api.exportApi.internalApi.isSystemReportActive(s))
|
|
41
|
-
.filter((s) => s !== GeneralConstants.VISUAL_DATA_REPORT)
|
|
42
41
|
.map((s) => {
|
|
43
42
|
return s;
|
|
44
43
|
})
|
|
@@ -90,10 +89,10 @@ class OpenFinViewPanelComponent extends React.Component {
|
|
|
90
89
|
}
|
|
91
90
|
function mapStateToProps(state) {
|
|
92
91
|
return {
|
|
93
|
-
CurrentLiveOpenFinReport: state.
|
|
92
|
+
CurrentLiveOpenFinReport: state.Internal.CurrentLiveOpenFinReport,
|
|
94
93
|
Reports: state.Export.Reports,
|
|
95
|
-
IsOpenFinRunning: !!state.
|
|
96
|
-
currentReportName: state.
|
|
94
|
+
IsOpenFinRunning: !!state.Internal.CurrentLiveOpenFinReport,
|
|
95
|
+
currentReportName: state.Internal.OpenFinCurrentReportName,
|
|
97
96
|
};
|
|
98
97
|
}
|
|
99
98
|
function mapDispatchToProps(dispatch) {
|
package/src/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AdaptablePlugin } from '@adaptabletools/adaptable/types';
|
|
2
2
|
import * as Redux from 'redux';
|
|
3
|
-
import {
|
|
3
|
+
import { InternalState } from '@adaptabletools/adaptable/src/PredefinedConfig/InternalState';
|
|
4
4
|
import { OpenFinApi } from '@adaptabletools/adaptable/src/Api/OpenFinApi';
|
|
5
5
|
import { OpenFinPluginOptions } from '@adaptabletools/adaptable/src/AdaptableOptions/OpenFinPluginOptions';
|
|
6
6
|
import { IAdaptable } from '@adaptabletools/adaptable/src/AdaptableInterfaces/IAdaptable';
|
|
@@ -14,7 +14,7 @@ declare class OpenFinPlugin extends AdaptablePlugin {
|
|
|
14
14
|
afterInit(adaptable: IAdaptable): void;
|
|
15
15
|
afterInitApi(adaptable: IAdaptable): void;
|
|
16
16
|
rootReducer: (rootReducer: any) => {
|
|
17
|
-
System: (state:
|
|
17
|
+
System: (state: InternalState, action: Redux.Action) => InternalState;
|
|
18
18
|
};
|
|
19
19
|
reduxMiddleware: (adaptable: IAdaptable) => Redux.Middleware;
|
|
20
20
|
afterInitStore(adaptable: IAdaptable): void;
|
package/src/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { AdaptablePlugin
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
// import { version as coreVersion } from '@adaptabletools/adaptable/package.json';
|
|
1
|
+
import { AdaptablePlugin } from '@adaptabletools/adaptable/types';
|
|
2
|
+
import { version, name } from '../package.json';
|
|
3
|
+
import { version as coreVersion } from '@adaptabletools/adaptable/package.json';
|
|
5
4
|
import * as ModuleConstants from '@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants';
|
|
6
5
|
import { OpenFinModuleId } from '@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants';
|
|
7
6
|
import * as PopupRedux from '@adaptabletools/adaptable/src/Redux/ActionsReducers/PopupRedux';
|
|
@@ -13,14 +12,14 @@ import { initialOpenFinState, OpenFinReducer } from './Redux/ActionReducers/Open
|
|
|
13
12
|
import { OPENFIN_START_LIVE_DATA, OPENFIN_STOP_LIVE_DATA, } from '@adaptabletools/adaptable/src/Redux/ActionsReducers/PluginsRedux';
|
|
14
13
|
import { OpenFinViewPanelControl } from './View/OpenFinViewPanel';
|
|
15
14
|
import { isRunningInOpenfin } from './Utilities/isRunningInOpenfin';
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
15
|
+
const suffix = name.endsWith('-cjs') ? '-cjs' : '';
|
|
16
|
+
if (version !== coreVersion) {
|
|
17
|
+
console.warn(`
|
|
18
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
19
|
+
!!!!!!! "@adaptabletools/adaptable-plugin-openfin${suffix}" (v @${version}) and "@adaptabletools/adaptable${suffix}" (v @${coreVersion}) have different versions - they should have the exact same version.
|
|
20
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
21
|
+
`);
|
|
22
|
+
}
|
|
24
23
|
const defaultOptions = {
|
|
25
24
|
throttleTime: 2000,
|
|
26
25
|
notificationTimeout: 5000,
|
|
@@ -67,7 +66,10 @@ class OpenFinPlugin extends AdaptablePlugin {
|
|
|
67
66
|
};
|
|
68
67
|
};
|
|
69
68
|
};
|
|
70
|
-
this.options =
|
|
69
|
+
this.options = {
|
|
70
|
+
...defaultOptions,
|
|
71
|
+
...options,
|
|
72
|
+
};
|
|
71
73
|
}
|
|
72
74
|
afterInit(adaptable) {
|
|
73
75
|
this.openFinModule = (adaptable.adaptableModules.get(ModuleConstants.OpenFinModuleId));
|