@bigbinary/neeto-integrations-frontend 2.10.5 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@ import React__default, { useState, useEffect } from 'react';
3
3
  import '@bigbinary/neeto-molecules/IntegrationCard';
4
4
  import DisconnectAlert from '@bigbinary/neeto-molecules/IntegrationDisconnectAlert';
5
5
  import WalkthroughModal from '@bigbinary/neeto-molecules/IntegrationWalkthroughModal';
6
+ import classnames from 'classnames';
6
7
  import i18next, { t as t$1 } from 'i18next';
7
8
  import { humanize, noop, isPresent, isNotEmpty } from '@bigbinary/neeto-cist';
8
9
  import { withT, useMutationWithInvalidation, withTitle, useQueryParams } from '@bigbinary/neeto-commons-frontend/react-utils';
@@ -17,7 +18,6 @@ import { Form as Form$2, Input } from '@bigbinary/neetoui/formik';
17
18
  import 'ramda';
18
19
  import * as yup from 'yup';
19
20
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
20
- import classnames from 'classnames';
21
21
  import { Check } from '@bigbinary/neeto-icons';
22
22
 
23
23
  function _typeof(o) {
@@ -146,6 +146,8 @@ var Manage$1 = withT(function (_ref) {
146
146
  setIsDisconnectAlertOpen = _ref$setIsDisconnectA === void 0 ? noop : _ref$setIsDisconnectA,
147
147
  _ref$isDisconnecting = _ref.isDisconnecting,
148
148
  isDisconnecting = _ref$isDisconnecting === void 0 ? false : _ref$isDisconnecting,
149
+ _ref$onConnect = _ref.onConnect,
150
+ onConnect = _ref$onConnect === void 0 ? undefined : _ref$onConnect,
149
151
  _ref$onDisconnect = _ref.onDisconnect,
150
152
  onDisconnect = _ref$onDisconnect === void 0 ? undefined : _ref$onDisconnect,
151
153
  _ref$onClose = _ref.onClose,
@@ -162,10 +164,14 @@ var Manage$1 = withT(function (_ref) {
162
164
  helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
163
165
  _ref$managePath = _ref.managePath,
164
166
  managePath = _ref$managePath === void 0 ? "" : _ref$managePath,
167
+ _ref$manageUrl = _ref.manageUrl,
168
+ manageUrl = _ref$manageUrl === void 0 ? "" : _ref$manageUrl,
165
169
  _ref$integrationName = _ref.integrationName,
166
170
  integrationName = _ref$integrationName === void 0 ? "" : _ref$integrationName,
167
171
  _ref$disconnectMessag = _ref.disconnectMessage,
168
172
  disconnectMessage = _ref$disconnectMessag === void 0 ? "" : _ref$disconnectMessag,
173
+ _ref$disconnectTitle = _ref.disconnectTitle,
174
+ disconnectTitle = _ref$disconnectTitle === void 0 ? "" : _ref$disconnectTitle,
169
175
  _ref$isConnectDisable = _ref.isConnectDisabled,
170
176
  isConnectDisabled = _ref$isConnectDisable === void 0 ? false : _ref$isConnectDisable,
171
177
  _ref$connectTooltipPr = _ref.connectTooltipProps,
@@ -190,11 +196,13 @@ var Manage$1 = withT(function (_ref) {
190
196
  }, /*#__PURE__*/React__default.createElement(Check, {
191
197
  size: 24
192
198
  }))), /*#__PURE__*/React__default.createElement(Typography, {
193
- className: "neeto-ui-text-gray-800 break-all",
194
199
  style: "body1",
195
- weight: "normal"
200
+ weight: "normal",
201
+ className: classnames("neeto-ui-text-gray-800", {
202
+ "break-all": isConnected
203
+ })
196
204
  }, description), helpDocUrl && /*#__PURE__*/React__default.createElement(Typography, {
197
- className: "neeto-ui-text-gray-800 break-all",
205
+ className: "neeto-ui-text-gray-800",
198
206
  style: "body2",
199
207
  weight: "normal"
200
208
  }, /*#__PURE__*/React__default.createElement(Trans, {
@@ -211,8 +219,10 @@ var Manage$1 = withT(function (_ref) {
211
219
  }
212
220
  }))), isConnected ? /*#__PURE__*/React__default.createElement("div", {
213
221
  className: "space-x-2"
214
- }, managePath && /*#__PURE__*/React__default.createElement(Button, {
222
+ }, (managePath || manageUrl) && /*#__PURE__*/React__default.createElement(Button, {
215
223
  "data-cy": "manage-button",
224
+ href: manageUrl,
225
+ target: manageUrl ? "_blank" : "_self",
216
226
  to: managePath,
217
227
  label: t("neetoIntegrations.common.manageIntegration", {
218
228
  integration: integrationName || humanize(integration)
@@ -226,7 +236,7 @@ var Manage$1 = withT(function (_ref) {
226
236
  onClick: function onClick() {
227
237
  return setIsDisconnectAlertOpen(true);
228
238
  }
229
- })) : /*#__PURE__*/React__default.createElement(Button, {
239
+ })) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, (connectPath || connectUrl || onConnect) && /*#__PURE__*/React__default.createElement(Button, {
230
240
  "data-cy": "connect-button",
231
241
  disabled: isConnectDisabled,
232
242
  href: connectUrl,
@@ -234,14 +244,15 @@ var Manage$1 = withT(function (_ref) {
234
244
  tooltipProps: connectTooltipProps,
235
245
  label: t("neetoIntegrations.common.connectIntegration", {
236
246
  integration: integrationName || humanize(integration)
237
- })
238
- }))), /*#__PURE__*/React__default.createElement(DisconnectAlert, {
247
+ }),
248
+ onClick: onConnect
249
+ })))), /*#__PURE__*/React__default.createElement(DisconnectAlert, {
239
250
  isDisconnecting: isDisconnecting,
240
251
  onClose: onClose,
241
252
  onDisconnect: onDisconnect,
242
253
  isOpen: isDisconnectAlertOpen,
243
- title: t("settings.integrations.".concat(integration, ".disconnect.title")),
244
- message: disconnectMessage || t("settings.integrations.".concat(integration, ".disconnect.message"))
254
+ message: disconnectMessage || t("settings.integrations.".concat(integration, ".disconnect.message")),
255
+ title: disconnectTitle || t("settings.integrations.".concat(integration, ".disconnect.title"))
245
256
  }));
246
257
  });
