@adaptabletools/adaptable-plugin-ipushpull 23.0.4-canary.0 → 23.0.5-canary.0

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": "23.0.4-canary.0",
3
+ "version": "23.0.5-canary.0",
4
4
  "description": "",
5
5
  "homepage": "http://www.adaptabletools.com/",
6
6
  "author": {
@@ -53,9 +53,7 @@ export class IPushPullApiImpl extends ApiBase {
53
53
  return;
54
54
  }
55
55
  this.getIPPService().unloadPage(currentLiveReport.Page);
56
- // clear the live report
57
56
  this.dispatchAction(IPushPullRedux.IPushPullLiveReportClear());
58
- // fire the Live Report event for Export Stopped
59
57
  this.getExportApi().internalApi.publishLiveLiveDataChangedEvent('ipushpull', 'LiveDataStopped', currentLiveReport);
60
58
  }
61
59
  isIPushPullReportLive(iPushPullReport) {
@@ -16,8 +16,6 @@ export class PushPullModule extends AdaptableModuleBase {
16
16
  setTimeout(() => {
17
17
  this.throttledRecomputeAndSendLiveDataEvent = throttle(() => this.sendNewLiveData(), this.getThrottleTimeFromState());
18
18
  }, 1000);
19
- // if a piece of data has updated then update any live reports except cell or row selected where the data change is relevant
20
- // currently we DONT send deltas - we simply send everything to ipushpull every time a relevant change happens
21
19
  this.api.internalApi
22
20
  .getDataService()
23
21
  .on('CellDataChanged', (cellDataChangedInfo) => {
@@ -32,15 +30,12 @@ export class PushPullModule extends AdaptableModuleBase {
32
30
  }
33
31
  }
34
32
  });
35
- // if the grid has refreshed then update all live reports
36
33
  this.adaptable._on('GridRefreshed', () => {
37
34
  if (this.getIPPApi().isIPushPullLiveDataRunning()) {
38
35
  this.throttledRecomputeAndSendLiveDataEvent();
39
36
  }
40
37
  });
41
- // if the grid filters have changed then update any live reports except cell or row selected
42
38
  this.adaptable._on('AdapTableFiltersApplied', () => {
43
- // Rerun all reports except selected cells / rows when filter changes
44
39
  if (this.getIPPApi().isIPushPullLiveDataRunning()) {
45
40
  let currentLiveIPushPullReport = this.getIPPApi().getCurrentLiveIPushPullReport();
46
41
  if (currentLiveIPushPullReport &&
@@ -49,7 +44,6 @@ export class PushPullModule extends AdaptableModuleBase {
49
44
  }
50
45
  }
51
46
  });
52
- // if grid selection has changed and the ipushpull Live report is 'Selected Cells' or 'Selected Rows' then send updated data
53
47
  this.api.eventApi.on('CellSelectionChanged', () => {
54
48
  if (this.getIPPApi().isIPushPullLiveDataRunning()) {
55
49
  let currentLiveIPushPullReport = this.getIPPApi().getCurrentLiveIPushPullReport();
@@ -74,7 +68,6 @@ export class PushPullModule extends AdaptableModuleBase {
74
68
  return 'Full';
75
69
  }
76
70
  setModuleEntitlement() {
77
- // TODO
78
71
  if (!this.api.pluginsApi.getipushpullPluginApi().isIPushPullAvailable()) {
79
72
  this.AccessLevel = 'Hidden';
80
73
  }
@@ -103,7 +96,6 @@ export class PushPullModule extends AdaptableModuleBase {
103
96
  return this.ippService;
104
97
  }
105
98
  sendNewLiveData() {
106
- // We wait for the last sendNewLiveData to finish
107
99
  if (this.isSendingData === true) {
108
100
  this.throttledRecomputeAndSendLiveDataEvent();
109
101
  return;
@@ -122,14 +114,14 @@ export class PushPullModule extends AdaptableModuleBase {
122
114
  if (currentData === this.lastData) {
123
115
  this.adaptable.logger.warn(EQUAL_DATA_ERR);
124
116
  this.isSendingData = false;
125
- throw new Error(EQUAL_DATA_ERR); // Using throw to exit the promise chain
117
+ throw new Error(EQUAL_DATA_ERR);
126
118
  }
127
119
  return { reportDataAsArray, currentData };
128
120
  })
129
121
  .then(({ reportDataAsArray, currentData }) => {
130
122
  return this.getIPPService()
131
123
  .pushData(currentLiveIPushPullReport.Page, reportDataAsArray)
132
- .then(() => currentData); // Pass currentData to the next then
124
+ .then(() => currentData);
133
125
  })
134
126
  .then((currentData) => {
135
127
  this.lastData = currentData;
@@ -138,7 +130,6 @@ export class PushPullModule extends AdaptableModuleBase {
138
130
  return this.api.exportApi.internalApi.publishLiveLiveDataChangedEvent('ipushpull', 'LiveDataUpdated', currentLiveIPushPullReport);
139
131
  })
140
132
  .catch((reason) => {
141
- // Skip logging for expected cases
142
133
  if (reason?.message !== EQUAL_DATA_ERR) {
143
134
  this.isSendingData = false;
144
135
  this.adaptable.logger.warn(`Failed to send data to ipushpull for report "${currentLiveIPushPullReport.ReportName}".`, reason);
@@ -90,9 +90,7 @@ export const iPushPullInitialState = {
90
90
  IPushPullCurrentPage: EMPTY_STRING,
91
91
  IPushPullCurrentAvailablePages: EMPTY_ARRAY,
92
92
  };
93
- export const IPushPullReducer = (
94
- // initial state is handled in the plugin rootReducer
95
- state, action) => {
93
+ export const IPushPullReducer = (state, action) => {
96
94
  switch (action.type) {
97
95
  case IPUSHPULL_SET_AVAILABLE_ON:
98
96
  return Object.assign({}, state, { IsIPushPullAvailable: true });
@@ -138,7 +136,6 @@ state, action) => {
138
136
  return Object.assign({}, state, { CurrentLiveIPushPullReport: actionType.iPushPullReport });
139
137
  }
140
138
  case IPUSHPULL_LIVE_REPORT_CLEAR: {
141
- // const atctionType = action as IPushPullLiveReportSetAction;
142
139
  return Object.assign({}, state, { CurrentLiveIPushPullReport: undefined });
143
140
  }
144
141
  case IPUSHPULL_SET_CURRENT_REPORTNAME: {
@@ -54,10 +54,6 @@ export class IPushPullService {
54
54
  getIPPApi() {
55
55
  return this.adaptable.api.pluginsApi.getipushpullPluginApi();
56
56
  }
57
- /**
58
- * Derives the IPushPull theme from Adaptable's current theme at call-time,
59
- * respecting the 'os' theme by checking `prefers-color-scheme`.
60
- */
61
57
  deriveDefaultTheme() {
62
58
  const themeName = this.adaptable.api.themeApi.getCurrentTheme();
63
59
  if (themeName === 'os') {
@@ -73,11 +69,6 @@ export class IPushPullService {
73
69
  }
74
70
  return 'lightTheme';
75
71
  }
76
- /**
77
- * Returns the resolved IPushPull theme, honouring the `cellStyles` option.
78
- * If `cellStyles` is a string, it's used directly.
79
- * If not set, the theme is derived from Adaptable's current theme.
80
- */
81
72
  getResolvedTheme() {
82
73
  const defaultCellStyles = this.deriveDefaultTheme();
83
74
  if (!this.cellStylesOption) {
@@ -42,9 +42,6 @@ const IPushPullLoginComponent = (props) => {
42
42
  };
43
43
  function mapStateToProps(state) {
44
44
  return {
45
- // pushpullLogin: state.IPushPull ? state.IPushPull!.Username : undefined,
46
- // pushpullPassword: state.IPushPull ? state.IPushPull!.Password : undefined,
47
- // pushpullLoginErrorMessage: state.IPushPull.IPushPullLoginErrorMessage,
48
45
  pushpullLoginErrorMessage: state.Internal.IPushPullLoginErrorMessage,
49
46
  };
50
47
  }
@@ -43,7 +43,6 @@ const IPushPullViewPanelComponent = (props) => {
43
43
  const onIPushPullStartLiveData = () => {
44
44
  props.onIPushPullStartLiveData(createIPushPullReportFromState());
45
45
  };
46
- // perhaps this should be props and in real state?
47
46
  const createIPushPullReportFromState = () => {
48
47
  return {
49
48
  ReportName: props.CurrentIPushPullReportName,
package/src/index.js CHANGED
@@ -71,14 +71,11 @@ class IPushPullPlugin extends AdaptablePlugin {
71
71
  this.registerProperty('api', () => this.iPushPullApi);
72
72
  this.registerProperty('service', () => this.PushPullService);
73
73
  }
74
- // FIXME AFL improve typing
75
74
  rootReducer = (rootReducer) => {
76
75
  return {
77
76
  Internal: (state, action) => {
78
77
  let augmentedState = rootReducer.Internal(state, action);
79
78
  if (!state) {
80
- // required for store initialization
81
- // (idiomatic way of default parameter value in reducer is not feasible because the passed argument is already initialized by the System reducer)
82
79
  augmentedState = Object.assign({}, augmentedState, iPushPullInitialState);
83
80
  }
84
81
  return IPushPullReducer(augmentedState, action);
@@ -43,7 +43,6 @@ export class IPushPullClient {
43
43
  if (!this.tokens?.refresh_token) {
44
44
  throw new Error('No refresh token available. Please login first.');
45
45
  }
46
- // Deduplicate concurrent refresh attempts
47
46
  if (this.refreshPromise) {
48
47
  return this.refreshPromise;
49
48
  }
@@ -157,10 +156,6 @@ export class IPushPullClient {
157
156
  return response;
158
157
  }
159
158
  }
160
- /**
161
- * Converts per-cell data (array of rows, each cell being { value, formatted_value, style })
162
- * into the official ipushpull page content format with deduplicated styles.
163
- */
164
159
  export function buildPageContentPayload(cellData) {
165
160
  const values = [];
166
161
  const formattedValues = [];