@bigbinary/neeto-integrations-frontend 2.10.4 → 2.10.6

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/dist/Zoom.js CHANGED
@@ -4,6 +4,7 @@ import { isPresent, noop, isNotEmpty, humanize } from '@bigbinary/neeto-cist';
4
4
  import { Daily as Daily$1, Zoom as Zoom$1 } from '@bigbinary/neeto-icons/misc';
5
5
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
6
6
  import { useTranslation, Trans } from 'react-i18next';
7
+ import classnames from 'classnames';
7
8
  import '@bigbinary/neeto-molecules/IntegrationCard';
8
9
  import DisconnectAlert from '@bigbinary/neeto-molecules/IntegrationDisconnectAlert';
9
10
  import WalkthroughModal from '@bigbinary/neeto-molecules/IntegrationWalkthroughModal';
@@ -17,38 +18,37 @@ import { Button, Typography } from '@bigbinary/neetoui';
17
18
  import { Form as Form$2, Input } from '@bigbinary/neetoui/formik';
18
19
  import 'ramda';
19
20
  import * as yup from 'yup';
20
- import classnames from 'classnames';
21
21
  import { Check } from '@bigbinary/neeto-icons';
22
22
 
23
23
  function _arrayWithHoles(arr) {
24
24
  if (Array.isArray(arr)) return arr;
25
25
  }
26
26
 