247
258
 
@@ -691,7 +702,8 @@ var Connect = withT(function (_ref) {
691
702
  buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
692
703
  _ref$onConnect = _ref.onConnect,
693
704
  onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect,
694
- children = _ref.children;
705
+ children = _ref.children,
706
+ secondaryButtonProps = _ref.secondaryButtonProps;
695
707
  return /*#__PURE__*/React__default.createElement("div", {
696
708
  className: "mx-auto w-full max-w-lg"
697
709
  }, /*#__PURE__*/React__default.createElement(Icon, {
@@ -704,10 +716,14 @@ var Connect = withT(function (_ref) {
704
716
  className: "neeto-ui-text-gray-700 mb-8",
705
717
  style: "body1",
706
718
  weight: "normal"
707
- }, description), children, /*#__PURE__*/React__default.createElement(Button, _extends$1({
719
+ }, description), children, /*#__PURE__*/React__default.createElement("div", {
720
+ className: "flex w-full items-start space-x-4"
721
+ }, /*#__PURE__*/React__default.createElement(Button, _extends$1({
708
722
  label: t("neetoIntegrations.common.connect"),
709
723
  onClick: onConnect
710
- }, buttonProps)));
724
+ }, buttonProps)), isNotEmpty(secondaryButtonProps) && /*#__PURE__*/React__default.createElement(Button, _extends$1({
725
+ style: "secondary"
726
+ }, secondaryButtonProps))));
711
727
  });
712
728
  Connect.prototypes = {
713
729
  /**