@adaptabletools/adaptable-plugin-ipushpull 12.2.3 → 13.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 +3 -3
- package/src/Module/PushPullModule.js +5 -5
- package/src/Utilities/Services/PushPullService.js +8 -8
- package/src/View/IPushPullAddPagePopup.js +2 -2
- package/src/View/IPushPullLoginPopup.js +3 -3
- package/src/View/IPushPullPopup.d.ts +1 -1
- package/src/View/IPushPullPopup.js +1 -1
- package/src/View/IPushPullViewPanel.d.ts +1 -1
- package/src/View/IPushPullViewPanel.js +2 -2
- package/src/index.js +4 -4
- package/src/logger.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adaptabletools/adaptable-plugin-ipushpull",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.0-canary.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "http://www.adaptabletools.com/",
|
|
6
6
|
"author": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"rebass": "^3.2.2",
|
|
19
19
|
"redux": "4.0.5",
|
|
20
20
|
"styled-components": "^4.4.1",
|
|
21
|
-
"tslib": "^2.
|
|
22
|
-
"@adaptabletools/adaptable": "
|
|
21
|
+
"tslib": "^2.3.0",
|
|
22
|
+
"@adaptabletools/adaptable": "13.0.0-canary.1"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -16,7 +16,7 @@ class PushPullModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
16
16
|
this.adaptable = api.internalApi.getAdaptableInstance();
|
|
17
17
|
this.api.eventApi.on('AdaptableReady', () => {
|
|
18
18
|
setTimeout(() => {
|
|
19
|
-
this.throttledRecomputeAndSendLiveDataEvent = throttle_1.default(() => this.sendNewLiveData(), this.getThrottleTimeFromState());
|
|
19
|
+
this.throttledRecomputeAndSendLiveDataEvent = (0, throttle_1.default)(() => this.sendNewLiveData(), this.getThrottleTimeFromState());
|
|
20
20
|
}, 1000);
|
|
21
21
|
});
|
|
22
22
|
// if a piece of data has updated then update any live reports except cell or row selected where the data change is relevant
|
|
@@ -113,7 +113,7 @@ class PushPullModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
113
113
|
let reportAsArray = this.adaptable.ReportService.getReportDataAsArray(report);
|
|
114
114
|
const currentData = JSON.stringify(reportAsArray);
|
|
115
115
|
if (currentData === this.lastData) {
|
|
116
|
-
logger_1.LogAdaptableWarning(EQUAL_DATA_ERR);
|
|
116
|
+
(0, logger_1.LogAdaptableWarning)(EQUAL_DATA_ERR);
|
|
117
117
|
this.isSendingData = false;
|
|
118
118
|
return;
|
|
119
119
|
}
|
|
@@ -136,7 +136,7 @@ class PushPullModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
136
136
|
return this.adaptable.ReportService.PublishLiveLiveDataChangedEvent('ipushpull', 'LiveDataUpdated', currentLiveIPushPullReport);
|
|
137
137
|
})
|
|
138
138
|
.catch((reason) => {
|
|
139
|
-
logger_1.LogAdaptableWarning('Failed to send data to ipushpull for [' + currentLiveIPushPullReport.ReportName + ']', reason);
|
|
139
|
+
(0, logger_1.LogAdaptableWarning)('Failed to send data to ipushpull for [' + currentLiveIPushPullReport.ReportName + ']', reason);
|
|
140
140
|
this.stopLiveData();
|
|
141
141
|
let errorMessage = 'Export Failed';
|
|
142
142
|
if (reason) {
|
|
@@ -147,11 +147,11 @@ class PushPullModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
147
147
|
});
|
|
148
148
|
Promise.resolve()
|
|
149
149
|
.then(() => {
|
|
150
|
-
logger_1.LogAdaptableSuccess('All live report data sent');
|
|
150
|
+
(0, logger_1.LogAdaptableSuccess)('All live report data sent');
|
|
151
151
|
this.isSendingData = false;
|
|
152
152
|
})
|
|
153
153
|
.catch(() => {
|
|
154
|
-
logger_1.LogAdaptableWarning('Failed to send data');
|
|
154
|
+
(0, logger_1.LogAdaptableWarning)('Failed to send data');
|
|
155
155
|
this.isSendingData = false;
|
|
156
156
|
});
|
|
157
157
|
}
|
|
@@ -66,7 +66,7 @@ class PushPullService {
|
|
|
66
66
|
.login(login, password)
|
|
67
67
|
.then((result) => {
|
|
68
68
|
this.ppInstance.__status = ServiceStatus.Connected;
|
|
69
|
-
logger_1.LogAdaptableSuccess('Logged in to ipushpull');
|
|
69
|
+
(0, logger_1.LogAdaptableSuccess)('Logged in to ipushpull');
|
|
70
70
|
return result;
|
|
71
71
|
})
|
|
72
72
|
.catch((err) => {
|
|
@@ -84,7 +84,7 @@ class PushPullService {
|
|
|
84
84
|
return this.ppInstance.api
|
|
85
85
|
.getDomainsAndPages(this.ppInstance.config.api_key)
|
|
86
86
|
.then((response) => {
|
|
87
|
-
logger_1.LogAdaptableSuccess('Retrieved ipushpull Folder/Page info');
|
|
87
|
+
(0, logger_1.LogAdaptableSuccess)('Retrieved ipushpull Folder/Page info');
|
|
88
88
|
return response.data.domains.map((domain) => ({
|
|
89
89
|
Name: domain.name,
|
|
90
90
|
FolderId: domain.id,
|
|
@@ -94,7 +94,7 @@ class PushPullService {
|
|
|
94
94
|
}));
|
|
95
95
|
})
|
|
96
96
|
.catch((error) => {
|
|
97
|
-
logger_1.LogAdaptableError("Couldn't get Domain/Pages from ipushpull : ", error);
|
|
97
|
+
(0, logger_1.LogAdaptableError)("Couldn't get Domain/Pages from ipushpull : ", error);
|
|
98
98
|
throw error.message;
|
|
99
99
|
});
|
|
100
100
|
}
|
|
@@ -105,7 +105,7 @@ class PushPullService {
|
|
|
105
105
|
return new Promise((resolve, reject) => {
|
|
106
106
|
const page = new this.ppInstance.Page(pageIPP, folderIPP);
|
|
107
107
|
page.on(page.EVENT_NEW_CONTENT, () => {
|
|
108
|
-
logger_1.LogAdaptableInfo(`Page Ready : ${pageIPP}`);
|
|
108
|
+
(0, logger_1.LogAdaptableInfo)(`Page Ready : ${pageIPP}`);
|
|
109
109
|
this.pages.set(pageIPP, page);
|
|
110
110
|
resolve(page);
|
|
111
111
|
// we return true so it removes the listener for new content.
|
|
@@ -119,7 +119,7 @@ class PushPullService {
|
|
|
119
119
|
if (pageIPP) {
|
|
120
120
|
pageIPP.destroy();
|
|
121
121
|
this.pages.delete(page);
|
|
122
|
-
logger_1.LogAdaptableInfo(`Page Unloaded : ${page}`);
|
|
122
|
+
(0, logger_1.LogAdaptableInfo)(`Page Unloaded : ${page}`);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
addNewPage(folderId, page) {
|
|
@@ -134,7 +134,7 @@ class PushPullService {
|
|
|
134
134
|
return this.getIPPApi().retrieveIPushPullDomainsFromIPushPull();
|
|
135
135
|
})
|
|
136
136
|
.catch((err) => {
|
|
137
|
-
logger_1.LogAdaptableError("Couldn't create Page: '" + page + "'. Reason: " + err);
|
|
137
|
+
(0, logger_1.LogAdaptableError)("Couldn't create Page: '" + page + "'. Reason: " + err);
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
140
|
pushData(page, data) {
|
|
@@ -203,10 +203,10 @@ class PushPullService {
|
|
|
203
203
|
pageIPP.Content.canDoDelta = false;
|
|
204
204
|
pageIPP.Content.update(newData, true);
|
|
205
205
|
pageIPP.push().then(() => {
|
|
206
|
-
logger_1.LogAdaptableSuccess(`Data pushed for ipushpull page : ${page}`);
|
|
206
|
+
(0, logger_1.LogAdaptableSuccess)(`Data pushed for ipushpull page : ${page}`);
|
|
207
207
|
resolve();
|
|
208
208
|
}, (err) => {
|
|
209
|
-
logger_1.LogAdaptableInfo(`Error pushing data for ipushpull page : ${page}`);
|
|
209
|
+
(0, logger_1.LogAdaptableInfo)(`Error pushing data for ipushpull page : ${page}`);
|
|
210
210
|
reject();
|
|
211
211
|
});
|
|
212
212
|
});
|
|
@@ -26,7 +26,7 @@ const IPushPullAddPageComponent = (props) => {
|
|
|
26
26
|
AvailablePages: GeneralConstants_1.EMPTY_ARRAY,
|
|
27
27
|
ErrorMessage: '',
|
|
28
28
|
});
|
|
29
|
-
const { hidePopup } = PopupContext_1.usePopupContext();
|
|
29
|
+
const { hidePopup } = (0, PopupContext_1.usePopupContext)();
|
|
30
30
|
const onSubmit = () => {
|
|
31
31
|
if (ArrayExtensions_1.default.ContainsItem(state.AvailablePages, state.Page)) {
|
|
32
32
|
setState(Object.assign(Object.assign({}, state), { ErrorMessage: 'A page with that name already exists in the folder' }));
|
|
@@ -101,4 +101,4 @@ function mapDispatchToProps(dispatch) {
|
|
|
101
101
|
},
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
|
-
exports.IPushPullAddPagePopup = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(IPushPullAddPageComponent);
|
|
104
|
+
exports.IPushPullAddPagePopup = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(IPushPullAddPageComponent);
|
|
@@ -18,13 +18,13 @@ const ErrorBox_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/sr
|
|
|
18
18
|
const HelpBlock_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/components/HelpBlock"));
|
|
19
19
|
const rebass_1 = require("rebass");
|
|
20
20
|
const IPushPullLoginComponent = (props) => {
|
|
21
|
-
const adaptable = AdaptableContext_1.useAdaptable();
|
|
21
|
+
const adaptable = (0, AdaptableContext_1.useAdaptable)();
|
|
22
22
|
const options = adaptable.getPlugin('ipushpull').options;
|
|
23
23
|
const [state, setState] = React.useState({
|
|
24
24
|
Login: options.username || '',
|
|
25
25
|
Password: options.password || '',
|
|
26
26
|
});
|
|
27
|
-
const { hidePopup } = PopupContext_1.usePopupContext();
|
|
27
|
+
const { hidePopup } = (0, PopupContext_1.usePopupContext)();
|
|
28
28
|
const onSubmit = () => {
|
|
29
29
|
props.onLogin(state.Login || '', state.Password || '');
|
|
30
30
|
};
|
|
@@ -76,4 +76,4 @@ function mapDispatchToProps(dispatch) {
|
|
|
76
76
|
},
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
|
-
exports.IPushPullLoginPopup = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(IPushPullLoginComponent);
|
|
79
|
+
exports.IPushPullLoginPopup = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(IPushPullLoginComponent);
|
|
@@ -18,5 +18,5 @@ declare class IPushPullPopupComponent extends React.Component<IPushPullPopupProp
|
|
|
18
18
|
render(): JSX.Element;
|
|
19
19
|
onApplyExport(iPushPullReport: IPushPullReport): void;
|
|
20
20
|
}
|
|
21
|
-
export declare let IPushPullPopup: import("react-redux").ConnectedComponent<typeof IPushPullPopupComponent, import("react-redux").Omit<React.ClassAttributes<IPushPullPopupComponent> & IPushPullPopupProps, "
|
|
21
|
+
export declare let IPushPullPopup: import("react-redux").ConnectedComponent<typeof IPushPullPopupComponent, import("react-redux").Omit<React.ClassAttributes<IPushPullPopupComponent> & IPushPullPopupProps, "key" | "api" | "ref" | "onSuspend" | "accessLevel" | "modalContainer" | "moduleInfo" | "popupParams" | "onClearPopupParams" | "teamSharingActivated" | "onClosePopup" | "onUnSuspend" | "onShare" | "onIPushPullSendSnapshot" | "onIPushPullStopLiveData">>;
|
|
22
22
|
export {};
|
|
@@ -38,4 +38,4 @@ function mapDispatchToProps(dispatch) {
|
|
|
38
38
|
onShare: (entity, config) => dispatch(TeamSharingRedux.TeamSharingShare(entity, ModuleConstants.IPushPullModuleId, config)),
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
|
-
exports.IPushPullPopup = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(IPushPullPopupComponent);
|
|
41
|
+
exports.IPushPullPopup = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(IPushPullPopupComponent);
|
|
@@ -24,4 +24,4 @@ export interface IPushPullViewPanelComponentProps extends ViewPanelProps {
|
|
|
24
24
|
onCurrentIPushPullFolderChange: (folder: string) => IPushPullRedux.IPushPullSetCurrentFolderAction;
|
|
25
25
|
onCurrentIPushPullPageChange: (page: string) => IPushPullRedux.IPushPullSetCurrentPageAction;
|
|
26
26
|
}
|
|
27
|
-
export declare const IPushPullViewPanelControl: import("react-redux").ConnectedComponent<(props: IPushPullViewPanelComponentProps) => JSX.Element, import("react-redux").Omit<IPushPullViewPanelComponentProps, "api" | "accessLevel" | "
|
|
27
|
+
export declare const IPushPullViewPanelControl: import("react-redux").ConnectedComponent<(props: IPushPullViewPanelComponentProps) => JSX.Element, import("react-redux").Omit<IPushPullViewPanelComponentProps, "api" | "accessLevel" | "moduleInfo" | "Columns" | "IsIPushPullRunning" | "IPushPullDomainsPages" | "CurrentLiveIPushPullReport" | "Reports" | "viewType" | "onIPushPullSendSnapshot" | "onIPushPullStartLiveData" | "onIPushPullStopLiveData" | "onNewIPushPullSchedule" | "onShowIPushPullLogin" | "onShowAddIPushPullPage" | "CurrentIPushPullReportName" | "CurrentIPushPullFolder" | "CurrentIPushPullPage" | "CurrentIPushPullAvailablePages" | "onCurrentIPushPullReportNameChange" | "onCurrentIPushPullFolderChange" | "onCurrentIPushPullPageChange">>;
|
|
@@ -115,7 +115,7 @@ const IPushPullViewPanelComponent = (props) => {
|
|
|
115
115
|
React.createElement(rebass_1.Flex, { style: { minWidth: '148px' } },
|
|
116
116
|
React.createElement(ButtonExport_1.ButtonExport, { marginLeft: 1, className: `ab-${elementType}__IPushPull__export`, onClick: () => onIPushPullSendSnapshot(), tooltip: "Send Snapshot to ipushpull", disabled: isLiveIPushPullReport || !isCompletedReport, accessLevel: props.accessLevel }),
|
|
117
117
|
true ? (React.createElement(ButtonPause_1.ButtonPause, { fillColor: 'red', marginLeft: 1, className: `ab-${elementType}__IPushPull__pause`, onClick: () => props.onIPushPullStopLiveData(), tooltip: "Stop sync with ipushpull", disabled: !isLiveIPushPullReport, accessLevel: props.accessLevel })) : (React.createElement(ButtonPlay_1.ButtonPlay, { marginLeft: 1, className: `ab-${elementType}__IPushPull__play`, onClick: () => onIPushPullStartLiveData(), tooltip: "Start sync with ipushpull", disabled: isLiveIPushPullReport || !isCompletedReport, accessLevel: props.accessLevel })),
|
|
118
|
-
isCompletedReport && (React.createElement(rebass_1.Flex, { className: join_1.default(props.accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__IPushPull__controls`), alignItems: "stretch" }, props.api.internalApi.getEntitlementService().isModuleFullEntitlement('Schedule') && (React.createElement(ButtonSchedule_1.ButtonSchedule, { marginLeft: 1, className: `ab-${elementType}__IPushPull__schedule`, onClick: () => onNewIPushPullSchedule(), tooltip: "Schedule", disabled: isLiveIPushPullReport || !isCompletedReport, accessLevel: props.accessLevel })))),
|
|
118
|
+
isCompletedReport && (React.createElement(rebass_1.Flex, { className: (0, join_1.default)(props.accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__IPushPull__controls`), alignItems: "stretch" }, props.api.internalApi.getEntitlementService().isModuleFullEntitlement('Schedule') && (React.createElement(ButtonSchedule_1.ButtonSchedule, { marginLeft: 1, className: `ab-${elementType}__IPushPull__schedule`, onClick: () => onNewIPushPullSchedule(), tooltip: "Schedule", disabled: isLiveIPushPullReport || !isCompletedReport, accessLevel: props.accessLevel })))),
|
|
119
119
|
' ',
|
|
120
120
|
React.createElement(ButtonNewPage_1.ButtonNewPage, { marginLeft: 1, className: `ab-${elementType}__IPushPull__newpage`, onClick: () => props.onShowAddIPushPullPage(), tooltip: "New Page", disabled: isLiveIPushPullReport, accessLevel: props.accessLevel }),
|
|
121
121
|
React.createElement(ButtonLogout_1.ButtonLogout, { marginLeft: 1, className: `ab-${elementType}__IPushPull__logout`, onClick: () => getIPPApi().logoutFromIPushPull(), tooltip: "Logout", disabled: isLiveIPushPullReport, accessLevel: props.accessLevel })))) : (React.createElement(ButtonLogin_1.ButtonLogin, { marginLeft: 1, className: `ab-${elementType}__IPushPull__login`, onClick: () => props.onShowIPushPullLogin(), tooltip: "Login to ipushpull", accessLevel: props.accessLevel },
|
|
@@ -155,4 +155,4 @@ function mapDispatchToProps(dispatch) {
|
|
|
155
155
|
onCurrentIPushPullPageChange: (page) => dispatch(IPushPullRedux.IPushPullSetCurrentPage(page)),
|
|
156
156
|
};
|
|
157
157
|
}
|
|
158
|
-
exports.IPushPullViewPanelControl = react_redux_1.connect(mapStateToProps, mapDispatchToProps)(IPushPullViewPanelComponent);
|
|
158
|
+
exports.IPushPullViewPanelControl = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(IPushPullViewPanelComponent);
|
package/src/index.js
CHANGED
|
@@ -63,7 +63,7 @@ class IPushPullPlugin extends types_1.AdaptablePlugin {
|
|
|
63
63
|
// (idiomatic way of default parameter value in reducer is not feasible because the passed argument is already initialized by the System reducer)
|
|
64
64
|
augmentedState = Object.assign({}, augmentedState, IPushPullRedux_1.iPushPullInitialState);
|
|
65
65
|
}
|
|
66
|
-
return IPushPullRedux_1.IPushPullReducer(augmentedState, action);
|
|
66
|
+
return (0, IPushPullRedux_1.IPushPullReducer)(augmentedState, action);
|
|
67
67
|
},
|
|
68
68
|
};
|
|
69
69
|
};
|
|
@@ -109,8 +109,8 @@ class IPushPullPlugin extends types_1.AdaptablePlugin {
|
|
|
109
109
|
.getipushpullPluginApi()
|
|
110
110
|
.getPagesForIPushPullDomain(currentFolder)
|
|
111
111
|
: [];
|
|
112
|
-
middlewareAPI.dispatch(IPushPullRedux_1.IPushPullSetCurrentAvailablePages(availablePages));
|
|
113
|
-
middlewareAPI.dispatch(IPushPullRedux_1.IPushPullSetCurrentPage(''));
|
|
112
|
+
middlewareAPI.dispatch((0, IPushPullRedux_1.IPushPullSetCurrentAvailablePages)(availablePages));
|
|
113
|
+
middlewareAPI.dispatch((0, IPushPullRedux_1.IPushPullSetCurrentPage)(''));
|
|
114
114
|
return next(action);
|
|
115
115
|
}
|
|
116
116
|
case PluginsRedux_1.IPUSHPULL_DOMAIN_PAGES_SET: {
|
|
@@ -121,7 +121,7 @@ class IPushPullPlugin extends types_1.AdaptablePlugin {
|
|
|
121
121
|
const availablePages = adaptable.api.pluginsApi
|
|
122
122
|
.getipushpullPluginApi()
|
|
123
123
|
.getPagesForIPushPullDomain(currentFolder);
|
|
124
|
-
middlewareAPI.dispatch(IPushPullRedux_1.IPushPullSetCurrentAvailablePages(availablePages));
|
|
124
|
+
middlewareAPI.dispatch((0, IPushPullRedux_1.IPushPullSetCurrentAvailablePages)(availablePages));
|
|
125
125
|
}
|
|
126
126
|
return next(action);
|
|
127
127
|
}
|
package/src/logger.js
CHANGED
|
@@ -3,4 +3,4 @@ var _a;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.LogAdaptableWarning = exports.LogAdaptableSuccess = exports.LogAdaptableInfo = exports.LogAdaptableError = void 0;
|
|
5
5
|
const LoggingHelper_1 = require("@adaptabletools/adaptable/src/Utilities/Helpers/LoggingHelper");
|
|
6
|
-
_a = LoggingHelper_1.getLoggingFunctions('ipushpull'), exports.LogAdaptableError = _a.LogAdaptableError, exports.LogAdaptableInfo = _a.LogAdaptableInfo, exports.LogAdaptableSuccess = _a.LogAdaptableSuccess, exports.LogAdaptableWarning = _a.LogAdaptableWarning;
|
|
6
|
+
_a = (0, LoggingHelper_1.getLoggingFunctions)('ipushpull'), exports.LogAdaptableError = _a.LogAdaptableError, exports.LogAdaptableInfo = _a.LogAdaptableInfo, exports.LogAdaptableSuccess = _a.LogAdaptableSuccess, exports.LogAdaptableWarning = _a.LogAdaptableWarning;
|