@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
package/dist/index.cjs.js
CHANGED
|
@@ -21,6 +21,7 @@ var ramda = require('ramda');
|
|
|
21
21
|
var yup = require('yup');
|
|
22
22
|
var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
|
|
23
23
|
var classnames = require('classnames');
|
|
24
|
+
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
24
25
|
|
|
25
26
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
26
27
|
|
|
@@ -53,6 +54,116 @@ var yup__namespace = /*#__PURE__*/_interopNamespace(yup);
|
|
|
53
54
|
var PageLoader__default = /*#__PURE__*/_interopDefaultLegacy(PageLoader);
|
|
54
55
|
var classnames__default = /*#__PURE__*/_interopDefaultLegacy(classnames);
|
|
55
56
|
|
|
57
|
+
var Manage$1 = reactUtils.withT(function (_ref) {
|
|
58
|
+
var t = _ref.t,
|
|
59
|
+
_ref$title = _ref.title,
|
|
60
|
+
title = _ref$title === void 0 ? "" : _ref$title,
|
|
61
|
+
_ref$description = _ref.description,
|
|
62
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
63
|
+
_ref$integration = _ref.integration,
|
|
64
|
+
integration = _ref$integration === void 0 ? "" : _ref$integration,
|
|
65
|
+
_ref$isDisconnectAler = _ref.isDisconnectAlertOpen,
|
|
66
|
+
isDisconnectAlertOpen = _ref$isDisconnectAler === void 0 ? false : _ref$isDisconnectAler,
|
|
67
|
+
_ref$setIsDisconnectA = _ref.setIsDisconnectAlertOpen,
|
|
68
|
+
setIsDisconnectAlertOpen = _ref$setIsDisconnectA === void 0 ? neetoCist.noop : _ref$setIsDisconnectA,
|
|
69
|
+
_ref$isDisconnecting = _ref.isDisconnecting,
|
|
70
|
+
isDisconnecting = _ref$isDisconnecting === void 0 ? false : _ref$isDisconnecting,
|
|
71
|
+
_ref$onDisconnect = _ref.onDisconnect,
|
|
72
|
+
onDisconnect = _ref$onDisconnect === void 0 ? undefined : _ref$onDisconnect,
|
|
73
|
+
_ref$onClose = _ref.onClose,
|
|
74
|
+
onClose = _ref$onClose === void 0 ? neetoCist.noop : _ref$onClose,
|
|
75
|
+
_ref$Icon = _ref.Icon,
|
|
76
|
+
Icon = _ref$Icon === void 0 ? null : _ref$Icon,
|
|
77
|
+
_ref$isConnected = _ref.isConnected,
|
|
78
|
+
isConnected = _ref$isConnected === void 0 ? false : _ref$isConnected,
|
|
79
|
+
_ref$connectPath = _ref.connectPath,
|
|
80
|
+
connectPath = _ref$connectPath === void 0 ? "" : _ref$connectPath,
|
|
81
|
+
_ref$connectUrl = _ref.connectUrl,
|
|
82
|
+
connectUrl = _ref$connectUrl === void 0 ? "" : _ref$connectUrl,
|
|
83
|
+
_ref$helpDocUrl = _ref.helpDocUrl,
|
|
84
|
+
helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
|
|
85
|
+
_ref$managePath = _ref.managePath,
|
|
86
|
+
managePath = _ref$managePath === void 0 ? "" : _ref$managePath,
|
|
87
|
+
_ref$integrationName = _ref.integrationName,
|
|
88
|
+
integrationName = _ref$integrationName === void 0 ? "" : _ref$integrationName,
|
|
89
|
+
_ref$disconnectMessag = _ref.disconnectMessage,
|
|
90
|
+
disconnectMessage = _ref$disconnectMessag === void 0 ? "" : _ref$disconnectMessag,
|
|
91
|
+
_ref$isConnectDisable = _ref.isConnectDisabled,
|
|
92
|
+
isConnectDisabled = _ref$isConnectDisable === void 0 ? false : _ref$isConnectDisable,
|
|
93
|
+
_ref$connectTooltipPr = _ref.connectTooltipProps,
|
|
94
|
+
connectTooltipProps = _ref$connectTooltipPr === void 0 ? null : _ref$connectTooltipPr;
|
|
95
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
96
|
+
className: "mx-auto w-full max-w-3xl"
|
|
97
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
98
|
+
className: "neeto-ui-border-gray-300 neeto-ui-rounded-xl mt-10 w-full space-y-4 border p-6"
|
|
99
|
+
}, Icon && /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
100
|
+
className: "neeto-ui-text-gray-600",
|
|
101
|
+
size: 60
|
|
102
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
103
|
+
className: "space-y-2"
|
|
104
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
105
|
+
className: "flex items-center space-x-4"
|
|
106
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
107
|
+
className: "neeto-ui-text-gray-800 mb-0.5",
|
|
108
|
+
style: "h2",
|
|
109
|
+
weight: "semibold"
|
|
110
|
+
}, title), isConnected && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
111
|
+
className: "neeto-ui-bg-success-500 neeto-ui-text-white neeto-ui-rounded-full flex items-center justify-center p-1"
|
|
112
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoIcons.Check, {
|
|
113
|
+
size: 24
|
|
114
|
+
}))), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
115
|
+
className: "neeto-ui-text-gray-800 break-all",
|
|
116
|
+
style: "body1",
|
|
117
|
+
weight: "normal"
|
|
118
|
+
}, description), helpDocUrl && /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
119
|
+
className: "neeto-ui-text-gray-800 break-all",
|
|
120
|
+
style: "body2",
|
|
121
|
+
weight: "normal"
|
|
122
|
+
}, /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
123
|
+
i18nKey: "neetoIntegrations.common.helpDocUrl",
|
|
124
|
+
components: {
|
|
125
|
+
helpLink: /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
126
|
+
href: helpDocUrl,
|
|
127
|
+
style: "link",
|
|
128
|
+
target: "_blank"
|
|
129
|
+
})
|
|
130
|
+
},
|
|
131
|
+
values: {
|
|
132
|
+
integration: integrationName || neetoCist.humanize(integration)
|
|
133
|
+
}
|
|
134
|
+
}))), isConnected ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
135
|
+
className: "space-x-2"
|
|
136
|
+
}, managePath && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
137
|
+
to: managePath,
|
|
138
|
+
label: t("neetoIntegrations.common.manageIntegration", {
|
|
139
|
+
integration: integrationName || neetoCist.humanize(integration)
|
|
140
|
+
})
|
|
141
|
+
}), onDisconnect && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
142
|
+
style: "secondary",
|
|
143
|
+
label: t("neetoIntegrations.common.disconnectIntegration", {
|
|
144
|
+
integration: integrationName || neetoCist.humanize(integration)
|
|
145
|
+
}),
|
|
146
|
+
onClick: function onClick() {
|
|
147
|
+
return setIsDisconnectAlertOpen(true);
|
|
148
|
+
}
|
|
149
|
+
})) : /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
150
|
+
disabled: isConnectDisabled,
|
|
151
|
+
href: connectUrl,
|
|
152
|
+
to: connectPath,
|
|
153
|
+
tooltipProps: connectTooltipProps,
|
|
154
|
+
label: t("neetoIntegrations.common.connectIntegration", {
|
|
155
|
+
integration: integrationName || neetoCist.humanize(integration)
|
|
156
|
+
})
|
|
157
|
+
}))), /*#__PURE__*/React__default["default"].createElement(DisconnectAlert__default["default"], {
|
|
158
|
+
isDisconnecting: isDisconnecting,
|
|
159
|
+
onClose: onClose,
|
|
160
|
+
onDisconnect: onDisconnect,
|
|
161
|
+
isOpen: isDisconnectAlertOpen,
|
|
162
|
+
title: t("settings.integrations.".concat(integration, ".disconnect.title")),
|
|
163
|
+
message: disconnectMessage || t("settings.integrations.".concat(integration, ".disconnect.message"))
|
|
164
|
+
}));
|
|
165
|
+
});
|
|
166
|
+
|
|
56
167
|
function _typeof(obj) {
|
|
57
168
|
"@babel/helpers - typeof";
|
|
58
169
|
|
|
@@ -312,6 +423,7 @@ var Form = function Form(_ref) {
|
|
|
312
423
|
i18nKey: "neetoIntegrations.daily.helpDoc",
|
|
313
424
|
components: {
|
|
314
425
|
externalLink: /*#__PURE__*/React__default["default"].createElement(ExternalLink$1, {
|
|
426
|
+
"data-cy": "api-key-help-doc-link",
|
|
315
427
|
href: helpDocUrl,
|
|
316
428
|
rel: "noreferrer",
|
|
317
429
|
target: "_blank"
|
|
@@ -341,46 +453,9 @@ var Form = function Form(_ref) {
|
|
|
341
453
|
};
|
|
342
454
|
var Form$1 = reactUtils.withTitle(Form, i18next__default["default"].t("neetoIntegrations.browserTitles.integrations.dailyco"));
|
|
343
455
|
|
|
344
|
-
var Manage$1 = reactUtils.withT(function (_ref) {
|
|
345
|
-
var t = _ref.t,
|
|
346
|
-
title = _ref.title,
|
|
347
|
-
description = _ref.description,
|
|
348
|
-
integration = _ref.integration,
|
|
349
|
-
isDisconnectAlertOpen = _ref.isDisconnectAlertOpen,
|
|
350
|
-
setIsDisconnectAlertOpen = _ref.setIsDisconnectAlertOpen,
|
|
351
|
-
isDisconnecting = _ref.isDisconnecting,
|
|
352
|
-
onDisconnect = _ref.onDisconnect,
|
|
353
|
-
onClose = _ref.onClose;
|
|
354
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
355
|
-
className: "mx-auto w-full max-w-md"
|
|
356
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
357
|
-
className: "mt-10 w-full space-y-4"
|
|
358
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
359
|
-
className: "neeto-ui-text-gray-800 mb-0.5",
|
|
360
|
-
style: "h3",
|
|
361
|
-
weight: "semibold"
|
|
362
|
-
}, title), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
363
|
-
className: "neeto-ui-text-gray-600 break-all",
|
|
364
|
-
style: "body1",
|
|
365
|
-
weight: "normal"
|
|
366
|
-
}, description), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
367
|
-
label: t("neetoIntegrations.common.disconnect"),
|
|
368
|
-
style: "danger",
|
|
369
|
-
onClick: function onClick() {
|
|
370
|
-
return setIsDisconnectAlertOpen(true);
|
|
371
|
-
}
|
|
372
|
-
}))), /*#__PURE__*/React__default["default"].createElement(DisconnectAlert__default["default"], {
|
|
373
|
-
isDisconnecting: isDisconnecting,
|
|
374
|
-
onClose: onClose,
|
|
375
|
-
onDisconnect: onDisconnect,
|
|
376
|
-
isOpen: isDisconnectAlertOpen,
|
|
377
|
-
message: t("neetoIntegrations.".concat(integration, ".disconnect.message")),
|
|
378
|
-
title: t("neetoIntegrations.".concat(integration, ".disconnect.title"))
|
|
379
|
-
}));
|
|
380
|
-
});
|
|
381
|
-
|
|
382
456
|
var Manage = function Manage(_ref) {
|
|
383
|
-
var
|
|
457
|
+
var description = _ref.description,
|
|
458
|
+
onDisconnect = _ref.onDisconnect;
|
|
384
459
|
var _useState = React.useState(false),
|
|
385
460
|
_useState2 = _slicedToArray(_useState, 2),
|
|
386
461
|
isDisconnectAlertOpen = _useState2[0],
|
|
@@ -390,7 +465,7 @@ var Manage = function Manage(_ref) {
|
|
|
390
465
|
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
391
466
|
_useFetchDaily$data2$ = _useFetchDaily$data2.metadata,
|
|
392
467
|
metadata = _useFetchDaily$data2$ === void 0 ? {} : _useFetchDaily$data2$,
|
|
393
|
-
|
|
468
|
+
isFetching = _useFetchDaily.isFetching;
|
|
394
469
|
var _ref2 = metadata || {},
|
|
395
470
|
_ref2$apiKey = _ref2.apiKey,
|
|
396
471
|
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
@@ -404,24 +479,33 @@ var Manage = function Manage(_ref) {
|
|
|
404
479
|
}),
|
|
405
480
|
destroyIntegration = _useDestroyDaily.mutate,
|
|
406
481
|
isDisconnecting = _useDestroyDaily.isLoading;
|
|
482
|
+
var isConnected = neetoCist.isPresent(apiKey);
|
|
407
483
|
var handleDisconnect = function handleDisconnect() {
|
|
408
484
|
return destroyIntegration("daily");
|
|
409
485
|
};
|
|
410
|
-
if (
|
|
411
|
-
return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
412
|
-
}
|
|
413
|
-
if (neetoCist.isNotPresent(apiKey)) {
|
|
414
|
-
onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
|
|
415
|
-
}
|
|
486
|
+
if (isFetching || isDisconnecting) return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
416
487
|
return /*#__PURE__*/React__default["default"].createElement(Manage$1, {
|
|
488
|
+
isConnected: isConnected,
|
|
417
489
|
isDisconnectAlertOpen: isDisconnectAlertOpen,
|
|
418
490
|
isDisconnecting: isDisconnecting,
|
|
419
491
|
setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
|
|
420
|
-
|
|
421
|
-
|
|
492
|
+
Icon: misc.Daily,
|
|
493
|
+
connectPath: utils.buildUrl(window.location.pathname, {
|
|
494
|
+
connect: true
|
|
422
495
|
}),
|
|
423
496
|
integration: "daily",
|
|
424
|
-
|
|
497
|
+
description: isConnected ? /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
498
|
+
components: {
|
|
499
|
+
underline: /*#__PURE__*/React__default["default"].createElement("u", {
|
|
500
|
+
className: "font-medium"
|
|
501
|
+
})
|
|
502
|
+
},
|
|
503
|
+
i18nKey: "neetoIntegrations.daily.yourApiKey",
|
|
504
|
+
values: {
|
|
505
|
+
apiKey: apiKey
|
|
506
|
+
}
|
|
507
|
+
}) : description,
|
|
508
|
+
title: isConnected ? t("neetoIntegrations.daily.connected") : t("neetoIntegrations.daily.connect"),
|
|
425
509
|
onClose: function onClose() {
|
|
426
510
|
return setIsDisconnectAlertOpen(false);
|
|
427
511
|
},
|
|
@@ -436,10 +520,14 @@ var Daily = function Daily(_ref) {
|
|
|
436
520
|
helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
|
|
437
521
|
_ref$videoUrl = _ref.videoUrl,
|
|
438
522
|
videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
|
|
523
|
+
_ref$description = _ref.description,
|
|
524
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
439
525
|
_ref$onConnect = _ref.onConnect,
|
|
440
526
|
onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect,
|
|
441
527
|
_ref$onDisconnect = _ref.onDisconnect,
|
|
442
528
|
onDisconnect = _ref$onDisconnect === void 0 ? neetoCist.noop : _ref$onDisconnect;
|
|
529
|
+
var _useQueryParams = reactUtils.useQueryParams(),
|
|
530
|
+
connect = _useQueryParams.connect;
|
|
443
531
|
var _useFetchDaily = useFetchDaily(),
|
|
444
532
|
_useFetchDaily$data = _useFetchDaily.data,
|
|
445
533
|
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
@@ -448,8 +536,9 @@ var Daily = function Daily(_ref) {
|
|
|
448
536
|
var _ref2 = metadata || {},
|
|
449
537
|
_ref2$apiKey = _ref2.apiKey,
|
|
450
538
|
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
451
|
-
if (neetoCist.isPresent(apiKey) && !isOnboarding) {
|
|
539
|
+
if (neetoCist.isPresent(apiKey) && !isOnboarding || !connect) {
|
|
452
540
|
return /*#__PURE__*/React__default["default"].createElement(Manage, {
|
|
541
|
+
description: description,
|
|
453
542
|
onDisconnect: onDisconnect
|
|
454
543
|
});
|
|
455
544
|
}
|
|
@@ -853,7 +942,11 @@ var useDestroyZoom = function useDestroyZoom(_ref) {
|
|
|
853
942
|
};
|
|
854
943
|
|
|
855
944
|
var Zoom = function Zoom(_ref) {
|
|
856
|
-
var _ref$
|
|
945
|
+
var _ref$connectUrl = _ref.connectUrl,
|
|
946
|
+
connectUrl = _ref$connectUrl === void 0 ? "" : _ref$connectUrl,
|
|
947
|
+
_ref$description = _ref.description,
|
|
948
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
949
|
+
_ref$onDisconnect = _ref.onDisconnect,
|
|
857
950
|
onDisconnect = _ref$onDisconnect === void 0 ? neetoCist.noop : _ref$onDisconnect;
|
|
858
951
|
var _useTranslation = reactI18next.useTranslation(),
|
|
859
952
|
t = _useTranslation.t;
|
|
@@ -877,24 +970,31 @@ var Zoom = function Zoom(_ref) {
|
|
|
877
970
|
}),
|
|
878
971
|
destroyIntegration = _useDestroyZoom.mutate,
|
|
879
972
|
isDisconnecting = _useDestroyZoom.isLoading;
|
|
973
|
+
var isConnected = neetoCist.isPresent(email);
|
|
880
974
|
var handleDisconnect = function handleDisconnect() {
|
|
881
975
|
return destroyIntegration("zoom");
|
|
882
976
|
};
|
|
883
|
-
if (isLoading)
|
|
884
|
-
return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
885
|
-
}
|
|
886
|
-
if (neetoCist.isNotPresent(email)) {
|
|
887
|
-
onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
|
|
888
|
-
}
|
|
977
|
+
if (isLoading) return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
889
978
|
return /*#__PURE__*/React__default["default"].createElement(Manage$1, {
|
|
979
|
+
connectUrl: connectUrl,
|
|
980
|
+
isConnected: isConnected,
|
|
890
981
|
isDisconnectAlertOpen: isDisconnectAlertOpen,
|
|
891
982
|
isDisconnecting: isDisconnecting,
|
|
892
983
|
setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
|
|
893
|
-
|
|
894
|
-
email: email
|
|
895
|
-
}),
|
|
984
|
+
Icon: misc.Zoom,
|
|
896
985
|
integration: "zoom",
|
|
897
|
-
|
|
986
|
+
description: isConnected ? /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
987
|
+
components: {
|
|
988
|
+
underline: /*#__PURE__*/React__default["default"].createElement("u", {
|
|
989
|
+
className: "font-medium"
|
|
990
|
+
})
|
|
991
|
+
},
|
|
992
|
+
i18nKey: "neetoIntegrations.zoom.account",
|
|
993
|
+
values: {
|
|
994
|
+
email: email
|
|
995
|
+
}
|
|
996
|
+
}) : description,
|
|
997
|
+
title: isConnected ? t("neetoIntegrations.zoom.connected") : t("neetoIntegrations.zoom.connect"),
|
|
898
998
|
onClose: function onClose() {
|
|
899
999
|
return setIsDisconnectAlertOpen(false);
|
|
900
1000
|
},
|
|
@@ -1301,6 +1401,7 @@ exports.Daily = index;
|
|
|
1301
1401
|
exports.Demo = Demo;
|
|
1302
1402
|
exports.Finish = Finish;
|
|
1303
1403
|
exports.GoogleCalendar = GoogleCalendar;
|
|
1404
|
+
exports.Manage = Manage$1;
|
|
1304
1405
|
exports.Modal = Modal;
|
|
1305
1406
|
exports.Twilio = Twilio;
|
|
1306
1407
|
exports.Zoom = Zoom;
|