@bigbinary/neeto-integrations-frontend 2.10.2 → 2.10.4
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/app/javascript/src/translations/en.json +11 -5
- package/dist/Daily.cjs.js +137 -48
- package/dist/Daily.cjs.js.map +1 -1
- package/dist/Daily.js +140 -51
- package/dist/Daily.js.map +1 -1
- package/dist/GoogleCalender.cjs.js +139 -50
- package/dist/GoogleCalender.cjs.js.map +1 -1
- package/dist/GoogleCalender.js +145 -56
- package/dist/GoogleCalender.js.map +1 -1
- package/dist/Zoom.cjs.js +143 -43
- package/dist/Zoom.cjs.js.map +1 -1
- package/dist/Zoom.js +145 -45
- package/dist/Zoom.js.map +1 -1
- package/dist/index.cjs.js +162 -61
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +168 -68
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +3 -0
|
@@ -19,6 +19,7 @@ require('ramda');
|
|
|
19
19
|
var yup = require('yup');
|
|
20
20
|
var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
|
|
21
21
|
var classnames = require('classnames');
|
|
22
|
+
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
22
23
|
|
|
23
24
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
24
25
|
|
|
@@ -162,6 +163,116 @@ function _slicedToArray(arr, i) {
|
|
|
162
163
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
163
164
|
}
|
|
164
165
|
|
|
166
|
+
var Manage$1 = reactUtils.withT(function (_ref) {
|
|
167
|
+
var t = _ref.t,
|
|
168
|
+
_ref$title = _ref.title,
|
|
169
|
+
title = _ref$title === void 0 ? "" : _ref$title,
|
|
170
|
+
_ref$description = _ref.description,
|
|
171
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
172
|
+
_ref$integration = _ref.integration,
|
|
173
|
+
integration = _ref$integration === void 0 ? "" : _ref$integration,
|
|
174
|
+
_ref$isDisconnectAler = _ref.isDisconnectAlertOpen,
|
|
175
|
+
isDisconnectAlertOpen = _ref$isDisconnectAler === void 0 ? false : _ref$isDisconnectAler,
|
|
176
|
+
_ref$setIsDisconnectA = _ref.setIsDisconnectAlertOpen,
|
|
177
|
+
setIsDisconnectAlertOpen = _ref$setIsDisconnectA === void 0 ? neetoCist.noop : _ref$setIsDisconnectA,
|
|
178
|
+
_ref$isDisconnecting = _ref.isDisconnecting,
|
|
179
|
+
isDisconnecting = _ref$isDisconnecting === void 0 ? false : _ref$isDisconnecting,
|
|
180
|
+
_ref$onDisconnect = _ref.onDisconnect,
|
|
181
|
+
onDisconnect = _ref$onDisconnect === void 0 ? undefined : _ref$onDisconnect,
|
|
182
|
+
_ref$onClose = _ref.onClose,
|
|
183
|
+
onClose = _ref$onClose === void 0 ? neetoCist.noop : _ref$onClose,
|
|
184
|
+
_ref$Icon = _ref.Icon,
|
|
185
|
+
Icon = _ref$Icon === void 0 ? null : _ref$Icon,
|
|
186
|
+
_ref$isConnected = _ref.isConnected,
|
|
187
|
+
isConnected = _ref$isConnected === void 0 ? false : _ref$isConnected,
|
|
188
|
+
_ref$connectPath = _ref.connectPath,
|
|
189
|
+
connectPath = _ref$connectPath === void 0 ? "" : _ref$connectPath,
|
|
190
|
+
_ref$connectUrl = _ref.connectUrl,
|
|
191
|
+
connectUrl = _ref$connectUrl === void 0 ? "" : _ref$connectUrl,
|
|
192
|
+
_ref$helpDocUrl = _ref.helpDocUrl,
|
|
193
|
+
helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
|
|
194
|
+
_ref$managePath = _ref.managePath,
|
|
195
|
+
managePath = _ref$managePath === void 0 ? "" : _ref$managePath,
|
|
196
|
+
_ref$integrationName = _ref.integrationName,
|
|
197
|
+
integrationName = _ref$integrationName === void 0 ? "" : _ref$integrationName,
|
|
198
|
+
_ref$disconnectMessag = _ref.disconnectMessage,
|
|
199
|
+
disconnectMessage = _ref$disconnectMessag === void 0 ? "" : _ref$disconnectMessag,
|
|
200
|
+
_ref$isConnectDisable = _ref.isConnectDisabled,
|
|
201
|
+
isConnectDisabled = _ref$isConnectDisable === void 0 ? false : _ref$isConnectDisable,
|
|
202
|
+
_ref$connectTooltipPr = _ref.connectTooltipProps,
|
|
203
|
+
connectTooltipProps = _ref$connectTooltipPr === void 0 ? null : _ref$connectTooltipPr;
|
|
204
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
205
|
+
className: "mx-auto w-full max-w-3xl"
|
|
206
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
207
|
+
className: "neeto-ui-border-gray-300 neeto-ui-rounded-xl mt-10 w-full space-y-4 border p-6"
|
|
208
|
+
}, Icon && /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
209
|
+
className: "neeto-ui-text-gray-600",
|
|
210
|
+
size: 60
|
|
211
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
212
|
+
className: "space-y-2"
|
|
213
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
214
|
+
className: "flex items-center space-x-4"
|
|
215
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
216
|
+
className: "neeto-ui-text-gray-800 mb-0.5",
|
|
217
|
+
style: "h2",
|
|
218
|
+
weight: "semibold"
|
|
219
|
+
}, title), isConnected && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
220
|
+
className: "neeto-ui-bg-success-500 neeto-ui-text-white neeto-ui-rounded-full flex items-center justify-center p-1"
|
|
221
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoIcons.Check, {
|
|
222
|
+
size: 24
|
|
223
|
+
}))), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
224
|
+
className: "neeto-ui-text-gray-800 break-all",
|
|
225
|
+
style: "body1",
|
|
226
|
+
weight: "normal"
|
|
227
|
+
}, description), helpDocUrl && /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
228
|
+
className: "neeto-ui-text-gray-800 break-all",
|
|
229
|
+
style: "body2",
|
|
230
|
+
weight: "normal"
|
|
231
|
+
}, /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
232
|
+
i18nKey: "neetoIntegrations.common.helpDocUrl",
|
|
233
|
+
components: {
|
|
234
|
+
helpLink: /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
235
|
+
href: helpDocUrl,
|
|
236
|
+
style: "link",
|
|
237
|
+
target: "_blank"
|
|
238
|
+
})
|
|
239
|
+
},
|
|
240
|
+
values: {
|
|
241
|
+
integration: integrationName || neetoCist.humanize(integration)
|
|
242
|
+
}
|
|
243
|
+
}))), isConnected ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
244
|
+
className: "space-x-2"
|
|
245
|
+
}, managePath && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
246
|
+
to: managePath,
|
|
247
|
+
label: t("neetoIntegrations.common.manageIntegration", {
|
|
248
|
+
integration: integrationName || neetoCist.humanize(integration)
|
|
249
|
+
})
|
|
250
|
+
}), onDisconnect && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
251
|
+
style: "secondary",
|
|
252
|
+
label: t("neetoIntegrations.common.disconnectIntegration", {
|
|
253
|
+
integration: integrationName || neetoCist.humanize(integration)
|
|
254
|
+
}),
|
|
255
|
+
onClick: function onClick() {
|
|
256
|
+
return setIsDisconnectAlertOpen(true);
|
|
257
|
+
}
|
|
258
|
+
})) : /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
259
|
+
disabled: isConnectDisabled,
|
|
260
|
+
href: connectUrl,
|
|
261
|
+
to: connectPath,
|
|
262
|
+
tooltipProps: connectTooltipProps,
|
|
263
|
+
label: t("neetoIntegrations.common.connectIntegration", {
|
|
264
|
+
integration: integrationName || neetoCist.humanize(integration)
|
|
265
|
+
})
|
|
266
|
+
}))), /*#__PURE__*/React__default["default"].createElement(DisconnectAlert__default["default"], {
|
|
267
|
+
isDisconnecting: isDisconnecting,
|
|
268
|
+
onClose: onClose,
|
|
269
|
+
onDisconnect: onDisconnect,
|
|
270
|
+
isOpen: isDisconnectAlertOpen,
|
|
271
|
+
title: t("settings.integrations.".concat(integration, ".disconnect.title")),
|
|
272
|
+
message: disconnectMessage || t("settings.integrations.".concat(integration, ".disconnect.message"))
|
|
273
|
+
}));
|
|
274
|
+
});
|
|
275
|
+
|
|
165
276
|
var INTEGRATIONS_ENGINE_BASE_URL = "/neeto_integrations";
|
|
166
277
|
var INTEGRATIONS_ENGINE_DAILY_URL = "".concat(INTEGRATIONS_ENGINE_BASE_URL, "/daily");
|
|
167
278
|
|
|
@@ -322,6 +433,7 @@ var Form = function Form(_ref) {
|
|
|
322
433
|
i18nKey: "neetoIntegrations.daily.helpDoc",
|
|
323
434
|
components: {
|
|
324
435
|
externalLink: /*#__PURE__*/React__default["default"].createElement(ExternalLink$1, {
|
|
436
|
+
"data-cy": "api-key-help-doc-link",
|
|
325
437
|
href: helpDocUrl,
|
|
326
438
|
rel: "noreferrer",
|
|
327
439
|
target: "_blank"
|
|
@@ -351,46 +463,9 @@ var Form = function Form(_ref) {
|
|
|
351
463
|
};
|
|
352
464
|
var Form$1 = reactUtils.withTitle(Form, i18next__default["default"].t("neetoIntegrations.browserTitles.integrations.dailyco"));
|
|
353
465
|
|
|
354
|
-
var Manage$1 = reactUtils.withT(function (_ref) {
|
|
355
|
-
var t = _ref.t,
|
|
356
|
-
title = _ref.title,
|
|
357
|
-
description = _ref.description,
|
|
358
|
-
integration = _ref.integration,
|
|
359
|
-
isDisconnectAlertOpen = _ref.isDisconnectAlertOpen,
|
|
360
|
-
setIsDisconnectAlertOpen = _ref.setIsDisconnectAlertOpen,
|
|
361
|
-
isDisconnecting = _ref.isDisconnecting,
|
|
362
|
-
onDisconnect = _ref.onDisconnect,
|
|
363
|
-
onClose = _ref.onClose;
|
|
364
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
365
|
-
className: "mx-auto w-full max-w-md"
|
|
366
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
367
|
-
className: "mt-10 w-full space-y-4"
|
|
368
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
369
|
-
className: "neeto-ui-text-gray-800 mb-0.5",
|
|
370
|
-
style: "h3",
|
|
371
|
-
weight: "semibold"
|
|
372
|
-
}, title), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
373
|
-
className: "neeto-ui-text-gray-600 break-all",
|
|
374
|
-
style: "body1",
|
|
375
|
-
weight: "normal"
|
|
376
|
-
}, description), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
377
|
-
label: t("neetoIntegrations.common.disconnect"),
|
|
378
|
-
style: "danger",
|
|
379
|
-
onClick: function onClick() {
|
|
380
|
-
return setIsDisconnectAlertOpen(true);
|
|
381
|
-
}
|
|
382
|
-
}))), /*#__PURE__*/React__default["default"].createElement(DisconnectAlert__default["default"], {
|
|
383
|
-
isDisconnecting: isDisconnecting,
|
|
384
|
-
onClose: onClose,
|
|
385
|
-
onDisconnect: onDisconnect,
|
|
386
|
-
isOpen: isDisconnectAlertOpen,
|
|
387
|
-
message: t("neetoIntegrations.".concat(integration, ".disconnect.message")),
|
|
388
|
-
title: t("neetoIntegrations.".concat(integration, ".disconnect.title"))
|
|
389
|
-
}));
|
|
390
|
-
});
|
|
391
|
-
|
|
392
466
|
var Manage = function Manage(_ref) {
|
|
393
|
-
var
|
|
467
|
+
var description = _ref.description,
|
|
468
|
+
onDisconnect = _ref.onDisconnect;
|
|
394
469
|
var _useState = React.useState(false),
|
|
395
470
|
_useState2 = _slicedToArray(_useState, 2),
|
|
396
471
|
isDisconnectAlertOpen = _useState2[0],
|
|
@@ -400,7 +475,7 @@ var Manage = function Manage(_ref) {
|
|
|
400
475
|
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
401
476
|
_useFetchDaily$data2$ = _useFetchDaily$data2.metadata,
|
|
402
477
|
metadata = _useFetchDaily$data2$ === void 0 ? {} : _useFetchDaily$data2$,
|
|
403
|
-
|
|
478
|
+
isFetching = _useFetchDaily.isFetching;
|
|
404
479
|
var _ref2 = metadata || {},
|
|
405
480
|
_ref2$apiKey = _ref2.apiKey,
|
|
406
481
|
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
@@ -414,24 +489,33 @@ var Manage = function Manage(_ref) {
|
|
|
414
489
|
}),
|
|
415
490
|
destroyIntegration = _useDestroyDaily.mutate,
|
|
416
491
|
isDisconnecting = _useDestroyDaily.isLoading;
|
|
492
|
+
var isConnected = neetoCist.isPresent(apiKey);
|
|
417
493
|
var handleDisconnect = function handleDisconnect() {
|
|
418
494
|
return destroyIntegration("daily");
|
|
419
495
|
};
|
|
420
|
-
if (
|
|
421
|
-
return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
422
|
-
}
|
|
423
|
-
if (neetoCist.isNotPresent(apiKey)) {
|
|
424
|
-
onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
|
|
425
|
-
}
|
|
496
|
+
if (isFetching || isDisconnecting) return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
426
497
|
return /*#__PURE__*/React__default["default"].createElement(Manage$1, {
|
|
498
|
+
isConnected: isConnected,
|
|
427
499
|
isDisconnectAlertOpen: isDisconnectAlertOpen,
|
|
428
500
|
isDisconnecting: isDisconnecting,
|
|
429
501
|
setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
|
|
430
|
-
|
|
431
|
-
|
|
502
|
+
Icon: misc.Daily,
|
|
503
|
+
connectPath: utils.buildUrl(window.location.pathname, {
|
|
504
|
+
connect: true
|
|
432
505
|
}),
|
|
433
506
|
integration: "daily",
|
|
434
|
-
|
|
507
|
+
description: isConnected ? /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
508
|
+
components: {
|
|
509
|
+
underline: /*#__PURE__*/React__default["default"].createElement("u", {
|
|
510
|
+
className: "font-medium"
|
|
511
|
+
})
|
|
512
|
+
},
|
|
513
|
+
i18nKey: "neetoIntegrations.daily.yourApiKey",
|
|
514
|
+
values: {
|
|
515
|
+
apiKey: apiKey
|
|
516
|
+
}
|
|
517
|
+
}) : description,
|
|
518
|
+
title: isConnected ? t("neetoIntegrations.daily.connected") : t("neetoIntegrations.daily.connect"),
|
|
435
519
|
onClose: function onClose() {
|
|
436
520
|
return setIsDisconnectAlertOpen(false);
|
|
437
521
|
},
|
|
@@ -446,10 +530,14 @@ var Daily = function Daily(_ref) {
|
|
|
446
530
|
helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
|
|
447
531
|
_ref$videoUrl = _ref.videoUrl,
|
|
448
532
|
videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
|
|
533
|
+
_ref$description = _ref.description,
|
|
534
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
449
535
|
_ref$onConnect = _ref.onConnect,
|
|
450
536
|
onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect,
|
|
451
537
|
_ref$onDisconnect = _ref.onDisconnect,
|
|
452
538
|
onDisconnect = _ref$onDisconnect === void 0 ? neetoCist.noop : _ref$onDisconnect;
|
|
539
|
+
var _useQueryParams = reactUtils.useQueryParams(),
|
|
540
|
+
connect = _useQueryParams.connect;
|
|
453
541
|
var _useFetchDaily = useFetchDaily(),
|
|
454
542
|
_useFetchDaily$data = _useFetchDaily.data,
|
|
455
543
|
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
@@ -458,8 +546,9 @@ var Daily = function Daily(_ref) {
|
|
|
458
546
|
var _ref2 = metadata || {},
|
|
459
547
|
_ref2$apiKey = _ref2.apiKey,
|
|
460
548
|
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
461
|
-
if (neetoCist.isPresent(apiKey) && !isOnboarding) {
|
|
549
|
+
if (neetoCist.isPresent(apiKey) && !isOnboarding || !connect) {
|
|
462
550
|
return /*#__PURE__*/React__default["default"].createElement(Manage, {
|
|
551
|
+
description: description,
|
|
463
552
|
onDisconnect: onDisconnect
|
|
464
553
|
});
|
|
465
554
|
}
|