@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
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,115 @@ 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 ? neetoCist.noop : _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: "settings.integrations.common.helpDocUrl",
|
|
124
|
+
components: {
|
|
125
|
+
helpLink: /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
126
|
+
href: helpDocUrl,
|
|
127
|
+
style: "link"
|
|
128
|
+
})
|
|
129
|
+
},
|
|
130
|
+
values: {
|
|
131
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
132
|
+
}
|
|
133
|
+
}))), isConnected ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
134
|
+
className: "space-x-2"
|
|
135
|
+
}, managePath && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
136
|
+
to: managePath,
|
|
137
|
+
label: t("settings.integrations.common.manageIntegration", {
|
|
138
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
139
|
+
})
|
|
140
|
+
}), onDisconnect && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
141
|
+
style: "danger",
|
|
142
|
+
label: t("settings.integrations.common.disconnectIntegration", {
|
|
143
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
144
|
+
}),
|
|
145
|
+
onClick: function onClick() {
|
|
146
|
+
return setIsDisconnectAlertOpen(true);
|
|
147
|
+
}
|
|
148
|
+
})) : /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
149
|
+
disabled: isConnectDisabled,
|
|
150
|
+
href: connectUrl,
|
|
151
|
+
to: connectPath,
|
|
152
|
+
tooltipProps: connectTooltipProps,
|
|
153
|
+
label: t("settings.integrations.common.connectIntegration", {
|
|
154
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
155
|
+
})
|
|
156
|
+
}))), /*#__PURE__*/React__default["default"].createElement(DisconnectAlert__default["default"], {
|
|
157
|
+
isDisconnecting: isDisconnecting,
|
|
158
|
+
onClose: onClose,
|
|
159
|
+
onDisconnect: onDisconnect,
|
|
160
|
+
isOpen: isDisconnectAlertOpen,
|
|
161
|
+
title: t("settings.integrations.".concat(integration, ".disconnect.title")),
|
|
162
|
+
message: disconnectMessage !== null && disconnectMessage !== void 0 ? disconnectMessage : t("settings.integrations.".concat(integration, ".disconnect.message"))
|
|
163
|
+
}));
|
|
164
|
+
});
|
|
165
|
+
|
|
56
166
|
function _typeof(obj) {
|
|
57
167
|
"@babel/helpers - typeof";
|
|
58
168
|
|
|
@@ -312,6 +422,7 @@ var Form = function Form(_ref) {
|
|
|
312
422
|
i18nKey: "neetoIntegrations.daily.helpDoc",
|
|
313
423
|
components: {
|
|
314
424
|
externalLink: /*#__PURE__*/React__default["default"].createElement(ExternalLink$1, {
|
|
425
|
+
"data-cy": "api-key-help-doc-link",
|
|
315
426
|
href: helpDocUrl,
|
|
316
427
|
rel: "noreferrer",
|
|
317
428
|
target: "_blank"
|
|
@@ -341,46 +452,9 @@ var Form = function Form(_ref) {
|
|
|
341
452
|
};
|
|
342
453
|
var Form$1 = reactUtils.withTitle(Form, i18next__default["default"].t("neetoIntegrations.browserTitles.integrations.dailyco"));
|
|
343
454
|
|
|
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
455
|
var Manage = function Manage(_ref) {
|
|
383
|
-
var
|
|
456
|
+
var description = _ref.description,
|
|
457
|
+
onDisconnect = _ref.onDisconnect;
|
|
384
458
|
var _useState = React.useState(false),
|
|
385
459
|
_useState2 = _slicedToArray(_useState, 2),
|
|
386
460
|
isDisconnectAlertOpen = _useState2[0],
|
|
@@ -390,7 +464,7 @@ var Manage = function Manage(_ref) {
|
|
|
390
464
|
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
391
465
|
_useFetchDaily$data2$ = _useFetchDaily$data2.metadata,
|
|
392
466
|
metadata = _useFetchDaily$data2$ === void 0 ? {} : _useFetchDaily$data2$,
|
|
393
|
-
|
|
467
|
+
isFetching = _useFetchDaily.isFetching;
|
|
394
468
|
var _ref2 = metadata || {},
|
|
395
469
|
_ref2$apiKey = _ref2.apiKey,
|
|
396
470
|
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
@@ -404,24 +478,33 @@ var Manage = function Manage(_ref) {
|
|
|
404
478
|
}),
|
|
405
479
|
destroyIntegration = _useDestroyDaily.mutate,
|
|
406
480
|
isDisconnecting = _useDestroyDaily.isLoading;
|
|
481
|
+
var isConnected = neetoCist.isPresent(apiKey);
|
|
407
482
|
var handleDisconnect = function handleDisconnect() {
|
|
408
483
|
return destroyIntegration("daily");
|
|
409
484
|
};
|
|
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
|
-
}
|
|
485
|
+
if (isFetching || isDisconnecting) return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
416
486
|
return /*#__PURE__*/React__default["default"].createElement(Manage$1, {
|
|
487
|
+
isConnected: isConnected,
|
|
417
488
|
isDisconnectAlertOpen: isDisconnectAlertOpen,
|
|
418
489
|
isDisconnecting: isDisconnecting,
|
|
419
490
|
setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
|
|
420
|
-
|
|
421
|
-
|
|
491
|
+
Icon: misc.Daily,
|
|
492
|
+
connectPath: utils.buildUrl(window.location.pathname, {
|
|
493
|
+
connect: true
|
|
422
494
|
}),
|
|
423
495
|
integration: "daily",
|
|
424
|
-
|
|
496
|
+
description: isConnected ? /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
497
|
+
components: {
|
|
498
|
+
underline: /*#__PURE__*/React__default["default"].createElement("u", {
|
|
499
|
+
className: "font-medium"
|
|
500
|
+
})
|
|
501
|
+
},
|
|
502
|
+
i18nKey: "neetoIntegrations.daily.yourApiKey",
|
|
503
|
+
values: {
|
|
504
|
+
apiKey: apiKey
|
|
505
|
+
}
|
|
506
|
+
}) : description,
|
|
507
|
+
title: isConnected ? t("neetoIntegrations.daily.connected") : t("neetoIntegrations.daily.connect"),
|
|
425
508
|
onClose: function onClose() {
|
|
426
509
|
return setIsDisconnectAlertOpen(false);
|
|
427
510
|
},
|
|
@@ -436,10 +519,14 @@ var Daily = function Daily(_ref) {
|
|
|
436
519
|
helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
|
|
437
520
|
_ref$videoUrl = _ref.videoUrl,
|
|
438
521
|
videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
|
|
522
|
+
_ref$description = _ref.description,
|
|
523
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
439
524
|
_ref$onConnect = _ref.onConnect,
|
|
440
525
|
onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect,
|
|
441
526
|
_ref$onDisconnect = _ref.onDisconnect,
|
|
442
527
|
onDisconnect = _ref$onDisconnect === void 0 ? neetoCist.noop : _ref$onDisconnect;
|
|
528
|
+
var _useQueryParams = reactUtils.useQueryParams(),
|
|
529
|
+
connect = _useQueryParams.connect;
|
|
443
530
|
var _useFetchDaily = useFetchDaily(),
|
|
444
531
|
_useFetchDaily$data = _useFetchDaily.data,
|
|
445
532
|
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
@@ -448,8 +535,9 @@ var Daily = function Daily(_ref) {
|
|
|
448
535
|
var _ref2 = metadata || {},
|
|
449
536
|
_ref2$apiKey = _ref2.apiKey,
|
|
450
537
|
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
451
|
-
if (neetoCist.isPresent(apiKey) && !isOnboarding) {
|
|
538
|
+
if (neetoCist.isPresent(apiKey) && !isOnboarding || !connect) {
|
|
452
539
|
return /*#__PURE__*/React__default["default"].createElement(Manage, {
|
|
540
|
+
description: description,
|
|
453
541
|
onDisconnect: onDisconnect
|
|
454
542
|
});
|
|
455
543
|
}
|
|
@@ -853,7 +941,11 @@ var useDestroyZoom = function useDestroyZoom(_ref) {
|
|
|
853
941
|
};
|
|
854
942
|
|
|
855
943
|
var Zoom = function Zoom(_ref) {
|
|
856
|
-
var _ref$
|
|
944
|
+
var _ref$connectUrl = _ref.connectUrl,
|
|
945
|
+
connectUrl = _ref$connectUrl === void 0 ? "" : _ref$connectUrl,
|
|
946
|
+
_ref$description = _ref.description,
|
|
947
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
948
|
+
_ref$onDisconnect = _ref.onDisconnect,
|
|
857
949
|
onDisconnect = _ref$onDisconnect === void 0 ? neetoCist.noop : _ref$onDisconnect;
|
|
858
950
|
var _useTranslation = reactI18next.useTranslation(),
|
|
859
951
|
t = _useTranslation.t;
|
|
@@ -877,24 +969,31 @@ var Zoom = function Zoom(_ref) {
|
|
|
877
969
|
}),
|
|
878
970
|
destroyIntegration = _useDestroyZoom.mutate,
|
|
879
971
|
isDisconnecting = _useDestroyZoom.isLoading;
|
|
972
|
+
var isConnected = neetoCist.isPresent(email);
|
|
880
973
|
var handleDisconnect = function handleDisconnect() {
|
|
881
974
|
return destroyIntegration("zoom");
|
|
882
975
|
};
|
|
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
|
-
}
|
|
976
|
+
if (isLoading) return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
889
977
|
return /*#__PURE__*/React__default["default"].createElement(Manage$1, {
|
|
978
|
+
connectUrl: connectUrl,
|
|
979
|
+
isConnected: isConnected,
|
|
890
980
|
isDisconnectAlertOpen: isDisconnectAlertOpen,
|
|
891
981
|
isDisconnecting: isDisconnecting,
|
|
892
982
|
setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
|
|
893
|
-
|
|
894
|
-
email: email
|
|
895
|
-
}),
|
|
983
|
+
Icon: misc.Zoom,
|
|
896
984
|
integration: "zoom",
|
|
897
|
-
|
|
985
|
+
description: isConnected ? /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
986
|
+
components: {
|
|
987
|
+
underline: /*#__PURE__*/React__default["default"].createElement("u", {
|
|
988
|
+
className: "font-medium"
|
|
989
|
+
})
|
|
990
|
+
},
|
|
991
|
+
i18nKey: "neetoIntegrations.zoom.account",
|
|
992
|
+
values: {
|
|
993
|
+
email: email
|
|
994
|
+
}
|
|
995
|
+
}) : description,
|
|
996
|
+
title: isConnected ? t("neetoIntegrations.zoom.connected") : t("neetoIntegrations.zoom.connect"),
|
|
898
997
|
onClose: function onClose() {
|
|
899
998
|
return setIsDisconnectAlertOpen(false);
|
|
900
999
|
},
|
|
@@ -1301,6 +1400,7 @@ exports.Daily = index;
|
|
|
1301
1400
|
exports.Demo = Demo;
|
|
1302
1401
|
exports.Finish = Finish;
|
|
1303
1402
|
exports.GoogleCalendar = GoogleCalendar;
|
|
1403
|
+
exports.Manage = Manage$1;
|
|
1304
1404
|
exports.Modal = Modal;
|
|
1305
1405
|
exports.Twilio = Twilio;
|
|
1306
1406
|
exports.Zoom = Zoom;
|