27
- function _iterableToArrayLimit(arr, i) {
28
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
29
- if (null != _i) {
30
- var _s,
31
- _e,
32
- _x,
33
- _r,
34
- _arr = [],
35
- _n = !0,
36
- _d = !1;
27
+ function _iterableToArrayLimit(r, l) {
28
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
29
+ if (null != t) {
30
+ var e,
31
+ n,
32
+ i,
33
+ u,
34
+ a = [],
35
+ f = !0,
36
+ o = !1;
37
37
  try {
38
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
39
- if (Object(_i) !== _i) return;
40
- _n = !1;
41
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
42
- } catch (err) {
43
- _d = !0, _e = err;
38
+ if (i = (t = t.call(r)).next, 0 === l) {
39
+ if (Object(t) !== t) return;
40
+ f = !1;
41
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
42
+ } catch (r) {
43
+ o = !0, n = r;
44
44
  } finally {
45
45
  try {
46
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
46
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
47
47
  } finally {
48
- if (_d) throw _e;
48
+ if (o) throw n;
49
49
  }
50
50
  }
51
- return _arr;
51
+ return a;
52
52
  }
53
53
  }
54
54
 
@@ -75,14 +75,14 @@ function _slicedToArray(arr, i) {
75
75
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
76
76
  }
77
77
 
78
- function _typeof(obj) {
78
+ function _typeof(o) {
79
79
  "@babel/helpers - typeof";
80
80
 
81
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
82
- return typeof obj;
83
- } : function (obj) {
84
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
85
- }, _typeof(obj);
81
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
82
+ return typeof o;
83
+ } : function (o) {
84
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
85
+ }, _typeof(o);
86
86
  }
87
87
 
88
88
  function _toPrimitive(input, hint) {
@@ -145,8 +145,8 @@ var QUERY_KEYS = {
145
145
  ZOOM_DETAILS: "zoom-details"
146
146
  };
147
147
 
148
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
149
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
148
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
149
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
150
150
  var useCreateDaily = function useCreateDaily() {
151
151
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
152
152
  return useMutationWithInvalidation(dailiesApi.create, _objectSpread({
@@ -329,7 +329,7 @@ var Manage$1 = function Manage$1(_ref) {
329
329
  var _useDestroyDaily = useDestroyDaily({
330
330
  onSuccess: function onSuccess() {
331
331
  setIsDisconnectAlertOpen(false);
332
- onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
332
+ onDisconnect === null || onDisconnect === void 0 || onDisconnect();
333
333
  }
334
334
  }),
335
335
  destroyIntegration = _useDestroyDaily.mutate,
@@ -688,6 +688,8 @@ var Manage = withT(function (_ref) {
688
688
  setIsDisconnectAlertOpen = _ref$setIsDisconnectA === void 0 ? noop : _ref$setIsDisconnectA,
689
689
  _ref$isDisconnecting = _ref.isDisconnecting,
690
690
  isDisconnecting = _ref$isDisconnecting === void 0 ? false : _ref$isDisconnecting,
691
+ _ref$onConnect = _ref.onConnect,
692
+ onConnect = _ref$onConnect === void 0 ? undefined : _ref$onConnect,
691
693
  _ref$onDisconnect = _ref.onDisconnect,
692
694
  onDisconnect = _ref$onDisconnect === void 0 ? undefined : _ref$onDisconnect,
693
695
  _ref$onClose = _ref.onClose,
@@ -704,10 +706,14 @@ var Manage = withT(function (_ref) {
704
706
  helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
705
707
  _ref$managePath = _ref.managePath,
706
708
  managePath = _ref$managePath === void 0 ? "" : _ref$managePath,
709
+ _ref$manageUrl = _ref.manageUrl,
710
+ manageUrl = _ref$manageUrl === void 0 ? "" : _ref$manageUrl,
707
711
  _ref$integrationName = _ref.integrationName,
708
712
  integrationName = _ref$integrationName === void 0 ? "" : _ref$integrationName,
709
713
  _ref$disconnectMessag = _ref.disconnectMessage,
710
714
  disconnectMessage = _ref$disconnectMessag === void 0 ? "" : _ref$disconnectMessag,
715
+ _ref$disconnectTitle = _ref.disconnectTitle,
716
+ disconnectTitle = _ref$disconnectTitle === void 0 ? "" : _ref$disconnectTitle,
711
717
  _ref$isConnectDisable = _ref.isConnectDisabled,
712
718
  isConnectDisabled = _ref$isConnectDisable === void 0 ? false : _ref$isConnectDisable,
713
719
  _ref$connectTooltipPr = _ref.connectTooltipProps,
@@ -732,11 +738,13 @@ var Manage = withT(function (_ref) {
732
738
  }, /*#__PURE__*/React__default.createElement(Check, {
733
739
  size: 24
734
740
  }))), /*#__PURE__*/React__default.createElement(Typography, {
735
- className: "neeto-ui-text-gray-800 break-all",
736
741
  style: "body1",
737
- weight: "normal"
742
+ weight: "normal",
743
+ className: classnames("neeto-ui-text-gray-800", {
744
+ "break-all": isConnected
745
+ })
738
746
  }, description), helpDocUrl && /*#__PURE__*/React__default.createElement(Typography, {
739
- className: "neeto-ui-text-gray-800 break-all",
747
+ className: "neeto-ui-text-gray-800",
740
748
  style: "body2",
741
749
  weight: "normal"
742
750
  }, /*#__PURE__*/React__default.createElement(Trans, {
@@ -753,12 +761,16 @@ var Manage = withT(function (_ref) {
753
761
  }
754
762
  }))), isConnected ? /*#__PURE__*/React__default.createElement("div", {
755
763
  className: "space-x-2"
756
- }, managePath && /*#__PURE__*/React__default.createElement(Button, {
764
+ }, (managePath || manageUrl) && /*#__PURE__*/React__default.createElement(Button, {
765
+ "data-cy": "manage-button",
766
+ href: manageUrl,
767
+ target: manageUrl ? "_blank" : "_self",
757
768
  to: managePath,
758
769
  label: t("neetoIntegrations.common.manageIntegration", {
759
770
  integration: integrationName || humanize(integration)
760
771
  })
761
772
  }), onDisconnect && /*#__PURE__*/React__default.createElement(Button, {
773
+ "data-cy": "disconnect-button",
762
774
  style: "secondary",
763
775
  label: t("neetoIntegrations.common.disconnectIntegration", {
764
776
  integration: integrationName || humanize(integration)
@@ -766,21 +778,23 @@ var Manage = withT(function (_ref) {
766
778
  onClick: function onClick() {
767
779
  return setIsDisconnectAlertOpen(true);
768
780
  }
769
- })) : /*#__PURE__*/React__default.createElement(Button, {
781
+ })) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, (connectPath || connectUrl || onConnect) && /*#__PURE__*/React__default.createElement(Button, {
782
+ "data-cy": "connect-button",
770
783
  disabled: isConnectDisabled,
771
784
  href: connectUrl,
772
785
  to: connectPath,
773
786
  tooltipProps: connectTooltipProps,
774
787
  label: t("neetoIntegrations.common.connectIntegration", {
775
788
  integration: integrationName || humanize(integration)
776
- })
777
- }))), /*#__PURE__*/React__default.createElement(DisconnectAlert, {
789
+ }),
790
+ onClick: onConnect
791
+ })))), /*#__PURE__*/React__default.createElement(DisconnectAlert, {
778
792
  isDisconnecting: isDisconnecting,
779
793
  onClose: onClose,
780
794
  onDisconnect: onDisconnect,
781
795
  isOpen: isDisconnectAlertOpen,
782
- title: t("settings.integrations.".concat(integration, ".disconnect.title")),
783
- message: disconnectMessage || t("settings.integrations.".concat(integration, ".disconnect.message"))
796
+ message: disconnectMessage || t("settings.integrations.".concat(integration, ".disconnect.message")),
797
+ title: disconnectTitle || t("settings.integrations.".concat(integration, ".disconnect.title"))
784
798
  }));
785
799
  });
786
800
 
@@ -838,7 +852,7 @@ var Zoom = function Zoom(_ref) {
838
852
  var _useDestroyZoom = useDestroyZoom({
839
853
  onSuccess: function onSuccess() {
840
854
  setIsDisconnectAlertOpen(false);
841
- onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
855
+ onDisconnect === null || onDisconnect === void 0 || onDisconnect();
842
856
  }
843
857
  }),
844
858
  destroyIntegration = _useDestroyZoom.mutate,