@adaptabletools/adaptable-plugin-ipushpull 22.0.0-canary.6 → 22.0.0-canary.8
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
|
@@ -135,7 +135,7 @@ export class PushPullModule extends AdaptableModuleBase {
|
|
|
135
135
|
})
|
|
136
136
|
.then((currentData) => {
|
|
137
137
|
this.lastData = currentData;
|
|
138
|
-
this.adaptable.logger.success('
|
|
138
|
+
this.adaptable.logger.success('Live report data sent successfully.');
|
|
139
139
|
this.isSendingData = false;
|
|
140
140
|
return this.api.exportApi.internalApi.publishLiveLiveDataChangedEvent('ipushpull', 'LiveDataUpdated', currentLiveIPushPullReport);
|
|
141
141
|
})
|
|
@@ -143,16 +143,14 @@ export class PushPullModule extends AdaptableModuleBase {
|
|
|
143
143
|
// Skip logging for expected cases
|
|
144
144
|
if (reason?.message !== EQUAL_DATA_ERR) {
|
|
145
145
|
this.isSendingData = false;
|
|
146
|
-
this.adaptable.logger.warn(
|
|
147
|
-
currentLiveIPushPullReport.ReportName +
|
|
148
|
-
']', reason);
|
|
146
|
+
this.adaptable.logger.warn(`Failed to send data to ipushpull for report "${currentLiveIPushPullReport.ReportName}".`, reason);
|
|
149
147
|
this.stopLiveData();
|
|
150
|
-
let errorMessage = 'Export
|
|
148
|
+
let errorMessage = 'Export failed';
|
|
151
149
|
if (reason) {
|
|
152
150
|
errorMessage += ': ' + reason;
|
|
153
151
|
}
|
|
154
|
-
errorMessage += '.
|
|
155
|
-
this.api.alertApi.showAlertError('ipushpull Export
|
|
152
|
+
errorMessage += '. The live export has been cancelled.';
|
|
153
|
+
this.api.alertApi.showAlertError('ipushpull Export', errorMessage);
|
|
156
154
|
}
|
|
157
155
|
});
|
|
158
156
|
}
|
|
@@ -170,7 +168,7 @@ export class PushPullModule extends AdaptableModuleBase {
|
|
|
170
168
|
}
|
|
171
169
|
})
|
|
172
170
|
.catch((error) => {
|
|
173
|
-
this.adaptable.logger.warn(`Failed to send snapshot for report
|
|
171
|
+
this.adaptable.logger.warn(`Failed to send snapshot for report "${iPushPullReport.ReportName}".`, error);
|
|
174
172
|
});
|
|
175
173
|
}
|
|
176
174
|
startLiveData(iPushPullReport) {
|
|
@@ -63,7 +63,7 @@ export class PushPullService {
|
|
|
63
63
|
.login(login, password)
|
|
64
64
|
.then((result) => {
|
|
65
65
|
this.ppInstance.__status = ServiceStatus.Connected;
|
|
66
|
-
this.adaptable.logger.success('Logged in to ipushpull');
|
|
66
|
+
this.adaptable.logger.success('Logged in to ipushpull.');
|
|
67
67
|
return result;
|
|
68
68
|
})
|
|
69
69
|
.catch((err) => {
|
|
@@ -76,12 +76,12 @@ export class PushPullService {
|
|
|
76
76
|
// Retrieves domain pages from ipushpull
|
|
77
77
|
getDomainPages() {
|
|
78
78
|
if (!this.ppInstance) {
|
|
79
|
-
return Promise.reject('No ipushpull instance found
|
|
79
|
+
return Promise.reject('No ipushpull instance found.');
|
|
80
80
|
}
|
|
81
81
|
return this.ppInstance.api
|
|
82
82
|
.getDomainsAndPages(this.ppInstance.config.api_key)
|
|
83
83
|
.then((response) => {
|
|
84
|
-
this.adaptable.logger.success('Retrieved ipushpull
|
|
84
|
+
this.adaptable.logger.success('Retrieved ipushpull folder and page info.');
|
|
85
85
|
return response.data.domains.map((domain) => ({
|
|
86
86
|
Name: domain.name,
|
|
87
87
|
FolderId: domain.id,
|
|
@@ -91,18 +91,18 @@ export class PushPullService {
|
|
|
91
91
|
}));
|
|
92
92
|
})
|
|
93
93
|
.catch((error) => {
|
|
94
|
-
this.adaptable.logger.error(
|
|
94
|
+
this.adaptable.logger.error('Failed to retrieve folders and pages from ipushpull.', error);
|
|
95
95
|
throw error.message;
|
|
96
96
|
});
|
|
97
97
|
}
|
|
98
98
|
loadPage(folderIPP, pageIPP) {
|
|
99
99
|
if (!this.ppInstance) {
|
|
100
|
-
return Promise.reject('No ipushpull instance found
|
|
100
|
+
return Promise.reject('No ipushpull instance found.');
|
|
101
101
|
}
|
|
102
102
|
return new Promise((resolve, reject) => {
|
|
103
103
|
const page = new this.ppInstance.Page(pageIPP, folderIPP);
|
|
104
104
|
page.on(page.EVENT_NEW_CONTENT, () => {
|
|
105
|
-
this.adaptable.logger.info(`Page
|
|
105
|
+
this.adaptable.logger.info(`Page ready: "${pageIPP}".`);
|
|
106
106
|
this.pages.set(pageIPP, page);
|
|
107
107
|
resolve(page);
|
|
108
108
|
// we return true so it removes the listener for new content.
|
|
@@ -116,22 +116,22 @@ export class PushPullService {
|
|
|
116
116
|
if (pageIPP) {
|
|
117
117
|
pageIPP.destroy();
|
|
118
118
|
this.pages.delete(page);
|
|
119
|
-
this.adaptable.logger.info(`Page
|
|
119
|
+
this.adaptable.logger.info(`Page unloaded: "${page}".`);
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
addNewPage(folderId, page) {
|
|
123
123
|
if (!this.ppInstance) {
|
|
124
|
-
return Promise.reject('No ipushpull instance found
|
|
124
|
+
return Promise.reject('No ipushpull instance found.');
|
|
125
125
|
}
|
|
126
126
|
return this.ppInstance.Page.create(folderId, page)
|
|
127
127
|
.then((createdPage) => {
|
|
128
|
-
let message = page
|
|
129
|
-
this.adaptable.api.alertApi.showAlertSuccess('ipushpull
|
|
128
|
+
let message = `Page "${page}" created successfully.`;
|
|
129
|
+
this.adaptable.api.alertApi.showAlertSuccess('ipushpull', message);
|
|
130
130
|
this.adaptable.api.internalApi.hidePopupScreen();
|
|
131
131
|
return this.getIPPApi().retrieveIPushPullDomainsFromIPushPull();
|
|
132
132
|
})
|
|
133
133
|
.catch((err) => {
|
|
134
|
-
this.adaptable.logger.error(
|
|
134
|
+
this.adaptable.logger.error(`Failed to create page "${page}": ${err}`);
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
pushData(page, data) {
|
|
@@ -198,10 +198,10 @@ export class PushPullService {
|
|
|
198
198
|
pageIPP.Content.canDoDelta = false;
|
|
199
199
|
pageIPP.Content.update(newData, true);
|
|
200
200
|
pageIPP.push().then(() => {
|
|
201
|
-
this.adaptable.logger.success(`Data pushed for ipushpull page
|
|
201
|
+
this.adaptable.logger.success(`Data pushed for ipushpull page "${page}".`);
|
|
202
202
|
resolve();
|
|
203
203
|
}, (err) => {
|
|
204
|
-
this.adaptable.logger.
|
|
204
|
+
this.adaptable.logger.error(`Failed to push data for ipushpull page "${page}".`);
|
|
205
205
|
reject();
|
|
206
206
|
});
|
|
207
207
|
});
|
|
@@ -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({ ...state, ErrorMessage: 'A page with that name already exists in
|
|
28
|
+
setState({ ...state, ErrorMessage: 'A page with that name already exists in this folder.' });
|
|
29
29
|
}
|
|
30
30
|
else {
|
|
31
31
|
props.onAddPage(state.Folder, state.Page);
|
package/src/index.js
CHANGED
|
@@ -20,11 +20,7 @@ const { version, name } = packageJson;
|
|
|
20
20
|
const { version: coreVersion } = adaptableCorePackageJson;
|
|
21
21
|
const suffix = name.endsWith('-cjs') ? '-cjs' : '';
|
|
22
22
|
if (version !== coreVersion) {
|
|
23
|
-
console.warn(`
|
|
24
|
-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
25
|
-
!!!!!!! "@adaptabletools/adaptable-plugin-ipushpull${suffix}" (v @${version}) and "@adaptabletools/adaptable${suffix}" (v @${coreVersion}) have different versions - they should have the exact same version.
|
|
26
|
-
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
27
|
-
`);
|
|
23
|
+
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.`);
|
|
28
24
|
}
|
|
29
25
|
const getApiKey = () => {
|
|
30
26
|
let key = env.IPUSHPULL_API_KEY; // need to make sure that is always there
|