@adaptabletools/adaptable-plugin-ipushpull 17.0.6 → 18.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/README.md ADDED
@@ -0,0 +1,113 @@
1
+ # AdapTable ipushpull Plugin Read Me
2
+
3
+ The ipushpull plugin connects AdapTable with [ipushpull](https://www.ipushpull.com) the market-leading collaborative software.
4
+
5
+ It allows user to send Reports - either System Reports shipped by AdapTable or those created via the AdapTable Export function - to ipushpull and from their to Symphony and other destinations.
6
+
7
+ ## Version 7
8
+ Version 7 of AdapTable made significant changes to how ipushpull is set up, primarily by using this dedicated plugin.
9
+
10
+ As a consequence, the ipushpull section from Predefined Config was removed and no ipushpull information is provided by users that way.
11
+
12
+ Similarly all ipushpull state is now transient and **not persisted** when the application ends.
13
+
14
+ Instead we now use the `ipushpullPluginOptions` object in a similar way to other plugins.
15
+
16
+ The actual ipushpull functionality is unchanged, and the information required to be supplied by the user is identical but it now done through Options and not Predefined Config - isolating it in this way enables us to add more ipushpull-related functionality in a much quicker and safer way, isolated from the rest of the application.
17
+
18
+ ## ipushpull Options
19
+
20
+ The ipushpull plugin contains an `ipushpullPluginOptions` object which allows users to set up their instance.
21
+
22
+ It contains credential details, useful properties (e.g. `throttleTime`, `autoLogin` etc.) and the ipupshpull config object.
23
+
24
+ ## ipushpull Api
25
+
26
+ The `ipushpullApi` is available for full runtime programmatic access to ipushpull objects and methods.
27
+
28
+ > Note: because ipushpull is a plugin, you can get hold of this object through the `getPluginApi` method of pluginsApi.
29
+
30
+ ## ipushpull Setup Example
31
+
32
+ ```ts
33
+
34
+ // set up AdaptableOptions
35
+ const adaptableOptions: AdaptableOptions = {
36
+ ******
37
+ plugins: [
38
+ ipp({
39
+ username: process.env.IPUSHPULL_USERNAME,
40
+ password: process.env.IPUSHPULL_PASSWORD,
41
+ throttleTime: 5000,
42
+ includeSystemReports: true,
43
+ ippConfig: {
44
+ api_secret: process.env.IPUSHPULL_API_KEY,
45
+ api_key: process.env.IPUSHPULL_API_KEY,
46
+ api_url: 'https://www.ipushpull.com/api/1.0',
47
+ ws_url: 'https://www.ipushpull.com',
48
+ web_url: 'https://www.ipushpull.com',
49
+ docs_url: 'https://docs.ipushpull.com',
50
+ storage_prefix: 'ipp_local',
51
+ transport: 'polling',
52
+ hsts: false, // strict cors policy
53
+ },
54
+ }),
55
+ ],
56
+ ******
57
+ };
58
+
59
+ // Instantitate AdapTable and get the main Api object
60
+ adaptableApi = await Adaptable.init(adaptableOptions);
61
+
62
+ // use the plugins api to get the IPushPullApi object
63
+ const ipushpullApi: IPushPullApi = adaptableApi.pluginsApi.getPluginApi(
64
+ 'ipushpull'
65
+ );
66
+
67
+ ```
68
+
69
+ ## ipushpull Toolbar
70
+
71
+ The ipushpull plugin includes a dedicated ipushpull Toolbar - the main way to interact with ipushpull inside AdapTable.
72
+
73
+ At start-up this simply displays a login button that, when clicked, opens a login screen asking for username and password.
74
+
75
+ > There is a `AutoLogin` property option which will automatically log the user in to ipushpull (if the correct credentials have been provided in ipushpull Plugin Options).
76
+
77
+ Once the user is successfully logged in, the Toolbar will contain a number of elements (primarily dropdowns and buttons). These include:
78
+
79
+ ### Dropdowns
80
+
81
+ 1. **Reports Dropdown** - this shows all the Reports that have been created via the Export function.
82
+ > This dropdown will also include any System Reports that AdapTable ships by default (e.g. Selected Cells); however these can be removed by setting `IncludeSystemReports` to false
83
+
84
+ 2. **Folders Dropdown** - lists all the folders (aka 'Domains') to which the user has access in ipushpull
85
+
86
+ 3. **Pages Dropdown** - lists all the ipushpull pages in the currently selected Folder (in the Folders Dropdown).
87
+
88
+ ### Buttons
89
+
90
+ 1. **Send Snapshot** - this will run the current report and send the data to the currently selected ipushpull page. This is a **one-off** action.
91
+
92
+ 2. **Run Live Report** - this will run the current report and send the data to the currently selected ipushpull page. It will also send live updates so as the data in the grid ticks and the report updaes, ipushpull will be updated in real time.
93
+ > The button displays a 'Play' icon; however, when a Live Report is running this changes to a 'Pause' icon.
94
+
95
+ 3. **New ipushpull Page** - alllows the user to create a new ipushpull page in the folder of his choice.
96
+
97
+ 4. **Create Schedule** - enables an ipushpull report to be sent at a schedule of the user's choice
98
+ >This leverages AdapTable Scheduling which enables actions to be performed either at a one off date and time or to be repeated daily at a scheduled time.
99
+
100
+ 5. **Logout Button** - logs the User out of ipushpull (and displays the login button).
101
+
102
+
103
+ ## Help
104
+
105
+ Developers can learn how to access AdapTable programmatically at [AdapTable Documentation](https://docs.adaptabletools.com).
106
+
107
+ ## More Information
108
+
109
+ General information about Adaptable Tools is available at our [Website](http://www.adaptabletools.com)
110
+
111
+ ## Support
112
+
113
+ For all support enquiries please email [`support@adaptabletools.com`](mailto:support@adaptabletools.com) or [raise a Support Ticket](https://adaptabletools.zendesk.com/hc/en-us/requests/new).
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@adaptabletools/adaptable-plugin-ipushpull",
3
- "version": "17.0.6",
3
+ "version": "18.0.0-canary.1",
4
4
  "description": "",
5
5
  "homepage": "http://www.adaptabletools.com/",
6
6
  "author": {
7
7
  "name": "Jonny Wolfson",
8
8
  "email": "jonny.wolfson@adaptabletools.com"
9
9
  },
10
- "main": "src/index.js",
11
10
  "typings": "src/index.d.ts",
12
11
  "dependencies": {
13
12
  "ipushpull-js": "^2.25.0",
@@ -19,6 +18,8 @@
19
18
  "redux": "4.0.5",
20
19
  "styled-components": "^4.4.1",
21
20
  "tslib": "^2.3.0",
22
- "@adaptabletools/adaptable": "17.0.6"
23
- }
21
+ "@adaptabletools/adaptable": "18.0.0-canary.1"
22
+ },
23
+ "type": "module",
24
+ "module": "src/index.js"
24
25
  }
@@ -1,13 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IPushPullApiImpl = void 0;
4
- const tslib_1 = require("tslib");
5
- const ApiBase_1 = require("@adaptabletools/adaptable/src/Api/Implementation/ApiBase");
6
- const ModuleConstants = tslib_1.__importStar(require("@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants"));
7
- const IPushPullRedux = tslib_1.__importStar(require("./Redux/ActionReducers/IPushPullRedux"));
8
- const ArrayExtensions_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/Utilities/Extensions/ArrayExtensions"));
9
- const Helper_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/Utilities/Helpers/Helper"));
10
- class IPushPullApiImpl extends ApiBase_1.ApiBase {
1
+ import { ApiBase } from '@adaptabletools/adaptable/src/Api/Implementation/ApiBase';
2
+ import * as ModuleConstants from '@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants';
3
+ import * as IPushPullRedux from './Redux/ActionReducers/IPushPullRedux';
4
+ import ArrayExtensions from '@adaptabletools/adaptable/src/Utilities/Extensions/ArrayExtensions';
5
+ import Helper from '@adaptabletools/adaptable/src/Utilities/Helpers/Helper';
6
+ export class IPushPullApiImpl extends ApiBase {
11
7
  constructor(adaptable, options) {
12
8
  super(adaptable);
13
9
  this.ippService = null;
@@ -80,7 +76,7 @@ class IPushPullApiImpl extends ApiBase_1.ApiBase {
80
76
  getPagesForIPushPullDomain(folderName) {
81
77
  let returnArray = [];
82
78
  let iPushPullDomains = this.getIPushPullDomains();
83
- if (ArrayExtensions_1.default.IsNotNullOrEmpty(iPushPullDomains)) {
79
+ if (ArrayExtensions.IsNotNullOrEmpty(iPushPullDomains)) {
84
80
  let iPushPullDomain = iPushPullDomains.find((f) => f.Name == folderName);
85
81
  if (iPushPullDomain) {
86
82
  returnArray = iPushPullDomain.Pages;
@@ -132,7 +128,7 @@ class IPushPullApiImpl extends ApiBase_1.ApiBase {
132
128
  this.adaptable.ReportService.PublishLiveLiveDataChangedEvent('ipushpull', 'Disconnected');
133
129
  }
134
130
  isIPushPullLiveDataRunning() {
135
- return Helper_1.default.objectExists(this.getCurrentLiveIPushPullReport());
131
+ return Helper.objectExists(this.getCurrentLiveIPushPullReport());
136
132
  }
137
133
  getIPPService() {
138
134
  if (!this.ippService) {
@@ -169,4 +165,3 @@ class IPushPullApiImpl extends ApiBase_1.ApiBase {
169
165
  this.dispatchAction(IPushPullRedux.IPushPullLiveReportClear());
170
166
  }
171
167
  }
172
- exports.IPushPullApiImpl = IPushPullApiImpl;
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,13 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PushPullModule = void 0;
4
- const tslib_1 = require("tslib");
5
- const AdaptableModuleBase_1 = require("@adaptabletools/adaptable/src/Strategy/AdaptableModuleBase");
6
- const ModuleConstants = tslib_1.__importStar(require("@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants"));
7
- const throttle_1 = tslib_1.__importDefault(require("lodash/throttle"));
8
- const GeneralConstants_1 = require("@adaptabletools/adaptable/src/Utilities/Constants/GeneralConstants");
1
+ import { AdaptableModuleBase } from '@adaptabletools/adaptable/src/Strategy/AdaptableModuleBase';
2
+ import * as ModuleConstants from '@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants';
3
+ import throttle from 'lodash/throttle';
4
+ import { SELECTED_CELLS_REPORT, DEFAULT_LIVE_REPORT_THROTTLE_TIME, SELECTED_ROWS_REPORT, } from '@adaptabletools/adaptable/src/Utilities/Constants/GeneralConstants';
9
5
  const EQUAL_DATA_ERR = 'equal data, so not sending';
10
- class PushPullModule extends AdaptableModuleBase_1.AdaptableModuleBase {
6
+ export class PushPullModule extends AdaptableModuleBase {
11
7
  constructor(api) {
12
8
  super(ModuleConstants.IPushPullModuleId, 'ipushpull', 'download', null, 'Send data from AdapTable to ipushpull', api);
13
9
  this.isSendingData = false;
@@ -15,7 +11,7 @@ class PushPullModule extends AdaptableModuleBase_1.AdaptableModuleBase {
15
11
  this.adaptable = api.internalApi.getAdaptableInstance();
16
12
  this.api.eventApi.on('AdaptableReady', () => {
17
13
  setTimeout(() => {
18
- this.throttledRecomputeAndSendLiveDataEvent = (0, throttle_1.default)(() => this.sendNewLiveData(), this.getThrottleTimeFromState());
14
+ this.throttledRecomputeAndSendLiveDataEvent = throttle(() => this.sendNewLiveData(), this.getThrottleTimeFromState());
19
15
  }, 1000);
20
16
  });
21
17
  // if a piece of data has updated then update any live reports except cell or row selected where the data change is relevant
@@ -28,8 +24,8 @@ class PushPullModule extends AdaptableModuleBase_1.AdaptableModuleBase {
28
24
  if (api.isIPushPullLiveDataRunning()) {
29
25
  let currentLiveIPushPullReport = api.getCurrentLiveIPushPullReport();
30
26
  if (currentLiveIPushPullReport &&
31
- currentLiveIPushPullReport.ReportName !== GeneralConstants_1.SELECTED_CELLS_REPORT &&
32
- currentLiveIPushPullReport.ReportName !== GeneralConstants_1.SELECTED_ROWS_REPORT &&
27
+ currentLiveIPushPullReport.ReportName !== SELECTED_CELLS_REPORT &&
28
+ currentLiveIPushPullReport.ReportName !== SELECTED_ROWS_REPORT &&
33
29
  exportApi.internalApi.isDataChangeInReport(cellDataChangedInfo, this.getCurrentReport())) {
34
30
  this.throttledRecomputeAndSendLiveDataEvent();
35
31
  }
@@ -47,8 +43,8 @@ class PushPullModule extends AdaptableModuleBase_1.AdaptableModuleBase {
47
43
  if (this.getIPPApi().isIPushPullLiveDataRunning()) {
48
44
  let currentLiveIPushPullReport = this.getIPPApi().getCurrentLiveIPushPullReport();
49
45
  if (currentLiveIPushPullReport &&
50
- currentLiveIPushPullReport.ReportName !== GeneralConstants_1.SELECTED_CELLS_REPORT &&
51
- currentLiveIPushPullReport.ReportName !== GeneralConstants_1.SELECTED_ROWS_REPORT) {
46
+ currentLiveIPushPullReport.ReportName !== SELECTED_CELLS_REPORT &&
47
+ currentLiveIPushPullReport.ReportName !== SELECTED_ROWS_REPORT) {
52
48
  this.throttledRecomputeAndSendLiveDataEvent();
53
49
  }
54
50
  }
@@ -58,7 +54,7 @@ class PushPullModule extends AdaptableModuleBase_1.AdaptableModuleBase {
58
54
  if (this.getIPPApi().isIPushPullLiveDataRunning()) {
59
55
  let currentLiveIPushPullReport = this.getIPPApi().getCurrentLiveIPushPullReport();
60
56
  if (currentLiveIPushPullReport &&
61
- currentLiveIPushPullReport.ReportName === GeneralConstants_1.SELECTED_CELLS_REPORT) {
57
+ currentLiveIPushPullReport.ReportName === SELECTED_CELLS_REPORT) {
62
58
  this.throttledRecomputeAndSendLiveDataEvent();
63
59
  }
64
60
  }
@@ -67,7 +63,7 @@ class PushPullModule extends AdaptableModuleBase_1.AdaptableModuleBase {
67
63
  if (this.getIPPApi().isIPushPullLiveDataRunning()) {
68
64
  let currentLiveIPushPullReport = this.getIPPApi().getCurrentLiveIPushPullReport();
69
65
  if (currentLiveIPushPullReport &&
70
- currentLiveIPushPullReport.ReportName === GeneralConstants_1.SELECTED_ROWS_REPORT) {
66
+ currentLiveIPushPullReport.ReportName === SELECTED_ROWS_REPORT) {
71
67
  this.throttledRecomputeAndSendLiveDataEvent();
72
68
  }
73
69
  }
@@ -192,7 +188,6 @@ class PushPullModule extends AdaptableModuleBase_1.AdaptableModuleBase {
192
188
  if (this.getIPPApi().isIPushPullRunning()) {
193
189
  iPushPullThrottleTime = this.getIPPApi().getIPushPullThrottleTime();
194
190
  }
195
- return iPushPullThrottleTime ? iPushPullThrottleTime : GeneralConstants_1.DEFAULT_LIVE_REPORT_THROTTLE_TIME;
191
+ return iPushPullThrottleTime ? iPushPullThrottleTime : DEFAULT_LIVE_REPORT_THROTTLE_TIME;
196
192
  }
197
193
  }
198
- exports.PushPullModule = PushPullModule;
@@ -1,172 +1,148 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IPushPullReducer = exports.iPushPullInitialState = exports.IPushPullSetCurrentAvailablePages = exports.IPushPullSetCurrentPage = exports.IPushPullSetCurrentFolder = exports.IPushPullSetCurrentReportName = exports.IPushPullLiveReportClear = exports.IPushPullLiveReportSet = exports.IPushPullClearDomainsPages = exports.IPushPullSetDomainsPages = exports.SetIPushPullRunningOff = exports.SetIPushPullRunningOn = exports.SetIPushPullAvailableOff = exports.SetIPushPullAvailableOn = exports.IPushPullAddPage = exports.IPushPullSetLoginErrorMessage = exports.IPushPullSetLoginDetails = exports.IPushPullLogout = exports.IPushPullLogin = exports.IPushPullStopLiveData = exports.IPushPullStartLiveData = exports.IPushPullSendSnapshot = exports.IPushPullSetThrottleTime = void 0;
4
- const GeneralConstants_1 = require("@adaptabletools/adaptable/src/Utilities/Constants/GeneralConstants");
5
- const PluginsRedux_1 = require("@adaptabletools/adaptable/src/Redux/ActionsReducers/PluginsRedux");
6
- const IPushPullSetThrottleTime = (throttleTime) => ({
7
- type: PluginsRedux_1.IPUSHPULL_SET_THROTTLE_TIME,
1
+ import { EMPTY_ARRAY, EMPTY_STRING, } from '@adaptabletools/adaptable/src/Utilities/Constants/GeneralConstants';
2
+ import { IPUSHPULL_SET_THROTTLE_TIME, IPUSHPULL_SEND_SNAPSHOT, IPUSHPULL_START_LIVE_DATA, IPUSHPULL_STOP_LIVE_DATA, IPUSHPULL_LOGIN, IPUSHPULL_LOGOUT, IPUSHPULL_SET_LOGIN_DETAILS, IPUSHPULL_SET_LOGIN_ERROR_MESSAGE, IPUSHPULL_ADD_PAGE, IPUSHPULL_SET_AVAILABLE_ON, IPUSHPULL_SET_AVAILABLE_OFF, IPUSHPULL_SET_RUNNING_ON, IPUSHPULL_SET_RUNNING_OFF, IPUSHPULL_DOMAIN_PAGES_SET, IPUSHPULL_DOMAIN_PAGES_CLEAR, IPUSHPULL_LIVE_REPORT_SET, IPUSHPULL_LIVE_REPORT_CLEAR, IPUSHPULL_SET_CURRENT_REPORTNAME, IPUSHPULL_SET_CURRENT_FOLDER, IPUSHPULL_SET_CURRENT_PAGE, IPUSHPULL_SET_CURRENT_AVAILABLE_PAGES, } from '@adaptabletools/adaptable/src/Redux/ActionsReducers/PluginsRedux';
3
+ export const IPushPullSetThrottleTime = (throttleTime) => ({
4
+ type: IPUSHPULL_SET_THROTTLE_TIME,
8
5
  throttleTime,
9
6
  });
10
- exports.IPushPullSetThrottleTime = IPushPullSetThrottleTime;
11
- const IPushPullSendSnapshot = (iPushPullReport) => ({
12
- type: PluginsRedux_1.IPUSHPULL_SEND_SNAPSHOT,
7
+ export const IPushPullSendSnapshot = (iPushPullReport) => ({
8
+ type: IPUSHPULL_SEND_SNAPSHOT,
13
9
  iPushPullReport,
14
10
  });
15
- exports.IPushPullSendSnapshot = IPushPullSendSnapshot;
16
- const IPushPullStartLiveData = (iPushPullReport) => ({
17
- type: PluginsRedux_1.IPUSHPULL_START_LIVE_DATA,
11
+ export const IPushPullStartLiveData = (iPushPullReport) => ({
12
+ type: IPUSHPULL_START_LIVE_DATA,
18
13
  iPushPullReport,
19
14
  });
20
- exports.IPushPullStartLiveData = IPushPullStartLiveData;
21
- const IPushPullStopLiveData = () => ({
22
- type: PluginsRedux_1.IPUSHPULL_STOP_LIVE_DATA,
15
+ export const IPushPullStopLiveData = () => ({
16
+ type: IPUSHPULL_STOP_LIVE_DATA,
23
17
  });
24
- exports.IPushPullStopLiveData = IPushPullStopLiveData;
25
- const IPushPullLogin = (username, password) => ({
26
- type: PluginsRedux_1.IPUSHPULL_LOGIN,
18
+ export const IPushPullLogin = (username, password) => ({
19
+ type: IPUSHPULL_LOGIN,
27
20
  username,
28
21
  password,
29
22
  });
30
- exports.IPushPullLogin = IPushPullLogin;
31
- const IPushPullLogout = () => ({
32
- type: PluginsRedux_1.IPUSHPULL_LOGOUT,
23
+ export const IPushPullLogout = () => ({
24
+ type: IPUSHPULL_LOGOUT,
33
25
  });
34
- exports.IPushPullLogout = IPushPullLogout;
35
- const IPushPullSetLoginDetails = (username, password) => ({
36
- type: PluginsRedux_1.IPUSHPULL_SET_LOGIN_DETAILS,
26
+ export const IPushPullSetLoginDetails = (username, password) => ({
27
+ type: IPUSHPULL_SET_LOGIN_DETAILS,
37
28
  username,
38
29
  password,
39
30
  });
40
- exports.IPushPullSetLoginDetails = IPushPullSetLoginDetails;
41
- const IPushPullSetLoginErrorMessage = (errorMessage) => ({
42
- type: PluginsRedux_1.IPUSHPULL_SET_LOGIN_ERROR_MESSAGE,
31
+ export const IPushPullSetLoginErrorMessage = (errorMessage) => ({
32
+ type: IPUSHPULL_SET_LOGIN_ERROR_MESSAGE,
43
33
  errorMessage,
44
34
  });
45
- exports.IPushPullSetLoginErrorMessage = IPushPullSetLoginErrorMessage;
46
- const IPushPullAddPage = (folder, page) => ({
47
- type: PluginsRedux_1.IPUSHPULL_ADD_PAGE,
35
+ export const IPushPullAddPage = (folder, page) => ({
36
+ type: IPUSHPULL_ADD_PAGE,
48
37
  folder,
49
38
  page,
50
39
  });
51
- exports.IPushPullAddPage = IPushPullAddPage;
52
- const SetIPushPullAvailableOn = () => ({
53
- type: PluginsRedux_1.IPUSHPULL_SET_AVAILABLE_ON,
40
+ export const SetIPushPullAvailableOn = () => ({
41
+ type: IPUSHPULL_SET_AVAILABLE_ON,
54
42
  });
55
- exports.SetIPushPullAvailableOn = SetIPushPullAvailableOn;
56
- const SetIPushPullAvailableOff = () => ({
57
- type: PluginsRedux_1.IPUSHPULL_SET_AVAILABLE_OFF,
43
+ export const SetIPushPullAvailableOff = () => ({
44
+ type: IPUSHPULL_SET_AVAILABLE_OFF,
58
45
  });
59
- exports.SetIPushPullAvailableOff = SetIPushPullAvailableOff;
60
- const SetIPushPullRunningOn = () => ({
61
- type: PluginsRedux_1.IPUSHPULL_SET_RUNNING_ON,
46
+ export const SetIPushPullRunningOn = () => ({
47
+ type: IPUSHPULL_SET_RUNNING_ON,
62
48
  });
63
- exports.SetIPushPullRunningOn = SetIPushPullRunningOn;
64
- const SetIPushPullRunningOff = () => ({
65
- type: PluginsRedux_1.IPUSHPULL_SET_RUNNING_OFF,
49
+ export const SetIPushPullRunningOff = () => ({
50
+ type: IPUSHPULL_SET_RUNNING_OFF,
66
51
  });
67
- exports.SetIPushPullRunningOff = SetIPushPullRunningOff;
68
- const IPushPullSetDomainsPages = (IPushPullDomainsPages) => {
52
+ export const IPushPullSetDomainsPages = (IPushPullDomainsPages) => {
69
53
  return {
70
- type: PluginsRedux_1.IPUSHPULL_DOMAIN_PAGES_SET,
54
+ type: IPUSHPULL_DOMAIN_PAGES_SET,
71
55
  IPushPullDomainsPages,
72
56
  };
73
57
  };
74
- exports.IPushPullSetDomainsPages = IPushPullSetDomainsPages;
75
- const IPushPullClearDomainsPages = () => {
58
+ export const IPushPullClearDomainsPages = () => {
76
59
  return {
77
- type: PluginsRedux_1.IPUSHPULL_DOMAIN_PAGES_CLEAR,
60
+ type: IPUSHPULL_DOMAIN_PAGES_CLEAR,
78
61
  };
79
62
  };
80
- exports.IPushPullClearDomainsPages = IPushPullClearDomainsPages;
81
- const IPushPullLiveReportSet = (iPushPullReport) => ({
82
- type: PluginsRedux_1.IPUSHPULL_LIVE_REPORT_SET,
63
+ export const IPushPullLiveReportSet = (iPushPullReport) => ({
64
+ type: IPUSHPULL_LIVE_REPORT_SET,
83
65
  iPushPullReport,
84
66
  });
85
- exports.IPushPullLiveReportSet = IPushPullLiveReportSet;
86
- const IPushPullLiveReportClear = () => ({
87
- type: PluginsRedux_1.IPUSHPULL_LIVE_REPORT_CLEAR,
67
+ export const IPushPullLiveReportClear = () => ({
68
+ type: IPUSHPULL_LIVE_REPORT_CLEAR,
88
69
  });
89
- exports.IPushPullLiveReportClear = IPushPullLiveReportClear;
90
- const IPushPullSetCurrentReportName = (reportName) => ({ type: PluginsRedux_1.IPUSHPULL_SET_CURRENT_REPORTNAME, reportName });
91
- exports.IPushPullSetCurrentReportName = IPushPullSetCurrentReportName;
92
- const IPushPullSetCurrentFolder = (folder) => ({
93
- type: PluginsRedux_1.IPUSHPULL_SET_CURRENT_FOLDER,
70
+ export const IPushPullSetCurrentReportName = (reportName) => ({ type: IPUSHPULL_SET_CURRENT_REPORTNAME, reportName });
71
+ export const IPushPullSetCurrentFolder = (folder) => ({
72
+ type: IPUSHPULL_SET_CURRENT_FOLDER,
94
73
  folder,
95
74
  });
96
- exports.IPushPullSetCurrentFolder = IPushPullSetCurrentFolder;
97
- const IPushPullSetCurrentPage = (page) => ({
98
- type: PluginsRedux_1.IPUSHPULL_SET_CURRENT_PAGE,
75
+ export const IPushPullSetCurrentPage = (page) => ({
76
+ type: IPUSHPULL_SET_CURRENT_PAGE,
99
77
  page,
100
78
  });
101
- exports.IPushPullSetCurrentPage = IPushPullSetCurrentPage;
102
- const IPushPullSetCurrentAvailablePages = (availablePages) => ({
103
- type: PluginsRedux_1.IPUSHPULL_SET_CURRENT_AVAILABLE_PAGES,
79
+ export const IPushPullSetCurrentAvailablePages = (availablePages) => ({
80
+ type: IPUSHPULL_SET_CURRENT_AVAILABLE_PAGES,
104
81
  availablePages,
105
82
  });
106
- exports.IPushPullSetCurrentAvailablePages = IPushPullSetCurrentAvailablePages;
107
- exports.iPushPullInitialState = {
83
+ export const iPushPullInitialState = {
108
84
  IsIPushPullRunning: false,
109
- IPushPullDomainsPages: GeneralConstants_1.EMPTY_ARRAY,
85
+ IPushPullDomainsPages: EMPTY_ARRAY,
110
86
  CurrentLiveIPushPullReport: undefined,
111
87
  IPushPullLoginErrorMessage: undefined,
112
- IPushPullCurrentReportName: GeneralConstants_1.EMPTY_STRING,
113
- IPushPullCurrentFolder: GeneralConstants_1.EMPTY_STRING,
114
- IPushPullCurrentPage: GeneralConstants_1.EMPTY_STRING,
115
- IPushPullCurrentAvailablePages: GeneralConstants_1.EMPTY_ARRAY,
88
+ IPushPullCurrentReportName: EMPTY_STRING,
89
+ IPushPullCurrentFolder: EMPTY_STRING,
90
+ IPushPullCurrentPage: EMPTY_STRING,
91
+ IPushPullCurrentAvailablePages: EMPTY_ARRAY,
116
92
  };
117
- const IPushPullReducer = (
93
+ export const IPushPullReducer = (
118
94
  // initial state is handled in the plugin rootReducer
119
95
  state, action) => {
120
96
  switch (action.type) {
121
- case PluginsRedux_1.IPUSHPULL_SET_AVAILABLE_ON:
97
+ case IPUSHPULL_SET_AVAILABLE_ON:
122
98
  return Object.assign({}, state, { IsIPushPullAvailable: true });
123
- case PluginsRedux_1.IPUSHPULL_SET_AVAILABLE_OFF:
99
+ case IPUSHPULL_SET_AVAILABLE_OFF:
124
100
  return Object.assign({}, state, { IsIPushPullAvailable: false });
125
- case PluginsRedux_1.IPUSHPULL_SET_RUNNING_ON:
101
+ case IPUSHPULL_SET_RUNNING_ON:
126
102
  return Object.assign({}, state, { IsIPushPullRunning: true });
127
- case PluginsRedux_1.IPUSHPULL_SET_RUNNING_OFF:
103
+ case IPUSHPULL_SET_RUNNING_OFF:
128
104
  return Object.assign({}, state, { IsIPushPullRunning: false });
129
- case PluginsRedux_1.IPUSHPULL_SET_LOGIN_DETAILS: {
105
+ case IPUSHPULL_SET_LOGIN_DETAILS: {
130
106
  let loginAction = action;
131
107
  return Object.assign(Object.assign({}, state), { CurrentIPushpullUsername: loginAction.username, CurrentIPushpullPassword: loginAction.password });
132
108
  }
133
- case PluginsRedux_1.IPUSHPULL_LOGOUT: {
109
+ case IPUSHPULL_LOGOUT: {
134
110
  return Object.assign(Object.assign({}, state), { CurrentIPushpullUsername: undefined, CurrentIPushpullPassword: undefined });
135
111
  }
136
- case PluginsRedux_1.IPUSHPULL_SET_LOGIN_ERROR_MESSAGE: {
112
+ case IPUSHPULL_SET_LOGIN_ERROR_MESSAGE: {
137
113
  return Object.assign(Object.assign({}, state), { IPushPullLoginErrorMessage: action.errorMessage });
138
114
  }
139
- case PluginsRedux_1.IPUSHPULL_DOMAIN_PAGES_SET: {
115
+ case IPUSHPULL_DOMAIN_PAGES_SET: {
140
116
  return Object.assign({}, state, {
141
117
  IPushPullDomainsPages: action.IPushPullDomainsPages || [],
142
118
  });
143
119
  }
144
- case PluginsRedux_1.IPUSHPULL_DOMAIN_PAGES_CLEAR: {
120
+ case IPUSHPULL_DOMAIN_PAGES_CLEAR: {
145
121
  return Object.assign({}, state, {
146
122
  IPushPullDomainsPages: [],
147
123
  });
148
124
  }
149
- case PluginsRedux_1.IPUSHPULL_LIVE_REPORT_SET: {
125
+ case IPUSHPULL_LIVE_REPORT_SET: {
150
126
  const actionType = action;
151
127
  return Object.assign({}, state, { CurrentLiveIPushPullReport: actionType.iPushPullReport });
152
128
  }
153
- case PluginsRedux_1.IPUSHPULL_LIVE_REPORT_CLEAR: {
129
+ case IPUSHPULL_LIVE_REPORT_CLEAR: {
154
130
  // const atctionType = action as IPushPullLiveReportSetAction;
155
131
  return Object.assign({}, state, { CurrentLiveIPushPullReport: undefined });
156
132
  }
157
- case PluginsRedux_1.IPUSHPULL_SET_CURRENT_REPORTNAME: {
133
+ case IPUSHPULL_SET_CURRENT_REPORTNAME: {
158
134
  const actionTyped = action;
159
135
  return Object.assign({}, state, { IPushPullCurrentReportName: actionTyped.reportName });
160
136
  }
161
- case PluginsRedux_1.IPUSHPULL_SET_CURRENT_FOLDER: {
137
+ case IPUSHPULL_SET_CURRENT_FOLDER: {
162
138
  const actionTyped = action;
163
139
  return Object.assign({}, state, { IPushPullCurrentFolder: actionTyped.folder });
164
140
  }
165
- case PluginsRedux_1.IPUSHPULL_SET_CURRENT_PAGE: {
141
+ case IPUSHPULL_SET_CURRENT_PAGE: {
166
142
  const actionTyped = action;
167
143
  return Object.assign({}, state, { IPushPullCurrentPage: actionTyped.page });
168
144
  }
169
- case PluginsRedux_1.IPUSHPULL_SET_CURRENT_AVAILABLE_PAGES: {
145
+ case IPUSHPULL_SET_CURRENT_AVAILABLE_PAGES: {
170
146
  const actionTyped = action;
171
147
  return Object.assign({}, state, {
172
148
  IPushPullCurrentAvailablePages: actionTyped.availablePages,
@@ -176,4 +152,3 @@ state, action) => {
176
152
  return state;
177
153
  }
178
154
  };
179
- exports.IPushPullReducer = IPushPullReducer;
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,16 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PushPullService = exports.ServiceStatus = void 0;
4
- const tslib_1 = require("tslib");
5
- const StringExtensions_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/Utilities/Extensions/StringExtensions"));
6
- var ServiceStatus;
1
+ import StringExtensions from '@adaptabletools/adaptable/src/Utilities/Extensions/StringExtensions';
2
+ export var ServiceStatus;
7
3
  (function (ServiceStatus) {
8
4
  ServiceStatus["Unknown"] = "Unknown";
9
5
  ServiceStatus["Disconnected"] = "Disconnected";
10
6
  ServiceStatus["Connected"] = "Connected";
11
7
  ServiceStatus["Error"] = "Error";
12
- })(ServiceStatus = exports.ServiceStatus || (exports.ServiceStatus = {}));
13
- class PushPullService {
8
+ })(ServiceStatus || (ServiceStatus = {}));
9
+ export class PushPullService {
14
10
  constructor(adaptable) {
15
11
  this.adaptable = adaptable;
16
12
  this.ppInstance = null;
@@ -31,8 +27,8 @@ class PushPullService {
31
27
  // get the username and passwrord from the options
32
28
  let userName = this.getIPPApi().getIPushPullUsername();
33
29
  let password = this.getIPPApi().getIPushPullPassword();
34
- if (StringExtensions_1.default.IsNotNullOrEmpty(userName) &&
35
- StringExtensions_1.default.IsNotNullOrEmpty(password)) {
30
+ if (StringExtensions.IsNotNullOrEmpty(userName) &&
31
+ StringExtensions.IsNotNullOrEmpty(password)) {
36
32
  try {
37
33
  // slightly circular but it means tht we do the logic in one go..
38
34
  this.getIPPApi().loginToIPushPull(userName, password);
@@ -211,4 +207,3 @@ class PushPullService {
211
207
  });
212
208
  }
213
209
  }
214
- exports.PushPullService = PushPullService;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as IPushPullRedux from '../Redux/ActionReducers/IPushPullRedux';
2
3
  import { IPushPullDomain } from '@adaptabletools/adaptable/src/PredefinedConfig/IPushPullState';
3
4
  interface IPushPullAddPagePopupProps {
@@ -1,34 +1,30 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IPushPullAddPagePopup = void 0;
4
- const tslib_1 = require("tslib");
5
- const React = tslib_1.__importStar(require("react"));
6
- const react_redux_1 = require("react-redux");
7
- const PopupRedux = tslib_1.__importStar(require("@adaptabletools/adaptable/src/Redux/ActionsReducers/PopupRedux"));
8
- const IPushPullRedux = tslib_1.__importStar(require("../Redux/ActionReducers/IPushPullRedux"));
9
- const StringExtensions_1 = require("@adaptabletools/adaptable/src/Utilities/Extensions/StringExtensions");
10
- const FormLayout_1 = tslib_1.__importStar(require("@adaptabletools/adaptable/src/components/FormLayout"));
11
- const Input_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/components/Input"));
12
- const SimpleButton_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/components/SimpleButton"));
13
- const FlexWithFooter_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/components/FlexWithFooter"));
14
- const PanelWithImage_1 = require("@adaptabletools/adaptable/src/View/Components/Panels/PanelWithImage");
15
- const PopupContext_1 = require("@adaptabletools/adaptable/src/View/Components/Popups/AdaptablePopup/PopupContext");
16
- const ErrorBox_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/components/ErrorBox"));
17
- const HelpBlock_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/components/HelpBlock"));
18
- const rebass_1 = require("rebass");
19
- const Dropdown_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/components/Dropdown"));
20
- const GeneralConstants_1 = require("@adaptabletools/adaptable/src/Utilities/Constants/GeneralConstants");
21
- const ArrayExtensions_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/Utilities/Extensions/ArrayExtensions"));
1
+ import * as React from 'react';
2
+ import { connect } from 'react-redux';
3
+ import * as PopupRedux from '@adaptabletools/adaptable/src/Redux/ActionsReducers/PopupRedux';
4
+ import * as IPushPullRedux from '../Redux/ActionReducers/IPushPullRedux';
5
+ import { StringExtensions } from '@adaptabletools/adaptable/src/Utilities/Extensions/StringExtensions';
6
+ import FormLayout, { FormRow } from '@adaptabletools/adaptable/src/components/FormLayout';
7
+ import Input from '@adaptabletools/adaptable/src/components/Input';
8
+ import SimpleButton from '@adaptabletools/adaptable/src/components/SimpleButton';
9
+ import FlexWithFooter from '@adaptabletools/adaptable/src/components/FlexWithFooter';
10
+ import { PanelWithImage } from '@adaptabletools/adaptable/src/View/Components/Panels/PanelWithImage';
11
+ import { usePopupContext } from '@adaptabletools/adaptable/src/View/Components/Popups/AdaptablePopup/PopupContext';
12
+ import ErrorBox from '@adaptabletools/adaptable/src/components/ErrorBox';
13
+ import HelpBlock from '@adaptabletools/adaptable/src/components/HelpBlock';
14
+ import { Flex } from 'rebass';
15
+ import Dropdown from '@adaptabletools/adaptable/src/components/Dropdown';
16
+ import { EMPTY_STRING, EMPTY_ARRAY, } from '@adaptabletools/adaptable/src/Utilities/Constants/GeneralConstants';
17
+ import ArrayExtensions from '@adaptabletools/adaptable/src/Utilities/Extensions/ArrayExtensions';
22
18
  const IPushPullAddPageComponent = (props) => {
23
19
  const [state, setState] = React.useState({
24
20
  Folder: '',
25
21
  Page: '',
26
- AvailablePages: GeneralConstants_1.EMPTY_ARRAY,
22
+ AvailablePages: EMPTY_ARRAY,
27
23
  ErrorMessage: '',
28
24
  });
29
- const { hidePopup } = (0, PopupContext_1.usePopupContext)();
25
+ const { hidePopup } = usePopupContext();
30
26
  const onSubmit = () => {
31
- if (ArrayExtensions_1.default.ContainsItem(state.AvailablePages, state.Page)) {
27
+ if (ArrayExtensions.ContainsItem(state.AvailablePages, state.Page)) {
32
28
  setState(Object.assign(Object.assign({}, state), { ErrorMessage: 'A page with that name already exists in the folder' }));
33
29
  }
34
30
  else {
@@ -40,21 +36,21 @@ const IPushPullAddPageComponent = (props) => {
40
36
  setState(Object.assign(Object.assign({}, state), { Page: e.value }));
41
37
  };
42
38
  const onFolderChanged = (folderName) => {
43
- if (StringExtensions_1.StringExtensions.IsNotNullOrEmpty(folderName) && folderName !== 'Select Folder') {
39
+ if (StringExtensions.IsNotNullOrEmpty(folderName) && folderName !== 'Select Folder') {
44
40
  let avaialablePages = props.IPushPullDomainsPages.find((f) => f.Name == folderName).Pages;
45
41
  setState({
46
42
  Folder: folderName,
47
43
  AvailablePages: avaialablePages,
48
- Page: GeneralConstants_1.EMPTY_STRING,
49
- ErrorMessage: GeneralConstants_1.EMPTY_STRING,
44
+ Page: EMPTY_STRING,
45
+ ErrorMessage: EMPTY_STRING,
50
46
  });
51
47
  }
52
48
  else {
53
49
  setState({
54
- Folder: GeneralConstants_1.EMPTY_STRING,
50
+ Folder: EMPTY_STRING,
55
51
  AvailablePages: [],
56
- Page: GeneralConstants_1.EMPTY_STRING,
57
- ErrorMessage: GeneralConstants_1.EMPTY_STRING,
52
+ Page: EMPTY_STRING,
53
+ ErrorMessage: EMPTY_STRING,
58
54
  });
59
55
  }
60
56
  };
@@ -64,29 +60,29 @@ const IPushPullAddPageComponent = (props) => {
64
60
  value: iPushPullDomain.Name,
65
61
  };
66
62
  });
67
- return (React.createElement(PanelWithImage_1.PanelWithImage, { header: "Add ipushpull Page", glyphicon: "newpage", variant: "primary", style: { height: '100%' } },
68
- React.createElement(FlexWithFooter_1.default, { as: "form", onSubmit: (e) => {
63
+ return (React.createElement(PanelWithImage, { header: "Add ipushpull Page", glyphicon: "newpage", variant: "primary", style: { height: '100%' } },
64
+ React.createElement(FlexWithFooter, { as: "form", onSubmit: (e) => {
69
65
  e.preventDefault();
70
66
  onSubmit();
71
67
  }, footerProps: {
72
68
  fontSize: 'var(--ab-font-size-4)',
73
69
  }, footer: React.createElement(React.Fragment, null,
74
- React.createElement(SimpleButton_1.default, { tone: "neutral", variant: "text", tooltip: "Close", onClick: (e) => {
70
+ React.createElement(SimpleButton, { tone: "neutral", variant: "text", tooltip: "Close", onClick: (e) => {
75
71
  e.stopPropagation();
76
72
  hidePopup();
77
73
  } }, "CLOSE"),
78
74
  React.createElement("div", { style: { flex: 1 } }),
79
- React.createElement(SimpleButton_1.default, { tone: "accent", variant: "raised", type: "submit", disabled: StringExtensions_1.StringExtensions.IsNullOrEmpty(state.Folder) ||
80
- StringExtensions_1.StringExtensions.IsNullOrEmpty(state.Page), icon: 'check' }, "Add Page")) },
81
- React.createElement(rebass_1.Flex, { flexDirection: "column", padding: 2, margin: 2 },
82
- React.createElement(HelpBlock_1.default, { marginBottom: 1 }, "Select a folder and then choose the name of the new ipushpull page it should contain."),
83
- React.createElement(FormLayout_1.default, { margin: 3 },
84
- React.createElement(FormLayout_1.FormRow, { label: "Folder:" },
85
- React.createElement(Dropdown_1.default, { disabled: availableFolders.length == 0, style: { minWidth: '50%' }, options: availableFolders, className: "ab-Popup__IPushPull__select", onChange: (folder) => onFolderChanged(folder), value: state.Folder ? state.Folder : null, placeholder: "Select Folder", marginRight: 2 })),
86
- React.createElement(FormLayout_1.FormRow, { label: "Page" },
87
- React.createElement(Input_1.default, { width: "50%", type: "text", placeholder: "Page Name", value: state.Page, onChange: onPageNameChange })),
88
- state.ErrorMessage ? (React.createElement(FormLayout_1.FormRow, { label: "" },
89
- React.createElement(ErrorBox_1.default, null, state.ErrorMessage))) : null)))));
75
+ React.createElement(SimpleButton, { tone: "accent", variant: "raised", type: "submit", disabled: StringExtensions.IsNullOrEmpty(state.Folder) ||
76
+ StringExtensions.IsNullOrEmpty(state.Page), icon: 'check' }, "Add Page")) },
77
+ React.createElement(Flex, { flexDirection: "column", padding: 2, margin: 2 },
78
+ React.createElement(HelpBlock, { marginBottom: 1 }, "Select a folder and then choose the name of the new ipushpull page it should contain."),
79
+ React.createElement(FormLayout, { margin: 3 },
80
+ React.createElement(FormRow, { label: "Folder:" },
81
+ React.createElement(Dropdown, { disabled: availableFolders.length == 0, style: { minWidth: '50%' }, options: availableFolders, className: "ab-Popup__IPushPull__select", onChange: (folder) => onFolderChanged(folder), value: state.Folder ? state.Folder : null, placeholder: "Select Folder", marginRight: 2 })),
82
+ React.createElement(FormRow, { label: "Page" },
83
+ React.createElement(Input, { width: "50%", type: "text", placeholder: "Page Name", value: state.Page, onChange: onPageNameChange })),
84
+ state.ErrorMessage ? (React.createElement(FormRow, { label: "" },
85
+ React.createElement(ErrorBox, null, state.ErrorMessage))) : null)))));
90
86
  };
91
87
  function mapStateToProps(state) {
92
88
  return {
@@ -101,4 +97,4 @@ function mapDispatchToProps(dispatch) {
101
97
  },
102
98
  };
103
99
  }
104
- exports.IPushPullAddPagePopup = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(IPushPullAddPageComponent);
100
+ export let IPushPullAddPagePopup = connect(mapStateToProps, mapDispatchToProps)(IPushPullAddPageComponent);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import * as IPushPullRedux from '../Redux/ActionReducers/IPushPullRedux';
2
3
  interface IPushPullLoginPopupProps {
3
4
  pushpullLogin: string | undefined;
@@ -1,30 +1,26 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IPushPullLoginPopup = void 0;
4
- const tslib_1 = require("tslib");
5
- const React = tslib_1.__importStar(require("react"));
6
- const react_redux_1 = require("react-redux");
7
- const AdaptableContext_1 = require("@adaptabletools/adaptable/src/View/AdaptableContext");
8
- const PopupRedux = tslib_1.__importStar(require("@adaptabletools/adaptable/src/Redux/ActionsReducers/PopupRedux"));
9
- const IPushPullRedux = tslib_1.__importStar(require("../Redux/ActionReducers/IPushPullRedux"));
10
- const StringExtensions_1 = require("@adaptabletools/adaptable/src/Utilities/Extensions/StringExtensions");
11
- const FormLayout_1 = tslib_1.__importStar(require("@adaptabletools/adaptable/src/components/FormLayout"));
12
- const Input_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/components/Input"));
13
- const SimpleButton_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/components/SimpleButton"));
14
- const FlexWithFooter_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/components/FlexWithFooter"));
15
- const PanelWithImage_1 = require("@adaptabletools/adaptable/src/View/Components/Panels/PanelWithImage");
16
- const PopupContext_1 = require("@adaptabletools/adaptable/src/View/Components/Popups/AdaptablePopup/PopupContext");
17
- const ErrorBox_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/components/ErrorBox"));
18
- const HelpBlock_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/components/HelpBlock"));
19
- const rebass_1 = require("rebass");
1
+ import * as React from 'react';
2
+ import { connect } from 'react-redux';
3
+ import { useAdaptable } from '@adaptabletools/adaptable/src/View/AdaptableContext';
4
+ import * as PopupRedux from '@adaptabletools/adaptable/src/Redux/ActionsReducers/PopupRedux';
5
+ import * as IPushPullRedux from '../Redux/ActionReducers/IPushPullRedux';
6
+ import { StringExtensions } from '@adaptabletools/adaptable/src/Utilities/Extensions/StringExtensions';
7
+ import FormLayout, { FormRow } from '@adaptabletools/adaptable/src/components/FormLayout';
8
+ import Input from '@adaptabletools/adaptable/src/components/Input';
9
+ import SimpleButton from '@adaptabletools/adaptable/src/components/SimpleButton';
10
+ import FlexWithFooter from '@adaptabletools/adaptable/src/components/FlexWithFooter';
11
+ import { PanelWithImage } from '@adaptabletools/adaptable/src/View/Components/Panels/PanelWithImage';
12
+ import { usePopupContext } from '@adaptabletools/adaptable/src/View/Components/Popups/AdaptablePopup/PopupContext';
13
+ import ErrorBox from '@adaptabletools/adaptable/src/components/ErrorBox';
14
+ import HelpBlock from '@adaptabletools/adaptable/src/components/HelpBlock';
15
+ import { Flex } from 'rebass';
20
16
  const IPushPullLoginComponent = (props) => {
21
- const adaptable = (0, AdaptableContext_1.useAdaptable)();
17
+ const adaptable = useAdaptable();
22
18
  const options = adaptable.getPlugin('ipushpull').options;
23
19
  const [state, setState] = React.useState({
24
20
  Login: options.username || '',
25
21
  Password: options.password || '',
26
22
  });
27
- const { hidePopup } = (0, PopupContext_1.usePopupContext)();
23
+ const { hidePopup } = usePopupContext();
28
24
  const onSubmit = () => {
29
25
  props.onLogin(state.Login || '', state.Password || '');
30
26
  };
@@ -36,28 +32,28 @@ const IPushPullLoginComponent = (props) => {
36
32
  const e = event.target;
37
33
  setState(Object.assign(Object.assign({}, state), { Password: e.value }));
38
34
  };
39
- return (React.createElement(PanelWithImage_1.PanelWithImage, { header: "ipushpull Login Details", glyphicon: "login", variant: "primary", style: { height: '100%' } },
40
- React.createElement(FlexWithFooter_1.default, { as: "form", onSubmit: (e) => {
35
+ return (React.createElement(PanelWithImage, { header: "ipushpull Login Details", glyphicon: "login", variant: "primary", style: { height: '100%' } },
36
+ React.createElement(FlexWithFooter, { as: "form", onSubmit: (e) => {
41
37
  e.preventDefault();
42
38
  onSubmit();
43
39
  }, footerProps: {
44
40
  fontSize: 'var(--ab-font-size-4)',
45
41
  }, footer: React.createElement(React.Fragment, null,
46
- React.createElement(SimpleButton_1.default, { tone: "neutral", variant: "text", tooltip: "Close", onClick: (e) => {
42
+ React.createElement(SimpleButton, { tone: "neutral", variant: "text", tooltip: "Close", onClick: (e) => {
47
43
  e.stopPropagation();
48
44
  hidePopup();
49
45
  } }, "CLOSE"),
50
46
  React.createElement("div", { style: { flex: 1 } }),
51
- React.createElement(SimpleButton_1.default, { tone: "accent", variant: "raised", type: "submit", disabled: StringExtensions_1.StringExtensions.IsNullOrEmpty(state.Password), icon: 'check' }, "Login")) },
52
- React.createElement(rebass_1.Flex, { flexDirection: "column", padding: 2, margin: 2 },
53
- React.createElement(HelpBlock_1.default, { marginBottom: 1 }, "Login to ipushpull using your login (email address) and password."),
54
- React.createElement(FormLayout_1.default, { margin: 3 },
55
- React.createElement(FormLayout_1.FormRow, { label: "ipushpull login:" },
56
- React.createElement(Input_1.default, { width: "100%", type: "email", placeholder: "Email address", value: state.Login, onChange: onLoginChange })),
57
- React.createElement(FormLayout_1.FormRow, { label: "ipushpull password:" },
58
- React.createElement(Input_1.default, { width: "100%", type: "password", placeholder: "Password", value: state.Password, onChange: onPasswordChange })),
59
- props.pushpullLoginErrorMessage ? (React.createElement(FormLayout_1.FormRow, { label: "" },
60
- React.createElement(ErrorBox_1.default, null, props.pushpullLoginErrorMessage))) : null)))));
47
+ React.createElement(SimpleButton, { tone: "accent", variant: "raised", type: "submit", disabled: StringExtensions.IsNullOrEmpty(state.Password), icon: 'check' }, "Login")) },
48
+ React.createElement(Flex, { flexDirection: "column", padding: 2, margin: 2 },
49
+ React.createElement(HelpBlock, { marginBottom: 1 }, "Login to ipushpull using your login (email address) and password."),
50
+ React.createElement(FormLayout, { margin: 3 },
51
+ React.createElement(FormRow, { label: "ipushpull login:" },
52
+ React.createElement(Input, { width: "100%", type: "email", placeholder: "Email address", value: state.Login, onChange: onLoginChange })),
53
+ React.createElement(FormRow, { label: "ipushpull password:" },
54
+ React.createElement(Input, { width: "100%", type: "password", placeholder: "Password", value: state.Password, onChange: onPasswordChange })),
55
+ props.pushpullLoginErrorMessage ? (React.createElement(FormRow, { label: "" },
56
+ React.createElement(ErrorBox, null, props.pushpullLoginErrorMessage))) : null)))));
61
57
  };
62
58
  function mapStateToProps(state) {
63
59
  return {
@@ -76,4 +72,4 @@ function mapDispatchToProps(dispatch) {
76
72
  },
77
73
  };
78
74
  }
79
- exports.IPushPullLoginPopup = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(IPushPullLoginComponent);
75
+ export let IPushPullLoginPopup = connect(mapStateToProps, mapDispatchToProps)(IPushPullLoginComponent);
@@ -1,19 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IPushPullPopup = void 0;
4
- const tslib_1 = require("tslib");
5
- const React = tslib_1.__importStar(require("react"));
6
- const react_redux_1 = require("react-redux");
7
- const PanelWithButton_1 = require("@adaptabletools/adaptable/src/View/Components/Panels/PanelWithButton");
8
- const IPushPullRedux = tslib_1.__importStar(require("../Redux/ActionReducers/IPushPullRedux"));
9
- const TeamSharingRedux = tslib_1.__importStar(require("@adaptabletools/adaptable/src/Redux/ActionsReducers/TeamSharingRedux"));
10
- const ModuleConstants = tslib_1.__importStar(require("@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants"));
11
- const UIHelper_1 = require("@adaptabletools/adaptable/src/View/UIHelper");
1
+ import * as React from 'react';
2
+ import { connect } from 'react-redux';
3
+ import { PanelWithButton } from '@adaptabletools/adaptable/src/View/Components/Panels/PanelWithButton';
4
+ import * as IPushPullRedux from '../Redux/ActionReducers/IPushPullRedux';
5
+ import * as TeamSharingRedux from '@adaptabletools/adaptable/src/Redux/ActionsReducers/TeamSharingRedux';
6
+ import * as ModuleConstants from '@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants';
7
+ import { UIHelper } from '@adaptabletools/adaptable/src/View/UIHelper';
12
8
  class IPushPullPopupComponent extends React.Component {
13
9
  constructor(props) {
14
10
  super(props);
15
11
  this.shouldClosePopupOnFinishWizard = false;
16
- this.state = UIHelper_1.UIHelper.getEmptyConfigState();
12
+ this.state = UIHelper.getEmptyConfigState();
17
13
  }
18
14
  componentDidMount() {
19
15
  if (this.props.popupParams) {
@@ -22,7 +18,7 @@ class IPushPullPopupComponent extends React.Component {
22
18
  }
23
19
  }
24
20
  render() {
25
- return (React.createElement(PanelWithButton_1.PanelWithButton, { headerText: this.props.moduleInfo.FriendlyName, bodyProps: { padding: 0 }, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed() }));
21
+ return (React.createElement(PanelWithButton, { headerText: this.props.moduleInfo.FriendlyName, bodyProps: { padding: 0 }, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed() }));
26
22
  }
27
23
  onApplyExport(iPushPullReport) {
28
24
  this.props.onIPushPullSendSnapshot(iPushPullReport);
@@ -38,4 +34,4 @@ function mapDispatchToProps(dispatch) {
38
34
  onShare: (entity, config) => dispatch(TeamSharingRedux.TeamSharingShare(entity, ModuleConstants.IPushPullModuleId, config)),
39
35
  };
40
36
  }
41
- exports.IPushPullPopup = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(IPushPullPopupComponent);
37
+ export let IPushPullPopup = connect(mapStateToProps, mapDispatchToProps)(IPushPullPopupComponent);
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { ViewPanelProps } from '@adaptabletools/adaptable/src/View/Components/SharedProps/ViewPanelProps';
2
3
  import { IPushPullDomain, IPushPullReport, IPushPullSchedule } from '@adaptabletools/adaptable/src/PredefinedConfig/IPushPullState';
3
4
  import * as IPushPullRedux from '../Redux/ActionReducers/IPushPullRedux';
@@ -1,25 +1,21 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.IPushPullViewPanelControl = void 0;
4
- const tslib_1 = require("tslib");
5
- const IPushPullRedux = tslib_1.__importStar(require("../Redux/ActionReducers/IPushPullRedux"));
6
- const PopupRedux = tslib_1.__importStar(require("@adaptabletools/adaptable/src/Redux/ActionsReducers/PopupRedux"));
7
- const React = tslib_1.__importStar(require("react"));
8
- const ObjectFactory_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/Utilities/ObjectFactory"));
9
- const StringExtensions_1 = require("@adaptabletools/adaptable/src/Utilities/Extensions/StringExtensions");
10
- const rebass_1 = require("rebass");
11
- const DropdownButton_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/components/DropdownButton"));
12
- const ButtonExport_1 = require("@adaptabletools/adaptable/src/View/Components/Buttons/ButtonExport");
13
- const ButtonPause_1 = require("@adaptabletools/adaptable/src/View/Components/Buttons/ButtonPause");
14
- const ButtonPlay_1 = require("@adaptabletools/adaptable/src/View/Components/Buttons/ButtonPlay");
15
- const join_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/components/utils/join"));
16
- const GeneralConstants = tslib_1.__importStar(require("@adaptabletools/adaptable/src/Utilities/Constants/GeneralConstants"));
17
- const ButtonSchedule_1 = require("@adaptabletools/adaptable/src/View/Components/Buttons/ButtonSchedule");
18
- const ButtonNewPage_1 = require("@adaptabletools/adaptable/src/View/Components/Buttons/ButtonNewPage");
19
- const ButtonLogout_1 = require("@adaptabletools/adaptable/src/View/Components/Buttons/ButtonLogout");
20
- const ButtonLogin_1 = require("@adaptabletools/adaptable/src/View/Components/Buttons/ButtonLogin");
21
- const ModuleConstants = tslib_1.__importStar(require("@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants"));
22
- const react_redux_1 = require("react-redux");
1
+ import * as IPushPullRedux from '../Redux/ActionReducers/IPushPullRedux';
2
+ import * as PopupRedux from '@adaptabletools/adaptable/src/Redux/ActionsReducers/PopupRedux';
3
+ import * as React from 'react';
4
+ import ObjectFactory from '@adaptabletools/adaptable/src/Utilities/ObjectFactory';
5
+ import { StringExtensions } from '@adaptabletools/adaptable/src/Utilities/Extensions/StringExtensions';
6
+ import { Flex } from 'rebass';
7
+ import DropdownButton from '@adaptabletools/adaptable/src/components/DropdownButton';
8
+ import { ButtonExport } from '@adaptabletools/adaptable/src/View/Components/Buttons/ButtonExport';
9
+ import { ButtonPause } from '@adaptabletools/adaptable/src/View/Components/Buttons/ButtonPause';
10
+ import { ButtonPlay } from '@adaptabletools/adaptable/src/View/Components/Buttons/ButtonPlay';
11
+ import join from '@adaptabletools/adaptable/src/components/utils/join';
12
+ import * as GeneralConstants from '@adaptabletools/adaptable/src/Utilities/Constants/GeneralConstants';
13
+ import { ButtonSchedule } from '@adaptabletools/adaptable/src/View/Components/Buttons/ButtonSchedule';
14
+ import { ButtonNewPage } from '@adaptabletools/adaptable/src/View/Components/Buttons/ButtonNewPage';
15
+ import { ButtonLogout } from '@adaptabletools/adaptable/src/View/Components/Buttons/ButtonLogout';
16
+ import { ButtonLogin } from '@adaptabletools/adaptable/src/View/Components/Buttons/ButtonLogin';
17
+ import * as ModuleConstants from '@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants';
18
+ import { connect } from 'react-redux';
23
19
  const IPushPullViewPanelComponent = (props) => {
24
20
  var _a, _b, _c, _d;
25
21
  const [_, update] = React.useState(0);
@@ -50,7 +46,7 @@ const IPushPullViewPanelComponent = (props) => {
50
46
  props.onIPushPullStartLiveData(createIPushPullReportFromState());
51
47
  };
52
48
  const onNewIPushPullSchedule = () => {
53
- let iPushPullSchedule = ObjectFactory_1.default.CreateIPushPullSchedule(createIPushPullReportFromState());
49
+ let iPushPullSchedule = ObjectFactory.CreateIPushPullSchedule(createIPushPullReportFromState());
54
50
  props.onNewIPushPullSchedule(iPushPullSchedule);
55
51
  };
56
52
  // perhaps this should be props and in real state?
@@ -90,35 +86,35 @@ const IPushPullViewPanelComponent = (props) => {
90
86
  })) !== null && _d !== void 0 ? _d : [];
91
87
  // this is clearly ridiculous!
92
88
  // im getting tired...
93
- let isCompletedReport = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullReportName) &&
94
- StringExtensions_1.StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullFolder) &&
95
- StringExtensions_1.StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullPage);
89
+ let isCompletedReport = StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullReportName) &&
90
+ StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullFolder) &&
91
+ StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullPage);
96
92
  let isLiveIPushPullReport = isCompletedReport &&
97
93
  props.CurrentLiveIPushPullReport &&
98
94
  props.CurrentIPushPullReportName == props.CurrentLiveIPushPullReport.ReportName &&
99
95
  props.CurrentIPushPullFolder == props.CurrentLiveIPushPullReport.Folder &&
100
96
  props.CurrentIPushPullPage == props.CurrentLiveIPushPullReport.Page;
101
97
  const elementType = props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
102
- return props.IsIPushPullRunning ? (React.createElement(rebass_1.Flex, { flexDirection: "row", className: `ab-${elementType}__IPushPull__wrap`, flexWrap: props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
103
- React.createElement(rebass_1.Flex, null,
104
- React.createElement(DropdownButton_1.default, { disabled: allReports.length == 0 || isLiveIPushPullReport, style: { minWidth: 140, fontSize: 'small' }, items: availableReports, columns: ['label'], className: `ab-${elementType}__IPushPull__select`, onClear: () => onSelectedReportChanged(''), showClearButton: StringExtensions_1.StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullReportName), variant: "outlined", marginRight: 2 }, StringExtensions_1.StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullReportName)
98
+ return props.IsIPushPullRunning ? (React.createElement(Flex, { flexDirection: "row", className: `ab-${elementType}__IPushPull__wrap`, flexWrap: props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
99
+ React.createElement(Flex, null,
100
+ React.createElement(DropdownButton, { disabled: allReports.length == 0 || isLiveIPushPullReport, style: { minWidth: 140, fontSize: 'small' }, items: availableReports, columns: ['label'], className: `ab-${elementType}__IPushPull__select`, onClear: () => onSelectedReportChanged(''), showClearButton: StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullReportName), variant: "outlined", marginRight: 2 }, StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullReportName)
105
101
  ? props.CurrentIPushPullReportName
106
102
  : 'Select Report')),
107
- React.createElement(rebass_1.Flex, null,
108
- React.createElement(DropdownButton_1.default, { disabled: allReports.length == 0 || isLiveIPushPullReport, style: { minWidth: 140, fontSize: 'small' }, items: availableFolders, columns: ['label'], className: `ab-${elementType}__IPushPull__select`, onClear: () => onFolderChanged(''), showClearButton: StringExtensions_1.StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullFolder), variant: "outlined", marginRight: 2 }, StringExtensions_1.StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullFolder)
103
+ React.createElement(Flex, null,
104
+ React.createElement(DropdownButton, { disabled: allReports.length == 0 || isLiveIPushPullReport, style: { minWidth: 140, fontSize: 'small' }, items: availableFolders, columns: ['label'], className: `ab-${elementType}__IPushPull__select`, onClear: () => onFolderChanged(''), showClearButton: StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullFolder), variant: "outlined", marginRight: 2 }, StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullFolder)
109
105
  ? props.CurrentIPushPullFolder
110
106
  : 'Select Folder')),
111
- React.createElement(rebass_1.Flex, null,
112
- React.createElement(DropdownButton_1.default, { disabled: allReports.length == 0 || isLiveIPushPullReport, style: { minWidth: 140, fontSize: 'small' }, items: availablePages, columns: ['label'], className: `ab-${elementType}__IPushPull__select`, onClear: () => onPageChanged(''), showClearButton: StringExtensions_1.StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullPage), variant: "outlined", marginRight: 2 }, StringExtensions_1.StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullPage)
107
+ React.createElement(Flex, null,
108
+ React.createElement(DropdownButton, { disabled: allReports.length == 0 || isLiveIPushPullReport, style: { minWidth: 140, fontSize: 'small' }, items: availablePages, columns: ['label'], className: `ab-${elementType}__IPushPull__select`, onClear: () => onPageChanged(''), showClearButton: StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullPage), variant: "outlined", marginRight: 2 }, StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullPage)
113
109
  ? props.CurrentIPushPullPage
114
110
  : 'Select Page')),
115
- React.createElement(rebass_1.Flex, { style: { minWidth: '148px' } },
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
- 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: (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 })))),
111
+ React.createElement(Flex, { style: { minWidth: '148px' } },
112
+ React.createElement(ButtonExport, { marginLeft: 1, className: `ab-${elementType}__IPushPull__export`, onClick: () => onIPushPullSendSnapshot(), tooltip: "Send Snapshot to ipushpull", disabled: isLiveIPushPullReport || !isCompletedReport, accessLevel: props.accessLevel }),
113
+ true ? (React.createElement(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, { marginLeft: 1, className: `ab-${elementType}__IPushPull__play`, onClick: () => onIPushPullStartLiveData(), tooltip: "Start sync with ipushpull", disabled: isLiveIPushPullReport || !isCompletedReport, accessLevel: props.accessLevel })),
114
+ isCompletedReport && (React.createElement(Flex, { className: join(props.accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__IPushPull__controls`), alignItems: "stretch" }, props.api.internalApi.getEntitlementService().isModuleFullEntitlement('Schedule') && (React.createElement(ButtonSchedule, { marginLeft: 1, className: `ab-${elementType}__IPushPull__schedule`, onClick: () => onNewIPushPullSchedule(), tooltip: "Schedule", disabled: isLiveIPushPullReport || !isCompletedReport, accessLevel: props.accessLevel })))),
119
115
  ' ',
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
- 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 },
116
+ React.createElement(ButtonNewPage, { marginLeft: 1, className: `ab-${elementType}__IPushPull__newpage`, onClick: () => props.onShowAddIPushPullPage(), tooltip: "New Page", disabled: isLiveIPushPullReport, accessLevel: props.accessLevel }),
117
+ React.createElement(ButtonLogout, { marginLeft: 1, className: `ab-${elementType}__IPushPull__logout`, onClick: () => getIPPApi().logoutFromIPushPull(), tooltip: "Logout", disabled: isLiveIPushPullReport, accessLevel: props.accessLevel })))) : (React.createElement(ButtonLogin, { marginLeft: 1, className: `ab-${elementType}__IPushPull__login`, onClick: () => props.onShowIPushPullLogin(), tooltip: "Login to ipushpull", accessLevel: props.accessLevel },
122
118
  ' ',
123
119
  "Login"));
124
120
  };
@@ -155,4 +151,4 @@ function mapDispatchToProps(dispatch) {
155
151
  onCurrentIPushPullPageChange: (page) => dispatch(IPushPullRedux.IPushPullSetCurrentPage(page)),
156
152
  };
157
153
  }
158
- exports.IPushPullViewPanelControl = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(IPushPullViewPanelComponent);
154
+ export const IPushPullViewPanelControl = connect(mapStateToProps, mapDispatchToProps)(IPushPullViewPanelComponent);
package/src/env.js CHANGED
@@ -1,6 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
1
+ export default {
4
2
  IPUSHPULL_API_KEY: "CbBaMaoqHVifScrYwKssGnGyNkv5xHOhQVGm3cYP",
5
3
  IPUSHPULL_API_SECRET: "xYzE51kuHyyt9kQCvMe0tz0H2sDSjyEQcF5SOBlPQmcL9em0NqcCzyqLYj5fhpuZxQ8BiVcYl6zoOHeI6GYZj1TkUiiLVFoW3HUxiCdEUjlPS8Vl2YHUMEPD5qkLYnGj",
6
4
  };
package/src/index.js CHANGED
@@ -1,37 +1,36 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- const types_1 = require("@adaptabletools/adaptable/types");
5
- const env_1 = tslib_1.__importDefault(require("./env"));
6
- const package_json_1 = require("../package.json");
7
- const version_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/version"));
8
- const ModuleConstants = tslib_1.__importStar(require("@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants"));
9
- const ModuleConstants_1 = require("@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants");
10
- const PopupRedux = tslib_1.__importStar(require("@adaptabletools/adaptable/src/Redux/ActionsReducers/PopupRedux"));
11
- const AdaptableViewFactory_1 = require("@adaptabletools/adaptable/src/View/AdaptableViewFactory");
12
- const PushPullModule_1 = require("./Module/PushPullModule");
13
- const IPushPullApiImpl_1 = require("./IPushPullApiImpl");
14
- const PushPullService_1 = require("./Utilities/Services/PushPullService");
15
- const ipushpull_js_1 = tslib_1.__importDefault(require("ipushpull-js"));
16
- const IPushPullRedux_1 = require("./Redux/ActionReducers/IPushPullRedux");
17
- const IPushPullLoginPopup_1 = require("./View/IPushPullLoginPopup");
18
- const IPushPullAddPagePopup_1 = require("./View/IPushPullAddPagePopup");
19
- const PluginsRedux_1 = require("@adaptabletools/adaptable/src/Redux/ActionsReducers/PluginsRedux");
20
- const StringExtensions_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable/src/Utilities/Extensions/StringExtensions"));
21
- const IPushPullViewPanel_1 = require("./View/IPushPullViewPanel");
22
- if (package_json_1.version !== version_1.default) {
23
- console.warn(`
24
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
25
- !!!!!!! "@adaptabletools/adaptable-plugin-ipushpull" (v @${package_json_1.version}) and "@adaptabletools/adaptable" (v @${version_1.default}) have different versions - they should have the exact same version.
26
- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
27
- `);
28
- }
1
+ import { AdaptablePlugin } from '@adaptabletools/adaptable/types';
2
+ import env from './env';
3
+ // TODO in the future, try to put back the version check
4
+ // import { version, name } from '../package.json';
5
+ // import { version as coreVersion } from '@adaptabletools/adaptable/package.json';
6
+ import * as ModuleConstants from '@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants';
7
+ import { IPushPullModuleId } from '@adaptabletools/adaptable/src/Utilities/Constants/ModuleConstants';
8
+ import * as PopupRedux from '@adaptabletools/adaptable/src/Redux/ActionsReducers/PopupRedux';
9
+ import { AdaptableViewFactory, AdaptableViewPanelFactory, } from '@adaptabletools/adaptable/src/View/AdaptableViewFactory';
10
+ import { PushPullModule } from './Module/PushPullModule';
11
+ import { IPushPullApiImpl } from './IPushPullApiImpl';
12
+ import { PushPullService } from './Utilities/Services/PushPullService';
13
+ import ipushpull from 'ipushpull-js';
14
+ import { iPushPullInitialState, IPushPullReducer, IPushPullSetCurrentAvailablePages, IPushPullSetCurrentPage, } from './Redux/ActionReducers/IPushPullRedux';
15
+ import { IPushPullLoginPopup } from './View/IPushPullLoginPopup';
16
+ import { IPushPullAddPagePopup } from './View/IPushPullAddPagePopup';
17
+ import { IPUSHPULL_ADD_PAGE, IPUSHPULL_DOMAIN_PAGES_SET, IPUSHPULL_LOGIN, IPUSHPULL_SEND_SNAPSHOT, IPUSHPULL_SET_CURRENT_FOLDER, IPUSHPULL_START_LIVE_DATA, IPUSHPULL_STOP_LIVE_DATA, } from '@adaptabletools/adaptable/src/Redux/ActionsReducers/PluginsRedux';
18
+ import StringExtensions from '@adaptabletools/adaptable/src/Utilities/Extensions/StringExtensions';
19
+ import { IPushPullViewPanelControl } from './View/IPushPullViewPanel';
20
+ // const suffix = name.endsWith('-cjs') ? '-cjs' : '';
21
+ // if (version !== coreVersion) {
22
+ // console.warn(`
23
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
24
+ // !!!!!!! "@adaptabletools/adaptable-plugin-ipushpull${suffix}" (v @${version}) and "@adaptabletools/adaptable${suffix}" (v @${coreVersion}) have different versions - they should have the exact same version.
25
+ // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26
+ // `);
27
+ // }
29
28
  const getApiKey = () => {
30
- let key = env_1.default.IPUSHPULL_API_KEY; // need to make sure that is always there
29
+ let key = env.IPUSHPULL_API_KEY; // need to make sure that is always there
31
30
  return key;
32
31
  };
33
32
  const getApiSecret = () => {
34
- let secret = env_1.default.IPUSHPULL_API_SECRET; // need to make sure that is always there
33
+ let secret = env.IPUSHPULL_API_SECRET; // need to make sure that is always there
35
34
  return secret;
36
35
  };
37
36
  const defaultOptions = {
@@ -50,7 +49,7 @@ const defaultOptions = {
50
49
  throttleTime: 2000,
51
50
  includeSystemReports: true,
52
51
  };
53
- class IPushPullPlugin extends types_1.AdaptablePlugin {
52
+ class IPushPullPlugin extends AdaptablePlugin {
54
53
  constructor(options) {
55
54
  super(options);
56
55
  this.pluginId = 'ipushpull';
@@ -61,9 +60,9 @@ class IPushPullPlugin extends types_1.AdaptablePlugin {
61
60
  if (!state) {
62
61
  // required for store initialization
63
62
  // (idiomatic way of default parameter value in reducer is not feasible because the passed argument is already initialized by the System reducer)
64
- augmentedState = Object.assign({}, augmentedState, IPushPullRedux_1.iPushPullInitialState);
63
+ augmentedState = Object.assign({}, augmentedState, iPushPullInitialState);
65
64
  }
66
- return (0, IPushPullRedux_1.IPushPullReducer)(augmentedState, action);
65
+ return IPushPullReducer(augmentedState, action);
67
66
  },
68
67
  };
69
68
  };
@@ -71,57 +70,57 @@ class IPushPullPlugin extends types_1.AdaptablePlugin {
71
70
  return (next) => {
72
71
  return (action) => {
73
72
  switch (action.type) {
74
- case PluginsRedux_1.IPUSHPULL_LOGIN: {
73
+ case IPUSHPULL_LOGIN: {
75
74
  const actionTyped = action;
76
75
  this.iPushPullApi.loginToIPushPull(actionTyped.username, actionTyped.password);
77
76
  return next(action);
78
77
  }
79
- case PluginsRedux_1.IPUSHPULL_SEND_SNAPSHOT: {
78
+ case IPUSHPULL_SEND_SNAPSHOT: {
80
79
  let iPushPullModule = (adaptable.adaptableModules.get(ModuleConstants.IPushPullModuleId));
81
80
  const actionTyped = action;
82
81
  iPushPullModule.sendSnapshot(actionTyped.iPushPullReport);
83
82
  middlewareAPI.dispatch(PopupRedux.PopupHideScreen());
84
83
  return next(action);
85
84
  }
86
- case PluginsRedux_1.IPUSHPULL_START_LIVE_DATA: {
85
+ case IPUSHPULL_START_LIVE_DATA: {
87
86
  let iPushPullModule = (adaptable.adaptableModules.get(ModuleConstants.IPushPullModuleId));
88
87
  const actionTyped = action;
89
88
  iPushPullModule.startLiveData(actionTyped.iPushPullReport);
90
89
  middlewareAPI.dispatch(PopupRedux.PopupHideScreen());
91
90
  return next(action);
92
91
  }
93
- case PluginsRedux_1.IPUSHPULL_STOP_LIVE_DATA: {
92
+ case IPUSHPULL_STOP_LIVE_DATA: {
94
93
  let iPushPullModule = (adaptable.adaptableModules.get(ModuleConstants.IPushPullModuleId));
95
94
  iPushPullModule.stopLiveData();
96
95
  return next(action);
97
96
  }
98
- case PluginsRedux_1.IPUSHPULL_ADD_PAGE: {
97
+ case IPUSHPULL_ADD_PAGE: {
99
98
  const actionTyped = action;
100
99
  this.iPushPullApi.addNewIPushPullPage(actionTyped.folder, actionTyped.page);
101
100
  return next(action);
102
101
  }
103
- case PluginsRedux_1.IPUSHPULL_SET_CURRENT_FOLDER: {
102
+ case IPUSHPULL_SET_CURRENT_FOLDER: {
104
103
  const actionTyped = action;
105
104
  const currentFolder = actionTyped.folder;
106
- const isFolderValid = StringExtensions_1.default.IsNotNullOrEmpty(currentFolder);
105
+ const isFolderValid = StringExtensions.IsNotNullOrEmpty(currentFolder);
107
106
  const availablePages = isFolderValid
108
107
  ? adaptable.api.pluginsApi
109
108
  .getipushpullPluginApi()
110
109
  .getPagesForIPushPullDomain(currentFolder)
111
110
  : [];
112
- middlewareAPI.dispatch((0, IPushPullRedux_1.IPushPullSetCurrentAvailablePages)(availablePages));
113
- middlewareAPI.dispatch((0, IPushPullRedux_1.IPushPullSetCurrentPage)(''));
111
+ middlewareAPI.dispatch(IPushPullSetCurrentAvailablePages(availablePages));
112
+ middlewareAPI.dispatch(IPushPullSetCurrentPage(''));
114
113
  return next(action);
115
114
  }
116
- case PluginsRedux_1.IPUSHPULL_DOMAIN_PAGES_SET: {
115
+ case IPUSHPULL_DOMAIN_PAGES_SET: {
117
116
  //refresh the available pages
118
117
  const currentFolder = middlewareAPI.getState().System.IPushPullCurrentFolder;
119
- const isFolderValid = StringExtensions_1.default.IsNotNullOrEmpty(currentFolder);
118
+ const isFolderValid = StringExtensions.IsNotNullOrEmpty(currentFolder);
120
119
  if (isFolderValid) {
121
120
  const availablePages = adaptable.api.pluginsApi
122
121
  .getipushpullPluginApi()
123
122
  .getPagesForIPushPullDomain(currentFolder);
124
- middlewareAPI.dispatch((0, IPushPullRedux_1.IPushPullSetCurrentAvailablePages)(availablePages));
123
+ middlewareAPI.dispatch(IPushPullSetCurrentAvailablePages(availablePages));
125
124
  }
126
125
  return next(action);
127
126
  }
@@ -146,20 +145,20 @@ class IPushPullPlugin extends types_1.AdaptablePlugin {
146
145
  * Includes ipushpull config and objects and, optionally, any ipushpull Reports (including schedules).
147
146
  */
148
147
  // IPushPull?: IPushPullState;
149
- ipushpull_js_1.default.config.set(this.options.ippConfig);
148
+ ipushpull.config.set(this.options.ippConfig);
150
149
  }
151
150
  afterInitApi(adaptable) {
152
- this.iPushPullApi = new IPushPullApiImpl_1.IPushPullApiImpl(adaptable, this.options);
153
- this.PushPullService = new PushPullService_1.PushPullService(adaptable);
154
- this.iPushPullApi.setIPushPullInstance(ipushpull_js_1.default);
151
+ this.iPushPullApi = new IPushPullApiImpl(adaptable, this.options);
152
+ this.PushPullService = new PushPullService(adaptable);
153
+ this.iPushPullApi.setIPushPullInstance(ipushpull);
155
154
  this.registerProperty('api', () => this.iPushPullApi);
156
155
  this.registerProperty('service', () => this.PushPullService);
157
156
  }
158
157
  afterInitModules(adaptable, modules) {
159
- modules.set(ModuleConstants_1.IPushPullModuleId, new PushPullModule_1.PushPullModule(adaptable.api));
160
- AdaptableViewFactory_1.AdaptableViewFactory.IPushPullLoginPopup = IPushPullLoginPopup_1.IPushPullLoginPopup;
161
- AdaptableViewFactory_1.AdaptableViewFactory.IPushPullAddPagePopup = IPushPullAddPagePopup_1.IPushPullAddPagePopup;
162
- AdaptableViewFactory_1.AdaptableViewPanelFactory.set(ModuleConstants_1.IPushPullModuleId, IPushPullViewPanel_1.IPushPullViewPanelControl);
158
+ modules.set(IPushPullModuleId, new PushPullModule(adaptable.api));
159
+ AdaptableViewFactory.IPushPullLoginPopup = IPushPullLoginPopup;
160
+ AdaptableViewFactory.IPushPullAddPagePopup = IPushPullAddPagePopup;
161
+ AdaptableViewPanelFactory.set(IPushPullModuleId, IPushPullViewPanelControl);
163
162
  }
164
163
  }
165
- exports.default = (options) => new IPushPullPlugin(options);
164
+ export default (options) => new IPushPullPlugin(options);