@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/Daily.js CHANGED
@@ -9,6 +9,7 @@ import axios from 'axios';
9
9
  import '@bigbinary/neeto-molecules/IntegrationCard';
10
10
  import DisconnectAlert from '@bigbinary/neeto-molecules/IntegrationDisconnectAlert';
11
11
  import WalkthroughModal from '@bigbinary/neeto-molecules/IntegrationWalkthroughModal';
12
+ import classnames from 'classnames';
12
13
  import { buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
13
14
  import { Daily as Daily$1 } from '@bigbinary/neeto-icons/misc';
14
15
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
@@ -17,17 +18,16 @@ import { Typography, Button } 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
- 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) {
@@ -88,8 +88,8 @@ var QUERY_KEYS = {
88
88
  ZOOM_DETAILS: "zoom-details"
89
89
  };
90
90
 
91
- 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; }
92
- 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; }
91
+ 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; }
92
+ 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; }
93
93
  var useCreateDaily = function useCreateDaily() {
94
94
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
95
95
  return useMutationWithInvalidation(dailiesApi.create, _objectSpread({
@@ -113,31 +113,31 @@ function _arrayWithHoles(arr) {
113
113
  if (Array.isArray(arr)) return arr;
114
114
  }
115
115
 
116
- function _iterableToArrayLimit(arr, i) {
117
- var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
118
- if (null != _i) {
119
- var _s,
120
- _e,
121
- _x,
122
- _r,
123
- _arr = [],
124
- _n = !0,
125
- _d = !1;
116
+ function _iterableToArrayLimit(r, l) {
117
+ var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
118
+ if (null != t) {
119
+ var e,
120
+ n,
121
+ i,
122
+ u,
123
+ a = [],
124
+ f = !0,
125
+ o = !1;
126
126
  try {
127
- if (_x = (_i = _i.call(arr)).next, 0 === i) {
128
- if (Object(_i) !== _i) return;
129
- _n = !1;
130
- } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
131
- } catch (err) {
132
- _d = !0, _e = err;
127
+ if (i = (t = t.call(r)).next, 0 === l) {
128
+ if (Object(t) !== t) return;
129
+ f = !1;
130
+ } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
131
+ } catch (r) {
132
+ o = !0, n = r;
133
133
  } finally {
134
134
  try {
135
- if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
135
+ if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
136
136
  } finally {
137
- if (_d) throw _e;
137
+ if (o) throw n;
138
138
  }
139
139
  }
140
- return _arr;
140
+ return a;
141
141
  }
142
142
  }
143
143
 
@@ -178,6 +178,8 @@ var Manage$1 = withT(function (_ref) {
178
178
  setIsDisconnectAlertOpen = _ref$setIsDisconnectA === void 0 ? noop : _ref$setIsDisconnectA,
179
179
  _ref$isDisconnecting = _ref.isDisconnecting,
180
180
  isDisconnecting = _ref$isDisconnecting === void 0 ? false : _ref$isDisconnecting,
181
+ _ref$onConnect = _ref.onConnect,
182
+ onConnect = _ref$onConnect === void 0 ? undefined : _ref$onConnect,
181
183
  _ref$onDisconnect = _ref.onDisconnect,
182
184
  onDisconnect = _ref$onDisconnect === void 0 ? undefined : _ref$onDisconnect,
183
185
  _ref$onClose = _ref.onClose,
@@ -194,10 +196,14 @@ var Manage$1 = withT(function (_ref) {
194
196
  helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
195
197
  _ref$managePath = _ref.managePath,
196
198
  managePath = _ref$managePath === void 0 ? "" : _ref$managePath,
199
+ _ref$manageUrl = _ref.manageUrl,
200
+ manageUrl = _ref$manageUrl === void 0 ? "" : _ref$manageUrl,
197
201
  _ref$integrationName = _ref.integrationName,
198
202
  integrationName = _ref$integrationName === void 0 ? "" : _ref$integrationName,
199
203
  _ref$disconnectMessag = _ref.disconnectMessage,
200
204
  disconnectMessage = _ref$disconnectMessag === void 0 ? "" : _ref$disconnectMessag,
205
+ _ref$disconnectTitle = _ref.disconnectTitle,
206
+ disconnectTitle = _ref$disconnectTitle === void 0 ? "" : _ref$disconnectTitle,
201
207
  _ref$isConnectDisable = _ref.isConnectDisabled,
202
208
  isConnectDisabled = _ref$isConnectDisable === void 0 ? false : _ref$isConnectDisable,
203
209
  _ref$connectTooltipPr = _ref.connectTooltipProps,
@@ -222,11 +228,13 @@ var Manage$1 = withT(function (_ref) {
222
228
  }, /*#__PURE__*/React__default.createElement(Check, {
223
229
  size: 24
224
230
  }))), /*#__PURE__*/React__default.createElement(Typography, {
225
- className: "neeto-ui-text-gray-800 break-all",
226
231
  style: "body1",
227
- weight: "normal"
232
+ weight: "normal",
233
+ className: classnames("neeto-ui-text-gray-800", {
234
+ "break-all": isConnected
235
+ })
228
236
  }, description), helpDocUrl && /*#__PURE__*/React__default.createElement(Typography, {
229
- className: "neeto-ui-text-gray-800 break-all",
237
+ className: "neeto-ui-text-gray-800",
230
238
  style: "body2",
231
239
  weight: "normal"
232
240
  }, /*#__PURE__*/React__default.createElement(Trans, {
@@ -243,12 +251,16 @@ var Manage$1 = withT(function (_ref) {
243
251
  }
244
252
  }))), isConnected ? /*#__PURE__*/React__default.createElement("div", {
245
253
  className: "space-x-2"
246
- }, managePath && /*#__PURE__*/React__default.createElement(Button, {
254
+ }, (managePath || manageUrl) && /*#__PURE__*/React__default.createElement(Button, {
255
+ "data-cy": "manage-button",
256
+ href: manageUrl,
257
+ target: manageUrl ? "_blank" : "_self",
247
258
  to: managePath,
248
259
  label: t("neetoIntegrations.common.manageIntegration", {
249
260
  integration: integrationName || humanize(integration)
250
261
  })
251
262
  }), onDisconnect && /*#__PURE__*/React__default.createElement(Button, {
263
+ "data-cy": "disconnect-button",
252
264
  style: "secondary",
253
265
  label: t("neetoIntegrations.common.disconnectIntegration", {
254
266
  integration: integrationName || humanize(integration)
@@ -256,21 +268,23 @@ var Manage$1 = withT(function (_ref) {
256
268
  onClick: function onClick() {
257
269
  return setIsDisconnectAlertOpen(true);
258
270
  }
259
- })) : /*#__PURE__*/React__default.createElement(Button, {
271
+ })) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, (connectPath || connectUrl || onConnect) && /*#__PURE__*/React__default.createElement(Button, {
272
+ "data-cy": "connect-button",
260
273
  disabled: isConnectDisabled,
261
274
  href: connectUrl,
262
275
  to: connectPath,
263
276
  tooltipProps: connectTooltipProps,
264
277
  label: t("neetoIntegrations.common.connectIntegration", {
265
278
  integration: integrationName || humanize(integration)
266
- })
267
- }))), /*#__PURE__*/React__default.createElement(DisconnectAlert, {
279
+ }),
280
+ onClick: onConnect
281
+ })))), /*#__PURE__*/React__default.createElement(DisconnectAlert, {
268
282
  isDisconnecting: isDisconnecting,
269
283
  onClose: onClose,
270
284
  onDisconnect: onDisconnect,
271
285
  isOpen: isDisconnectAlertOpen,
272
- title: t("settings.integrations.".concat(integration, ".disconnect.title")),
273
- message: disconnectMessage || t("settings.integrations.".concat(integration, ".disconnect.message"))
286
+ message: disconnectMessage || t("settings.integrations.".concat(integration, ".disconnect.message")),
287
+ title: disconnectTitle || t("settings.integrations.".concat(integration, ".disconnect.title"))
274
288
  }));
275
289
  });
276
290
 
@@ -706,7 +720,7 @@ var Manage = function Manage(_ref) {
706
720
  var _useDestroyDaily = useDestroyDaily({
707
721
  onSuccess: function onSuccess() {
708
722
  setIsDisconnectAlertOpen(false);
709
- onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
723
+ onDisconnect === null || onDisconnect === void 0 || onDisconnect();
710
724
  }
711
725
  }),
712
726
  destroyIntegration = _useDestroyDaily.mutate,