@bigbinary/neeto-integrations-frontend 2.12.7 → 3.0.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.
package/dist/Daily.js CHANGED
@@ -3,26 +3,38 @@ import React__default, { useState } from 'react';
3
3
  import i18next, { t as t$1 } from 'i18next';
4
4
  import { humanize, noop, isNotEmpty, isPresent } from '@bigbinary/neeto-cist';
5
5
  import { useMutationWithInvalidation, withT, withTitle, useQueryParams } from '@bigbinary/neeto-commons-frontend/react-utils';
6
+ import { useQuery } from '@tanstack/react-query';
6
7
  import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
7
- import { useQuery } from 'react-query';
8
8
  import axios from 'axios';
9
9
  import Container from '@bigbinary/neeto-molecules/Container';
10
10
  import Header from '@bigbinary/neeto-molecules/Header';
11
11
  import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
12
12
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
13
- import { Typography, Button, Tooltip } from '@bigbinary/neetoui';
14
- import { Form as Form$2, Input } from '@bigbinary/neetoui/formik';
13
+ import Button from '@bigbinary/neetoui/Button';
14
+ import Input from '@bigbinary/neetoui/formik/Input';
15
+ import FormikFormWrapper from '@bigbinary/neetoui/formik/Form';
16
+ import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
15
17
  import { Trans, useTranslation } from 'react-i18next';
18
+ import { useHistory } from 'react-router-dom';
16
19
  import classnames from 'classnames';
20
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
17
21
  import '@bigbinary/neeto-molecules/IntegrationCard';
18
22
  import DisconnectAlert from '@bigbinary/neeto-molecules/IntegrationDisconnectAlert';
19
23
  import WalkthroughModal from '@bigbinary/neeto-molecules/IntegrationWalkthroughModal';
20
- import { Check } from '@bigbinary/neeto-icons';
24
+ import Check from '@bigbinary/neeto-icons/Check';
25
+ import Tooltip from '@bigbinary/neetoui/Tooltip';
26
+ import Typography from '@bigbinary/neetoui/Typography';
21
27
  import { buildUrl } from '@bigbinary/neeto-commons-frontend/utils';
22
- import { Daily as Daily$1 } from '@bigbinary/neeto-icons/misc';
28
+ import DailyIcon from '@bigbinary/neeto-icons/misc/Daily';
23
29
  import CopyToClipboardButton from '@bigbinary/neeto-molecules/CopyToClipboardButton';
30
+ import '@bigbinary/neeto-icons/misc/GoogleCalendar';
31
+ import '@bigbinary/neeto-icons/misc/Google';
32
+ import '@bigbinary/neetoui/Callout';
24
33
  import 'ramda';
34
+ import '@bigbinary/neetoui/formik/Select';
25
35
  import * as yup from 'yup';
36
+ import '@bigbinary/neeto-icons/misc/Zoom';
37
+ import '@bigbinary/neetoui/Modal';
26
38
 
