@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/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,13 +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/utils');
|
|
16
|
-
require('@bigbinary/neeto-icons/misc');
|
|
16
|
+
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
17
17
|
var neetoui = require('@bigbinary/neetoui');
|
|
18
18
|
var formik = require('@bigbinary/neetoui/formik');
|
|
19
19
|
require('ramda');
|
|
20
20
|
var yup = require('yup');
|
|
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
|
|
|
@@ -308,6 +309,7 @@ var Form = function Form(_ref) {
|
|
|
308
309
|
i18nKey: "neetoIntegrations.daily.helpDoc",
|
|
309
310
|
components: {
|
|
310
311
|
externalLink: /*#__PURE__*/React__default["default"].createElement(ExternalLink$1, {
|
|
312
|
+
"data-cy": "api-key-help-doc-link",
|
|
311
313
|
href: helpDocUrl,
|
|
312
314
|
rel: "noreferrer",
|
|
313
315
|
target: "_blank"
|
|
@@ -338,7 +340,8 @@ var Form = function Form(_ref) {
|
|
|
338
340
|
var Form$1 = reactUtils.withTitle(Form, i18next__default["default"].t("neetoIntegrations.browserTitles.integrations.dailyco"));
|
|
339
341
|
|
|
340
342
|
var Manage$1 = function Manage$1(_ref) {
|
|
341
|
-
var
|
|
343
|
+
var description = _ref.description,
|
|
344
|
+
onDisconnect = _ref.onDisconnect;
|
|
342
345
|
var _useState = React.useState(false),
|
|
343
346
|
_useState2 = _slicedToArray(_useState, 2),
|
|
344
347
|
isDisconnectAlertOpen = _useState2[0],
|
|
@@ -348,7 +351,7 @@ var Manage$1 = function Manage$1(_ref) {
|
|
|
348
351
|
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
349
352
|
_useFetchDaily$data2$ = _useFetchDaily$data2.metadata,
|
|
350
353
|
metadata = _useFetchDaily$data2$ === void 0 ? {} : _useFetchDaily$data2$,
|
|
351
|
-
|
|
354
|
+
isFetching = _useFetchDaily.isFetching;
|
|
352
355
|
var _ref2 = metadata || {},
|
|
353
356
|
_ref2$apiKey = _ref2.apiKey,
|
|
354
357
|
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
@@ -362,24 +365,33 @@ var Manage$1 = function Manage$1(_ref) {
|
|
|
362
365
|
}),
|
|
363
366
|
destroyIntegration = _useDestroyDaily.mutate,
|
|
364
367
|
isDisconnecting = _useDestroyDaily.isLoading;
|
|
368
|
+
var isConnected = neetoCist.isPresent(apiKey);
|
|
365
369
|
var handleDisconnect = function handleDisconnect() {
|
|
366
370
|
return destroyIntegration("daily");
|
|
367
371
|
};
|
|
368
|
-
if (
|
|
369
|
-
return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
370
|
-
}
|
|
371
|
-
if (neetoCist.isNotPresent(apiKey)) {
|
|
372
|
-
onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
|
|
373
|
-
}
|
|
372
|
+
if (isFetching || isDisconnecting) return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
374
373
|
return /*#__PURE__*/React__default["default"].createElement(Manage, {
|
|
374
|
+
isConnected: isConnected,
|
|
375
375
|
isDisconnectAlertOpen: isDisconnectAlertOpen,
|
|
376
376
|
isDisconnecting: isDisconnecting,
|
|
377
377
|
setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
|
|
378
|
-
|
|
379
|
-
|
|
378
|
+
Icon: misc.Daily,
|
|
379
|
+
connectPath: utils.buildUrl(window.location.pathname, {
|
|
380
|
+
connect: true
|
|
380
381
|
}),
|
|
381
382
|
integration: "daily",
|
|
382
|
-
|
|
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"),
|
|
383
395
|
onClose: function onClose() {
|
|
384
396
|
return setIsDisconnectAlertOpen(false);
|
|
385
397
|
},
|
|
@@ -394,10 +406,14 @@ var Daily = function Daily(_ref) {
|
|
|
394
406
|
helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
|
|
395
407
|
_ref$videoUrl = _ref.videoUrl,
|
|
396
408
|
videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
|
|
409
|
+
_ref$description = _ref.description,
|
|
410
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
397
411
|
_ref$onConnect = _ref.onConnect,
|
|
398
412
|
onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect,
|
|
399
413
|
_ref$onDisconnect = _ref.onDisconnect,
|
|
400
414
|
onDisconnect = _ref$onDisconnect === void 0 ? neetoCist.noop : _ref$onDisconnect;
|
|
415
|
+
var _useQueryParams = reactUtils.useQueryParams(),
|
|
416
|
+
connect = _useQueryParams.connect;
|
|
401
417
|
var _useFetchDaily = useFetchDaily(),
|
|
402
418
|
_useFetchDaily$data = _useFetchDaily.data,
|
|
403
419
|
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
@@ -406,8 +422,9 @@ var Daily = function Daily(_ref) {
|
|
|
406
422
|
var _ref2 = metadata || {},
|
|
407
423
|
_ref2$apiKey = _ref2.apiKey,
|
|
408
424
|
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
409
|
-
if (neetoCist.isPresent(apiKey) && !isOnboarding) {
|
|
425
|
+
if (neetoCist.isPresent(apiKey) && !isOnboarding || !connect) {
|
|
410
426
|
return /*#__PURE__*/React__default["default"].createElement(Manage$1, {
|
|
427
|
+
description: description,
|
|
411
428
|
onDisconnect: onDisconnect
|
|
412
429
|
});
|
|
413
430
|
}
|
|
@@ -690,39 +707,110 @@ n(css,{});
|
|
|
690
707
|
|
|
691
708
|
var Manage = reactUtils.withT(function (_ref) {
|
|
692
709
|
var t = _ref.t,
|
|
693
|
-
title = _ref.title,
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
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;
|
|
701
746
|
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
702
|
-
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"
|
|
703
755
|
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
704
|
-
className: "
|
|
756
|
+
className: "flex items-center space-x-4"
|
|
705
757
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
706
758
|
className: "neeto-ui-text-gray-800 mb-0.5",
|
|
707
|
-
style: "
|
|
759
|
+
style: "h2",
|
|
708
760
|
weight: "semibold"
|
|
709
|
-
}, title), /*#__PURE__*/React__default["default"].createElement(
|
|
710
|
-
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",
|
|
711
767
|
style: "body1",
|
|
712
768
|
weight: "normal"
|
|
713
|
-
}, description), /*#__PURE__*/React__default["default"].createElement(neetoui.
|
|
714
|
-
|
|
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, {
|
|
715
792
|
style: "danger",
|
|
793
|
+
label: t("settings.integrations.common.disconnectIntegration", {
|
|
794
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
795
|
+
}),
|
|
716
796
|
onClick: function onClick() {
|
|
717
797
|
return setIsDisconnectAlertOpen(true);
|
|
718
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
|
+
})
|
|
719
807
|
}))), /*#__PURE__*/React__default["default"].createElement(DisconnectAlert__default["default"], {
|
|
720
808
|
isDisconnecting: isDisconnecting,
|
|
721
809
|
onClose: onClose,
|
|
722
810
|
onDisconnect: onDisconnect,
|
|
723
811
|
isOpen: isDisconnectAlertOpen,
|
|
724
|
-
|
|
725
|
-
|
|
812
|
+
title: t("settings.integrations.".concat(integration, ".disconnect.title")),
|
|
813
|
+
message: disconnectMessage !== null && disconnectMessage !== void 0 ? disconnectMessage : t("settings.integrations.".concat(integration, ".disconnect.message"))
|
|
726
814
|
}));
|
|
727
815
|
});
|
|
728
816
|
|
|
@@ -757,7 +845,11 @@ var useDestroyZoom = function useDestroyZoom(_ref) {
|
|
|
757
845
|
};
|
|
758
846
|
|
|
759
847
|
var Zoom = function Zoom(_ref) {
|
|
760
|
-
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,
|
|
761
853
|
onDisconnect = _ref$onDisconnect === void 0 ? neetoCist.noop : _ref$onDisconnect;
|
|
762
854
|
var _useTranslation = reactI18next.useTranslation(),
|
|
763
855
|
t = _useTranslation.t;
|
|
@@ -781,24 +873,31 @@ var Zoom = function Zoom(_ref) {
|
|
|
781
873
|
}),
|
|
782
874
|
destroyIntegration = _useDestroyZoom.mutate,
|
|
783
875
|
isDisconnecting = _useDestroyZoom.isLoading;
|
|
876
|
+
var isConnected = neetoCist.isPresent(email);
|
|
784
877
|
var handleDisconnect = function handleDisconnect() {
|
|
785
878
|
return destroyIntegration("zoom");
|
|
786
879
|
};
|
|
787
|
-
if (isLoading)
|
|
788
|
-
return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
789
|
-
}
|
|
790
|
-
if (neetoCist.isNotPresent(email)) {
|
|
791
|
-
onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
|
|
792
|
-
}
|
|
880
|
+
if (isLoading) return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
793
881
|
return /*#__PURE__*/React__default["default"].createElement(Manage, {
|
|
882
|
+
connectUrl: connectUrl,
|
|
883
|
+
isConnected: isConnected,
|
|
794
884
|
isDisconnectAlertOpen: isDisconnectAlertOpen,
|
|
795
885
|
isDisconnecting: isDisconnecting,
|
|
796
886
|
setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
|
|
797
|
-
|
|
798
|
-
email: email
|
|
799
|
-
}),
|
|
887
|
+
Icon: misc.Zoom,
|
|
800
888
|
integration: "zoom",
|
|
801
|
-
|
|
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"),
|
|
802
901
|
onClose: function onClose() {
|
|
803
902
|
return setIsDisconnectAlertOpen(false);
|
|
804
903
|
},
|