@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.
@@ -2,26 +2,38 @@ import * as React from 'react';
2
2
  import React__default, { 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';
6
- import { Typography, Button, Tooltip, Modal as Modal$1, Callout } from '@bigbinary/neetoui';
5
+ import GoogleCalendarIcon from '@bigbinary/neeto-icons/misc/GoogleCalendar';
6
+ import Google from '@bigbinary/neeto-icons/misc/Google';
7
+ import Typography from '@bigbinary/neetoui/Typography';
8
+ import Callout from '@bigbinary/neetoui/Callout';
9
+ import Button from '@bigbinary/neetoui/Button';
7
10
  import { Trans, useTranslation } from 'react-i18next';
8
11
  import '@bigbinary/neeto-molecules/IntegrationCard';
9
12
  import DisconnectAlert from '@bigbinary/neeto-molecules/IntegrationDisconnectAlert';
10
13
  import WalkthroughModal from '@bigbinary/neeto-molecules/IntegrationWalkthroughModal';
11
14
  import classnames from 'classnames';
12
15
  import { withT, useMutationWithInvalidation, withTitle, useQueryParams } from '@bigbinary/neeto-commons-frontend/react-utils';
13
- import { Check } from '@bigbinary/neeto-icons';
16
+ import Check from '@bigbinary/neeto-icons/Check';
17
+ import Tooltip from '@bigbinary/neetoui/Tooltip';
14
18
  import i18next, { t as t$1 } from 'i18next';
19
+ import { useQuery } from '@tanstack/react-query';
15
20
  import { DEFAULT_STALE_TIME } from '@bigbinary/neeto-commons-frontend/constants';
16
- import { useQuery } from 'react-query';
17
21
  import axios from 'axios';
18
22
  import Container from '@bigbinary/neeto-molecules/Container';
19
23
  import Header from '@bigbinary/neeto-molecules/Header';
20
24
  import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
21
25
  import PageLoader from '@bigbinary/neeto-molecules/PageLoader';
22
- import { Form as Form$2, Input } from '@bigbinary/neetoui/formik';
26
+ import Input from '@bigbinary/neetoui/formik/Input';
27
+ import FormikForm from '@bigbinary/neetoui/formik/Form';
28
+ import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
29
+ import { useHistory } from 'react-router-dom';
30
+ import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
23
31
  import 'ramda';
32
+ import '@bigbinary/neetoui/formik/Select';
24
33
  import * as yup from 'yup';
34
+ import '@bigbinary/neeto-icons/misc/Zoom';
35
+ import NeetoUIModal from '@bigbinary/neetoui/Modal';
36
+ import DailyIcon from '@bigbinary/neeto-icons/misc/Daily';
25
37
  import CopyToClipboardButton from '@bigbinary/neeto-molecules/CopyToClipboardButton';
26
38
 
27
39
  function _typeof(o) {
@@ -136,21 +148,8 @@ function _slicedToArray(arr, i) {
136
148
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
137
149
  }
138
150
 
139
- function _extends$1() {
140
- _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
141
- for (var i = 1; i < arguments.length; i++) {
142
- var source = arguments[i];
143
- for (var key in source) {
144
- if (Object.prototype.hasOwnProperty.call(source, key)) {
145
- target[key] = source[key];
146
- }
147
- }
148
- }
149
- return target;
150
- };
151
- return _extends$1.apply(this, arguments);
152
- }
153
-
151
+ 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; }
152
+ 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; }
154
153
  var Manage$1 = withT(function (_ref) {
155
154
  var t = _ref.t,
156
155
  _ref$title = _ref.title,
@@ -194,86 +193,107 @@ var Manage$1 = withT(function (_ref) {
194
193
  _ref$isConnectDisable = _ref.isConnectDisabled,
195
194
  isConnectDisabled = _ref$isConnectDisable === void 0 ? false : _ref$isConnectDisable,
196
195
  _ref$connectTooltipPr = _ref.connectTooltipProps,
197
- connectTooltipProps = _ref$connectTooltipPr === void 0 ? null : _ref$connectTooltipPr;
198
- return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement("div", {
199
- className: "mx-auto w-full max-w-3xl"
200
- }, /*#__PURE__*/React__default.createElement("div", {
201
- className: "neeto-ui-border-gray-300 neeto-ui-rounded-xl mt-10 w-full space-y-4 border p-6"
202
- }, Icon && /*#__PURE__*/React__default.createElement(Icon, {
203
- className: "neeto-ui-text-gray-600",
204
- size: 48
205
- }), /*#__PURE__*/React__default.createElement("div", {
206
- className: "space-y-2"
207
- }, /*#__PURE__*/React__default.createElement("div", {
208
- className: "flex items-center space-x-4"
209
- }, /*#__PURE__*/React__default.createElement(Typography, {
210
- className: "neeto-ui-text-gray-800 mb-0.5",
211
- style: "h2",
212
- weight: "semibold"
213
- }, title), isConnected && /*#__PURE__*/React__default.createElement("div", {
214
- className: "neeto-ui-bg-success-500 neeto-ui-text-white neeto-ui-rounded-full flex items-center justify-center p-1"
215
- }, /*#__PURE__*/React__default.createElement(Check, {
216
- size: 24
217
- }))), /*#__PURE__*/React__default.createElement(Typography, {
218
- style: "body1",
219
- weight: "normal",
220
- className: classnames("neeto-ui-text-gray-800", {
221
- "break-all": isConnected
222
- })
223
- }, description), helpDocUrl && /*#__PURE__*/React__default.createElement(Typography, {
224
- className: "neeto-ui-text-gray-800",
225
- style: "body2",
226
- weight: "normal"
227
- }, /*#__PURE__*/React__default.createElement(Trans, {
228
- i18nKey: "neetoIntegrations.common.helpDocUrl",
229
- components: {
230
- helpLink: /*#__PURE__*/React__default.createElement(Button, {
231
- href: helpDocUrl,
232
- style: "link",
233
- target: "_blank"
196
+ connectTooltipProps = _ref$connectTooltipPr === void 0 ? null : _ref$connectTooltipPr,
197
+ _ref$buttonProps = _ref.buttonProps,
198
+ buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
199
+ _ref$secondaryButtonP = _ref.secondaryButtonProps,
200
+ secondaryButtonProps = _ref$secondaryButtonP === void 0 ? {} : _ref$secondaryButtonP;
201
+ return /*#__PURE__*/jsxs(Fragment, {
202
+ children: [/*#__PURE__*/jsx("div", {
203
+ className: "mx-auto w-full max-w-3xl",
204
+ children: /*#__PURE__*/jsxs("div", {
205
+ className: "neeto-ui-border-gray-300 neeto-ui-rounded-xl mt-10 w-full space-y-4 border p-6",
206
+ children: [Icon && /*#__PURE__*/jsx(Icon, {
207
+ className: "neeto-ui-text-gray-600",
208
+ size: 48
209
+ }), /*#__PURE__*/jsxs("div", {
210
+ className: "space-y-2",
211
+ children: [/*#__PURE__*/jsxs("div", {
212
+ className: "flex items-center space-x-4",
213
+ children: [/*#__PURE__*/jsx(Typography, {
214
+ className: "neeto-ui-text-gray-800 mb-0.5",
215
+ style: "h2",
216
+ weight: "semibold",
217
+ children: title
218
+ }), isConnected && /*#__PURE__*/jsx("div", {
219
+ className: "neeto-ui-bg-success-500 neeto-ui-text-white neeto-ui-rounded-full flex items-center justify-center p-1",
220
+ children: /*#__PURE__*/jsx(Check, {
221
+ size: 24
222
+ })
223
+ })]
224
+ }), /*#__PURE__*/jsx(Typography, {
225
+ style: "body1",
226
+ weight: "normal",
227
+ className: classnames("neeto-ui-text-gray-800", {
228
+ "break-all": isConnected
229
+ }),
230
+ children: description
231
+ }), helpDocUrl && /*#__PURE__*/jsx(Typography, {
232
+ className: "neeto-ui-text-gray-800",
233
+ style: "body2",
234
+ weight: "normal",
235
+ children: /*#__PURE__*/jsx(Trans, {
236
+ i18nKey: "neetoIntegrations.common.helpDocUrl",
237
+ components: {
238
+ helpLink: /*#__PURE__*/jsx(Button, {
239
+ href: helpDocUrl,
240
+ style: "link",
241
+ target: "_blank"
242
+ })
243
+ },
244
+ values: {
245
+ integration: integrationName || humanize(integration)
246
+ }
247
+ })
248
+ })]
249
+ }), isConnected ? /*#__PURE__*/jsxs("div", {
250
+ className: "space-x-2",
251
+ children: [(managePath || manageUrl) && /*#__PURE__*/jsx(Button, _objectSpread$5({
252
+ "data-cy": "manage-button",
253
+ href: manageUrl,
254
+ target: manageUrl ? "_blank" : "_self",
255
+ to: managePath,
256
+ label: t("neetoIntegrations.common.manageIntegration", {
257
+ integration: integrationName || humanize(integration)
258
+ })
259
+ }, buttonProps)), onDisconnect && /*#__PURE__*/jsx(Button, _objectSpread$5({
260
+ "data-cy": "disconnect-button",
261
+ style: "secondary",
262
+ label: t("neetoIntegrations.common.disconnectIntegration", {
263
+ integration: integrationName || humanize(integration)
264
+ }),
265
+ onClick: function onClick() {
266
+ return setIsDisconnectAlertOpen(true);
267
+ }
268
+ }, secondaryButtonProps))]
269
+ }) : /*#__PURE__*/jsx("div", {
270
+ children: /*#__PURE__*/jsx(Tooltip, _objectSpread$5(_objectSpread$5({
271
+ disabled: !isConnectDisabled
272
+ }, connectTooltipProps), {}, {
273
+ children: /*#__PURE__*/jsx("span", {
274
+ children: (connectPath || connectUrl || onConnect) && /*#__PURE__*/jsx(Button, _objectSpread$5({
275
+ "data-cy": "connect-button",
276
+ disabled: isConnectDisabled,
277
+ href: connectUrl,
278
+ to: connectPath,
279
+ label: t("neetoIntegrations.common.connectIntegration", {
280
+ integration: integrationName || humanize(integration)
281
+ }),
282
+ onClick: onConnect
283
+ }, buttonProps))
284
+ })
285
+ }))
286
+ })]
234
287
  })
235
- },
236
- values: {
237
- integration: integrationName || humanize(integration)
238
- }
239
- }))), isConnected ? /*#__PURE__*/React__default.createElement("div", {
240
- className: "space-x-2"
241
- }, (managePath || manageUrl) && /*#__PURE__*/React__default.createElement(Button, {
242
- "data-cy": "manage-button",
243
- href: manageUrl,
244
- target: manageUrl ? "_blank" : "_self",
245
- to: managePath,
246
- label: t("neetoIntegrations.common.manageIntegration", {
247
- integration: integrationName || humanize(integration)
248
- })
249
- }), onDisconnect && /*#__PURE__*/React__default.createElement(Button, {
250
- "data-cy": "disconnect-button",
251
- style: "secondary",
252
- label: t("neetoIntegrations.common.disconnectIntegration", {
253
- integration: integrationName || humanize(integration)
254
- }),
255
- onClick: function onClick() {
256
- return setIsDisconnectAlertOpen(true);
257
- }
258
- })) : /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(Tooltip, _extends$1({
259
- disabled: !isConnectDisabled
260
- }, connectTooltipProps), /*#__PURE__*/React__default.createElement("span", null, (connectPath || connectUrl || onConnect) && /*#__PURE__*/React__default.createElement(Button, {
261
- "data-cy": "connect-button",
262
- disabled: isConnectDisabled,
263
- href: connectUrl,
264
- to: connectPath,
265
- label: t("neetoIntegrations.common.connectIntegration", {
266
- integration: integrationName || humanize(integration)
267
- }),
268
- onClick: onConnect
269
- })))))), /*#__PURE__*/React__default.createElement(DisconnectAlert, {
270
- isDisconnecting: isDisconnecting,
271
- onClose: onClose,
272
- onDisconnect: onDisconnect,
273
- isOpen: isDisconnectAlertOpen,
274
- message: disconnectMessage || t("settings.integrations.".concat(integration, ".disconnect.message")),
275
- title: disconnectTitle || t("settings.integrations.".concat(integration, ".disconnect.title"))
276
- }));
288
+ }), /*#__PURE__*/jsx(DisconnectAlert, {
289
+ isDisconnecting: isDisconnecting,
290
+ onClose: onClose,
291
+ onDisconnect: onDisconnect,
292
+ isOpen: isDisconnectAlertOpen,
293
+ message: disconnectMessage || t("settings.integrations.".concat(integration, ".disconnect.message")),
294
+ title: disconnectTitle || t("settings.integrations.".concat(integration, ".disconnect.title"))
295
+ })]
296
+ });
277
297
  });
278
298
 
279
299
  var INTEGRATIONS_ENGINE_BASE_URL = "/neeto_integrations";
@@ -303,23 +323,25 @@ var QUERY_KEYS = {
303
323
  ZOOM_DETAILS: "zoom-details"
304
324
  };
305
325
 
306
- 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; }
307
- 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; }
326
+ 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; }
327
+ 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; }
308
328
  var useCreateDaily = function useCreateDaily() {
309
329
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
310
- return useMutationWithInvalidation(dailiesApi.create, _objectSpread$1({
311
- keysToInvalidate: [QUERY_KEYS.DAILY_CO_DETAILS]
330
+ return useMutationWithInvalidation(dailiesApi.create, _objectSpread$4({
331
+ keysToInvalidate: [[QUERY_KEYS.DAILY_CO_DETAILS]]
312
332
  }, options));
313
333
  };
314
334
  var useFetchDaily = function useFetchDaily() {
315
- return useQuery(QUERY_KEYS.DAILY_CO_DETAILS, dailiesApi.show, {
335
+ return useQuery({
336
+ queryKey: [QUERY_KEYS.DAILY_CO_DETAILS],
337
+ queryFn: dailiesApi.show,
316
338
  staleTime: DEFAULT_STALE_TIME
317
339
  });
318
340
  };
319
341
  var useDestroyDaily = function useDestroyDaily(_ref) {
320
342
  var onSuccess = _ref.onSuccess;
321
343
  return useMutationWithInvalidation(dailiesApi.destroy, {
322
- keysToInvalidate: [QUERY_KEYS.DAILY_CO_DETAILS],
344
+ keysToInvalidate: [[QUERY_KEYS.DAILY_CO_DETAILS]],
323
345
  onSuccess: onSuccess
324
346
  });
325
347
  };
@@ -354,15 +376,19 @@ function _objectWithoutProperties(source, excluded) {
354
376
  }
355
377
 
356
378
  var _excluded = ["className", "children"];
379
+ 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; }
380
+ 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; }
357
381
  var ExternalLink = function ExternalLink(_ref) {
358
382
  var _ref$className = _ref.className,
359
383
  className = _ref$className === void 0 ? "" : _ref$className,
360
384
  _ref$children = _ref.children,
361
385
  children = _ref$children === void 0 ? null : _ref$children,
362
386
  props = _objectWithoutProperties(_ref, _excluded);
363
- return /*#__PURE__*/React__default.createElement("a", _extends$1({
387
+ return /*#__PURE__*/jsx("a", _objectSpread$3(_objectSpread$3({
364
388
  className: classnames(["neeto-ui-text-primary-800 hover:neeto-ui-text-primary-800 visited:neeto-ui-text-primary-600 font-medium", className])
365
- }, props), children);
389
+ }, props), {}, {
390
+ children: children
391
+ }));
366
392
  };
367
393
  var ExternalLink$1 = /*#__PURE__*/React__default.memo(ExternalLink);
368
394
 
@@ -382,6 +408,7 @@ var Form = function Form(_ref) {
382
408
  breadcrumbs = _ref.breadcrumbs;
383
409
  var _useTranslation = useTranslation(),
384
410
  t = _useTranslation.t;
411
+ var history = useHistory();
385
412
  var _useState = useState(false),
386
413
  _useState2 = _slicedToArray(_useState, 2),
387
414
  isDemoModalOpen = _useState2[0],
@@ -392,75 +419,83 @@ var Form = function Form(_ref) {
392
419
  }
393
420
  }),
394
421
  createDaily = _useCreateDaily.mutate,
395
- isConnecting = _useCreateDaily.isLoading;
422
+ isConnecting = _useCreateDaily.isPending;
396
423
  var handleSubmit = function handleSubmit(payload) {
397
424
  return createDaily(payload);
398
425
  };
399
426
  if (isConnecting) {
400
- return /*#__PURE__*/React__default.createElement(PageLoader, null);
427
+ return /*#__PURE__*/jsx(PageLoader, {});
401
428
  }
402
- return /*#__PURE__*/React__default.createElement(Container, {
403
- isHeaderFixed: true
404
- }, /*#__PURE__*/React__default.createElement(Header, {
405
- breadcrumbs: breadcrumbs,
406
- title: /*#__PURE__*/React__default.createElement("span", {
407
- className: "flex items-center gap-2"
408
- }, t("neetoIntegrations.daily.connect.title"), /*#__PURE__*/React__default.createElement(HelpPopover, {
409
- title: t("neetoIntegrations.daily.connect.title"),
410
- description: /*#__PURE__*/React__default.createElement(Trans, {
411
- i18nKey: "neetoIntegrations.daily.helpDoc",
412
- components: {
413
- externalLink: /*#__PURE__*/React__default.createElement(ExternalLink$1, {
414
- "data-cy": "api-key-help-doc-link",
415
- href: helpDocUrl,
416
- rel: "noreferrer",
417
- target: "_blank"
418
- })
419
- }
420
- }),
421
- helpLinkProps: {
422
- label: /*#__PURE__*/React__default.createElement(Button, {
423
- className: "mt-8",
424
- label: t("neetoIntegrations.daily.walkthroughText"),
425
- style: "link",
426
- onClick: function onClick() {
427
- return setIsDemoModalOpen(true);
429
+ return /*#__PURE__*/jsxs(Container, {
430
+ isHeaderFixed: true,
431
+ children: [/*#__PURE__*/jsx(Header, {
432
+ breadcrumbs: breadcrumbs,
433
+ title: /*#__PURE__*/jsxs("span", {
434
+ className: "flex items-center gap-2",
435
+ children: [t("neetoIntegrations.daily.connect.title"), /*#__PURE__*/jsx(HelpPopover, {
436
+ title: t("neetoIntegrations.daily.connect.title"),
437
+ description: /*#__PURE__*/jsx(Trans, {
438
+ i18nKey: "neetoIntegrations.daily.helpDoc",
439
+ components: {
440
+ externalLink: /*#__PURE__*/jsx(ExternalLink$1, {
441
+ "data-cy": "api-key-help-doc-link",
442
+ href: helpDocUrl,
443
+ rel: "noreferrer",
444
+ target: "_blank"
445
+ })
446
+ }
447
+ }),
448
+ helpLinkProps: {
449
+ label: /*#__PURE__*/jsx(Button, {
450
+ className: "mt-8",
451
+ label: t("neetoIntegrations.daily.walkthroughText"),
452
+ style: "link",
453
+ onClick: function onClick() {
454
+ return setIsDemoModalOpen(true);
455
+ }
456
+ })
428
457
  }
458
+ })]
459
+ })
460
+ }), /*#__PURE__*/jsxs("div", {
461
+ className: "mx-auto w-full max-w-md",
462
+ children: [/*#__PURE__*/jsx(FormikForm, {
463
+ formikProps: {
464
+ initialValues: MANAGE_DAILY_CO_FORM_INITIAL_VALUES,
465
+ validationSchema: DAILY_CO_VALIDATION_SCHEMA,
466
+ onSubmit: handleSubmit
467
+ },
468
+ children: /*#__PURE__*/jsxs("div", {
469
+ className: "mt-14 w-full space-y-2",
470
+ children: [/*#__PURE__*/jsx("div", {
471
+ className: "block min-h-20",
472
+ children: /*#__PURE__*/jsx(Input, {
473
+ autoFocus: true,
474
+ required: true,
475
+ label: t("neetoIntegrations.daily.apiKey"),
476
+ name: "apiKey"
477
+ })
478
+ }), /*#__PURE__*/jsx(ActionBlock, {
479
+ cancelButtonProps: {
480
+ onClick: function onClick() {
481
+ return history.goBack();
482
+ }
483
+ },
484
+ isSubmitting: isConnecting,
485
+ submitButtonProps: {
486
+ label: t("neetoIntegrations.common.connect")
487
+ }
488
+ })]
429
489
  })
430
- }
431
- }))
432
- }), /*#__PURE__*/React__default.createElement("div", {
433
- className: "mx-auto w-full max-w-md"
434
- }, /*#__PURE__*/React__default.createElement(Form$2, {
435
- formikProps: {
436
- initialValues: MANAGE_DAILY_CO_FORM_INITIAL_VALUES,
437
- validationSchema: DAILY_CO_VALIDATION_SCHEMA,
438
- onSubmit: handleSubmit
439
- }
440
- }, function (_ref2) {
441
- var dirty = _ref2.dirty;
442
- return /*#__PURE__*/React__default.createElement("div", {
443
- className: "mt-14 w-full space-y-5"
444
- }, /*#__PURE__*/React__default.createElement("div", {
445
- className: "block min-h-20"
446
- }, /*#__PURE__*/React__default.createElement(Input, {
447
- autoFocus: true,
448
- required: true,
449
- label: t("neetoIntegrations.daily.apiKey"),
450
- name: "apiKey"
451
- })), /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(Button, {
452
- disabled: isConnecting || !dirty,
453
- label: t("neetoIntegrations.common.connect"),
454
- loading: isConnecting,
455
- type: "submit"
456
- })));
457
- }), /*#__PURE__*/React__default.createElement(WalkthroughModal, {
458
- videoUrl: videoUrl,
459
- isOpen: isDemoModalOpen,
460
- onClose: function onClose() {
461
- return setIsDemoModalOpen(false);
462
- }
463
- })));
490
+ }), /*#__PURE__*/jsx(WalkthroughModal, {
491
+ videoUrl: videoUrl,
492
+ isOpen: isDemoModalOpen,
493
+ onClose: function onClose() {
494
+ return setIsDemoModalOpen(false);
495
+ }
496
+ })]
497
+ })]
498
+ });
464
499
  };
465
500
  var Form$1 = withTitle(Form, i18next.t("neetoIntegrations.browserTitles.integrations.dailyco"));
466
501
 
@@ -489,35 +524,35 @@ var Manage = function Manage(_ref) {
489
524
  }
490
525
  }),
491
526
  destroyIntegration = _useDestroyDaily.mutate,
492
- isDisconnecting = _useDestroyDaily.isLoading;
527
+ isDisconnecting = _useDestroyDaily.isPending;
493
528
  var isConnected = isPresent(apiKey);
494
529
  var handleDisconnect = function handleDisconnect() {
495
530
  return destroyIntegration("daily");
496
531
  };
497
- if (isFetching || isDisconnecting) return /*#__PURE__*/React__default.createElement(PageLoader, null);
498
- return /*#__PURE__*/React__default.createElement(Manage$1, {
532
+ if (isFetching || isDisconnecting) return /*#__PURE__*/jsx(PageLoader, {});
533
+ return /*#__PURE__*/jsx(Manage$1, {
499
534
  isConnected: isConnected,
500
535
  isDisconnectAlertOpen: isDisconnectAlertOpen,
501
536
  isDisconnecting: isDisconnecting,
502
537
  setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
503
- Icon: Daily$1,
538
+ Icon: DailyIcon,
504
539
  connectPath: buildUrl(window.location.pathname, {
505
540
  connect: true
506
541
  }),
507
542
  integration: "daily",
508
- description: isConnected ? /*#__PURE__*/React__default.createElement(Trans, {
543
+ description: isConnected ? /*#__PURE__*/jsx(Trans, {
509
544
  i18nKey: "neetoIntegrations.daily.yourApiKey",
510
545
  values: {
511
546
  apiKey: apiKey
512
547
  },
513
548
  components: {
514
- wrapper: /*#__PURE__*/React__default.createElement("div", {
549
+ wrapper: /*#__PURE__*/jsx("div", {
515
550
  className: "neeto-ui-rounded-md mt-2 flex items-center justify-between gap-x-3 border px-3 py-2"
516
551
  }),
517
- span: /*#__PURE__*/React__default.createElement("span", {
552
+ span: /*#__PURE__*/jsx("span", {
518
553
  className: "break-all text-sm"
519
554
  }),
520
- copy: /*#__PURE__*/React__default.createElement(CopyToClipboardButton, {
555
+ copy: /*#__PURE__*/jsx(CopyToClipboardButton, {
521
556
  className: "flex-shrink-0 self-start",
522
557
  style: "text",
523
558
  value: apiKey
@@ -556,12 +591,12 @@ var Daily = function Daily(_ref) {
556
591
  _ref2$apiKey = _ref2.apiKey,
557
592
  apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
558
593
  if (isPresent(apiKey) && !isOnboarding || !connect) {
559
- return /*#__PURE__*/React__default.createElement(Manage, {
594
+ return /*#__PURE__*/jsx(Manage, {
560
595
  description: description,
561
596
  onDisconnect: onDisconnect
562
597
  });
563
598
  }
564
- return /*#__PURE__*/React__default.createElement(Form$1, {
599
+ return /*#__PURE__*/jsx(Form$1, {
565
600
  helpDocUrl: helpDocUrl,
566
601
  onConnect: onConnect,
567
602
  videoUrl: videoUrl
@@ -575,42 +610,47 @@ var Stepper = function Stepper(_ref) {
575
610
  var isActiveOrCompleted = function isActiveOrCompleted(activeStatus, completedStatus) {
576
611
  return activeStatus || completedStatus;
577
612
  };
578
- return /*#__PURE__*/React__default.createElement("ul", {
579
- className: "flex gap-4"
580
- }, steps === null || steps === void 0 ? void 0 : steps.map(function (_ref2) {
581
- var step = _ref2.step,
582
- label = _ref2.label,
583
- isActive = _ref2.isActive,
584
- isCompleted = _ref2.isCompleted;
585
- return /*#__PURE__*/React__default.createElement("li", {
586
- className: "flex items-center gap-4",
587
- key: step
588
- }, step !== "1" && /*#__PURE__*/React__default.createElement("div", {
589
- className: classnames("w-10 border-b", {
590
- "neeto-ui-border-gray-800": isActiveOrCompleted(isActive, isCompleted),
591
- "neeto-ui-border-gray-400": !isActiveOrCompleted(isActive, isCompleted)
592
- })
593
- }), /*#__PURE__*/React__default.createElement("div", {
594
- className: "flex items-center gap-2"
595
- }, /*#__PURE__*/React__default.createElement("div", {
596
- className: classnames("neeto-ui-rounded-full neeto-ui-gray-600 flex h-6 w-6 items-center justify-center border", {
597
- "neeto-ui-bg-success-600 neeto-ui-border-success-600 neeto-ui-text-white": isActive,
598
- "neeto-ui-bg-primary-600 neeto-ui-border-primary-600 neeto-ui-text-white": isCompleted,
599
- "neeto-ui-border-gray-400": !isActiveOrCompleted(isActive, isCompleted)
600
- })
601
- }, /*#__PURE__*/React__default.createElement(Typography, {
602
- component: "span",
603
- style: "body2",
604
- weight: "normal"
605
- }, step)), /*#__PURE__*/React__default.createElement(Typography, {
606
- style: "body2",
607
- weight: "normal",
608
- className: classnames({
609
- "neeto-ui-text-gray-800": isActiveOrCompleted(isActive, isCompleted),
610
- "neeto-ui-text-gray-600": !isActiveOrCompleted(isActive, isCompleted)
611
- })
612
- }, label)));
613
- }));
613
+ return /*#__PURE__*/jsx("ul", {
614
+ className: "flex gap-4",
615
+ children: steps === null || steps === void 0 ? void 0 : steps.map(function (_ref2) {
616
+ var step = _ref2.step,
617
+ label = _ref2.label,
618
+ isActive = _ref2.isActive,
619
+ isCompleted = _ref2.isCompleted;
620
+ return /*#__PURE__*/jsxs("li", {
621
+ className: "flex items-center gap-4",
622
+ children: [step !== "1" && /*#__PURE__*/jsx("div", {
623
+ className: classnames("w-10 border-b", {
624
+ "neeto-ui-border-gray-800": isActiveOrCompleted(isActive, isCompleted),
625
+ "neeto-ui-border-gray-400": !isActiveOrCompleted(isActive, isCompleted)
626
+ })
627
+ }), /*#__PURE__*/jsxs("div", {
628
+ className: "flex items-center gap-2",
629
+ children: [/*#__PURE__*/jsx("div", {
630
+ className: classnames("neeto-ui-rounded-full neeto-ui-gray-600 flex h-6 w-6 items-center justify-center border", {
631
+ "neeto-ui-bg-success-600 neeto-ui-border-success-600 neeto-ui-text-white": isActive,
632
+ "neeto-ui-bg-primary-600 neeto-ui-border-primary-600 neeto-ui-text-white": isCompleted,
633
+ "neeto-ui-border-gray-400": !isActiveOrCompleted(isActive, isCompleted)
634
+ }),
635
+ children: /*#__PURE__*/jsx(Typography, {
636
+ component: "span",
637
+ style: "body2",
638
+ weight: "normal",
639
+ children: step
640
+ })
641
+ }), /*#__PURE__*/jsx(Typography, {
642
+ style: "body2",
643
+ weight: "normal",
644
+ className: classnames({
645
+ "neeto-ui-text-gray-800": isActiveOrCompleted(isActive, isCompleted),
646
+ "neeto-ui-text-gray-600": !isActiveOrCompleted(isActive, isCompleted)
647
+ }),
648
+ children: label
649
+ })]
650
+ })]
651
+ }, step);
652
+ })
653
+ });
614
654
  };
615
655
 
616
656
  var Modal = function Modal(_ref) {
@@ -621,18 +661,23 @@ var Modal = function Modal(_ref) {
621
661
  _ref$steps = _ref.steps,
622
662
  steps = _ref$steps === void 0 ? {} : _ref$steps,
623
663
  children = _ref.children;
624
- return /*#__PURE__*/React__default.createElement(Modal$1, {
664
+ return /*#__PURE__*/jsxs(NeetoUIModal, {
625
665
  isOpen: isOpen,
626
666
  onClose: onClose,
627
667
  className: "neeto-ui-flex neeto-ui-flex-col neeto-ui-transform-none w-screen overflow-y-auto",
628
- size: "fullScreen"
629
- }, /*#__PURE__*/React__default.createElement(Modal$1.Header, null, /*#__PURE__*/React__default.createElement(Stepper, {
630
- steps: steps
631
- })), /*#__PURE__*/React__default.createElement(Modal$1.Body, {
632
- className: "neeto-ui-flex neeto-ui-justify-center neeto-ui-flex-grow"
633
- }, /*#__PURE__*/React__default.createElement("div", {
634
- className: "neeto-ui-w-full py-10"
635
- }, children)));
668
+ size: "fullScreen",
669
+ children: [/*#__PURE__*/jsx(NeetoUIModal.Header, {
670
+ children: /*#__PURE__*/jsx(Stepper, {
671
+ steps: steps
672
+ })
673
+ }), /*#__PURE__*/jsx(NeetoUIModal.Body, {
674
+ className: "neeto-ui-flex neeto-ui-justify-center neeto-ui-flex-grow",
675
+ children: /*#__PURE__*/jsx("div", {
676
+ className: "neeto-ui-w-full py-10",
677
+ children: children
678
+ })
679
+ })]
680
+ });
636
681
  };
637
682
 
638
683
  function getDefaultExportFromCjs (x) {
@@ -717,6 +762,8 @@ var factoryWithThrowingShims = function factoryWithThrowingShims() {
717
762
  var propTypesExports = propTypes.exports;
718
763
  var PropTypes = /*@__PURE__*/getDefaultExportFromCjs(propTypesExports);
719
764
 
765
+ 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; }
766
+ 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; }
720
767
  var Connect = withT(function (_ref) {
721
768
  var t = _ref.t,
722
769
  Icon = _ref.Icon,
@@ -724,32 +771,61 @@ var Connect = withT(function (_ref) {
724
771
  title = _ref$title === void 0 ? "" : _ref$title,
725
772
  _ref$description = _ref.description,
726
773
  description = _ref$description === void 0 ? "" : _ref$description,
774
+ _ref$integration = _ref.integration,
775
+ integration = _ref$integration === void 0 ? "" : _ref$integration,
776
+ _ref$integrationName = _ref.integrationName,
777
+ integrationName = _ref$integrationName === void 0 ? "" : _ref$integrationName,
778
+ _ref$helpDocUrl = _ref.helpDocUrl,
779
+ helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
727
780
  _ref$buttonProps = _ref.buttonProps,
728
781
  buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps,
729
782
  _ref$onConnect = _ref.onConnect,
730
783
  onConnect = _ref$onConnect === void 0 ? noop : _ref$onConnect,
731
784
  children = _ref.children,
732
785
  secondaryButtonProps = _ref.secondaryButtonProps;
733
- return /*#__PURE__*/React__default.createElement("div", {
734
- className: "mx-auto w-full max-w-3xl"
735
- }, /*#__PURE__*/React__default.createElement("div", {
736
- className: "mb-6 flex flex-col gap-y-2"
737
- }, /*#__PURE__*/React__default.createElement(Icon, {
738
- size: 48
739
- }), /*#__PURE__*/React__default.createElement("div", {
740
- className: "flex flex-col gap-y-1"
741
- }, /*#__PURE__*/React__default.createElement(Typography, {
742
- style: "h2"
743
- }, title), /*#__PURE__*/React__default.createElement(Typography, {
744
- style: "body2"
745
- }, description))), children, /*#__PURE__*/React__default.createElement("div", {
746
- className: "flex w-full items-center gap-x-3"
747
- }, /*#__PURE__*/React__default.createElement(Button, _extends$1({
748
- label: t("neetoIntegrations.common.connect"),
749
- onClick: onConnect
750
- }, buttonProps)), secondaryButtonProps && /*#__PURE__*/React__default.createElement(Button, _extends$1({
751
- style: "secondary"
752
- }, secondaryButtonProps))));
786
+ return /*#__PURE__*/jsxs("div", {
787
+ className: "mx-auto w-full max-w-3xl",
788
+ children: [/*#__PURE__*/jsxs("div", {
789
+ className: "mb-6 flex flex-col gap-y-2",
790
+ children: [/*#__PURE__*/jsx(Icon, {
791
+ size: 48
792
+ }), /*#__PURE__*/jsxs("div", {
793
+ className: "flex flex-col gap-y-1",
794
+ children: [/*#__PURE__*/jsx(Typography, {
795
+ style: "h2",
796
+ children: title
797
+ }), /*#__PURE__*/jsx(Typography, {
798
+ style: "body2",
799
+ children: description
800
+ })]
801
+ })]
802
+ }), helpDocUrl && /*#__PURE__*/jsx("div", {
803
+ className: "mb-4",
804
+ children: /*#__PURE__*/jsx(Trans, {
805
+ i18nKey: "neetoIntegrations.common.helpDocUrl",
806
+ components: {
807
+ helpLink: /*#__PURE__*/jsx(Button, {
808
+ className: "text-xs",
809
+ href: helpDocUrl,
810
+ size: "small",
811
+ style: "link",
812
+ target: "_blank"
813
+ })
814
+ },
815
+ values: {
816
+ integration: integrationName || humanize(integration)
817
+ }
818
+ })
819
+ }), children, /*#__PURE__*/jsxs("div", {
820
+ className: "flex w-full items-center gap-x-3",
821
+ children: [/*#__PURE__*/jsx(Button, _objectSpread$2({
822
+ label: t("neetoIntegrations.common.connect"),
823
+ onClick: onConnect
824
+ }, buttonProps)), secondaryButtonProps && /*#__PURE__*/jsx(Button, _objectSpread$2({
825
+ style: "secondary"
826
+ }, secondaryButtonProps))]
827
+ })]
828
+ });
753
829
  });
754
830
  Connect.prototypes = {
755
831
  /**
@@ -823,6 +899,8 @@ const SvgSuccess = props => /*#__PURE__*/React.createElement("svg", _extends({
823
899
  height: 344
824
900
  }))));
825
901
 
902
+ 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; }
903
+ 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; }
826
904
  var Finish = withT(function (_ref) {
827
905
  var t = _ref.t,
828
906
  _ref$onClick = _ref.onClick,
@@ -834,20 +912,23 @@ var Finish = withT(function (_ref) {
834
912
  _ref$secondaryButtonP = _ref.secondaryButtonProps,
835
913
  secondaryButtonProps = _ref$secondaryButtonP === void 0 ? {} : _ref$secondaryButtonP,
836
914
  children = _ref.children;
837
- return /*#__PURE__*/React__default.createElement("div", {
838
- className: "mx-auto w-full max-w-3xl"
839
- }, /*#__PURE__*/React__default.createElement(SvgSuccess, null), /*#__PURE__*/React__default.createElement(Typography, {
840
- className: "mb-6 mt-4",
841
- style: "h2",
842
- weight: "semibold"
843
- }, title), children, /*#__PURE__*/React__default.createElement("div", {
844
- className: "flex w-full items-center gap-x-2"
845
- }, /*#__PURE__*/React__default.createElement(Button, _extends$1({
846
- onClick: onClick,
847
- label: t("neetoIntegrations.common.continue")
848
- }, buttonProps)), isNotEmpty(secondaryButtonProps) && /*#__PURE__*/React__default.createElement(Button, _extends$1({
849
- style: "secondary"
850
- }, secondaryButtonProps))));
915
+ return /*#__PURE__*/jsxs("div", {
916
+ className: "mx-auto w-full max-w-3xl",
917
+ children: [/*#__PURE__*/jsx(SvgSuccess, {}), /*#__PURE__*/jsx(Typography, {
918
+ className: "mb-6 mt-4",
919
+ style: "h2",
920
+ weight: "semibold",
921
+ children: title
922
+ }), children, /*#__PURE__*/jsxs("div", {
923
+ className: "flex w-full items-center gap-x-2",
924
+ children: [/*#__PURE__*/jsx(Button, _objectSpread$1({
925
+ onClick: onClick,
926
+ label: t("neetoIntegrations.common.continue")
927
+ }, buttonProps)), isNotEmpty(secondaryButtonProps) && /*#__PURE__*/jsx(Button, _objectSpread$1({
928
+ style: "secondary"
929
+ }, secondaryButtonProps))]
930
+ })]
931
+ });
851
932
  });
852
933
  Finish.prototypes = {
853
934
  /**
@@ -939,41 +1020,47 @@ var GoogleCalendar = function GoogleCalendar(_ref) {
939
1020
  return stepsClone;
940
1021
  });
941
1022
  }, [activeTab]);
942
- return /*#__PURE__*/React__default.createElement(Modal, {
1023
+ return /*#__PURE__*/jsxs(Modal, {
943
1024
  steps: steps,
944
1025
  isOpen: true,
945
- onClose: handleClose
946
- }, activeTab === STEPS.connect && /*#__PURE__*/React__default.createElement("div", {
947
- className: "mx-auto w-full max-w-3xl"
948
- }, /*#__PURE__*/React__default.createElement(GoogleCalendar$1, {
949
- size: 48
950
- }), /*#__PURE__*/React__default.createElement(Typography, {
951
- className: "mb-4 mt-2",
952
- style: "h2"
953
- }, t("neetoIntegrations.google.connect.title")), /*#__PURE__*/React__default.createElement("div", {
954
- className: "flex w-full flex-col items-start"
955
- }, /*#__PURE__*/React__default.createElement(Callout, {
956
- className: "block leading-5"
957
- }, /*#__PURE__*/React__default.createElement(Trans, {
958
- components: {
959
- bold: /*#__PURE__*/React__default.createElement("strong", null)
960
- },
961
- i18nKey: "neetoIntegrations.google.connect.reminderToAcceptPermissions",
962
- values: {
963
- selectCheckbox: t("neetoIntegrations.google.connect.selectCheckbox")
964
- }
965
- })), permissionImage && /*#__PURE__*/React__default.createElement("div", {
966
- className: "neeto-ui-border-gray-300 neeto-ui-rounded-md my-4 overflow-hidden border"
967
- }, /*#__PURE__*/React__default.createElement("img", {
968
- src: permissionImage
969
- }))), /*#__PURE__*/React__default.createElement(Button, {
970
- icon: Google,
971
- label: t("neetoIntegrations.google.connect.signIn"),
972
- onClick: fetchAuthorizationUrl
973
- })), activeTab === STEPS.finish && /*#__PURE__*/React__default.createElement(Finish, {
974
- title: t("neetoIntegrations.google.finish.title"),
975
- onClick: handleRedirect
976
- }));
1026
+ onClose: handleClose,
1027
+ children: [activeTab === STEPS.connect && /*#__PURE__*/jsxs("div", {
1028
+ className: "mx-auto w-full max-w-3xl",
1029
+ children: [/*#__PURE__*/jsx(GoogleCalendarIcon, {
1030
+ size: 48
1031
+ }), /*#__PURE__*/jsx(Typography, {
1032
+ className: "mb-4 mt-2",
1033
+ style: "h2",
1034
+ children: t("neetoIntegrations.google.connect.title")
1035
+ }), /*#__PURE__*/jsxs("div", {
1036
+ className: "flex w-full flex-col items-start",
1037
+ children: [/*#__PURE__*/jsx(Callout, {
1038
+ className: "block leading-5",
1039
+ children: /*#__PURE__*/jsx(Trans, {
1040
+ components: {
1041
+ bold: /*#__PURE__*/jsx("strong", {})
1042
+ },
1043
+ i18nKey: "neetoIntegrations.google.connect.reminderToAcceptPermissions",
1044
+ values: {
1045
+ selectCheckbox: t("neetoIntegrations.google.connect.selectCheckbox")
1046
+ }
1047
+ })
1048
+ }), permissionImage && /*#__PURE__*/jsx("div", {
1049
+ className: "neeto-ui-border-gray-300 neeto-ui-rounded-md my-4 overflow-hidden border",
1050
+ children: /*#__PURE__*/jsx("img", {
1051
+ src: permissionImage
1052
+ })
1053
+ })]
1054
+ }), /*#__PURE__*/jsx(Button, {
1055
+ icon: Google,
1056
+ label: t("neetoIntegrations.google.connect.signIn"),
1057
+ onClick: fetchAuthorizationUrl
1058
+ })]
1059
+ }), activeTab === STEPS.finish && /*#__PURE__*/jsx(Finish, {
1060
+ title: t("neetoIntegrations.google.finish.title"),
1061
+ onClick: handleRedirect
1062
+ })]
1063
+ });
977
1064
  };
978
1065
 
979
1066
  export { GoogleCalendar as default };