@adaptabletools/adaptable-plugin-ipushpull 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-plugin-ipushpull",
3
- "version": "22.0.0-canary.6",
3
+ "version": "22.0.0-canary.7",
4
4
  "description": "",
5
5
  "homepage": "http://www.adaptabletools.com/",
6
6
  "author": {
@@ -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('All live report data sent');
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('Failed to send data to ipushpull for [' +
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 Failed';
148
+ let errorMessage = 'Export failed';
151
149
  if (reason) {
152
150
  errorMessage += ': ' + reason;
153
151
  }
154
- errorMessage += '. This live export has been cancelled.';
155
- this.api.alertApi.showAlertError('ipushpull Export Error', errorMessage);
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 [${iPushPullReport.ReportName}]`, error);
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 Folder/Page info');
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("Couldn't get Domain/Pages from ipushpull : ", 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 Ready : ${pageIPP}`);
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 Unloaded : ${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 + "' successfully created.";
129
- this.adaptable.api.alertApi.showAlertSuccess('ipushpull Page', message);
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("Couldn't create Page: '" + page + "'. Reason: " + err);
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 : ${page}`);
201
+ this.adaptable.logger.success(`Data pushed for ipushpull page "${page}".`);
202
202
  resolve();
203
203
  }, (err) => {
204
- this.adaptable.logger.info(`Error pushing data for ipushpull page : ${page}`);
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 the folder' });
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