@bigbinary/neeto-integrations-frontend 2.10.1 → 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 -48
- package/dist/Daily.cjs.js.map +1 -1
- package/dist/Daily.js +138 -51
- package/dist/Daily.js.map +1 -1
- package/dist/GoogleCalender.cjs.js +143 -56
- package/dist/GoogleCalender.cjs.js.map +1 -1
- package/dist/GoogleCalender.js +149 -62
- package/dist/GoogleCalender.js.map +1 -1
- package/dist/Zoom.cjs.js +141 -43
- package/dist/Zoom.cjs.js.map +1 -1
- package/dist/Zoom.js +143 -45
- package/dist/Zoom.js.map +1 -1
- package/dist/index.cjs.js +166 -67
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +172 -74
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/types.d.ts +3 -0
package/dist/Zoom.cjs.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var React = require('react');
|
|
4
4
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
5
|
+
var misc = require('@bigbinary/neeto-icons/misc');
|
|
5
6
|
var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
|
|
6
7
|
var reactI18next = require('react-i18next');
|
|
7
8
|
require('@bigbinary/neeto-molecules/IntegrationCard');
|
|
@@ -12,14 +13,13 @@ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
|
12
13
|
var constants = require('@bigbinary/neeto-commons-frontend/constants');
|
|
13
14
|
var reactQuery = require('react-query');
|
|
14
15
|
var axios = require('axios');
|
|
15
|
-
require('@bigbinary/neeto-commons-frontend/
|
|
16
|
-
require('@bigbinary/neeto-commons-frontend/utils');
|
|
17
|
-
require('@bigbinary/neeto-icons/misc');
|
|
16
|
+
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
18
17
|
var neetoui = require('@bigbinary/neetoui');
|
|
19
18
|
var formik = require('@bigbinary/neetoui/formik');
|
|
20
19
|
require('ramda');
|
|
21
20
|
var yup = require('yup');
|
|
22
21
|
var classnames = require('classnames');
|
|
22
|
+
var neetoIcons = require('@bigbinary/neeto-icons');
|
|
23
23
|
|
|
24
24
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
25
25
|
|
|
@@ -309,6 +309,7 @@ var Form = function Form(_ref) {
|
|
|
309
309
|
i18nKey: "neetoIntegrations.daily.helpDoc",
|
|
310
310
|
components: {
|
|
311
311
|
externalLink: /*#__PURE__*/React__default["default"].createElement(ExternalLink$1, {
|
|
312
|
+
"data-cy": "api-key-help-doc-link",
|
|
312
313
|
href: helpDocUrl,
|
|
313
314
|
rel: "noreferrer",
|
|
314
315
|
target: "_blank"
|
|
@@ -339,7 +340,8 @@ var Form = function Form(_ref) {
|
|
|
339
340
|
var Form$1 = reactUtils.withTitle(Form, i18next__default["default"].t("neetoIntegrations.browserTitles.integrations.dailyco"));
|
|
340
341
|
|
|
341
342
|
var Manage$1 = function Manage$1(_ref) {
|
|
342
|
-
var
|
|
343
|
+
var description = _ref.description,
|
|
344
|
+
onDisconnect = _ref.onDisconnect;
|
|
343
345
|
var _useState = React.useState(false),
|
|
344
346
|
_useState2 = _slicedToArray(_useState, 2),
|
|
345
347
|
isDisconnectAlertOpen = _useState2[0],
|
|
@@ -349,7 +351,7 @@ var Manage$1 = function Manage$1(_ref) {
|
|
|
349
351
|
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
350
352
|
_useFetchDaily$data2$ = _useFetchDaily$data2.metadata,
|
|
351
353
|
metadata = _useFetchDaily$data2$ === void 0 ? {} : _useFetchDaily$data2$,
|
|
352
|
-
|
|
354
|
+
isFetching = _useFetchDaily.isFetching;
|
|
353
355
|
var _ref2 = metadata || {},
|
|
354
356
|
_ref2$apiKey = _ref2.apiKey,
|
|
355
357
|
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
@@ -363,24 +365,33 @@ var Manage$1 = function Manage$1(_ref) {
|
|
|
363
365
|
}),
|
|
364
366
|
destroyIntegration = _useDestroyDaily.mutate,
|
|
365
367
|
isDisconnecting = _useDestroyDaily.isLoading;
|
|
368
|
+
var isConnected = neetoCist.isPresent(apiKey);
|
|
366
369
|
var handleDisconnect = function handleDisconnect() {
|
|
367
370
|
return destroyIntegration("daily");
|
|
368
371
|
};
|
|
369
|
-
if (
|
|
370
|
-
return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
371
|
-
}
|
|
372
|
-
if (neetoCist.isNotPresent(apiKey)) {
|
|
373
|
-
onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
|
|
374
|
-
}
|
|
372
|
+
if (isFetching || isDisconnecting) return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
375
373
|
return /*#__PURE__*/React__default["default"].createElement(Manage, {
|
|
374
|
+
isConnected: isConnected,
|
|
376
375
|
isDisconnectAlertOpen: isDisconnectAlertOpen,
|
|
377
376
|
isDisconnecting: isDisconnecting,
|
|
378
377
|
setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
|
|
379
|
-
|
|
380
|
-
|
|
378
|
+
Icon: misc.Daily,
|
|
379
|
+
connectPath: utils.buildUrl(window.location.pathname, {
|
|
380
|
+
connect: true
|
|
381
381
|
}),
|
|
382
382
|
integration: "daily",
|
|
383
|
-
|
|
383
|
+
description: isConnected ? /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
384
|
+
components: {
|
|
385
|
+
underline: /*#__PURE__*/React__default["default"].createElement("u", {
|
|
386
|
+
className: "font-medium"
|
|
387
|
+
})
|
|
388
|
+
},
|
|
389
|
+
i18nKey: "neetoIntegrations.daily.yourApiKey",
|
|
390
|
+
values: {
|
|
391
|
+
apiKey: apiKey
|
|
392
|
+
}
|
|
393
|
+
}) : description,
|
|
394
|
+
title: isConnected ? t("neetoIntegrations.daily.connected") : t("neetoIntegrations.daily.connect"),
|
|
384
395
|
onClose: function onClose() {
|
|
385
396
|
return setIsDisconnectAlertOpen(false);
|
|
386
397
|
},
|
|
@@ -395,10 +406,14 @@ var Daily = function Daily(_ref) {
|
|
|
395
406
|
helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
|
|
396
407
|
_ref$videoUrl = _ref.videoUrl,
|
|
397
408
|
videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
|
|
409
|
+
_ref$description = _ref.description,
|
|
410
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
398
411
|
_ref$onConnect = _ref.onConnect,
|
|
399
412
|
onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect,
|
|
400
413
|
_ref$onDisconnect = _ref.onDisconnect,
|
|
401
414
|
onDisconnect = _ref$onDisconnect === void 0 ? neetoCist.noop : _ref$onDisconnect;
|
|
415
|
+
var _useQueryParams = reactUtils.useQueryParams(),
|
|
416
|
+
connect = _useQueryParams.connect;
|
|
402
417
|
var _useFetchDaily = useFetchDaily(),
|
|
403
418
|
_useFetchDaily$data = _useFetchDaily.data,
|
|
404
419
|
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
@@ -407,8 +422,9 @@ var Daily = function Daily(_ref) {
|
|
|
407
422
|
var _ref2 = metadata || {},
|
|
408
423
|
_ref2$apiKey = _ref2.apiKey,
|
|
409
424
|
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
410
|
-
if (neetoCist.isPresent(apiKey) && !isOnboarding) {
|
|
425
|
+
if (neetoCist.isPresent(apiKey) && !isOnboarding || !connect) {
|
|
411
426
|
return /*#__PURE__*/React__default["default"].createElement(Manage$1, {
|
|
427
|
+
description: description,
|
|
412
428
|
onDisconnect: onDisconnect
|
|
413
429
|
});
|
|
414
430
|
}
|
|
@@ -691,39 +707,110 @@ n(css,{});
|
|
|
691
707
|
|
|
692
708
|
var Manage = reactUtils.withT(function (_ref) {
|
|
693
709
|
var t = _ref.t,
|
|
694
|
-
title = _ref.title,
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
710
|
+
_ref$title = _ref.title,
|
|
711
|
+
title = _ref$title === void 0 ? "" : _ref$title,
|
|
712
|
+
_ref$description = _ref.description,
|
|
713
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
714
|
+
_ref$integration = _ref.integration,
|
|
715
|
+
integration = _ref$integration === void 0 ? "" : _ref$integration,
|
|
716
|
+
_ref$isDisconnectAler = _ref.isDisconnectAlertOpen,
|
|
717
|
+
isDisconnectAlertOpen = _ref$isDisconnectAler === void 0 ? false : _ref$isDisconnectAler,
|
|
718
|
+
_ref$setIsDisconnectA = _ref.setIsDisconnectAlertOpen,
|
|
719
|
+
setIsDisconnectAlertOpen = _ref$setIsDisconnectA === void 0 ? neetoCist.noop : _ref$setIsDisconnectA,
|
|
720
|
+
_ref$isDisconnecting = _ref.isDisconnecting,
|
|
721
|
+
isDisconnecting = _ref$isDisconnecting === void 0 ? false : _ref$isDisconnecting,
|
|
722
|
+
_ref$onDisconnect = _ref.onDisconnect,
|
|
723
|
+
onDisconnect = _ref$onDisconnect === void 0 ? neetoCist.noop : _ref$onDisconnect,
|
|
724
|
+
_ref$onClose = _ref.onClose,
|
|
725
|
+
onClose = _ref$onClose === void 0 ? neetoCist.noop : _ref$onClose,
|
|
726
|
+
_ref$Icon = _ref.Icon,
|
|
727
|
+
Icon = _ref$Icon === void 0 ? null : _ref$Icon,
|
|
728
|
+
_ref$isConnected = _ref.isConnected,
|
|
729
|
+
isConnected = _ref$isConnected === void 0 ? false : _ref$isConnected,
|
|
730
|
+
_ref$connectPath = _ref.connectPath,
|
|
731
|
+
connectPath = _ref$connectPath === void 0 ? "" : _ref$connectPath,
|
|
732
|
+
_ref$connectUrl = _ref.connectUrl,
|
|
733
|
+
connectUrl = _ref$connectUrl === void 0 ? "" : _ref$connectUrl,
|
|
734
|
+
_ref$helpDocUrl = _ref.helpDocUrl,
|
|
735
|
+
helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
|
|
736
|
+
_ref$managePath = _ref.managePath,
|
|
737
|
+
managePath = _ref$managePath === void 0 ? "" : _ref$managePath,
|
|
738
|
+
_ref$integrationName = _ref.integrationName,
|
|
739
|
+
integrationName = _ref$integrationName === void 0 ? "" : _ref$integrationName,
|
|
740
|
+
_ref$disconnectMessag = _ref.disconnectMessage,
|
|
741
|
+
disconnectMessage = _ref$disconnectMessag === void 0 ? "" : _ref$disconnectMessag,
|
|
742
|
+
_ref$isConnectDisable = _ref.isConnectDisabled,
|
|
743
|
+
isConnectDisabled = _ref$isConnectDisable === void 0 ? false : _ref$isConnectDisable,
|
|
744
|
+
_ref$connectTooltipPr = _ref.connectTooltipProps,
|
|
745
|
+
connectTooltipProps = _ref$connectTooltipPr === void 0 ? null : _ref$connectTooltipPr;
|
|
702
746
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
703
|
-
className: "mx-auto w-full max-w-
|
|
747
|
+
className: "mx-auto w-full max-w-3xl"
|
|
748
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
749
|
+
className: "neeto-ui-border-gray-300 neeto-ui-rounded-xl mt-10 w-full space-y-4 border p-6"
|
|
750
|
+
}, Icon && /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
751
|
+
className: "neeto-ui-text-gray-600",
|
|
752
|
+
size: 60
|
|
753
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
754
|
+
className: "space-y-2"
|
|
704
755
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
705
|
-
className: "
|
|
756
|
+
className: "flex items-center space-x-4"
|
|
706
757
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
707
758
|
className: "neeto-ui-text-gray-800 mb-0.5",
|
|
708
|
-
style: "
|
|
759
|
+
style: "h2",
|
|
709
760
|
weight: "semibold"
|
|
710
|
-
}, title), /*#__PURE__*/React__default["default"].createElement(
|
|
711
|
-
className: "neeto-ui-text-
|
|
761
|
+
}, title), isConnected && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
762
|
+
className: "neeto-ui-bg-success-500 neeto-ui-text-white neeto-ui-rounded-full flex items-center justify-center p-1"
|
|
763
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoIcons.Check, {
|
|
764
|
+
size: 24
|
|
765
|
+
}))), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
766
|
+
className: "neeto-ui-text-gray-800 break-all",
|
|
712
767
|
style: "body1",
|
|
713
768
|
weight: "normal"
|
|
714
|
-
}, description), /*#__PURE__*/React__default["default"].createElement(neetoui.
|
|
715
|
-
|
|
769
|
+
}, description), helpDocUrl && /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
770
|
+
className: "neeto-ui-text-gray-800 break-all",
|
|
771
|
+
style: "body2",
|
|
772
|
+
weight: "normal"
|
|
773
|
+
}, /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
774
|
+
i18nKey: "settings.integrations.common.helpDocUrl",
|
|
775
|
+
components: {
|
|
776
|
+
helpLink: /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
777
|
+
href: helpDocUrl,
|
|
778
|
+
style: "link"
|
|
779
|
+
})
|
|
780
|
+
},
|
|
781
|
+
values: {
|
|
782
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
783
|
+
}
|
|
784
|
+
}))), isConnected ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
785
|
+
className: "space-x-2"
|
|
786
|
+
}, managePath && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
787
|
+
to: managePath,
|
|
788
|
+
label: t("settings.integrations.common.manageIntegration", {
|
|
789
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
790
|
+
})
|
|
791
|
+
}), onDisconnect && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
716
792
|
style: "danger",
|
|
793
|
+
label: t("settings.integrations.common.disconnectIntegration", {
|
|
794
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
795
|
+
}),
|
|
717
796
|
onClick: function onClick() {
|
|
718
797
|
return setIsDisconnectAlertOpen(true);
|
|
719
798
|
}
|
|
799
|
+
})) : /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
800
|
+
disabled: isConnectDisabled,
|
|
801
|
+
href: connectUrl,
|
|
802
|
+
to: connectPath,
|
|
803
|
+
tooltipProps: connectTooltipProps,
|
|
804
|
+
label: t("settings.integrations.common.connectIntegration", {
|
|
805
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
806
|
+
})
|
|
720
807
|
}))), /*#__PURE__*/React__default["default"].createElement(DisconnectAlert__default["default"], {
|
|
721
808
|
isDisconnecting: isDisconnecting,
|
|
722
809
|
onClose: onClose,
|
|
723
810
|
onDisconnect: onDisconnect,
|
|
724
811
|
isOpen: isDisconnectAlertOpen,
|
|
725
|
-
|
|
726
|
-
|
|
812
|
+
title: t("settings.integrations.".concat(integration, ".disconnect.title")),
|
|
813
|
+
message: disconnectMessage !== null && disconnectMessage !== void 0 ? disconnectMessage : t("settings.integrations.".concat(integration, ".disconnect.message"))
|
|
727
814
|
}));
|
|
728
815
|
});
|
|
729
816
|
|
|
@@ -758,7 +845,11 @@ var useDestroyZoom = function useDestroyZoom(_ref) {
|
|
|
758
845
|
};
|
|
759
846
|
|
|
760
847
|
var Zoom = function Zoom(_ref) {
|
|
761
|
-
var _ref$
|
|
848
|
+
var _ref$connectUrl = _ref.connectUrl,
|
|
849
|
+
connectUrl = _ref$connectUrl === void 0 ? "" : _ref$connectUrl,
|
|
850
|
+
_ref$description = _ref.description,
|
|
851
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
852
|
+
_ref$onDisconnect = _ref.onDisconnect,
|
|
762
853
|
onDisconnect = _ref$onDisconnect === void 0 ? neetoCist.noop : _ref$onDisconnect;
|
|
763
854
|
var _useTranslation = reactI18next.useTranslation(),
|
|
764
855
|
t = _useTranslation.t;
|
|
@@ -782,24 +873,31 @@ var Zoom = function Zoom(_ref) {
|
|
|
782
873
|
}),
|
|
783
874
|
destroyIntegration = _useDestroyZoom.mutate,
|
|
784
875
|
isDisconnecting = _useDestroyZoom.isLoading;
|
|
876
|
+
var isConnected = neetoCist.isPresent(email);
|
|
785
877
|
var handleDisconnect = function handleDisconnect() {
|
|
786
878
|
return destroyIntegration("zoom");
|
|
787
879
|
};
|
|
788
|
-
if (isLoading)
|
|
789
|
-
return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
790
|
-
}
|
|
791
|
-
if (neetoCist.isNotPresent(email)) {
|
|
792
|
-
onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
|
|
793
|
-
}
|
|
880
|
+
if (isLoading) return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
794
881
|
return /*#__PURE__*/React__default["default"].createElement(Manage, {
|
|
882
|
+
connectUrl: connectUrl,
|
|
883
|
+
isConnected: isConnected,
|
|
795
884
|
isDisconnectAlertOpen: isDisconnectAlertOpen,
|
|
796
885
|
isDisconnecting: isDisconnecting,
|
|
797
886
|
setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
|
|
798
|
-
|
|
799
|
-
email: email
|
|
800
|
-
}),
|
|
887
|
+
Icon: misc.Zoom,
|
|
801
888
|
integration: "zoom",
|
|
802
|
-
|
|
889
|
+
description: isConnected ? /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
890
|
+
components: {
|
|
891
|
+
underline: /*#__PURE__*/React__default["default"].createElement("u", {
|
|
892
|
+
className: "font-medium"
|
|
893
|
+
})
|
|
894
|
+
},
|
|
895
|
+
i18nKey: "neetoIntegrations.zoom.account",
|
|
896
|
+
values: {
|
|
897
|
+
email: email
|
|
898
|
+
}
|
|
899
|
+
}) : description,
|
|
900
|
+
title: isConnected ? t("neetoIntegrations.zoom.connected") : t("neetoIntegrations.zoom.connect"),
|
|
803
901
|
onClose: function onClose() {
|
|
804
902
|
return setIsDisconnectAlertOpen(false);
|
|
805
903
|
},
|