27
39
  function _typeof(o) {
28
40
  "@babel/helpers - typeof";
@@ -92,23 +104,25 @@ var QUERY_KEYS = {
92
104
  ZOOM_DETAILS: "zoom-details"
93
105
  };
94
106
 
95
- 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; }
96
- 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; }
107
+ 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; }
108
+ 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; }
97
109
  var useCreateDaily = function useCreateDaily() {
98
110
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
99
- return useMutationWithInvalidation(dailiesApi.create, _objectSpread({
100
- keysToInvalidate: [QUERY_KEYS.DAILY_CO_DETAILS]
111
+ return useMutationWithInvalidation(dailiesApi.create, _objectSpread$4({
112
+ keysToInvalidate: [[QUERY_KEYS.DAILY_CO_DETAILS]]
101
113
  }, options));
102
114
  };
103
115
  var useFetchDaily = function useFetchDaily() {
104
- return useQuery(QUERY_KEYS.DAILY_CO_DETAILS, dailiesApi.show, {
116
+ return useQuery({
117
+ queryKey: [QUERY_KEYS.DAILY_CO_DETAILS],
118
+ queryFn: dailiesApi.show,
105
119
  staleTime: DEFAULT_STALE_TIME
106
120
  });
107
121
  };
108
122
  var useDestroyDaily = function useDestroyDaily(_ref) {
109
123
  var onSuccess = _ref.onSuccess;
110
124
  return useMutationWithInvalidation(dailiesApi.destroy, {
111
- keysToInvalidate: [QUERY_KEYS.DAILY_CO_DETAILS],
125
+ keysToInvalidate: [[QUERY_KEYS.DAILY_CO_DETAILS]],
112
126
  onSuccess: onSuccess
113
127
  });
114
128
  };
@@ -168,21 +182,6 @@ function _slicedToArray(arr, i) {
168
182
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
169
183
  }
170
184
 
171
- function _extends$1() {
172
- _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
173
- for (var i = 1; i < arguments.length; i++) {
174
- var source = arguments[i];
175
- for (var key in source) {
176
- if (Object.prototype.hasOwnProperty.call(source, key)) {
177
- target[key] = source[key];
178
- }
179
- }
180
- }
181
- return target;
182
- };
183
- return _extends$1.apply(this, arguments);
184
- }
185
-
186
185
  function _objectWithoutPropertiesLoose(source, excluded) {
187
186
  if (source == null) return {};
188
187
  var target = {};
@@ -213,18 +212,24 @@ function _objectWithoutProperties(source, excluded) {
213
212
  }
214
213
 
215
214
  var _excluded = ["className", "children"];
215
+ 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; }
216
+ 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; }
216
217
  var ExternalLink = function ExternalLink(_ref) {
217
218
  var _ref$className = _ref.className,
218
219
  className = _ref$className === void 0 ? "" : _ref$className,
219
220
  _ref$children = _ref.children,
220
221
  children = _ref$children === void 0 ? null : _ref$children,
221
222
  props = _objectWithoutProperties(_ref, _excluded);
222
- return /*#__PURE__*/React__default.createElement("a", _extends$1({
223
+ return /*#__PURE__*/jsx("a", _objectSpread$3(_objectSpread$3({
223
224
  className: classnames(["neeto-ui-text-primary-800 hover:neeto-ui-text-primary-800 visited:neeto-ui-text-primary-600 font-medium", className])
224
- }, props), children);
225
+ }, props), {}, {
226
+ children: children
227
+ }));
225
228
  };
226
229
  var ExternalLink$1 = /*#__PURE__*/React__default.memo(ExternalLink);
227
230
 
231
+ function ownKeys$2(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; }
232
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
228
233
  var Manage$1 = withT(function (_ref) {
229
234
  var t = _ref.t,
230
235
  _ref$title = _ref.title,
@@ -268,86 +273,107 @@ var Manage$1 = withT(function (_ref) {
268
273
  _ref$isConnectDisable = _ref.isConnectDisabled,
269
274
  isConnectDisabled = _ref$isConnectDisable === void 0 ? false : _ref$isConnectDisable,
270
275
  _ref$connectTooltipPr = _ref.connectTooltipProps,
271
- connectTooltipProps = _ref$connectTooltipPr === void 0 ? null : _ref$connectTooltipPr;
272
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
273
- className: "mx-auto w-full max-w-3xl"
274
- }, /*#__PURE__*/React__default.createElement("div", {
275
- className: "neeto-ui-border-gray-300 neeto-ui-rounded-xl mt-10 w-full space-y-4 border p-6"
276
- }, Icon && /*#__PURE__*/React__default.createElement(Icon, {
277
- className: "neeto-ui-text-gray-600",
278
- size: 48
279
- }), /*#__PURE__*/React__default.createElement("div", {
280
- className: "space-y-2"
281
- }, /*#__PURE__*/React__default.createElement("div", {
282
- className: "flex items-center space-x-4"
283
- }, /*#__PURE__*/React__default.createElement(Typography, {
284
- className: "neeto-ui-text-gray-800 mb-0.5",
285
- style: "h2",
286
- weight: "semibold"
287
- }, title), isConnected && /*#__PURE__*/React__default.createElement("div", {
288
- className: "neeto-ui-bg-success-500 neeto-ui-text-white neeto-ui-rounded-full flex items-center justify-center p-1"
289
- }, /*#__PURE__*/React__default.createElement(Check, {
290
- size: 24
291
- }))), /*#__PURE__*/React__default.createElement(Typography, {
292
- style: "body1",
293
- weight: "normal",
294
- className: classnames("neeto-ui-text-gray-800", {
295
- "break-all": isConnected
296
- })
297
- }, description), helpDocUrl && /*#__PURE__*/React__default.createElement(Typography, {
298
- className: "neeto-ui-text-gray-800",
299
- style: "body2",
300
- weight: "normal"
301
- }, /*#__PURE__*/React__default.createElement(Trans, {
302
- i18nKey: "neetoIntegrations.common.helpDocUrl",
303
- components: {
304
- helpLink: /*#__PURE__*/React__default.createElement(Button, {
305
- href: helpDocUrl,
306
- style: "link",
307
- target: "_blank"
276
+ connectTooltipProps = _ref$connectTooltipPr === void 0 ? null : _ref$connectTooltipPr,
277
+ _ref$buttonProps = _ref.buttonProps,
278
+ buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
279
+ _ref$secondaryButtonP = _ref.secondaryButtonProps,
280
+ secondaryButtonProps = _ref$secondaryButtonP === void 0 ? {} : _ref$secondaryButtonP;
281
+ return /*#__PURE__*/jsxs(Fragment, {
282
+ children: [/*#__PURE__*/jsx("div", {
283
+ className: "mx-auto w-full max-w-3xl",
284
+ children: /*#__PURE__*/jsxs("div", {
285
+ className: "neeto-ui-border-gray-300 neeto-ui-rounded-xl mt-10 w-full space-y-4 border p-6",
286
+ children: [Icon && /*#__PURE__*/jsx(Icon, {
287
+ className: "neeto-ui-text-gray-600",
288
+ size: 48
289
+ }), /*#__PURE__*/jsxs("div", {
290
+ className: "space-y-2",
291
+ children: [/*#__PURE__*/jsxs("div", {
292
+ className: "flex items-center space-x-4",
293
+ children: [/*#__PURE__*/jsx(Typography, {
294
+ className: "neeto-ui-text-gray-800 mb-0.5",
295
+ style: "h2",
296
+ weight: "semibold",
297
+ children: title
298
+ }), isConnected && /*#__PURE__*/jsx("div", {
299
+ className: "neeto-ui-bg-success-500 neeto-ui-text-white neeto-ui-rounded-full flex items-center justify-center p-1",
300
+ children: /*#__PURE__*/jsx(Check, {
301
+ size: 24
302
+ })
303
+ })]
304
+ }), /*#__PURE__*/jsx(Typography, {
305
+ style: "body1",
306
+ weight: "normal",
307
+ className: classnames("neeto-ui-text-gray-800", {
308
+ "break-all": isConnected
309
+ }),
310
+ children: description
311
+ }), helpDocUrl && /*#__PURE__*/jsx(Typography, {
312
+ className: "neeto-ui-text-gray-800",
313
+ style: "body2",
314
+ weight: "normal",
315
+ children: /*#__PURE__*/jsx(Trans, {
316
+ i18nKey: "neetoIntegrations.common.helpDocUrl",
317
+ components: {
318
+ helpLink: /*#__PURE__*/jsx(Button, {
319
+ href: helpDocUrl,
320
+ style: "link",
321
+ target: "_blank"
322
+ })
323
+ },
324
+ values: {
325
+ integration: integrationName || humanize(integration)
326
+ }
327
+ })
328
+ })]
329
+ }), isConnected ? /*#__PURE__*/jsxs("div", {
330
+ className: "space-x-2",
331
+ children: [(managePath || manageUrl) && /*#__PURE__*/jsx(Button, _objectSpread$2({
332
+ "data-cy": "manage-button",
333
+ href: manageUrl,
334
+ target: manageUrl ? "_blank" : "_self",
335
+ to: managePath,
336
+ label: t("neetoIntegrations.common.manageIntegration", {
337
+ integration: integrationName || humanize(integration)
338
+ })
339
+ }, buttonProps)), onDisconnect && /*#__PURE__*/jsx(Button, _objectSpread$2({
340
+ "data-cy": "disconnect-button",
341
+ style: "secondary",
342
+ label: t("neetoIntegrations.common.disconnectIntegration", {
343
+ integration: integrationName || humanize(integration)
344
+ }),
345
+ onClick: function onClick() {
346
+ return setIsDisconnectAlertOpen(true);
347
+ }
348
+ }, secondaryButtonProps))]
349
+ }) : /*#__PURE__*/jsx("div", {
350
+ children: /*#__PURE__*/jsx(Tooltip, _objectSpread$2(_objectSpread$2({
351
+ disabled: !isConnectDisabled
352
+ }, connectTooltipProps), {}, {
353
+ children: /*#__PURE__*/jsx("span", {
354
+ children: (connectPath || connectUrl || onConnect) && /*#__PURE__*/jsx(Button, _objectSpread$2({
355
+ "data-cy": "connect-button",
356
+ disabled: isConnectDisabled,
357
+ href: connectUrl,
358
+ to: connectPath,
359
+ label: t("neetoIntegrations.common.connectIntegration", {
360
+ integration: integrationName || humanize(integration)
361
+ }),
362
+ onClick: onConnect
363
+ }, buttonProps))
364
+ })
365
+ }))
366
+ })]
308
367
  })
309
- },
310
- values: {
311
- integration: integrationName || humanize(integration)
312
- }
313
- }))), isConnected ? /*#__PURE__*/React__default.createElement("div", {
314
- className: "space-x-2"
315
- }, (managePath || manageUrl) && /*#__PURE__*/React__default.createElement(Button, {
316
- "data-cy": "manage-button",
317
- href: manageUrl,
318
- target: manageUrl ? "_blank" : "_self",
319
- to: managePath,
320
- label: t("neetoIntegrations.common.manageIntegration", {
321
- integration: integrationName || humanize(integration)
322
- })
323
- }), onDisconnect && /*#__PURE__*/React__default.createElement(Button, {
324
- "data-cy": "disconnect-button",
325
- style: "secondary",
326
- label: t("neetoIntegrations.common.disconnectIntegration", {
327
- integration: integrationName || humanize(integration)
328
- }),
329
- onClick: function onClick() {
330
- return setIsDisconnectAlertOpen(true);
331
- }
332
- })) : /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(Tooltip, _extends$1({
333
- disabled: !isConnectDisabled
334
- }, connectTooltipProps), /*#__PURE__*/React__default.createElement("span", null, (connectPath || connectUrl || onConnect) && /*#__PURE__*/React__default.createElement(Button, {
335
- "data-cy": "connect-button",
336
- disabled: isConnectDisabled,
337
- href: connectUrl,
338
- to: connectPath,
339
- label: t("neetoIntegrations.common.connectIntegration", {
340
- integration: integrationName || humanize(integration)
341
- }),
342
- onClick: onConnect
343
- })))))), /*#__PURE__*/React__default.createElement(DisconnectAlert, {
344
- isDisconnecting: isDisconnecting,
345
- onClose: onClose,
346
- onDisconnect: onDisconnect,
347
- isOpen: isDisconnectAlertOpen,
348
- message: disconnectMessage || t("settings.integrations.".concat(integration, ".disconnect.message")),
349
- title: disconnectTitle || t("settings.integrations.".concat(integration, ".disconnect.title"))
350
- }));
368
+ }), /*#__PURE__*/jsx(DisconnectAlert, {
369
+ isDisconnecting: isDisconnecting,
370
+ onClose: onClose,
371
+ onDisconnect: onDisconnect,
372
+ isOpen: isDisconnectAlertOpen,
373
+ message: disconnectMessage || t("settings.integrations.".concat(integration, ".disconnect.message")),
374
+ title: disconnectTitle || t("settings.integrations.".concat(integration, ".disconnect.title"))
375
+ })]
376
+ });
351
377
  });
352
378
 
353
379
  [{
@@ -448,6 +474,8 @@ var factoryWithThrowingShims = function factoryWithThrowingShims() {
448
474
  var propTypesExports = propTypes.exports;
449
475
  var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
450
476
 
477
+ 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; }
478
+ 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; }
451
479
  var Connect = withT(function (_ref) {
452
480
  var t = _ref.t,
453
481
  Icon = _ref.Icon,
@@ -455,32 +483,61 @@ var Connect = withT(function (_ref) {
455
483
  title = _ref$title === void 0 ? "" : _ref$title,
456
484
  _ref$description = _ref.description,
457
485
  description = _ref$description === void 0 ? "" : _ref$description,
486
+ _ref$integration = _ref.integration,
487
+ integration = _ref$integration === void 0 ? "" : _ref$integration,
488
+ _ref$integrationName = _ref.integrationName,
489
+ integrationName = _ref$integrationName === void 0 ? "" : _ref$integrationName,
490
+ _ref$helpDocUrl = _ref.helpDocUrl,
491
+ helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
458
492
  _ref$buttonProps = _ref.buttonProps,
459
493
  buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
460
494
  _ref$onConnect = _ref.onConnect,
461
495
  onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect,
462
496
  children = _ref.children,
463
497
  secondaryButtonProps = _ref.secondaryButtonProps;
464
- return /*#__PURE__*/React__default.createElement("div", {
465
- className: "mx-auto w-full max-w-3xl"
466
- }, /*#__PURE__*/React__default.createElement("div", {
467
- className: "mb-6 flex flex-col gap-y-2"
468
- }, /*#__PURE__*/React__default.createElement(Icon, {
469
- size: 48
470
- }), /*#__PURE__*/React__default.createElement("div", {
471
- className: "flex flex-col gap-y-1"
472
- }, /*#__PURE__*/React__default.createElement(Typography, {
473
- style: "h2"
474
- }, title), /*#__PURE__*/React__default.createElement(Typography, {
475
- style: "body2"
476
- }, description))), children, /*#__PURE__*/React__default.createElement("div", {
477
- className: "flex w-full items-center gap-x-3"
478
- }, /*#__PURE__*/React__default.createElement(Button, _extends$1({
479
- label: t("neetoIntegrations.common.connect"),
480
- onClick: onConnect
481
- }, buttonProps)), secondaryButtonProps && /*#__PURE__*/React__default.createElement(Button, _extends$1({
482
- style: "secondary"
483
- }, secondaryButtonProps))));
498
+ return /*#__PURE__*/jsxs("div", {
499
+ className: "mx-auto w-full max-w-3xl",
500
+ children: [/*#__PURE__*/jsxs("div", {
501
+ className: "mb-6 flex flex-col gap-y-2",
502
+ children: [/*#__PURE__*/jsx(Icon, {
503
+ size: 48
504
+ }), /*#__PURE__*/jsxs("div", {
505
+ className: "flex flex-col gap-y-1",
506
+ children: [/*#__PURE__*/jsx(Typography, {
507
+ style: "h2",
508
+ children: title
509
+ }), /*#__PURE__*/jsx(Typography, {
510
+ style: "body2",
511
+ children: description
512
+ })]
513
+ })]
514
+ }), helpDocUrl && /*#__PURE__*/jsx("div", {
515
+ className: "mb-4",
516
+ children: /*#__PURE__*/jsx(Trans, {
517
+ i18nKey: "neetoIntegrations.common.helpDocUrl",
518
+ components: {
519
+ helpLink: /*#__PURE__*/jsx(Button, {
520
+ className: "text-xs",
521
+ href: helpDocUrl,
522
+ size: "small",
523
+ style: "link",
524
+ target: "_blank"
525
+ })
526
+ },
527
+ values: {
528
+ integration: integrationName || humanize(integration)
529
+ }
530
+ })
531
+ }), children, /*#__PURE__*/jsxs("div", {
532
+ className: "flex w-full items-center gap-x-3",
533
+ children: [/*#__PURE__*/jsx(Button, _objectSpread$1({
534
+ label: t("neetoIntegrations.common.connect"),
535
+ onClick: onConnect
536
+ }, buttonProps)), secondaryButtonProps && /*#__PURE__*/jsx(Button, _objectSpread$1({
537
+ style: "secondary"
538
+ }, secondaryButtonProps))]
539
+ })]
540
+ });
484
541
  });
485
542
  Connect.prototypes = {
486
543
  /**
@@ -554,6 +611,8 @@ const SvgSuccess = props => /*#__PURE__*/React.createElement("svg", _extends({
554
611
  height: 344
555
612
  }))));
556
613
 
614
+ 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; }
615
+ 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; }
557
616
  var Finish = withT(function (_ref) {
558
617
  var t = _ref.t,
559
618
  _ref$onClick = _ref.onClick,
@@ -565,20 +624,23 @@ var Finish = withT(function (_ref) {
565
624
  _ref$secondaryButtonP = _ref.secondaryButtonProps,
566
625
  secondaryButtonProps = _ref$secondaryButtonP === void 0 ? {} : _ref$secondaryButtonP,
567
626
  children = _ref.children;
568
- return /*#__PURE__*/React__default.createElement("div", {
569
- className: "mx-auto w-full max-w-3xl"
570
- }, /*#__PURE__*/React__default.createElement(SvgSuccess, null), /*#__PURE__*/React__default.createElement(Typography, {
571
- className: "mb-6 mt-4",
572
- style: "h2",
573
- weight: "semibold"
574
- }, title), children, /*#__PURE__*/React__default.createElement("div", {
575
- className: "flex w-full items-center gap-x-2"
576
- }, /*#__PURE__*/React__default.createElement(Button, _extends$1({
577
- onClick: onClick,
578
- label: t("neetoIntegrations.common.continue")
579
- }, buttonProps)), isNotEmpty(secondaryButtonProps) && /*#__PURE__*/React__default.createElement(Button, _extends$1({
580
- style: "secondary"
581
- }, secondaryButtonProps))));
627
+ return /*#__PURE__*/jsxs("div", {
628
+ className: "mx-auto w-full max-w-3xl",
629
+ children: [/*#__PURE__*/jsx(SvgSuccess, {}), /*#__PURE__*/jsx(Typography, {
630
+ className: "mb-6 mt-4",
631
+ style: "h2",
632
+ weight: "semibold",
633
+ children: title
634
+ }), children, /*#__PURE__*/jsxs("div", {
635
+ className: "flex w-full items-center gap-x-2",
636
+ children: [/*#__PURE__*/jsx(Button, _objectSpread({
637
+ onClick: onClick,
638
+ label: t("neetoIntegrations.common.continue")
639
+ }, buttonProps)), isNotEmpty(secondaryButtonProps) && /*#__PURE__*/jsx(Button, _objectSpread({
640
+ style: "secondary"
641
+ }, secondaryButtonProps))]
642
+ })]
643
+ });
582
644
  });
583
645
  Finish.prototypes = {
584
646
  /**
@@ -640,6 +702,7 @@ var Form = function Form(_ref) {
640
702
  breadcrumbs = _ref.breadcrumbs;
641
703
  var _useTranslation = useTranslation(),
642
704
  t = _useTranslation.t;
705
+ var history = useHistory();
643
706
  var _useState = useState(false),
644
707
  _useState2 = _slicedToArray(_useState, 2),
645
708
  isDemoModalOpen = _useState2[0],
@@ -650,75 +713,83 @@ var Form = function Form(_ref) {
650
713
  }
651
714
  }),
652
715
  createDaily = _useCreateDaily.mutate,
653
- isConnecting = _useCreateDaily.isLoading;
716
+ isConnecting = _useCreateDaily.isPending;
654
717
  var handleSubmit = function handleSubmit(payload) {
655
718
  return createDaily(payload);
656
719
  };
657
720
  if (isConnecting) {
658
- return /*#__PURE__*/React__default.createElement(PageLoader, null);
721
+ return /*#__PURE__*/jsx(PageLoader, {});
659
722
  }
660
- return /*#__PURE__*/React__default.createElement(Container, {
661
- isHeaderFixed: true
662
- }, /*#__PURE__*/React__default.createElement(Header, {
663
- breadcrumbs: breadcrumbs,
664
- title: /*#__PURE__*/React__default.createElement("span", {
665
- className: "flex items-center gap-2"
666
- }, t("neetoIntegrations.daily.connect.title"), /*#__PURE__*/React__default.createElement(HelpPopover, {
667
- title: t("neetoIntegrations.daily.connect.title"),
668
- description: /*#__PURE__*/React__default.createElement(Trans, {
669
- i18nKey: "neetoIntegrations.daily.helpDoc",
670
- components: {
671
- externalLink: /*#__PURE__*/React__default.createElement(ExternalLink$1, {
672
- "data-cy": "api-key-help-doc-link",
673
- href: helpDocUrl,
674
- rel: "noreferrer",
675
- target: "_blank"
676
- })
677
- }
678
- }),
679
- helpLinkProps: {
680
- label: /*#__PURE__*/React__default.createElement(Button, {
681
- className: "mt-8",
682
- label: t("neetoIntegrations.daily.walkthroughText"),
683
- style: "link",
684
- onClick: function onClick() {
685
- return setIsDemoModalOpen(true);
723
+ return /*#__PURE__*/jsxs(Container, {
724
+ isHeaderFixed: true,
725
+ children: [/*#__PURE__*/jsx(Header, {
726
+ breadcrumbs: breadcrumbs,
727
+ title: /*#__PURE__*/jsxs("span", {
728
+ className: "flex items-center gap-2",
729
+ children: [t("neetoIntegrations.daily.connect.title"), /*#__PURE__*/jsx(HelpPopover, {
730
+ title: t("neetoIntegrations.daily.connect.title"),
731
+ description: /*#__PURE__*/jsx(Trans, {
732
+ i18nKey: "neetoIntegrations.daily.helpDoc",
733
+ components: {
734
+ externalLink: /*#__PURE__*/jsx(ExternalLink$1, {
735
+ "data-cy": "api-key-help-doc-link",
736
+ href: helpDocUrl,
737
+ rel: "noreferrer",
738
+ target: "_blank"
739
+ })
740
+ }
741
+ }),
742
+ helpLinkProps: {
743
+ label: /*#__PURE__*/jsx(Button, {
744
+ className: "mt-8",
745
+ label: t("neetoIntegrations.daily.walkthroughText"),
746
+ style: "link",
747
+ onClick: function onClick() {
748
+ return setIsDemoModalOpen(true);
749
+ }
750
+ })
686
751
  }
752
+ })]
753
+ })
754
+ }), /*#__PURE__*/jsxs("div", {
755
+ className: "mx-auto w-full max-w-md",
756
+ children: [/*#__PURE__*/jsx(FormikFormWrapper, {
757
+ formikProps: {
758
+ initialValues: MANAGE_DAILY_CO_FORM_INITIAL_VALUES,
759
+ validationSchema: DAILY_CO_VALIDATION_SCHEMA,
760
+ onSubmit: handleSubmit
761
+ },
762
+ children: /*#__PURE__*/jsxs("div", {
763
+ className: "mt-14 w-full space-y-2",
764
+ children: [/*#__PURE__*/jsx("div", {
765
+ className: "block min-h-20",
766
+ children: /*#__PURE__*/jsx(Input, {
767
+ autoFocus: true,
768
+ required: true,
769
+ label: t("neetoIntegrations.daily.apiKey"),
770
+ name: "apiKey"
771
+ })
772
+ }), /*#__PURE__*/jsx(ActionBlock, {
773
+ cancelButtonProps: {
774
+ onClick: function onClick() {
775
+ return history.goBack();
776
+ }
777
+ },
778
+ isSubmitting: isConnecting,
779
+ submitButtonProps: {
780
+ label: t("neetoIntegrations.common.connect")
781
+ }
782
+ })]
687
783
  })
688
- }
689
- }))
690
- }), /*#__PURE__*/React__default.createElement("div", {
691
- className: "mx-auto w-full max-w-md"
692
- }, /*#__PURE__*/React__default.createElement(Form$2, {
693
- formikProps: {
694
- initialValues: MANAGE_DAILY_CO_FORM_INITIAL_VALUES,
695
- validationSchema: DAILY_CO_VALIDATION_SCHEMA,
696
- onSubmit: handleSubmit
697
- }
698
- }, function (_ref2) {
699
- var dirty = _ref2.dirty;
700
- return /*#__PURE__*/React__default.createElement("div", {
701
- className: "mt-14 w-full space-y-5"
702
- }, /*#__PURE__*/React__default.createElement("div", {
703
- className: "block min-h-20"
704
- }, /*#__PURE__*/React__default.createElement(Input, {
705
- autoFocus: true,
706
- required: true,
707
- label: t("neetoIntegrations.daily.apiKey"),
708
- name: "apiKey"
709
- })), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(Button, {
710
- disabled: isConnecting || !dirty,
711
- label: t("neetoIntegrations.common.connect"),
712
- loading: isConnecting,
713
- type: "submit"
714
- })));
715
- }), /*#__PURE__*/React__default.createElement(WalkthroughModal, {
716
- videoUrl: videoUrl,
717
- isOpen: isDemoModalOpen,
718
- onClose: function onClose() {
719
- return setIsDemoModalOpen(false);
720
- }
721
- })));
784
+ }), /*#__PURE__*/jsx(WalkthroughModal, {
785
+ videoUrl: videoUrl,
786
+ isOpen: isDemoModalOpen,
787
+ onClose: function onClose() {
788
+ return setIsDemoModalOpen(false);
789
+ }
790
+ })]
791
+ })]
792
+ });
722
793
  };
723
794
  var Form$1 = withTitle(Form, i18next.t("neetoIntegrations.browserTitles.integrations.dailyco"));
724
795
 
@@ -747,35 +818,35 @@ var Manage = function Manage(_ref) {
747
818
  }
748
819
  }),
749
820
  destroyIntegration = _useDestroyDaily.mutate,
750
- isDisconnecting = _useDestroyDaily.isLoading;
821
+ isDisconnecting = _useDestroyDaily.isPending;
751
822
  var isConnected = isPresent(apiKey);
752
823
  var handleDisconnect = function handleDisconnect() {
753
824
  return destroyIntegration("daily");
754
825
  };
755
- if (isFetching || isDisconnecting) return /*#__PURE__*/React__default.createElement(PageLoader, null);
756
- return /*#__PURE__*/React__default.createElement(Manage$1, {
826
+ if (isFetching || isDisconnecting) return /*#__PURE__*/jsx(PageLoader, {});
827
+ return /*#__PURE__*/jsx(Manage$1, {
757
828
  isConnected: isConnected,
758
829
  isDisconnectAlertOpen: isDisconnectAlertOpen,
759
830
  isDisconnecting: isDisconnecting,
760
831
  setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
761
- Icon: Daily$1,
832
+ Icon: DailyIcon,
762
833
  connectPath: buildUrl(window.location.pathname, {
763
834
  connect: true
764
835
  }),
765
836
  integration: "daily",
766
- description: isConnected ? /*#__PURE__*/React__default.createElement(Trans, {
837
+ description: isConnected ? /*#__PURE__*/jsx(Trans, {
767
838
  i18nKey: "neetoIntegrations.daily.yourApiKey",
768
839
  values: {
769
840
  apiKey: apiKey
770
841
  },
771
842
  components: {
772
- wrapper: /*#__PURE__*/React__default.createElement("div", {
843
+ wrapper: /*#__PURE__*/jsx("div", {
773
844
  className: "neeto-ui-rounded-md mt-2 flex items-center justify-between gap-x-3 border px-3 py-2"
774
845
  }),
775
- span: /*#__PURE__*/React__default.createElement("span", {
846
+ span: /*#__PURE__*/jsx("span", {
776
847
  className: "break-all text-sm"
777
848
  }),
778
- copy: /*#__PURE__*/React__default.createElement(CopyToClipboardButton, {
849
+ copy: /*#__PURE__*/jsx(CopyToClipboardButton, {
779
850
  className: "flex-shrink-0 self-start",
780
851
  style: "text",
781
852
  value: apiKey
@@ -814,12 +885,12 @@ var Daily = function Daily(_ref) {
814
885
  _ref2$apiKey = _ref2.apiKey,
815
886
  apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
816
887
  if (isPresent(apiKey) && !isOnboarding || !connect) {
817
- return /*#__PURE__*/React__default.createElement(Manage, {
888
+ return /*#__PURE__*/jsx(Manage, {
818
889
  description: description,
819
890
  onDisconnect: onDisconnect
820
891
  });
821
892
  }
822
- return /*#__PURE__*/React__default.createElement(Form$1, {
893
+ return /*#__PURE__*/jsx(Form$1, {
823
894
  helpDocUrl: helpDocUrl,
824
895
  onConnect: onConnect,
825
896
  videoUrl: videoUrl