@bigbinary/neeto-integrations-frontend 2.10.2 → 2.10.3
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 +9 -5
- package/dist/Daily.cjs.js +135 -47
- package/dist/Daily.cjs.js.map +1 -1
- package/dist/Daily.js +138 -50
- package/dist/Daily.js.map +1 -1
- package/dist/GoogleCalender.cjs.js +138 -50
- package/dist/GoogleCalender.cjs.js.map +1 -1
- package/dist/GoogleCalender.js +144 -56
- package/dist/GoogleCalender.js.map +1 -1
- package/dist/Zoom.cjs.js +141 -42
- package/dist/Zoom.cjs.js.map +1 -1
- package/dist/Zoom.js +143 -44
- package/dist/Zoom.js.map +1 -1
- package/dist/index.cjs.js +161 -61
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +167 -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,115 @@ 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 ? neetoCist.noop : _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: "settings.integrations.common.helpDocUrl",
|
|
233
|
+
components: {
|
|
234
|
+
helpLink: /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
235
|
+
href: helpDocUrl,
|
|
236
|
+
style: "link"
|
|
237
|
+
})
|
|
238
|
+
},
|
|
239
|
+
values: {
|
|
240
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
241
|
+
}
|
|
242
|
+
}))), isConnected ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
243
|
+
className: "space-x-2"
|
|
244
|
+
}, managePath && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
245
|
+
to: managePath,
|
|
246
|
+
label: t("settings.integrations.common.manageIntegration", {
|
|
247
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
248
|
+
})
|
|
249
|
+
}), onDisconnect && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
250
|
+
style: "danger",
|
|
251
|
+
label: t("settings.integrations.common.disconnectIntegration", {
|
|
252
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
253
|
+
}),
|
|
254
|
+
onClick: function onClick() {
|
|
255
|
+
return setIsDisconnectAlertOpen(true);
|
|
256
|
+
}
|
|
257
|
+
})) : /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
258
|
+
disabled: isConnectDisabled,
|
|
259
|
+
href: connectUrl,
|
|
260
|
+
to: connectPath,
|
|
261
|
+
tooltipProps: connectTooltipProps,
|
|
262
|
+
label: t("settings.integrations.common.connectIntegration", {
|
|
263
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
264
|
+
})
|
|
265
|
+
}))), /*#__PURE__*/React__default["default"].createElement(DisconnectAlert__default["default"], {
|
|
266
|
+
isDisconnecting: isDisconnecting,
|
|
267
|
+
onClose: onClose,
|
|
268
|
+
onDisconnect: onDisconnect,
|
|
269
|
+
isOpen: isDisconnectAlertOpen,
|
|
270
|
+
title: t("settings.integrations.".concat(integration, ".disconnect.title")),
|
|
271
|
+
message: disconnectMessage !== null && disconnectMessage !== void 0 ? disconnectMessage : t("settings.integrations.".concat(integration, ".disconnect.message"))
|
|
272
|
+
}));
|
|
273
|
+
});
|
|
274
|
+
|
|
165
275
|
var INTEGRATIONS_ENGINE_BASE_URL = "/neeto_integrations";
|
|
166
276
|
var INTEGRATIONS_ENGINE_DAILY_URL = "".concat(INTEGRATIONS_ENGINE_BASE_URL, "/daily");
|
|
167
277
|
|
|
@@ -322,6 +432,7 @@ var Form = function Form(_ref) {
|
|
|
322
432
|
i18nKey: "neetoIntegrations.daily.helpDoc",
|
|
323
433
|
components: {
|
|
324
434
|
externalLink: /*#__PURE__*/React__default["default"].createElement(ExternalLink$1, {
|
|
435
|
+
"data-cy": "api-key-help-doc-link",
|
|
325
436
|
href: helpDocUrl,
|
|
326
437
|
rel: "noreferrer",
|
|
327
438
|
target: "_blank"
|
|
@@ -351,46 +462,9 @@ var Form = function Form(_ref) {
|
|
|
351
462
|
};
|
|
352
463
|
var Form$1 = reactUtils.withTitle(Form, i18next__default["default"].t("neetoIntegrations.browserTitles.integrations.dailyco"));
|
|
353
464
|
|
|
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
465
|
var Manage = function Manage(_ref) {
|
|
393
|
-
var
|
|
466
|
+
var description = _ref.description,
|
|
467
|
+
onDisconnect = _ref.onDisconnect;
|
|
394
468
|
var _useState = React.useState(false),
|
|
395
469
|
_useState2 = _slicedToArray(_useState, 2),
|
|
396
470
|
isDisconnectAlertOpen = _useState2[0],
|
|
@@ -400,7 +474,7 @@ var Manage = function Manage(_ref) {
|
|
|
400
474
|
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
401
475
|
_useFetchDaily$data2$ = _useFetchDaily$data2.metadata,
|
|
402
476
|
metadata = _useFetchDaily$data2$ === void 0 ? {} : _useFetchDaily$data2$,
|
|
403
|
-
|
|
477
|
+
isFetching = _useFetchDaily.isFetching;
|
|
404
478
|
var _ref2 = metadata || {},
|
|
405
479
|
_ref2$apiKey = _ref2.apiKey,
|
|
406
480
|
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
@@ -414,24 +488,33 @@ var Manage = function Manage(_ref) {
|
|
|
414
488
|
}),
|
|
415
489
|
destroyIntegration = _useDestroyDaily.mutate,
|
|
416
490
|
isDisconnecting = _useDestroyDaily.isLoading;
|
|
491
|
+
var isConnected = neetoCist.isPresent(apiKey);
|
|
417
492
|
var handleDisconnect = function handleDisconnect() {
|
|
418
493
|
return destroyIntegration("daily");
|
|
419
494
|
};
|
|
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
|
-
}
|
|
495
|
+
if (isFetching || isDisconnecting) return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
426
496
|
return /*#__PURE__*/React__default["default"].createElement(Manage$1, {
|
|
497
|
+
isConnected: isConnected,
|
|
427
498
|
isDisconnectAlertOpen: isDisconnectAlertOpen,
|
|
428
499
|
isDisconnecting: isDisconnecting,
|
|
429
500
|
setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
|
|
430
|
-
|
|
431
|
-
|
|
501
|
+
Icon: misc.Daily,
|
|
502
|
+
connectPath: utils.buildUrl(window.location.pathname, {
|
|
503
|
+
connect: true
|
|
432
504
|
}),
|
|
433
505
|
integration: "daily",
|
|
434
|
-
|
|
506
|
+
description: isConnected ? /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
507
|
+
components: {
|
|
508
|
+
underline: /*#__PURE__*/React__default["default"].createElement("u", {
|
|
509
|
+
className: "font-medium"
|
|
510
|
+
})
|
|
511
|
+
},
|
|
512
|
+
i18nKey: "neetoIntegrations.daily.yourApiKey",
|
|
513
|
+
values: {
|
|
514
|
+
apiKey: apiKey
|
|
515
|
+
}
|
|
516
|
+
}) : description,
|
|
517
|
+
title: isConnected ? t("neetoIntegrations.daily.connected") : t("neetoIntegrations.daily.connect"),
|
|
435
518
|
onClose: function onClose() {
|
|
436
519
|
return setIsDisconnectAlertOpen(false);
|
|
437
520
|
},
|
|
@@ -446,10 +529,14 @@ var Daily = function Daily(_ref) {
|
|
|
446
529
|
helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
|
|
447
530
|
_ref$videoUrl = _ref.videoUrl,
|
|
448
531
|
videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
|
|
532
|
+
_ref$description = _ref.description,
|
|
533
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
449
534
|
_ref$onConnect = _ref.onConnect,
|
|
450
535
|
onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect,
|
|
451
536
|
_ref$onDisconnect = _ref.onDisconnect,
|
|
452
537
|
onDisconnect = _ref$onDisconnect === void 0 ? neetoCist.noop : _ref$onDisconnect;
|
|
538
|
+
var _useQueryParams = reactUtils.useQueryParams(),
|
|
539
|
+
connect = _useQueryParams.connect;
|
|
453
540
|
var _useFetchDaily = useFetchDaily(),
|
|
454
541
|
_useFetchDaily$data = _useFetchDaily.data,
|
|
455
542
|
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
@@ -458,8 +545,9 @@ var Daily = function Daily(_ref) {
|
|
|
458
545
|
var _ref2 = metadata || {},
|
|
459
546
|
_ref2$apiKey = _ref2.apiKey,
|
|
460
547
|
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
461
|
-
if (neetoCist.isPresent(apiKey) && !isOnboarding) {
|
|
548
|
+
if (neetoCist.isPresent(apiKey) && !isOnboarding || !connect) {
|
|
462
549
|
return /*#__PURE__*/React__default["default"].createElement(Manage, {
|
|
550
|
+
description: description,
|
|
463
551
|
onDisconnect: onDisconnect
|
|
464
552
|
});
|
|
465
553
|
}
|