@adaptabletools/adaptable-plugin-ipushpull 19.2.4 → 20.0.0-canary.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +6 -7
- package/src/IPushPullApiImpl.js +11 -12
- package/src/Module/PushPullModule.js +55 -56
- package/src/Redux/ActionReducers/IPushPullRedux.js +14 -3
- package/src/Utilities/Services/Interface/IPushPullService.d.ts +1 -1
- package/src/Utilities/Services/PushPullService.d.ts +1 -1
- package/src/Utilities/Services/PushPullService.js +4 -4
- package/src/View/IPushPullAddPagePopup.d.ts +5 -2
- package/src/View/IPushPullAddPagePopup.js +4 -4
- package/src/View/IPushPullLoginPopup.d.ts +5 -2
- package/src/View/IPushPullLoginPopup.js +4 -4
- package/src/View/IPushPullPopup.d.ts +6 -2
- package/src/View/IPushPullViewPanel.d.ts +5 -2
- package/src/View/IPushPullViewPanel.js +12 -13
- package/src/index.d.ts +2 -1
- package/src/index.js +20 -13
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@adaptabletools/adaptable-plugin-ipushpull",
|
3
|
-
"version": "
|
3
|
+
"version": "20.0.0-canary.1",
|
4
4
|
"description": "",
|
5
5
|
"homepage": "http://www.adaptabletools.com/",
|
6
6
|
"author": {
|
@@ -12,14 +12,13 @@
|
|
12
12
|
"ipushpull-js": "^2.25.0",
|
13
13
|
"lodash": "^4.17.15",
|
14
14
|
"prop-types": "^15.6.2",
|
15
|
-
"react": "^
|
16
|
-
"react-redux": "
|
17
|
-
"
|
18
|
-
"redux": "4.0.5",
|
15
|
+
"react": "^18.0.0 || ^19.0.0",
|
16
|
+
"react-redux": "^9.2.0",
|
17
|
+
"redux": "^5.0.1",
|
19
18
|
"styled-components": "^4.4.1",
|
20
19
|
"tinycolor2": "^1.4.2",
|
21
|
-
"tslib": "^2.
|
22
|
-
"@adaptabletools/adaptable": "
|
20
|
+
"tslib": "^2.8.1",
|
21
|
+
"@adaptabletools/adaptable": "20.0.0-canary.1"
|
23
22
|
},
|
24
23
|
"type": "module",
|
25
24
|
"module": "src/index.js"
|
package/src/IPushPullApiImpl.js
CHANGED
@@ -10,10 +10,10 @@ export class IPushPullApiImpl extends ApiBase {
|
|
10
10
|
this.options = options;
|
11
11
|
}
|
12
12
|
getCurrentIPushPullUsername() {
|
13
|
-
return this.getAdaptableState().
|
13
|
+
return this.getAdaptableState().Internal.CurrentIPushpullUsername;
|
14
14
|
}
|
15
15
|
getCurrentIPushPullPassword() {
|
16
|
-
return this.getAdaptableState().
|
16
|
+
return this.getAdaptableState().Internal.CurrentIPushpullPassword;
|
17
17
|
}
|
18
18
|
getIPushPullUsername() {
|
19
19
|
return this.options.username;
|
@@ -22,11 +22,10 @@ export class IPushPullApiImpl extends ApiBase {
|
|
22
22
|
return this.options.password;
|
23
23
|
}
|
24
24
|
getAutoLogin() {
|
25
|
-
|
26
|
-
return (_a = this.options.autoLogin) !== null && _a !== void 0 ? _a : false;
|
25
|
+
return this.options.autoLogin ?? false;
|
27
26
|
}
|
28
27
|
getCurrentLiveIPushPullReport() {
|
29
|
-
return this.getAdaptableState().
|
28
|
+
return this.getAdaptableState().Internal.CurrentLiveIPushPullReport;
|
30
29
|
}
|
31
30
|
setIPushPullInstance(ippInstance) {
|
32
31
|
this.ippInstance = ippInstance;
|
@@ -37,13 +36,13 @@ export class IPushPullApiImpl extends ApiBase {
|
|
37
36
|
sendSnapshot(iPushPullReport) {
|
38
37
|
if (this.checkItemExists(iPushPullReport, iPushPullReport.ReportName, 'IPushPull Report')) {
|
39
38
|
this.dispatchAction(IPushPullRedux.IPushPullSendSnapshot(iPushPullReport));
|
40
|
-
this.
|
39
|
+
this.getExportApi().internalApi.publishLiveLiveDataChangedEvent('ipushpull', 'SnapshotSent');
|
41
40
|
}
|
42
41
|
}
|
43
42
|
startLiveData(iPushPullReport) {
|
44
43
|
if (this.checkItemExists(iPushPullReport, iPushPullReport.ReportName, 'IPushPull Report')) {
|
45
44
|
this.dispatchAction(IPushPullRedux.IPushPullLiveReportSet(iPushPullReport));
|
46
|
-
this.
|
45
|
+
this.getExportApi().internalApi.publishLiveLiveDataChangedEvent('ipushpull', 'LiveDataStarted', iPushPullReport);
|
47
46
|
}
|
48
47
|
}
|
49
48
|
stopLiveData() {
|
@@ -55,7 +54,7 @@ export class IPushPullApiImpl extends ApiBase {
|
|
55
54
|
// clear the live report
|
56
55
|
this.dispatchAction(IPushPullRedux.IPushPullLiveReportClear());
|
57
56
|
// fire the Live Report event for Export Stopped
|
58
|
-
this.
|
57
|
+
this.getExportApi().internalApi.publishLiveLiveDataChangedEvent('ipushpull', 'LiveDataStopped', currentLiveReport);
|
59
58
|
}
|
60
59
|
isIPushPullReportLive(iPushPullReport) {
|
61
60
|
if (!iPushPullReport) {
|
@@ -68,10 +67,10 @@ export class IPushPullApiImpl extends ApiBase {
|
|
68
67
|
return true;
|
69
68
|
}
|
70
69
|
isIPushPullRunning() {
|
71
|
-
return this.getAdaptableState().
|
70
|
+
return this.getAdaptableState().Internal.IsIPushPullRunning;
|
72
71
|
}
|
73
72
|
getIPushPullDomains() {
|
74
|
-
return this.getAdaptableState().
|
73
|
+
return this.getAdaptableState().Internal.IPushPullDomainsPages || [];
|
75
74
|
}
|
76
75
|
getPagesForIPushPullDomain(folderName) {
|
77
76
|
let returnArray = [];
|
@@ -121,11 +120,11 @@ export class IPushPullApiImpl extends ApiBase {
|
|
121
120
|
}
|
122
121
|
setIPushPullRunningOn() {
|
123
122
|
this.dispatchAction(IPushPullRedux.SetIPushPullRunningOn());
|
124
|
-
this.
|
123
|
+
this.getExportApi().internalApi.publishLiveLiveDataChangedEvent('ipushpull', 'Connected');
|
125
124
|
}
|
126
125
|
setIPushPullRunningOff() {
|
127
126
|
this.dispatchAction(IPushPullRedux.SetIPushPullRunningOff());
|
128
|
-
this.
|
127
|
+
this.getExportApi().internalApi.publishLiveLiveDataChangedEvent('ipushpull', 'Disconnected');
|
129
128
|
}
|
130
129
|
isIPushPullLiveDataRunning() {
|
131
130
|
return Helper.objectExists(this.getCurrentLiveIPushPullReport());
|
@@ -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, SELECTED_DATA_REPORT, } from '@adaptabletools/adaptable/src/Utilities/Constants/GeneralConstants';
|
5
5
|
const EQUAL_DATA_ERR = 'equal data, so not sending';
|
6
6
|
export class PushPullModule extends AdaptableModuleBase {
|
7
7
|
constructor(api) {
|
@@ -13,59 +13,59 @@ export class PushPullModule extends AdaptableModuleBase {
|
|
13
13
|
setTimeout(() => {
|
14
14
|
this.throttledRecomputeAndSendLiveDataEvent = throttle(() => this.sendNewLiveData(), this.getThrottleTimeFromState());
|
15
15
|
}, 1000);
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
}
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
}
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
}
|
16
|
+
if (this.getIPPApi().isIPushPullRunning()) {
|
17
|
+
// if a piece of data has updated then update any live reports except cell or row selected where the data change is relevant
|
18
|
+
// currently we DONT send deltas - we simply send everything to ipushpull every time a relevant change happens
|
19
|
+
this.api.internalApi
|
20
|
+
.getDataService()
|
21
|
+
.on('CellDataChanged', (cellDataChangedInfo) => {
|
22
|
+
const api = this.getIPPApi();
|
23
|
+
const exportApi = this.api.exportApi;
|
24
|
+
if (api.isIPushPullLiveDataRunning()) {
|
25
|
+
let currentLiveIPushPullReport = api.getCurrentLiveIPushPullReport();
|
26
|
+
if (currentLiveIPushPullReport &&
|
27
|
+
currentLiveIPushPullReport.ReportName !== SELECTED_DATA_REPORT &&
|
28
|
+
exportApi.internalApi.isDataChangeInReport(cellDataChangedInfo, this.getCurrentReport())) {
|
29
|
+
this.throttledRecomputeAndSendLiveDataEvent();
|
30
|
+
}
|
31
|
+
}
|
32
|
+
});
|
33
|
+
// if the grid has refreshed then update all live reports
|
34
|
+
this.adaptable._on('GridRefreshed', () => {
|
35
|
+
if (this.getIPPApi().isIPushPullLiveDataRunning()) {
|
36
|
+
this.throttledRecomputeAndSendLiveDataEvent();
|
37
|
+
}
|
38
|
+
});
|
39
|
+
// if the grid filters have changed then update any live reports except cell or row selected
|
40
|
+
this.adaptable._on('AdapTableFiltersApplied', () => {
|
41
|
+
// Rerun all reports except selected cells / rows when filter changes
|
42
|
+
if (this.getIPPApi().isIPushPullLiveDataRunning()) {
|
43
|
+
let currentLiveIPushPullReport = this.getIPPApi().getCurrentLiveIPushPullReport();
|
44
|
+
if (currentLiveIPushPullReport &&
|
45
|
+
currentLiveIPushPullReport.ReportName !== SELECTED_DATA_REPORT) {
|
46
|
+
this.throttledRecomputeAndSendLiveDataEvent();
|
47
|
+
}
|
48
|
+
}
|
49
|
+
});
|
50
|
+
// if grid selection has changed and the ipushpull Live report is 'Selected Cells' or 'Selected Rows' then send updated data
|
51
|
+
this.api.eventApi.on('CellSelectionChanged', () => {
|
52
|
+
if (this.getIPPApi().isIPushPullLiveDataRunning()) {
|
53
|
+
let currentLiveIPushPullReport = this.getIPPApi().getCurrentLiveIPushPullReport();
|
54
|
+
if (currentLiveIPushPullReport &&
|
55
|
+
currentLiveIPushPullReport.ReportName === SELECTED_DATA_REPORT) {
|
56
|
+
this.throttledRecomputeAndSendLiveDataEvent();
|
57
|
+
}
|
58
|
+
}
|
59
|
+
});
|
60
|
+
this.api.eventApi.on('RowSelectionChanged', () => {
|
61
|
+
if (this.getIPPApi().isIPushPullLiveDataRunning()) {
|
62
|
+
let currentLiveIPushPullReport = this.getIPPApi().getCurrentLiveIPushPullReport();
|
63
|
+
if (currentLiveIPushPullReport &&
|
64
|
+
currentLiveIPushPullReport.ReportName === SELECTED_DATA_REPORT) {
|
65
|
+
this.throttledRecomputeAndSendLiveDataEvent();
|
66
|
+
}
|
67
|
+
}
|
68
|
+
});
|
69
69
|
}
|
70
70
|
});
|
71
71
|
}
|
@@ -78,8 +78,7 @@ export class PushPullModule extends AdaptableModuleBase {
|
|
78
78
|
this.AccessLevel = 'Hidden';
|
79
79
|
}
|
80
80
|
else {
|
81
|
-
this.AccessLevel = this.api.entitlementApi
|
82
|
-
.getEntitlementAccessLevelForModule(this.moduleInfo.ModuleName);
|
81
|
+
this.AccessLevel = this.api.entitlementApi.getEntitlementAccessLevelForModule(this.moduleInfo.ModuleName);
|
83
82
|
}
|
84
83
|
}
|
85
84
|
getIPPApi() {
|
@@ -104,13 +104,24 @@ state, action) => {
|
|
104
104
|
return Object.assign({}, state, { IsIPushPullRunning: false });
|
105
105
|
case IPUSHPULL_SET_LOGIN_DETAILS: {
|
106
106
|
let loginAction = action;
|
107
|
-
return
|
107
|
+
return {
|
108
|
+
...state,
|
109
|
+
CurrentIPushpullUsername: loginAction.username,
|
110
|
+
CurrentIPushpullPassword: loginAction.password,
|
111
|
+
};
|
108
112
|
}
|
109
113
|
case IPUSHPULL_LOGOUT: {
|
110
|
-
return
|
114
|
+
return {
|
115
|
+
...state,
|
116
|
+
CurrentIPushpullUsername: undefined,
|
117
|
+
CurrentIPushpullPassword: undefined,
|
118
|
+
};
|
111
119
|
}
|
112
120
|
case IPUSHPULL_SET_LOGIN_ERROR_MESSAGE: {
|
113
|
-
return
|
121
|
+
return {
|
122
|
+
...state,
|
123
|
+
IPushPullLoginErrorMessage: action.errorMessage,
|
124
|
+
};
|
114
125
|
}
|
115
126
|
case IPUSHPULL_DOMAIN_PAGES_SET: {
|
116
127
|
return Object.assign({}, state, {
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { ServiceStatus } from '../PushPullService';
|
2
|
-
import { IPushPullDomain } from '@adaptabletools/adaptable/src/PredefinedConfig/
|
2
|
+
import { IPushPullDomain } from '@adaptabletools/adaptable/src/PredefinedConfig/InternalState';
|
3
3
|
export interface IPushPullService {
|
4
4
|
login(login: string, password: string): Promise<any>;
|
5
5
|
getDomainPages(): Promise<IPushPullDomain[]>;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { IAdaptable } from '@adaptabletools/adaptable/src/AdaptableInterfaces/IAdaptable';
|
2
2
|
import { IPPStyle } from '@adaptabletools/adaptable/src/Utilities/Interface/IPPStyle';
|
3
3
|
import { IPushPullService } from './Interface/IPushPullService';
|
4
|
-
import { IPushPullDomain } from '@adaptabletools/adaptable/src/PredefinedConfig/
|
4
|
+
import { IPushPullDomain } from '@adaptabletools/adaptable/src/PredefinedConfig/InternalState';
|
5
5
|
export declare enum ServiceStatus {
|
6
6
|
Unknown = "Unknown",
|
7
7
|
Disconnected = "Disconnected",
|
@@ -228,7 +228,7 @@ export class PushPullService {
|
|
228
228
|
headerFontStyle: headerColStyle.fontStyle,
|
229
229
|
headerFontWeight: headerColStyle.fontWeight,
|
230
230
|
height: Number(headerColStyle.height.replace('px', '')),
|
231
|
-
Columns: this.adaptable.api.columnApi.
|
231
|
+
Columns: this.adaptable.api.columnApi.getUIAvailableColumns().map((col) => {
|
232
232
|
const headerColumn = document.querySelector(`.ag-header-cell[col-id='${col.columnId}']`);
|
233
233
|
const headerColumnStyle = window.getComputedStyle(headerColumn || headerFirstCol, null);
|
234
234
|
return {
|
@@ -247,7 +247,7 @@ export class PushPullService {
|
|
247
247
|
fontStyle: firstRowStyle.fontStyle,
|
248
248
|
fontWeight: firstRowStyle.fontWeight,
|
249
249
|
height: Number(firstRowStyle.height.replace('px', '')),
|
250
|
-
Columns: this.adaptable.api.columnApi.
|
250
|
+
Columns: this.adaptable.api.columnApi.getUIAvailableColumns().map((col) => {
|
251
251
|
const cellElement = document.querySelector(`.ag-cell[col-id='${col.columnId}']`);
|
252
252
|
const headerColumnStyle = window.getComputedStyle(cellElement || firstRow, null);
|
253
253
|
return {
|
@@ -269,7 +269,7 @@ export class PushPullService {
|
|
269
269
|
headerFontStyle: 'normal',
|
270
270
|
headerFontWeight: '400',
|
271
271
|
height: 65,
|
272
|
-
Columns: this.adaptable.api.columnApi.
|
272
|
+
Columns: this.adaptable.api.columnApi.getUIAvailableColumns().map((col) => {
|
273
273
|
return {
|
274
274
|
columnFriendlyName: col.friendlyName,
|
275
275
|
width: 200,
|
@@ -286,7 +286,7 @@ export class PushPullService {
|
|
286
286
|
fontStyle: 'normal',
|
287
287
|
fontWeight: '400',
|
288
288
|
height: 30,
|
289
|
-
Columns: this.adaptable.api.columnApi.
|
289
|
+
Columns: this.adaptable.api.columnApi.getUIAvailableColumns().map((col) => {
|
290
290
|
return {
|
291
291
|
columnFriendlyName: col.friendlyName,
|
292
292
|
width: 200,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
import * as React from 'react';
|
2
2
|
import * as IPushPullRedux from '../Redux/ActionReducers/IPushPullRedux';
|
3
3
|
import { IPushPullDomain } from '@adaptabletools/adaptable/src/PredefinedConfig/IPushPullState';
|
4
4
|
interface IPushPullAddPagePopupProps {
|
@@ -6,5 +6,8 @@ interface IPushPullAddPagePopupProps {
|
|
6
6
|
onAddPage: (folder: string, page: string) => IPushPullRedux.IPushPullAddPageAction;
|
7
7
|
onCancel: () => any;
|
8
8
|
}
|
9
|
-
export declare let IPushPullAddPagePopup: import("react-redux").ConnectedComponent<(props: IPushPullAddPagePopupProps) => JSX.Element,
|
9
|
+
export declare let IPushPullAddPagePopup: import("react-redux").ConnectedComponent<(props: IPushPullAddPagePopupProps) => React.JSX.Element, {
|
10
|
+
context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").UnknownAction>>;
|
11
|
+
store?: import("redux").Store<any, import("redux").UnknownAction, unknown>;
|
12
|
+
}>;
|
10
13
|
export {};
|
@@ -11,7 +11,7 @@ import { PanelWithImage } from '@adaptabletools/adaptable/src/View/Components/Pa
|
|
11
11
|
import { usePopupContext } from '@adaptabletools/adaptable/src/View/Components/Popups/AdaptablePopup/PopupContext';
|
12
12
|
import ErrorBox from '@adaptabletools/adaptable/src/components/ErrorBox';
|
13
13
|
import HelpBlock from '@adaptabletools/adaptable/src/components/HelpBlock';
|
14
|
-
import { Flex } from '
|
14
|
+
import { Flex } from '@adaptabletools/adaptable/src/components/Flex';
|
15
15
|
import Dropdown from '@adaptabletools/adaptable/src/components/Dropdown';
|
16
16
|
import { EMPTY_STRING, EMPTY_ARRAY, } from '@adaptabletools/adaptable/src/Utilities/Constants/GeneralConstants';
|
17
17
|
import ArrayExtensions from '@adaptabletools/adaptable/src/Utilities/Extensions/ArrayExtensions';
|
@@ -25,7 +25,7 @@ const IPushPullAddPageComponent = (props) => {
|
|
25
25
|
const { hidePopup } = usePopupContext();
|
26
26
|
const onSubmit = () => {
|
27
27
|
if (ArrayExtensions.ContainsItem(state.AvailablePages, state.Page)) {
|
28
|
-
setState(
|
28
|
+
setState({ ...state, ErrorMessage: 'A page with that name already exists in the folder' });
|
29
29
|
}
|
30
30
|
else {
|
31
31
|
props.onAddPage(state.Folder, state.Page);
|
@@ -33,7 +33,7 @@ const IPushPullAddPageComponent = (props) => {
|
|
33
33
|
};
|
34
34
|
const onPageNameChange = (event) => {
|
35
35
|
const e = event.target;
|
36
|
-
setState(
|
36
|
+
setState({ ...state, Page: e.value });
|
37
37
|
};
|
38
38
|
const onFolderChanged = (folderName) => {
|
39
39
|
if (StringExtensions.IsNotNullOrEmpty(folderName) && folderName !== 'Select Folder') {
|
@@ -86,7 +86,7 @@ const IPushPullAddPageComponent = (props) => {
|
|
86
86
|
};
|
87
87
|
function mapStateToProps(state) {
|
88
88
|
return {
|
89
|
-
IPushPullDomainsPages: state.
|
89
|
+
IPushPullDomainsPages: state.Internal.IPushPullDomainsPages,
|
90
90
|
};
|
91
91
|
}
|
92
92
|
function mapDispatchToProps(dispatch) {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
import * as React from 'react';
|
2
2
|
import * as IPushPullRedux from '../Redux/ActionReducers/IPushPullRedux';
|
3
3
|
interface IPushPullLoginPopupProps {
|
4
4
|
pushpullLogin: string | undefined;
|
@@ -7,5 +7,8 @@ interface IPushPullLoginPopupProps {
|
|
7
7
|
onLogin: (login: string, password: string) => IPushPullRedux.IPushPullLoginAction;
|
8
8
|
onCancel: () => any;
|
9
9
|
}
|
10
|
-
export declare let IPushPullLoginPopup: import("react-redux").ConnectedComponent<(props: IPushPullLoginPopupProps) => JSX.Element,
|
10
|
+
export declare let IPushPullLoginPopup: import("react-redux").ConnectedComponent<(props: IPushPullLoginPopupProps) => React.JSX.Element, {
|
11
|
+
context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").UnknownAction>>;
|
12
|
+
store?: import("redux").Store<any, import("redux").UnknownAction, unknown>;
|
13
|
+
}>;
|
11
14
|
export {};
|
@@ -12,7 +12,7 @@ import { PanelWithImage } from '@adaptabletools/adaptable/src/View/Components/Pa
|
|
12
12
|
import { usePopupContext } from '@adaptabletools/adaptable/src/View/Components/Popups/AdaptablePopup/PopupContext';
|
13
13
|
import ErrorBox from '@adaptabletools/adaptable/src/components/ErrorBox';
|
14
14
|
import HelpBlock from '@adaptabletools/adaptable/src/components/HelpBlock';
|
15
|
-
import { Flex } from '
|
15
|
+
import { Flex } from '@adaptabletools/adaptable/src/components/Flex';
|
16
16
|
const IPushPullLoginComponent = (props) => {
|
17
17
|
const adaptable = useAdaptable();
|
18
18
|
const options = adaptable.getPlugin('ipushpull').options;
|
@@ -26,11 +26,11 @@ const IPushPullLoginComponent = (props) => {
|
|
26
26
|
};
|
27
27
|
const onLoginChange = (event) => {
|
28
28
|
const e = event.target;
|
29
|
-
setState(
|
29
|
+
setState({ ...state, Login: e.value });
|
30
30
|
};
|
31
31
|
const onPasswordChange = (event) => {
|
32
32
|
const e = event.target;
|
33
|
-
setState(
|
33
|
+
setState({ ...state, Password: e.value });
|
34
34
|
};
|
35
35
|
return (React.createElement(PanelWithImage, { header: "ipushpull Login Details", glyphicon: "login", variant: "primary", style: { height: '100%' } },
|
36
36
|
React.createElement(FlexWithFooter, { as: "form", onSubmit: (e) => {
|
@@ -60,7 +60,7 @@ function mapStateToProps(state) {
|
|
60
60
|
// pushpullLogin: state.IPushPull ? state.IPushPull!.Username : undefined,
|
61
61
|
// pushpullPassword: state.IPushPull ? state.IPushPull!.Password : undefined,
|
62
62
|
// pushpullLoginErrorMessage: state.IPushPull.IPushPullLoginErrorMessage,
|
63
|
-
pushpullLoginErrorMessage: state.
|
63
|
+
pushpullLoginErrorMessage: state.Internal.IPushPullLoginErrorMessage,
|
64
64
|
};
|
65
65
|
}
|
66
66
|
function mapDispatchToProps(dispatch) {
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
+
import * as Redux from 'redux';
|
2
3
|
import * as IPushPullRedux from '../Redux/ActionReducers/IPushPullRedux';
|
3
4
|
import { ModuleViewPopupProps } from '@adaptabletools/adaptable/src/View/Components/SharedProps/ModuleViewPopupProps';
|
4
5
|
import * as TeamSharingRedux from '@adaptabletools/adaptable/src/Redux/ActionsReducers/TeamSharingRedux';
|
@@ -15,8 +16,11 @@ declare class IPushPullPopupComponent extends React.Component<IPushPullPopupProp
|
|
15
16
|
constructor(props: IPushPullPopupProps);
|
16
17
|
shouldClosePopupOnFinishWizard: boolean;
|
17
18
|
componentDidMount(): void;
|
18
|
-
render(): JSX.Element;
|
19
|
+
render(): React.JSX.Element;
|
19
20
|
onApplyExport(iPushPullReport: IPushPullReport): void;
|
20
21
|
}
|
21
|
-
export declare let IPushPullPopup: import("react-redux").ConnectedComponent<typeof IPushPullPopupComponent,
|
22
|
+
export declare let IPushPullPopup: import("react-redux").ConnectedComponent<typeof IPushPullPopupComponent, {
|
23
|
+
context?: React.Context<import("react-redux").ReactReduxContextValue<any, Redux.UnknownAction>>;
|
24
|
+
store?: Redux.Store<any, Redux.UnknownAction, unknown>;
|
25
|
+
}>;
|
22
26
|
export {};
|
@@ -1,10 +1,10 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
import { ViewPanelProps } from '@adaptabletools/adaptable/src/View/Components/SharedProps/ViewPanelProps';
|
3
2
|
import { IPushPullDomain, IPushPullReport, IPushPullSchedule } from '@adaptabletools/adaptable/src/PredefinedConfig/IPushPullState';
|
4
3
|
import * as IPushPullRedux from '../Redux/ActionReducers/IPushPullRedux';
|
5
4
|
import * as PopupRedux from '@adaptabletools/adaptable/src/Redux/ActionsReducers/PopupRedux';
|
6
5
|
import { AdaptableColumn } from '@adaptabletools/adaptable/src/PredefinedConfig/Common/AdaptableColumn';
|
7
6
|
import { Report } from '@adaptabletools/adaptable/src/PredefinedConfig/ExportState';
|
7
|
+
import * as React from 'react';
|
8
8
|
export interface IPushPullViewPanelComponentProps extends ViewPanelProps {
|
9
9
|
onIPushPullSendSnapshot: (iPushPulleport: IPushPullReport) => IPushPullRedux.IPushPullSendSnapshotAction;
|
10
10
|
onIPushPullStartLiveData: (iPushPulleport: IPushPullReport) => IPushPullRedux.IPushPullStartLiveDataAction;
|
@@ -25,4 +25,7 @@ export interface IPushPullViewPanelComponentProps extends ViewPanelProps {
|
|
25
25
|
onCurrentIPushPullFolderChange: (folder: string) => IPushPullRedux.IPushPullSetCurrentFolderAction;
|
26
26
|
onCurrentIPushPullPageChange: (page: string) => IPushPullRedux.IPushPullSetCurrentPageAction;
|
27
27
|
}
|
28
|
-
export declare const IPushPullViewPanelControl: import("react-redux").ConnectedComponent<(props: IPushPullViewPanelComponentProps) => JSX.Element,
|
28
|
+
export declare const IPushPullViewPanelControl: import("react-redux").ConnectedComponent<(props: IPushPullViewPanelComponentProps) => React.JSX.Element, {
|
29
|
+
context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").UnknownAction>>;
|
30
|
+
store?: import("redux").Store<any, import("redux").UnknownAction, unknown>;
|
31
|
+
}>;
|
@@ -3,7 +3,7 @@ import * as PopupRedux from '@adaptabletools/adaptable/src/Redux/ActionsReducers
|
|
3
3
|
import * as React from 'react';
|
4
4
|
import ObjectFactory from '@adaptabletools/adaptable/src/Utilities/ObjectFactory';
|
5
5
|
import { StringExtensions } from '@adaptabletools/adaptable/src/Utilities/Extensions/StringExtensions';
|
6
|
-
import { Flex } from '
|
6
|
+
import { Flex } from '@adaptabletools/adaptable/src/components/Flex';
|
7
7
|
import DropdownButton from '@adaptabletools/adaptable/src/components/DropdownButton';
|
8
8
|
import { ButtonExport } from '@adaptabletools/adaptable/src/View/Components/Buttons/ButtonExport';
|
9
9
|
import { ButtonPause } from '@adaptabletools/adaptable/src/View/Components/Buttons/ButtonPause';
|
@@ -17,7 +17,6 @@ import { ButtonLogin } from '@adaptabletools/adaptable/src/View/Components/Butto
|
|
17
17
|
import * as ModuleConstants from '@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants';
|
18
18
|
import { connect } from 'react-redux';
|
19
19
|
const IPushPullViewPanelComponent = (props) => {
|
20
|
-
var _a, _b, _c, _d;
|
21
20
|
const [_, update] = React.useState(0);
|
22
21
|
const forceUpdate = () => update((x) => x + 1);
|
23
22
|
const onLiveDataChanged = React.useCallback((liveDataChangedInfo) => {
|
@@ -70,20 +69,20 @@ const IPushPullViewPanelComponent = (props) => {
|
|
70
69
|
onClick: () => onSelectedReportChanged(report),
|
71
70
|
};
|
72
71
|
});
|
73
|
-
let availableFolders =
|
72
|
+
let availableFolders = props.IPushPullDomainsPages?.map((iPushPullDomain) => {
|
74
73
|
return {
|
75
74
|
label: iPushPullDomain.Name,
|
76
75
|
value: iPushPullDomain.Name,
|
77
76
|
onClick: () => onFolderChanged(iPushPullDomain.Name),
|
78
77
|
};
|
79
|
-
})
|
80
|
-
let availablePages =
|
78
|
+
}) ?? [];
|
79
|
+
let availablePages = props.CurrentIPushPullAvailablePages?.map((page) => {
|
81
80
|
return {
|
82
81
|
label: page,
|
83
82
|
value: page,
|
84
83
|
onClick: () => onPageChanged(page),
|
85
84
|
};
|
86
|
-
})
|
85
|
+
}) ?? [];
|
87
86
|
// this is clearly ridiculous!
|
88
87
|
// im getting tired...
|
89
88
|
let isCompletedReport = StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullReportName) &&
|
@@ -120,14 +119,14 @@ const IPushPullViewPanelComponent = (props) => {
|
|
120
119
|
};
|
121
120
|
function mapStateToProps(state) {
|
122
121
|
return {
|
123
|
-
CurrentLiveIPushPullReport: state.
|
122
|
+
CurrentLiveIPushPullReport: state.Internal.CurrentLiveIPushPullReport,
|
124
123
|
Reports: state.Export.Reports,
|
125
|
-
IPushPullDomainsPages: state.
|
126
|
-
IsIPushPullRunning: state.
|
127
|
-
CurrentIPushPullReportName: state.
|
128
|
-
CurrentIPushPullFolder: state.
|
129
|
-
CurrentIPushPullPage: state.
|
130
|
-
CurrentIPushPullAvailablePages: state.
|
124
|
+
IPushPullDomainsPages: state.Internal.IPushPullDomainsPages,
|
125
|
+
IsIPushPullRunning: state.Internal.IsIPushPullRunning,
|
126
|
+
CurrentIPushPullReportName: state.Internal.IPushPullCurrentReportName,
|
127
|
+
CurrentIPushPullFolder: state.Internal.IPushPullCurrentFolder,
|
128
|
+
CurrentIPushPullPage: state.Internal.IPushPullCurrentPage,
|
129
|
+
CurrentIPushPullAvailablePages: state.Internal.IPushPullCurrentAvailablePages,
|
131
130
|
};
|
132
131
|
}
|
133
132
|
function mapDispatchToProps(dispatch) {
|
package/src/index.d.ts
CHANGED
@@ -4,6 +4,7 @@ import { IPushPullState } from '@adaptabletools/adaptable/src/PredefinedConfig/I
|
|
4
4
|
import { IPushPullApi } from '@adaptabletools/adaptable/src/Api/IPushPullApi';
|
5
5
|
import { IPushPullPluginOptions } from '@adaptabletools/adaptable/src/AdaptableOptions/IPushPullPluginOptions';
|
6
6
|
import { IAdaptable } from '@adaptabletools/adaptable/src/AdaptableInterfaces/IAdaptable';
|
7
|
+
import type { Middleware, Action } from 'redux';
|
7
8
|
declare class IPushPullPlugin extends AdaptablePlugin {
|
8
9
|
options: IPushPullPluginOptions;
|
9
10
|
pluginId: string;
|
@@ -14,7 +15,7 @@ declare class IPushPullPlugin extends AdaptablePlugin {
|
|
14
15
|
rootReducer: (rootReducer: any) => {
|
15
16
|
System: (state: IPushPullState, action: Redux.Action) => IPushPullState;
|
16
17
|
};
|
17
|
-
reduxMiddleware: (adaptable: IAdaptable) =>
|
18
|
+
reduxMiddleware: (adaptable: IAdaptable) => Middleware;
|
18
19
|
afterInitStore(adaptable: IAdaptable): void;
|
19
20
|
}
|
20
21
|
declare const _default: (options?: IPushPullPluginOptions) => IPushPullPlugin;
|
package/src/index.js
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { AdaptablePlugin } from '@adaptabletools/adaptable/types';
|
2
2
|
import env from './env';
|
3
3
|
// TODO in the future, try to put back the version check
|
4
|
-
|
5
|
-
|
4
|
+
import { version, name } from '../package.json';
|
5
|
+
import { version as coreVersion } from '@adaptabletools/adaptable/package.json';
|
6
6
|
import * as ModuleConstants from '@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants';
|
7
7
|
import { IPushPullModuleId } from '@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants';
|
8
8
|
import * as PopupRedux from '@adaptabletools/adaptable/src/Redux/ActionsReducers/PopupRedux';
|
@@ -17,14 +17,14 @@ import { IPushPullAddPagePopup } from './View/IPushPullAddPagePopup';
|
|
17
17
|
import { IPUSHPULL_ADD_PAGE, IPUSHPULL_DOMAIN_PAGES_SET, IPUSHPULL_LOGIN, IPUSHPULL_SEND_SNAPSHOT, IPUSHPULL_SET_CURRENT_FOLDER, IPUSHPULL_START_LIVE_DATA, IPUSHPULL_STOP_LIVE_DATA, } from '@adaptabletools/adaptable/src/Redux/ActionsReducers/PluginsRedux';
|
18
18
|
import StringExtensions from '@adaptabletools/adaptable/src/Utilities/Extensions/StringExtensions';
|
19
19
|
import { IPushPullViewPanelControl } from './View/IPushPullViewPanel';
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
20
|
+
const suffix = name.endsWith('-cjs') ? '-cjs' : '';
|
21
|
+
if (version !== coreVersion) {
|
22
|
+
console.warn(`
|
23
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
24
|
+
!!!!!!! "@adaptabletools/adaptable-plugin-ipushpull${suffix}" (v @${version}) and "@adaptabletools/adaptable${suffix}" (v @${coreVersion}) have different versions - they should have the exact same version.
|
25
|
+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
26
|
+
`);
|
27
|
+
}
|
28
28
|
const getApiKey = () => {
|
29
29
|
let key = env.IPUSHPULL_API_KEY; // need to make sure that is always there
|
30
30
|
return key;
|
@@ -114,7 +114,7 @@ class IPushPullPlugin extends AdaptablePlugin {
|
|
114
114
|
}
|
115
115
|
case IPUSHPULL_DOMAIN_PAGES_SET: {
|
116
116
|
//refresh the available pages
|
117
|
-
const currentFolder = middlewareAPI.getState().
|
117
|
+
const currentFolder = middlewareAPI.getState().Internal.IPushPullCurrentFolder;
|
118
118
|
const isFolderValid = StringExtensions.IsNotNullOrEmpty(currentFolder);
|
119
119
|
if (isFolderValid) {
|
120
120
|
const availablePages = adaptable.api.pluginsApi
|
@@ -131,14 +131,21 @@ class IPushPullPlugin extends AdaptablePlugin {
|
|
131
131
|
};
|
132
132
|
};
|
133
133
|
};
|
134
|
-
const ippConfig =
|
134
|
+
const ippConfig = {
|
135
|
+
...defaultOptions.ippConfig,
|
136
|
+
...(options || {}).ippConfig,
|
137
|
+
};
|
135
138
|
if (!ippConfig.api_key) {
|
136
139
|
ippConfig.api_key = defaultOptions.ippConfig.api_key;
|
137
140
|
}
|
138
141
|
if (!ippConfig.api_secret) {
|
139
142
|
ippConfig.api_secret = defaultOptions.ippConfig.api_secret;
|
140
143
|
}
|
141
|
-
this.options =
|
144
|
+
this.options = {
|
145
|
+
...defaultOptions,
|
146
|
+
...options,
|
147
|
+
ippConfig,
|
148
|
+
};
|
142
149
|
/**
|
143
150
|
* Contains the objects required to export (snapshot or live) data to ipushpull from AdapTable.
|
144
151
|
*
|