@adaptabletools/adaptable-plugin-ipushpull-cjs 22.0.0-canary.6 → 22.0.0-canary.7
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
CHANGED
|
@@ -139,7 +139,7 @@ class PushPullModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
139
139
|
})
|
|
140
140
|
.then((currentData) => {
|
|
141
141
|
this.lastData = currentData;
|
|
142
|
-
this.adaptable.logger.success('
|
|
142
|
+
this.adaptable.logger.success('Live report data sent successfully.');
|
|
143
143
|
this.isSendingData = false;
|
|
144
144
|
return this.api.exportApi.internalApi.publishLiveLiveDataChangedEvent('ipushpull', 'LiveDataUpdated', currentLiveIPushPullReport);
|
|
145
145
|
})
|
|
@@ -147,16 +147,14 @@ class PushPullModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
147
147
|
// Skip logging for expected cases
|
|
148
148
|
if (reason?.message !== EQUAL_DATA_ERR) {
|
|
149
149
|
this.isSendingData = false;
|
|
150
|
-
this.adaptable.logger.warn(
|
|
151
|
-
currentLiveIPushPullReport.ReportName +
|
|
152
|
-
']', reason);
|
|
150
|
+
this.adaptable.logger.warn(`Failed to send data to ipushpull for report "${currentLiveIPushPullReport.ReportName}".`, reason);
|
|
153
151
|
this.stopLiveData();
|
|
154
|
-
let errorMessage = 'Export
|
|
152
|
+
let errorMessage = 'Export failed';
|
|
155
153
|
if (reason) {
|
|
156
154
|
errorMessage += ': ' + reason;
|
|
157
155
|
}
|
|
158
|
-
errorMessage += '.
|
|
159
|
-
this.api.alertApi.showAlertError('ipushpull Export
|
|
156
|
+
errorMessage += '. The live export has been cancelled.';
|
|
157
|
+
this.api.alertApi.showAlertError('ipushpull Export', errorMessage);
|
|
160
158
|
}
|
|
161
159
|
});
|
|
162
160
|
}
|
|
@@ -174,7 +172,7 @@ class PushPullModule extends AdaptableModuleBase_1.AdaptableModuleBase {
|
|
|
174
172
|
}
|
|
175
173
|
})
|
|
176
174
|
.catch((error) => {
|
|
177
|
-
this.adaptable.logger.warn(`Failed to send snapshot for report
|
|
175
|
+
this.adaptable.logger.warn(`Failed to send snapshot for report "${iPushPullReport.ReportName}".`, error);
|
|
178
176
|
});
|
|
179
177
|
}
|
|
180
178
|
startLiveData(iPushPullReport) {
|
|
@@ -67,7 +67,7 @@ class PushPullService {
|
|
|
67
67
|
.login(login, password)
|
|
68
68
|
.then((result) => {
|
|
69
69
|
this.ppInstance.__status = ServiceStatus.Connected;
|
|
70
|
-
this.adaptable.logger.success('Logged in to ipushpull');
|
|
70
|
+
this.adaptable.logger.success('Logged in to ipushpull.');
|
|
71
71
|
return result;
|
|
72
72
|
})
|
|
73
73
|
.catch((err) => {
|
|
@@ -80,12 +80,12 @@ class PushPullService {
|
|
|
80
80
|
// Retrieves domain pages from ipushpull
|
|
81
81
|
getDomainPages() {
|
|
82
82
|
if (!this.ppInstance) {
|
|
83
|
-
return Promise.reject('No ipushpull instance found
|
|
83
|
+
return Promise.reject('No ipushpull instance found.');
|
|
84
84
|
}
|
|
85
85
|
return this.ppInstance.api
|
|
86
86
|
.getDomainsAndPages(this.ppInstance.config.api_key)
|
|
87
87
|
.then((response) => {
|
|
88
|
-
this.adaptable.logger.success('Retrieved ipushpull
|
|
88
|
+
this.adaptable.logger.success('Retrieved ipushpull folder and page info.');
|
|
89
89
|
return response.data.domains.map((domain) => ({
|
|
90
90
|
Name: domain.name,
|
|
91
91
|
FolderId: domain.id,
|
|
@@ -95,18 +95,18 @@ class PushPullService {
|
|
|
95
95
|
}));
|
|
96
96
|
})
|
|
97
97
|
.catch((error) => {
|
|
98
|
-
this.adaptable.logger.error(
|
|
98
|
+
this.adaptable.logger.error('Failed to retrieve folders and pages from ipushpull.', error);
|
|
99
99
|
throw error.message;
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
loadPage(folderIPP, pageIPP) {
|
|
103
103
|
if (!this.ppInstance) {
|
|
104
|
-
return Promise.reject('No ipushpull instance found
|
|
104
|
+
return Promise.reject('No ipushpull instance found.');
|
|
105
105
|
}
|
|
106
106
|
return new Promise((resolve, reject) => {
|
|
107
107
|
const page = new this.ppInstance.Page(pageIPP, folderIPP);
|
|
108
108
|
page.on(page.EVENT_NEW_CONTENT, () => {
|
|
109
|
-
this.adaptable.logger.info(`Page
|
|
109
|
+
this.adaptable.logger.info(`Page ready: "${pageIPP}".`);
|
|
110
110
|
this.pages.set(pageIPP, page);
|
|
111
111
|
resolve(page);
|
|
112
112
|
// we return true so it removes the listener for new content.
|
|
@@ -120,22 +120,22 @@ class PushPullService {
|
|
|
120
120
|
if (pageIPP) {
|
|
121
121
|
pageIPP.destroy();
|
|
122
122
|
this.pages.delete(page);
|
|
123
|
-
this.adaptable.logger.info(`Page
|
|
123
|
+
this.adaptable.logger.info(`Page unloaded: "${page}".`);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
addNewPage(folderId, page) {
|
|
127
127
|
if (!this.ppInstance) {
|
|
128
|
-
return Promise.reject('No ipushpull instance found
|
|
128
|
+
return Promise.reject('No ipushpull instance found.');
|
|
129
129
|
}
|
|
130
130
|
return this.ppInstance.Page.create(folderId, page)
|
|
131
131
|
.then((createdPage) => {
|
|
132
|
-
let message = page
|
|
133
|
-
this.adaptable.api.alertApi.showAlertSuccess('ipushpull
|
|
132
|
+
let message = `Page "${page}" created successfully.`;
|
|
133
|
+
this.adaptable.api.alertApi.showAlertSuccess('ipushpull', message);
|
|
134
134
|
this.adaptable.api.internalApi.hidePopupScreen();
|
|
135
135
|
return this.getIPPApi().retrieveIPushPullDomainsFromIPushPull();
|
|
136
136
|
})
|
|
137
137
|
.catch((err) => {
|
|
138
|
-
this.adaptable.logger.error(
|
|
138
|
+
this.adaptable.logger.error(`Failed to create page "${page}": ${err}`);
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
pushData(page, data) {
|
|
@@ -202,10 +202,10 @@ class PushPullService {
|
|
|
202
202
|
pageIPP.Content.canDoDelta = false;
|
|
203
203
|
pageIPP.Content.update(newData, true);
|
|
204
204
|
pageIPP.push().then(() => {
|
|
205
|
-
this.adaptable.logger.success(`Data pushed for ipushpull page
|
|
205
|
+
this.adaptable.logger.success(`Data pushed for ipushpull page "${page}".`);
|
|
206
206
|
resolve();
|
|
207
207
|
}, (err) => {
|
|
208
|
-
this.adaptable.logger.
|
|
208
|
+
this.adaptable.logger.error(`Failed to push data for ipushpull page "${page}".`);
|
|
209
209
|
reject();
|
|
210
210
|
});
|
|
211
211
|
});
|
|
@@ -29,7 +29,7 @@ const IPushPullAddPageComponent = (props) => {
|
|
|
29
29
|
const { hidePopup } = (0, PopupContext_1.usePopupContext)();
|
|
30
30
|
const onSubmit = () => {
|
|
31
31
|
if (ArrayExtensions_1.default.ContainsItem(state.AvailablePages, state.Page)) {
|
|
32
|
-
setState({ ...state, ErrorMessage: 'A page with that name already exists in
|
|
32
|
+
setState({ ...state, ErrorMessage: 'A page with that name already exists in this folder.' });
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
35
|
props.onAddPage(state.Folder, state.Page);
|
package/src/index.js
CHANGED
|
@@ -23,11 +23,7 @@ const { version, name } = package_json_1.default;
|
|
|
23
23
|
const { version: coreVersion } = package_json_2.default;
|
|
24
24
|
const suffix = name.endsWith('-cjs') ? '-cjs' : '';
|
|
25
25
|
if (version !== coreVersion) {
|
|
26
|
-
console.warn(`
|
|
27
|
-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
28
|
-
!!!!!!! "@adaptabletools/adaptable-plugin-ipushpull${suffix}" (v @${version}) and "@adaptabletools/adaptable${suffix}" (v @${coreVersion}) have different versions - they should have the exact same version.
|
|
29
|
-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
30
|
-
`);
|
|
26
|
+
console.warn(`Version mismatch: "@adaptabletools/adaptable-plugin-ipushpull${suffix}" (v${version}) and "@adaptabletools/adaptable${suffix}" (v${coreVersion}) have different versions. They should be the exact same version.`);
|
|
31
27
|
}
|
|
32
28
|
const getApiKey = () => {
|
|
33
29
|
let key = env_1.default.IPUSHPULL_API_KEY; // need to make sure that is always there
|