@bigbinary/neeto-integrations-frontend 2.12.8 → 3.1.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.
@@ -1,8 +1,9 @@
1
1
  import * as React from 'react';
2
- import React__default, { useState, useEffect } from 'react';
2
+ import { useState, useEffect } from 'react';
3
3
  import { humanize, noop, isPresent, isNotEmpty } from '@bigbinary/neeto-cist';
4
4
  import { buildUrl, getQueryParams } from '@bigbinary/neeto-commons-frontend/utils';
5
- import { Daily as Daily$1, GoogleCalendar as GoogleCalendar$1, Google } from '@bigbinary/neeto-icons/misc';
5
+ import GoogleCalendarIcon from '@bigbinary/neeto-icons/misc/GoogleCalendar';
6
+ import Google from '@bigbinary/neeto-icons/misc/Google';
6
7
  import Typography from '@bigbinary/neetoui/Typography';
7
8
  import Callout from '@bigbinary/neetoui/Callout';
8
9
  import Button from '@bigbinary/neetoui/Button';
@@ -12,11 +13,11 @@ import DisconnectAlert from '@bigbinary/neeto-molecules/IntegrationDisconnectAle
12
13
  import WalkthroughModal from '@bigbinary/neeto-molecules/IntegrationWalkthroughModal';
13
14
  import classnames from 'classnames';
14
15
  import { withT, useMutationWithInvalidation, withTitle, useQueryParams } from '@bigbinary/neeto-commons-frontend/react-utils';
15
- import { Check } from '@bigbinary/neeto-icons';
16
+ import Check from '@bigbinary/neeto-icons/Check';
16
17
  import Tooltip from '@bigbinary/neetoui/Tooltip';
17
18
  import i18next, { t as t$1 } from 'i18next';
19
+ import { useQuery } from '@tanstack/react-query';
18
20
  import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
19
- import { useQuery } from 'react-query';
20
21
  import axios from 'axios';
21
22
  import Container from '@bigbinary/neeto-molecules/Container';
22
23
  import Header from '@bigbinary/neeto-molecules/Header';
@@ -30,7 +31,9 @@ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
30
31
  import 'ramda';
31
32
  import '@bigbinary/neetoui/formik/Select';
32
33
  import * as yup from 'yup';
34
+ import '@bigbinary/neeto-icons/misc/Zoom';
33
35
  import NeetoUIModal from '@bigbinary/neetoui/Modal';
36
+ import DailyIcon from '@bigbinary/neeto-icons/misc/Daily';
34
37
  import CopyToClipboardButton from '@bigbinary/neeto-molecules/CopyToClipboardButton';
35
38
 
