@adaptabletools/adaptable-plugin-ipushpull-cjs 22.0.2 → 22.0.4
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 +1 -1
- package/src/View/IPushPullAddPagePopup.js +8 -8
- package/src/View/IPushPullLoginPopup.js +5 -5
- package/src/View/IPushPullViewPanel.js +31 -47
- package/src/index.d.ts +4 -4
- package/src/index.js +6 -3
- package/src/ipushpull-client/IPushPullClient.d.ts +1 -0
- package/src/ipushpull-client/IPushPullClient.js +7 -6
- package/src/types.d.ts +1 -0
- package/src/types.js +2 -0
- package/src/View/IPushPullPopup.d.ts +0 -2
- package/src/View/IPushPullPopup.js +0 -41
package/package.json
CHANGED
|
@@ -8,14 +8,14 @@ const PopupRedux = tslib_1.__importStar(require("@adaptabletools/adaptable-cjs/s
|
|
|
8
8
|
const IPushPullRedux = tslib_1.__importStar(require("../Redux/ActionReducers/IPushPullRedux"));
|
|
9
9
|
const StringExtensions_1 = require("@adaptabletools/adaptable-cjs/src/Utilities/Extensions/StringExtensions");
|
|
10
10
|
const FormLayout_1 = tslib_1.__importStar(require("@adaptabletools/adaptable-cjs/src/components/FormLayout"));
|
|
11
|
-
const
|
|
11
|
+
const AdaptableInput_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable-cjs/src/View/Components/AdaptableInput"));
|
|
12
12
|
const SimpleButton_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable-cjs/src/components/SimpleButton"));
|
|
13
13
|
const PanelWithImage_1 = require("@adaptabletools/adaptable-cjs/src/View/Components/Panels/PanelWithImage");
|
|
14
14
|
const PopupContext_1 = require("@adaptabletools/adaptable-cjs/src/View/Components/Popups/AdaptablePopup/PopupContext");
|
|
15
15
|
const ErrorBox_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable-cjs/src/components/ErrorBox"));
|
|
16
16
|
const HelpBlock_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable-cjs/src/components/HelpBlock"));
|
|
17
17
|
const Flex_1 = require("@adaptabletools/adaptable-cjs/src/components/Flex");
|
|
18
|
-
const
|
|
18
|
+
const Select_1 = require("@adaptabletools/adaptable-cjs/src/components/Select");
|
|
19
19
|
const GeneralConstants_1 = require("@adaptabletools/adaptable-cjs/src/Utilities/Constants/GeneralConstants");
|
|
20
20
|
const ArrayExtensions_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable-cjs/src/Utilities/Extensions/ArrayExtensions"));
|
|
21
21
|
const IPushPullAddPageComponent = (props) => {
|
|
@@ -39,11 +39,11 @@ const IPushPullAddPageComponent = (props) => {
|
|
|
39
39
|
setState({ ...state, Page: e.value });
|
|
40
40
|
};
|
|
41
41
|
const onFolderChanged = (folderName) => {
|
|
42
|
-
if (StringExtensions_1.StringExtensions.IsNotNullOrEmpty(folderName)
|
|
43
|
-
let
|
|
42
|
+
if (StringExtensions_1.StringExtensions.IsNotNullOrEmpty(folderName)) {
|
|
43
|
+
let availablePages = props.IPushPullDomainsPages.find((f) => f.Name == folderName)?.Pages ?? [];
|
|
44
44
|
setState({
|
|
45
45
|
Folder: folderName,
|
|
46
|
-
AvailablePages:
|
|
46
|
+
AvailablePages: availablePages,
|
|
47
47
|
Page: GeneralConstants_1.EMPTY_STRING,
|
|
48
48
|
ErrorMessage: GeneralConstants_1.EMPTY_STRING,
|
|
49
49
|
});
|
|
@@ -71,10 +71,10 @@ const IPushPullAddPageComponent = (props) => {
|
|
|
71
71
|
React.createElement(Flex_1.Flex, { flexDirection: "column", className: "twa:p-2 twa:m-2" },
|
|
72
72
|
React.createElement(HelpBlock_1.default, { className: "twa:mb-1" }, "Select a folder and then choose the name of the new ipushpull page it should contain."),
|
|
73
73
|
React.createElement(FormLayout_1.default, { className: "twa:m-3" },
|
|
74
|
-
React.createElement(FormLayout_1.FormRow, { label: "Folder
|
|
75
|
-
React.createElement(
|
|
74
|
+
React.createElement(FormLayout_1.FormRow, { label: "Folder" },
|
|
75
|
+
React.createElement(Select_1.Select, { disabled: availableFolders.length == 0, options: availableFolders, className: "ab-Popup__IPushPull__select twa:min-w-[50%] twa:mr-2", onChange: (folder) => onFolderChanged(folder), value: state.Folder || undefined, placeholder: "Select Folder", isClearable: true })),
|
|
76
76
|
React.createElement(FormLayout_1.FormRow, { label: "Page" },
|
|
77
|
-
React.createElement(
|
|
77
|
+
React.createElement(AdaptableInput_1.default, { className: "twa:w-1/2", type: "text", placeholder: "Page Name", value: state.Page, disabled: StringExtensions_1.StringExtensions.IsNullOrEmpty(state.Folder), onChange: onPageNameChange })),
|
|
78
78
|
state.ErrorMessage ? (React.createElement(FormLayout_1.FormRow, { label: "" },
|
|
79
79
|
React.createElement(ErrorBox_1.default, null, state.ErrorMessage))) : null)),
|
|
80
80
|
React.createElement(Flex_1.Flex, { className: "twa:p-2", justifyContent: "space-between" },
|
|
@@ -9,7 +9,7 @@ const PopupRedux = tslib_1.__importStar(require("@adaptabletools/adaptable-cjs/s
|
|
|
9
9
|
const IPushPullRedux = tslib_1.__importStar(require("../Redux/ActionReducers/IPushPullRedux"));
|
|
10
10
|
const StringExtensions_1 = require("@adaptabletools/adaptable-cjs/src/Utilities/Extensions/StringExtensions");
|
|
11
11
|
const FormLayout_1 = tslib_1.__importStar(require("@adaptabletools/adaptable-cjs/src/components/FormLayout"));
|
|
12
|
-
const
|
|
12
|
+
const AdaptableInput_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable-cjs/src/View/Components/AdaptableInput"));
|
|
13
13
|
const SimpleButton_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable-cjs/src/components/SimpleButton"));
|
|
14
14
|
const PanelWithImage_1 = require("@adaptabletools/adaptable-cjs/src/View/Components/Panels/PanelWithImage");
|
|
15
15
|
const PopupContext_1 = require("@adaptabletools/adaptable-cjs/src/View/Components/Popups/AdaptablePopup/PopupContext");
|
|
@@ -43,10 +43,10 @@ const IPushPullLoginComponent = (props) => {
|
|
|
43
43
|
React.createElement(Flex_1.Flex, { flexDirection: "column", className: "twa:p-2 twa:m-2" },
|
|
44
44
|
React.createElement(HelpBlock_1.default, { className: "twa:mb-1" }, "Login to ipushpull using your login (email address) and password."),
|
|
45
45
|
React.createElement(FormLayout_1.default, { className: "twa:m-3" },
|
|
46
|
-
React.createElement(FormLayout_1.FormRow, { label: "
|
|
47
|
-
React.createElement(
|
|
48
|
-
React.createElement(FormLayout_1.FormRow, { label: "
|
|
49
|
-
React.createElement(
|
|
46
|
+
React.createElement(FormLayout_1.FormRow, { label: "User" },
|
|
47
|
+
React.createElement(AdaptableInput_1.default, { className: "twa:w-full", type: "email", placeholder: "Email address", value: state.Login, onChange: onLoginChange })),
|
|
48
|
+
React.createElement(FormLayout_1.FormRow, { label: "Password" },
|
|
49
|
+
React.createElement(AdaptableInput_1.default, { className: "twa:w-full", type: "password", placeholder: "Password", value: state.Password, onChange: onPasswordChange })),
|
|
50
50
|
props.pushpullLoginErrorMessage ? (React.createElement(FormLayout_1.FormRow, { label: "" },
|
|
51
51
|
React.createElement(ErrorBox_1.default, null, props.pushpullLoginErrorMessage))) : null)),
|
|
52
52
|
React.createElement(Flex_1.Flex, { className: "twa:p-2", justifyContent: "space-between" },
|
|
@@ -8,7 +8,7 @@ const React = tslib_1.__importStar(require("react"));
|
|
|
8
8
|
const ObjectFactory_1 = tslib_1.__importDefault(require("@adaptabletools/adaptable-cjs/src/Utilities/ObjectFactory"));
|
|
9
9
|
const StringExtensions_1 = require("@adaptabletools/adaptable-cjs/src/Utilities/Extensions/StringExtensions");
|
|
10
10
|
const Flex_1 = require("@adaptabletools/adaptable-cjs/src/components/Flex");
|
|
11
|
-
const
|
|
11
|
+
const Select_1 = require("@adaptabletools/adaptable-cjs/src/components/Select");
|
|
12
12
|
const ButtonExport_1 = require("@adaptabletools/adaptable-cjs/src/View/Components/Buttons/ButtonExport");
|
|
13
13
|
const ButtonPause_1 = require("@adaptabletools/adaptable-cjs/src/View/Components/Buttons/ButtonPause");
|
|
14
14
|
const ButtonPlay_1 = require("@adaptabletools/adaptable-cjs/src/View/Components/Buttons/ButtonPlay");
|
|
@@ -66,58 +66,42 @@ const IPushPullViewPanelComponent = (props) => {
|
|
|
66
66
|
let allReports = systemReports
|
|
67
67
|
.filter((s) => props.api.exportApi.internalApi.isSystemReportActive(s))
|
|
68
68
|
.concat(props.Reports.map((r) => r.Name));
|
|
69
|
-
let availableReports = allReports.map((report) => {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
let
|
|
84
|
-
|
|
85
|
-
label: page,
|
|
86
|
-
value: page,
|
|
87
|
-
onClick: () => onPageChanged(page),
|
|
88
|
-
};
|
|
89
|
-
}) ?? [];
|
|
90
|
-
// this is clearly ridiculous!
|
|
91
|
-
// im getting tired...
|
|
92
|
-
let isCompletedReport = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullReportName) &&
|
|
93
|
-
StringExtensions_1.StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullFolder) &&
|
|
94
|
-
StringExtensions_1.StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullPage);
|
|
69
|
+
let availableReports = allReports.map((report) => ({
|
|
70
|
+
label: report,
|
|
71
|
+
value: report,
|
|
72
|
+
}));
|
|
73
|
+
let availableFolders = props.IPushPullDomainsPages?.map((iPushPullDomain) => ({
|
|
74
|
+
label: iPushPullDomain.Name,
|
|
75
|
+
value: iPushPullDomain.Name,
|
|
76
|
+
})) ?? [];
|
|
77
|
+
let availablePages = props.CurrentIPushPullAvailablePages?.map((page) => ({
|
|
78
|
+
label: page,
|
|
79
|
+
value: page,
|
|
80
|
+
})) ?? [];
|
|
81
|
+
let hasReport = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullReportName);
|
|
82
|
+
let hasFolder = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullFolder);
|
|
83
|
+
let hasPage = StringExtensions_1.StringExtensions.IsNotNullOrEmpty(props.CurrentIPushPullPage);
|
|
84
|
+
let isCompletedReport = hasReport && hasFolder && hasPage;
|
|
95
85
|
let isLiveIPushPullReport = isCompletedReport &&
|
|
96
86
|
props.CurrentLiveIPushPullReport &&
|
|
97
87
|
props.CurrentIPushPullReportName == props.CurrentLiveIPushPullReport.ReportName &&
|
|
98
88
|
props.CurrentIPushPullFolder == props.CurrentLiveIPushPullReport.Folder &&
|
|
99
89
|
props.CurrentIPushPullPage == props.CurrentLiveIPushPullReport.Page;
|
|
100
90
|
const elementType = props.viewType === 'Toolbar' ? 'DashboardToolbar' : 'ToolPanel';
|
|
101
|
-
return props.IsIPushPullRunning ? (React.createElement(Flex_1.Flex, { flexDirection: "row", className: `ab-${elementType}__IPushPull__wrap`, flexWrap: props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
102
|
-
React.createElement(Flex_1.Flex,
|
|
103
|
-
React.createElement(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
React.createElement(Flex_1.Flex,
|
|
107
|
-
React.createElement(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
:
|
|
114
|
-
|
|
115
|
-
React.createElement(ButtonExport_1.ButtonExport, { className: `ab-${elementType}__IPushPull__export twa:ml-1`, onClick: () => onIPushPullSendSnapshot(), tooltip: "Send Snapshot to ipushpull", disabled: isLiveIPushPullReport || !isCompletedReport, accessLevel: props.accessLevel }),
|
|
116
|
-
isLiveIPushPullReport ? (React.createElement(ButtonPause_1.ButtonPause, { className: `ab-${elementType}__IPushPull__pause twa:ml-1 twa:fill-red-500`, onClick: () => props.onIPushPullStopLiveData(), tooltip: "Stop sync with ipushpull", disabled: !isLiveIPushPullReport, accessLevel: props.accessLevel })) : (React.createElement(ButtonPlay_1.ButtonPlay, { className: `ab-${elementType}__IPushPull__play twa:ml-1`, onClick: () => onIPushPullStartLiveData(), tooltip: "Start sync with ipushpull", disabled: isLiveIPushPullReport || !isCompletedReport, accessLevel: props.accessLevel })),
|
|
117
|
-
isCompletedReport && (React.createElement(Flex_1.Flex, { className: (0, join_1.default)(props.accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__IPushPull__controls`), alignItems: "stretch" }, props.api.entitlementApi.isModuleFullEntitlement('Schedule') && (React.createElement(ButtonSchedule_1.ButtonSchedule, { className: `ab-${elementType}__IPushPull__schedule twa:ml-1`, onClick: () => onNewIPushPullSchedule(), tooltip: "Schedule", disabled: isLiveIPushPullReport || !isCompletedReport, accessLevel: props.accessLevel })))),
|
|
118
|
-
' ',
|
|
119
|
-
React.createElement(ButtonNewPage_1.ButtonNewPage, { className: `ab-${elementType}__IPushPull__newpage twa:ml-1`, onClick: () => props.onShowAddIPushPullPage(), tooltip: "New Page", disabled: isLiveIPushPullReport, accessLevel: props.accessLevel }),
|
|
120
|
-
React.createElement(ButtonLogout_1.ButtonLogout, { className: `ab-${elementType}__IPushPull__logout twa:ml-1`, onClick: () => getIPPApi().logoutFromIPushPull(), tooltip: "Logout", disabled: isLiveIPushPullReport, accessLevel: props.accessLevel })))) : (React.createElement(ButtonLogin_1.ButtonLogin, { className: `ab-${elementType}__IPushPull__login twa:ml-1`, onClick: () => props.onShowIPushPullLogin(), tooltip: "Login to ipushpull", accessLevel: props.accessLevel },
|
|
91
|
+
return props.IsIPushPullRunning ? (React.createElement(Flex_1.Flex, { flexDirection: "row", className: `ab-${elementType}__IPushPull__wrap twa:gap-1`, flexWrap: props.viewType === 'ToolPanel' ? 'wrap' : 'nowrap' },
|
|
92
|
+
React.createElement(Flex_1.Flex, { className: "twa:min-w-[140px]" },
|
|
93
|
+
React.createElement(Select_1.Select, { disabled: allReports.length == 0 || isLiveIPushPullReport, options: availableReports, className: `ab-${elementType}__IPushPull__select twa:w-full`, placeholder: "Select Report", onChange: (reportName) => onSelectedReportChanged(reportName), value: props.CurrentIPushPullReportName, isClearable: true })),
|
|
94
|
+
React.createElement(Flex_1.Flex, { className: "twa:min-w-[140px]" },
|
|
95
|
+
React.createElement(Select_1.Select, { disabled: !hasReport || isLiveIPushPullReport, options: availableFolders, className: `ab-${elementType}__IPushPull__select twa:w-full`, placeholder: "Select Folder", onChange: (folder) => onFolderChanged(folder), value: props.CurrentIPushPullFolder, isClearable: true })),
|
|
96
|
+
React.createElement(Flex_1.Flex, { className: "twa:min-w-[140px]" },
|
|
97
|
+
React.createElement(Select_1.Select, { disabled: !hasFolder || isLiveIPushPullReport, options: availablePages, className: `ab-${elementType}__IPushPull__select twa:w-full`, placeholder: "Select Page", onChange: (page) => onPageChanged(page), value: props.CurrentIPushPullPage, isClearable: true })),
|
|
98
|
+
React.createElement(Flex_1.Flex, { className: (0, join_1.default)(props.accessLevel == 'ReadOnly' ? GeneralConstants.READ_ONLY_STYLE : '', `ab-${elementType}__IPushPull__controls twa:w-full`) },
|
|
99
|
+
React.createElement(Flex_1.Flex, null,
|
|
100
|
+
React.createElement(ButtonExport_1.ButtonExport, { className: `ab-${elementType}__IPushPull__export`, onClick: () => onIPushPullSendSnapshot(), tooltip: "Send Snapshot to ipushpull", disabled: isLiveIPushPullReport || !isCompletedReport, accessLevel: props.accessLevel }),
|
|
101
|
+
isLiveIPushPullReport ? (React.createElement(ButtonPause_1.ButtonPause, { className: `ab-${elementType}__IPushPull__pause twa:fill-red-500`, onClick: () => props.onIPushPullStopLiveData(), tooltip: "Stop sync with ipushpull", disabled: !isLiveIPushPullReport, accessLevel: props.accessLevel })) : (React.createElement(ButtonPlay_1.ButtonPlay, { className: `ab-${elementType}__IPushPull__play`, onClick: () => onIPushPullStartLiveData(), tooltip: "Start sync with ipushpull", disabled: isLiveIPushPullReport || !isCompletedReport, accessLevel: props.accessLevel })),
|
|
102
|
+
props.api.entitlementApi.isModuleFullEntitlement('Schedule') && (React.createElement(ButtonSchedule_1.ButtonSchedule, { className: `ab-${elementType}__IPushPull__schedule`, onClick: () => onNewIPushPullSchedule(), tooltip: "Schedule", disabled: isLiveIPushPullReport || !isCompletedReport, accessLevel: props.accessLevel })),
|
|
103
|
+
React.createElement(ButtonNewPage_1.ButtonNewPage, { className: `ab-${elementType}__IPushPull__newpage`, onClick: () => props.onShowAddIPushPullPage(), tooltip: "New Page", disabled: !hasFolder || isLiveIPushPullReport, accessLevel: props.accessLevel }),
|
|
104
|
+
React.createElement(ButtonLogout_1.ButtonLogout, { className: `ab-${elementType}__IPushPull__logout`, onClick: () => getIPPApi().logoutFromIPushPull(), tooltip: "Logout", disabled: isLiveIPushPullReport, accessLevel: props.accessLevel }))))) : (React.createElement(ButtonLogin_1.ButtonLogin, { className: `ab-${elementType}__IPushPull__login twa:ml-1`, onClick: () => props.onShowIPushPullLogin(), tooltip: "Login to ipushpull", accessLevel: props.accessLevel },
|
|
121
105
|
' ',
|
|
122
106
|
"Login"));
|
|
123
107
|
};
|
package/src/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { Middleware } from 'redux';
|
|
|
3
3
|
import * as Redux from 'redux';
|
|
4
4
|
import { IPushPullState } from "@adaptabletools/adaptable-cjs/src/AdaptableState/IPushPullState";
|
|
5
5
|
import { IPushPullApi } from "@adaptabletools/adaptable-cjs/src/Api/IPushPullApi";
|
|
6
|
-
import { IPushPullPluginOptions } from './
|
|
6
|
+
import { IPushPullPluginOptions } from './types';
|
|
7
7
|
import { IAdaptable } from "@adaptabletools/adaptable-cjs/src/AdaptableInterfaces/IAdaptable";
|
|
8
8
|
declare class IPushPullPlugin extends AdaptablePlugin {
|
|
9
9
|
options: IPushPullPluginOptions;
|
|
@@ -18,6 +18,6 @@ declare class IPushPullPlugin extends AdaptablePlugin {
|
|
|
18
18
|
reduxMiddleware: (adaptable: IAdaptable) => Middleware;
|
|
19
19
|
afterInitStore(adaptable: IAdaptable): void;
|
|
20
20
|
}
|
|
21
|
-
export type { IPushPullPluginOptions, IPushPullConfig } from './
|
|
22
|
-
declare const
|
|
23
|
-
export default
|
|
21
|
+
export type { IPushPullPluginOptions, IPushPullConfig } from './types';
|
|
22
|
+
export declare const ipushpullPlugin: (options?: IPushPullPluginOptions) => IPushPullPlugin;
|
|
23
|
+
export default ipushpullPlugin;
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ipushpullPlugin = void 0;
|
|
3
4
|
const tslib_1 = require("tslib");
|
|
4
5
|
const types_1 = require("@adaptabletools/adaptable-cjs/types");
|
|
5
6
|
const env_1 = tslib_1.__importDefault(require("./env"));
|
|
@@ -135,7 +136,7 @@ class IPushPullPlugin extends types_1.AdaptablePlugin {
|
|
|
135
136
|
return next(action);
|
|
136
137
|
}
|
|
137
138
|
case PluginsRedux_1.IPUSHPULL_DOMAIN_PAGES_SET: {
|
|
138
|
-
|
|
139
|
+
const result = next(action);
|
|
139
140
|
const currentFolder = middlewareAPI.getState().Internal.IPushPullCurrentFolder;
|
|
140
141
|
const isFolderValid = StringExtensions_1.default.IsNotNullOrEmpty(currentFolder);
|
|
141
142
|
if (isFolderValid) {
|
|
@@ -144,7 +145,7 @@ class IPushPullPlugin extends types_1.AdaptablePlugin {
|
|
|
144
145
|
.getPagesForIPushPullDomain(currentFolder);
|
|
145
146
|
middlewareAPI.dispatch((0, IPushPullRedux_1.IPushPullSetCurrentAvailablePages)(availablePages));
|
|
146
147
|
}
|
|
147
|
-
return
|
|
148
|
+
return result;
|
|
148
149
|
}
|
|
149
150
|
default: {
|
|
150
151
|
return next(action);
|
|
@@ -160,4 +161,6 @@ class IPushPullPlugin extends types_1.AdaptablePlugin {
|
|
|
160
161
|
AdaptableViewFactory_1.AdaptableViewPanelFactory.set(ModuleConstants_1.IPushPullModuleId, IPushPullViewPanel_1.IPushPullViewPanelControl);
|
|
161
162
|
}
|
|
162
163
|
}
|
|
163
|
-
|
|
164
|
+
const ipushpullPlugin = (options) => new IPushPullPlugin(options);
|
|
165
|
+
exports.ipushpullPlugin = ipushpullPlugin;
|
|
166
|
+
exports.default = exports.ipushpullPlugin;
|
|
@@ -4,6 +4,7 @@ export declare class IPushPullClient {
|
|
|
4
4
|
private tokens;
|
|
5
5
|
private refreshPromise;
|
|
6
6
|
constructor(config: IPushPullClientConfig);
|
|
7
|
+
private getBasicAuthHeader;
|
|
7
8
|
private buildOAuthBody;
|
|
8
9
|
login(username: string, password: string): Promise<IPushPullTokens>;
|
|
9
10
|
refreshToken(): Promise<IPushPullTokens>;
|
|
@@ -9,13 +9,12 @@ class IPushPullClient {
|
|
|
9
9
|
constructor(config) {
|
|
10
10
|
this.config = config;
|
|
11
11
|
}
|
|
12
|
+
getBasicAuthHeader() {
|
|
13
|
+
const credentials = `${this.config.api_key}:${this.config.api_secret}`;
|
|
14
|
+
return `Basic ${btoa(credentials)}`;
|
|
15
|
+
}
|
|
12
16
|
buildOAuthBody(params) {
|
|
13
|
-
|
|
14
|
-
...params,
|
|
15
|
-
client_id: this.config.api_key,
|
|
16
|
-
client_secret: this.config.api_secret,
|
|
17
|
-
};
|
|
18
|
-
return Object.entries(allParams)
|
|
17
|
+
return Object.entries(params)
|
|
19
18
|
.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
|
|
20
19
|
.join('&');
|
|
21
20
|
}
|
|
@@ -30,6 +29,7 @@ class IPushPullClient {
|
|
|
30
29
|
method: 'POST',
|
|
31
30
|
headers: {
|
|
32
31
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
32
|
+
Authorization: this.getBasicAuthHeader(),
|
|
33
33
|
},
|
|
34
34
|
body,
|
|
35
35
|
});
|
|
@@ -70,6 +70,7 @@ class IPushPullClient {
|
|
|
70
70
|
method: 'POST',
|
|
71
71
|
headers: {
|
|
72
72
|
'Content-Type': 'application/x-www-form-urlencoded',
|
|
73
|
+
Authorization: this.getBasicAuthHeader(),
|
|
73
74
|
},
|
|
74
75
|
body,
|
|
75
76
|
});
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { IPushPullPluginOptions, IPushPullConfig } from './IPushPullPluginOptions';
|
package/src/types.js
ADDED
|
@@ -1,41 +0,0 @@
|
|
|
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-cjs/src/View/Components/Panels/PanelWithButton");
|
|
8
|
-
const IPushPullRedux = tslib_1.__importStar(require("../Redux/ActionReducers/IPushPullRedux"));
|
|
9
|
-
const TeamSharingRedux = tslib_1.__importStar(require("@adaptabletools/adaptable-cjs/src/Redux/ActionsReducers/TeamSharingRedux"));
|
|
10
|
-
const ModuleConstants = tslib_1.__importStar(require("@adaptabletools/adaptable-cjs/src/Utilities/Constants/ModuleConstants"));
|
|
11
|
-
const UIHelper_1 = require("@adaptabletools/adaptable-cjs/src/View/UIHelper");
|
|
12
|
-
class IPushPullPopupComponent extends React.Component {
|
|
13
|
-
constructor(props) {
|
|
14
|
-
super(props);
|
|
15
|
-
this.state = UIHelper_1.UIHelper.getEmptyConfigState();
|
|
16
|
-
}
|
|
17
|
-
shouldClosePopupOnFinishWizard = false;
|
|
18
|
-
componentDidMount() {
|
|
19
|
-
if (this.props.popupParams) {
|
|
20
|
-
this.shouldClosePopupOnFinishWizard =
|
|
21
|
-
this.props.popupParams.source && this.props.popupParams.source == 'Toolbar';
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
render() {
|
|
25
|
-
return (React.createElement(PanelWithButton_1.PanelWithButton, { headerText: this.props.moduleInfo.FriendlyName, bodyProps: { className: 'twa:p-0' }, glyphicon: this.props.moduleInfo.Glyph, infoLink: this.props.moduleInfo.HelpPage, infoLinkDisabled: !this.props.api.internalApi.isDocumentationLinksDisplayed() }));
|
|
26
|
-
}
|
|
27
|
-
onApplyExport(iPushPullReport) {
|
|
28
|
-
this.props.onIPushPullSendSnapshot(iPushPullReport);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function mapStateToProps(state) {
|
|
32
|
-
return {};
|
|
33
|
-
}
|
|
34
|
-
function mapDispatchToProps(dispatch) {
|
|
35
|
-
return {
|
|
36
|
-
onIPushPullSendSnapshot: (report) => dispatch(IPushPullRedux.IPushPullSendSnapshot(report)),
|
|
37
|
-
onIPushPullStopLiveData: () => dispatch(IPushPullRedux.IPushPullStopLiveData()),
|
|
38
|
-
onShare: (entity, config) => dispatch(TeamSharingRedux.TeamSharingShare(entity, ModuleConstants.IPushPullModuleId, config)),
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
exports.IPushPullPopup = (0, react_redux_1.connect)(mapStateToProps, mapDispatchToProps)(IPushPullPopupComponent);
|