@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.
@@ -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,17 +18,16 @@ 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
- function _typeof(obj) {
23
+ function _typeof(o) {
24
24
  "@babel/helpers - typeof";
25
25
 
26
- return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
27
- return typeof obj;
28
- } : function (obj) {
29
- return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
30
- }, _typeof(obj);
26
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
27
+ return typeof o;
28
+ } : function (o) {
29
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
30
+ }, _typeof(o);
31
31
  }
32
32
 
33
33
  function _toPrimitive(input, hint) {
@@ -96,31 +96,31 @@ function _arrayWithHoles(arr) {
96
96
  if (Array.isArray(arr)) return arr;
97
97
  }
98
98
 
99
- function _iterableToArrayLimit(arr, i) {
100
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
101
- if (null != _i) {
102
- var _s,
103
- _e,
104
- _x,
105
- _r,
106
- _arr = [],
107
- _n = !0,
108
- _d = !1;
99
+ function _iterableToArrayLimit(r, l) {
100
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
101
+ if (null != t) {
102
+ var e,
103
+ n,
104
+ i,
105
+ u,
106
+ a = [],
107
+ f = !0,
108
+ o = !1;
109
109
  try {
110
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
111
- if (Object(_i) !== _i) return;
112
- _n = !1;
113
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
114
- } catch (err) {
115
- _d = !0, _e = err;
110
+ if (i = (t = t.call(r)).next, 0 === l) {
111
+ if (Object(t) !== t) return;
112
+ f = !1;
113
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
114
+ } catch (r) {
115
+ o = !0, n = r;
116
116
  } finally {
117
117
  try {
118
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
118
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
119
119
  } finally {
120
- if (_d) throw _e;
120
+ if (o) throw n;
121
121
  }
122
122
  }
123
- return _arr;
123
+ return a;
124
124
  }
125
125
  }
126
126
 
@@ -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,12 +219,16 @@ 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, {
223
+ "data-cy": "manage-button",
224
+ href: manageUrl,
225
+ target: manageUrl ? "_blank" : "_self",
215
226
  to: managePath,
216
227
  label: t("neetoIntegrations.common.manageIntegration", {
217
228
  integration: integrationName || humanize(integration)
218
229
  })
219
230
  }), onDisconnect && /*#__PURE__*/React__default.createElement(Button, {
231
+ "data-cy": "disconnect-button",
220
232
  style: "secondary",
221
233
  label: t("neetoIntegrations.common.disconnectIntegration", {
222
234
  integration: integrationName || humanize(integration)
@@ -224,21 +236,23 @@ var Manage$1 = withT(function (_ref) {
224
236
  onClick: function onClick() {
225
237
  return setIsDisconnectAlertOpen(true);
226
238
  }
227
- })) : /*#__PURE__*/React__default.createElement(Button, {
239
+ })) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, (connectPath || connectUrl || onConnect) && /*#__PURE__*/React__default.createElement(Button, {
240
+ "data-cy": "connect-button",
228
241
  disabled: isConnectDisabled,
229
242
  href: connectUrl,
230
243
  to: connectPath,
231
244
  tooltipProps: connectTooltipProps,
232
245
  label: t("neetoIntegrations.common.connectIntegration", {
233
246
  integration: integrationName || humanize(integration)
234
- })
235
- }))), /*#__PURE__*/React__default.createElement(DisconnectAlert, {
247
+ }),
248
+ onClick: onConnect
249
+ })))), /*#__PURE__*/React__default.createElement(DisconnectAlert, {
236
250
  isDisconnecting: isDisconnecting,
237
251
  onClose: onClose,
238
252
  onDisconnect: onDisconnect,
239
253
  isOpen: isDisconnectAlertOpen,
240
- title: t("settings.integrations.".concat(integration, ".disconnect.title")),
241
- 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"))
242
256
  }));
243
257
  });
244
258
 
@@ -269,8 +283,8 @@ var QUERY_KEYS = {
269
283
  ZOOM_DETAILS: "zoom-details"
270
284
  };
271
285
 
272
- function ownKeys$1(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; }
273
- function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
286
+ function ownKeys$1(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; }
287
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
274
288
  var useCreateDaily = function useCreateDaily() {
275
289
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
276
290
  return useMutationWithInvalidation(dailiesApi.create, _objectSpread$1({
@@ -453,7 +467,7 @@ var Manage = function Manage(_ref) {
453
467
  var _useDestroyDaily = useDestroyDaily({
454
468
  onSuccess: function onSuccess() {
455
469
  setIsDisconnectAlertOpen(false);
456
- onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
470
+ onDisconnect === null || onDisconnect === void 0 || onDisconnect();
457
471
  }
458
472
  }),
459
473
  destroyIntegration = _useDestroyDaily.mutate,
@@ -864,8 +878,8 @@ var STEPS = {
864
878
  finish: t$1("neetoIntegrations.common.finish")
865
879
  };
866
880
 
867
- 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; }
868
- 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; }
881
+ 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; }
882
+ 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; }
869
883
  var GoogleCalendar = function GoogleCalendar(_ref) {
870
884
  var permissionImage = _ref.permissionImage,
871
885
  fetchAuthorizationUrl = _ref.fetchAuthorizationUrl,