36
39
  function _typeof(o) {
@@ -145,8 +148,8 @@ function _slicedToArray(arr, i) {
145
148
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
146
149
  }
147
150
 
148
- function ownKeys$5(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$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
151
+ function ownKeys$4(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; }
152
+ function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
150
153
  var Manage$1 = withT(function (_ref) {
151
154
  var t = _ref.t,
152
155
  _ref$title = _ref.title,
@@ -245,7 +248,7 @@ var Manage$1 = withT(function (_ref) {
245
248
  })]
246
249
  }), isConnected ? /*#__PURE__*/jsxs("div", {
247
250
  className: "space-x-2",
248
- children: [(managePath || manageUrl) && /*#__PURE__*/jsx(Button, _objectSpread$5({
251
+ children: [(managePath || manageUrl) && /*#__PURE__*/jsx(Button, _objectSpread$4({
249
252
  "data-cy": "manage-button",
250
253
  href: manageUrl,
251
254
  target: manageUrl ? "_blank" : "_self",
@@ -253,7 +256,7 @@ var Manage$1 = withT(function (_ref) {
253
256
  label: t("neetoIntegrations.common.manageIntegration", {
254
257
  integration: integrationName || humanize(integration)
255
258
  })
256
- }, buttonProps)), onDisconnect && /*#__PURE__*/jsx(Button, _objectSpread$5({
259
+ }, buttonProps)), onDisconnect && /*#__PURE__*/jsx(Button, _objectSpread$4({
257
260
  "data-cy": "disconnect-button",
258
261
  style: "secondary",
259
262
  label: t("neetoIntegrations.common.disconnectIntegration", {
@@ -264,11 +267,11 @@ var Manage$1 = withT(function (_ref) {
264
267
  }
265
268
  }, secondaryButtonProps))]
266
269
  }) : /*#__PURE__*/jsx("div", {
267
- children: /*#__PURE__*/jsx(Tooltip, _objectSpread$5(_objectSpread$5({
270
+ children: /*#__PURE__*/jsx(Tooltip, _objectSpread$4(_objectSpread$4({
268
271
  disabled: !isConnectDisabled
269
272
  }, connectTooltipProps), {}, {
270
273
  children: /*#__PURE__*/jsx("span", {
271
- children: (connectPath || connectUrl || onConnect) && /*#__PURE__*/jsx(Button, _objectSpread$5({
274
+ children: (connectPath || connectUrl || onConnect) && /*#__PURE__*/jsx(Button, _objectSpread$4({
272
275
  "data-cy": "connect-button",
273
276
  disabled: isConnectDisabled,
274
277
  href: connectUrl,
@@ -320,73 +323,29 @@ var QUERY_KEYS = {
320
323
  ZOOM_DETAILS: "zoom-details"
321
324
  };
322
325
 
323
- function ownKeys$4(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; }
324
- function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
326
+ function ownKeys$3(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; }
327
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
325
328
  var useCreateDaily = function useCreateDaily() {
326
329
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
327
- return useMutationWithInvalidation(dailiesApi.create, _objectSpread$4({
328
- keysToInvalidate: [QUERY_KEYS.DAILY_CO_DETAILS]
330
+ return useMutationWithInvalidation(dailiesApi.create, _objectSpread$3({
331
+ keysToInvalidate: [[QUERY_KEYS.DAILY_CO_DETAILS]]
329
332
  }, options));
330
333
  };
331
334
  var useFetchDaily = function useFetchDaily() {
332
- return useQuery(QUERY_KEYS.DAILY_CO_DETAILS, dailiesApi.show, {
335
+ return useQuery({
336
+ queryKey: [QUERY_KEYS.DAILY_CO_DETAILS],
337
+ queryFn: dailiesApi.show,
333
338
  staleTime: DEFAULT_STALE_TIME
334
339
  });
335
340
  };
336
341
  var useDestroyDaily = function useDestroyDaily(_ref) {
337
342
  var onSuccess = _ref.onSuccess;
338
343
  return useMutationWithInvalidation(dailiesApi.destroy, {
339
- keysToInvalidate: [QUERY_KEYS.DAILY_CO_DETAILS],
344
+ keysToInvalidate: [[QUERY_KEYS.DAILY_CO_DETAILS]],
340
345
  onSuccess: onSuccess
341
346
  });
342
347
  };
343
348
 
344
- function _objectWithoutPropertiesLoose(source, excluded) {
345
- if (source == null) return {};
346
- var target = {};
347
- var sourceKeys = Object.keys(source);
348
- var key, i;
349
- for (i = 0; i < sourceKeys.length; i++) {
350
- key = sourceKeys[i];
351
- if (excluded.indexOf(key) >= 0) continue;
352
- target[key] = source[key];
353
- }
354
- return target;
355
- }
356
-
357
- function _objectWithoutProperties(source, excluded) {
358
- if (source == null) return {};
359
- var target = _objectWithoutPropertiesLoose(source, excluded);
360
- var key, i;
361
- if (Object.getOwnPropertySymbols) {
362
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
363
- for (i = 0; i < sourceSymbolKeys.length; i++) {
364
- key = sourceSymbolKeys[i];
365
- if (excluded.indexOf(key) >= 0) continue;
366
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
367
- target[key] = source[key];
368
- }
369
- }
370
- return target;
371
- }
372
-
373
- var _excluded = ["className", "children"];
374
- function ownKeys$3(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; }
375
- function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
376
- var ExternalLink = function ExternalLink(_ref) {
377
- var _ref$className = _ref.className,
378
- className = _ref$className === void 0 ? "" : _ref$className,
379
- _ref$children = _ref.children,
380
- children = _ref$children === void 0 ? null : _ref$children,
381
- props = _objectWithoutProperties(_ref, _excluded);
382
- return /*#__PURE__*/jsx("a", _objectSpread$3(_objectSpread$3({
383
- className: classnames(["neeto-ui-text-primary-800 hover:neeto-ui-text-primary-800 visited:neeto-ui-text-primary-600 font-medium", className])
384
- }, props), {}, {
385
- children: children
386
- }));
387
- };
388
- var ExternalLink$1 = /*#__PURE__*/React__default.memo(ExternalLink);
389
-
390
349
  var MANAGE_DAILY_CO_FORM_INITIAL_VALUES = {
391
350
  apiKey: ""
392
351
  };
@@ -414,7 +373,7 @@ var Form = function Form(_ref) {
414
373
  }
415
374
  }),
416
375
  createDaily = _useCreateDaily.mutate,
417
- isConnecting = _useCreateDaily.isLoading;
376
+ isConnecting = _useCreateDaily.isPending;
418
377
  var handleSubmit = function handleSubmit(payload) {
419
378
  return createDaily(payload);
420
379
  };
@@ -429,26 +388,24 @@ var Form = function Form(_ref) {
429
388
  className: "flex items-center gap-2",
430
389
  children: [t("neetoIntegrations.daily.connect.title"), /*#__PURE__*/jsx(HelpPopover, {
431
390
  title: t("neetoIntegrations.daily.connect.title"),
432
- description: /*#__PURE__*/jsx(Trans, {
433
- i18nKey: "neetoIntegrations.daily.helpDoc",
434
- components: {
435
- externalLink: /*#__PURE__*/jsx(ExternalLink$1, {
436
- "data-cy": "api-key-help-doc-link",
437
- href: helpDocUrl,
438
- rel: "noreferrer",
439
- target: "_blank"
440
- })
441
- }
442
- }),
443
- helpLinkProps: {
444
- label: /*#__PURE__*/jsx(Button, {
445
- className: "mt-8",
446
- label: t("neetoIntegrations.daily.walkthroughText"),
447
- style: "link",
448
- onClick: function onClick() {
449
- return setIsDemoModalOpen(true);
391
+ description: /*#__PURE__*/jsx(Typography, {
392
+ lineHeight: "normal",
393
+ style: "body2",
394
+ children: /*#__PURE__*/jsx(Trans, {
395
+ i18nKey: "neetoIntegrations.daily.helpDoc",
396
+ components: {
397
+ videoLink: /*#__PURE__*/jsx(Button, {
398
+ style: "link",
399
+ onClick: function onClick() {
400
+ return setIsDemoModalOpen(true);
401
+ }
402
+ })
450
403
  }
451
404
  })
405
+ }),
406
+ helpLinkProps: {
407
+ href: helpDocUrl,
408
+ "data-cy": "api-key-help-doc-link"
452
409
  }
453
410
  })]
454
411
  })
@@ -519,7 +476,7 @@ var Manage = function Manage(_ref) {
519
476
  }
520
477
  }),
521
478
  destroyIntegration = _useDestroyDaily.mutate,
522
- isDisconnecting = _useDestroyDaily.isLoading;
479
+ isDisconnecting = _useDestroyDaily.isPending;
523
480
  var isConnected = isPresent(apiKey);
524
481
  var handleDisconnect = function handleDisconnect() {
525
482
  return destroyIntegration("daily");
@@ -530,7 +487,7 @@ var Manage = function Manage(_ref) {
530
487
  isDisconnectAlertOpen: isDisconnectAlertOpen,
531
488
  isDisconnecting: isDisconnecting,
532
489
  setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
533
- Icon: Daily$1,
490
+ Icon: DailyIcon,
534
491
  connectPath: buildUrl(window.location.pathname, {
535
492
  connect: true
536
493
  }),
@@ -1021,7 +978,7 @@ var GoogleCalendar = function GoogleCalendar(_ref) {
1021
978
  onClose: handleClose,
1022
979
  children: [activeTab === STEPS.connect && /*#__PURE__*/jsxs("div", {
1023
980
  className: "mx-auto w-full max-w-3xl",
1024
- children: [/*#__PURE__*/jsx(GoogleCalendar$1, {
981
+ children: [/*#__PURE__*/jsx(GoogleCalendarIcon, {
1025
982
  size: 48
1026
983
  }), /*#__PURE__*/jsx(Typography, {
1027
984
  className: "mb-4 mt-2",