@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.
@@ -12,7 +12,11 @@
12
12
  "tryAgain": "Try Again",
13
13
  "verify": "Verify",
14
14
  "phNo": "Phone number",
15
- "saveChanges": "Save changes"
15
+ "saveChanges": "Save changes",
16
+ "disconnectIntegration": "Disconnect {{integration, anyCase}}",
17
+ "connectIntegration": "Connect {{integration, anyCase}}",
18
+ "manageIntegration": "Manage {{integration, anyCase}}",
19
+ "helpDocUrl": "To learn more about the {{integration, anyCase}} integration, see the <helpLink>Help center</helpLink>."
16
20
  },
17
21
  "errors": {
18
22
  "required": "{{entity}} is required"
@@ -79,8 +83,9 @@
79
83
  "description": "Include daily.co links in your meetings booked using {{appName, anyCase}}.",
80
84
  "apiKey": "API key",
81
85
  "helpDoc": "<externalLink>See instructions</externalLink> on getting the API key",
82
- "yourApiKey": "You are connected to Daily.co with this API key: {{apiKey, anyCase}}",
83
- "connected": "You are connected to Daily.co.",
86
+ "yourApiKey": "You are connected to Daily.co with the API key: <underline>{{apiKey, anyCase}}</underline>",
87
+ "connect": "Connect your Daily.co account",
88
+ "connected": "You are connected to Daily.co",
84
89
  "disconnect": {
85
90
  "title": "Disconnect Daily.co integration?",
86
91
  "message": "This action will disconnect Daily.co integration."
@@ -95,8 +100,9 @@
95
100
  "zoom": {
96
101
  "title": "Zoom",
97
102
  "description": "Include Zoom video links in your meetings booked using {{appName, anyCase}}.",
98
- "connected": "You are connected to Zoom.",
99
- "account": "Your connected email is: {{email}}",
103
+ "connect": "Connect your Zoom account",
104
+ "connected": "You are connected to Zoom",
105
+ "account": "Your connected email is <underline>{{email}}</underline>.",
100
106
  "disconnect": {
101
107
  "title": "Disconnect Zoom integration?",
102
108
  "message": "This action will disconnect Zoom integration."
package/dist/Daily.cjs.js CHANGED
@@ -10,15 +10,16 @@ var axios = require('axios');
10
10
  require('@bigbinary/neeto-molecules/IntegrationCard');
11
11
  var DisconnectAlert = require('@bigbinary/neeto-molecules/IntegrationDisconnectAlert');
12
12
  var WalkthroughModal = require('@bigbinary/neeto-molecules/IntegrationWalkthroughModal');
13
+ var utils = require('@bigbinary/neeto-commons-frontend/utils');
14
+ var misc = require('@bigbinary/neeto-icons/misc');
13
15
  var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
14
16
  var reactI18next = require('react-i18next');
15
- require('@bigbinary/neeto-commons-frontend/utils');
16
- require('@bigbinary/neeto-icons/misc');
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
 
@@ -194,60 +195,132 @@ function _slicedToArray(arr, i) {
194
195
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
195
196
  }
196
197
 
197
- [{
198
- step: "1",
199
- label: i18next.t("neetoIntegrations.common.connect"),
200
- isActive: true,
201
- isCompleted: false
202
- }, {
203
- step: "2",
204
- label: i18next.t("neetoIntegrations.common.finish"),
205
- isActive: false,
206
- isCompleted: false
207
- }];
208
- ({
209
- connect: i18next.t("neetoIntegrations.common.connect"),
210
- finish: i18next.t("neetoIntegrations.common.finish")
211
- });
212
-
213
198
  var Manage$1 = reactUtils.withT(function (_ref) {
214
199
  var t = _ref.t,
215
- title = _ref.title,
216
- description = _ref.description,
217
- integration = _ref.integration,
218
- isDisconnectAlertOpen = _ref.isDisconnectAlertOpen,
219
- setIsDisconnectAlertOpen = _ref.setIsDisconnectAlertOpen,
220
- isDisconnecting = _ref.isDisconnecting,
221
- onDisconnect = _ref.onDisconnect,
222
- onClose = _ref.onClose;
200
+ _ref$title = _ref.title,
201
+ title = _ref$title === void 0 ? "" : _ref$title,
202
+ _ref$description = _ref.description,
203
+ description = _ref$description === void 0 ? "" : _ref$description,
204
+ _ref$integration = _ref.integration,
205
+ integration = _ref$integration === void 0 ? "" : _ref$integration,
206
+ _ref$isDisconnectAler = _ref.isDisconnectAlertOpen,
207
+ isDisconnectAlertOpen = _ref$isDisconnectAler === void 0 ? false : _ref$isDisconnectAler,
208
+ _ref$setIsDisconnectA = _ref.setIsDisconnectAlertOpen,
209
+ setIsDisconnectAlertOpen = _ref$setIsDisconnectA === void 0 ? neetoCist.noop : _ref$setIsDisconnectA,
210
+ _ref$isDisconnecting = _ref.isDisconnecting,
211
+ isDisconnecting = _ref$isDisconnecting === void 0 ? false : _ref$isDisconnecting,
212
+ _ref$onDisconnect = _ref.onDisconnect,
213
+ onDisconnect = _ref$onDisconnect === void 0 ? undefined : _ref$onDisconnect,
214
+ _ref$onClose = _ref.onClose,
215
+ onClose = _ref$onClose === void 0 ? neetoCist.noop : _ref$onClose,
216
+ _ref$Icon = _ref.Icon,
217
+ Icon = _ref$Icon === void 0 ? null : _ref$Icon,
218
+ _ref$isConnected = _ref.isConnected,
219
+ isConnected = _ref$isConnected === void 0 ? false : _ref$isConnected,
220
+ _ref$connectPath = _ref.connectPath,
221
+ connectPath = _ref$connectPath === void 0 ? "" : _ref$connectPath,
222
+ _ref$connectUrl = _ref.connectUrl,
223
+ connectUrl = _ref$connectUrl === void 0 ? "" : _ref$connectUrl,
224
+ _ref$helpDocUrl = _ref.helpDocUrl,
225
+ helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
226
+ _ref$managePath = _ref.managePath,
227
+ managePath = _ref$managePath === void 0 ? "" : _ref$managePath,
228
+ _ref$integrationName = _ref.integrationName,
229
+ integrationName = _ref$integrationName === void 0 ? "" : _ref$integrationName,
230
+ _ref$disconnectMessag = _ref.disconnectMessage,
231
+ disconnectMessage = _ref$disconnectMessag === void 0 ? "" : _ref$disconnectMessag,
232
+ _ref$isConnectDisable = _ref.isConnectDisabled,
233
+ isConnectDisabled = _ref$isConnectDisable === void 0 ? false : _ref$isConnectDisable,
234
+ _ref$connectTooltipPr = _ref.connectTooltipProps,
235
+ connectTooltipProps = _ref$connectTooltipPr === void 0 ? null : _ref$connectTooltipPr;
223
236
  return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
224
- className: "mx-auto w-full max-w-md"
237
+ className: "mx-auto w-full max-w-3xl"
225
238
  }, /*#__PURE__*/React__default["default"].createElement("div", {
226
- className: "mt-10 w-full space-y-4"
239
+ className: "neeto-ui-border-gray-300 neeto-ui-rounded-xl mt-10 w-full space-y-4 border p-6"
240
+ }, Icon && /*#__PURE__*/React__default["default"].createElement(Icon, {
241
+ className: "neeto-ui-text-gray-600",
242
+ size: 60
243
+ }), /*#__PURE__*/React__default["default"].createElement("div", {
244
+ className: "space-y-2"
245
+ }, /*#__PURE__*/React__default["default"].createElement("div", {
246
+ className: "flex items-center space-x-4"
227
247
  }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
228
248
  className: "neeto-ui-text-gray-800 mb-0.5",
229
- style: "h3",
249
+ style: "h2",
230
250
  weight: "semibold"
231
- }, title), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
232
- className: "neeto-ui-text-gray-600 break-all",
251
+ }, title), isConnected && /*#__PURE__*/React__default["default"].createElement("div", {
252
+ className: "neeto-ui-bg-success-500 neeto-ui-text-white neeto-ui-rounded-full flex items-center justify-center p-1"
253
+ }, /*#__PURE__*/React__default["default"].createElement(neetoIcons.Check, {
254
+ size: 24
255
+ }))), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
256
+ className: "neeto-ui-text-gray-800 break-all",
233
257
  style: "body1",
234
258
  weight: "normal"
235
- }, description), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
236
- label: t("neetoIntegrations.common.disconnect"),
237
- style: "danger",
259
+ }, description), helpDocUrl && /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
260
+ className: "neeto-ui-text-gray-800 break-all",
261
+ style: "body2",
262
+ weight: "normal"
263
+ }, /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
264
+ i18nKey: "neetoIntegrations.common.helpDocUrl",
265
+ components: {
266
+ helpLink: /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
267
+ href: helpDocUrl,
268
+ style: "link",
269
+ target: "_blank"
270
+ })
271
+ },
272
+ values: {
273
+ integration: integrationName || neetoCist.humanize(integration)
274
+ }
275
+ }))), isConnected ? /*#__PURE__*/React__default["default"].createElement("div", {
276
+ className: "space-x-2"
277
+ }, managePath && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
278
+ to: managePath,
279
+ label: t("neetoIntegrations.common.manageIntegration", {
280
+ integration: integrationName || neetoCist.humanize(integration)
281
+ })
282
+ }), onDisconnect && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
283
+ style: "secondary",
284
+ label: t("neetoIntegrations.common.disconnectIntegration", {
285
+ integration: integrationName || neetoCist.humanize(integration)
286
+ }),
238
287
  onClick: function onClick() {
239
288
  return setIsDisconnectAlertOpen(true);
240
289
  }
290
+ })) : /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
291
+ disabled: isConnectDisabled,
292
+ href: connectUrl,
293
+ to: connectPath,
294
+ tooltipProps: connectTooltipProps,
295
+ label: t("neetoIntegrations.common.connectIntegration", {
296
+ integration: integrationName || neetoCist.humanize(integration)
297
+ })
241
298
  }))), /*#__PURE__*/React__default["default"].createElement(DisconnectAlert__default["default"], {
242
299
  isDisconnecting: isDisconnecting,
243
300
  onClose: onClose,
244
301
  onDisconnect: onDisconnect,
245
302
  isOpen: isDisconnectAlertOpen,
246
- message: t("neetoIntegrations.".concat(integration, ".disconnect.message")),
247
- title: t("neetoIntegrations.".concat(integration, ".disconnect.title"))
303
+ title: t("settings.integrations.".concat(integration, ".disconnect.title")),
304
+ message: disconnectMessage || t("settings.integrations.".concat(integration, ".disconnect.message"))
248
305
  }));
249
306
  });
250
307
 
308
+ [{
309
+ step: "1",
310
+ label: i18next.t("neetoIntegrations.common.connect"),
311
+ isActive: true,
312
+ isCompleted: false
313
+ }, {
314
+ step: "2",
315
+ label: i18next.t("neetoIntegrations.common.finish"),
316
+ isActive: false,
317
+ isCompleted: false
318
+ }];
319
+ ({
320
+ connect: i18next.t("neetoIntegrations.common.connect"),
321
+ finish: i18next.t("neetoIntegrations.common.finish")
322
+ });
323
+
251
324
  function _extends$1() {
252
325
  _extends$1 = Object.assign ? Object.assign.bind() : function (target) {
253
326
  for (var i = 1; i < arguments.length; i++) {
@@ -613,6 +686,7 @@ var Form = function Form(_ref) {
613
686
  i18nKey: "neetoIntegrations.daily.helpDoc",
614
687
  components: {
615
688
  externalLink: /*#__PURE__*/React__default["default"].createElement(ExternalLink$1, {
689
+ "data-cy": "api-key-help-doc-link",
616
690
  href: helpDocUrl,
617
691
  rel: "noreferrer",
618
692
  target: "_blank"
@@ -643,7 +717,8 @@ var Form = function Form(_ref) {
643
717
  var Form$1 = reactUtils.withTitle(Form, i18next__default["default"].t("neetoIntegrations.browserTitles.integrations.dailyco"));
644
718
 
645
719
  var Manage = function Manage(_ref) {
646
- var onDisconnect = _ref.onDisconnect;
720
+ var description = _ref.description,
721
+ onDisconnect = _ref.onDisconnect;
647
722
  var _useState = React.useState(false),
648
723
  _useState2 = _slicedToArray(_useState, 2),
649
724
  isDisconnectAlertOpen = _useState2[0],
@@ -653,7 +728,7 @@ var Manage = function Manage(_ref) {
653
728
  _useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
654
729
  _useFetchDaily$data2$ = _useFetchDaily$data2.metadata,
655
730
  metadata = _useFetchDaily$data2$ === void 0 ? {} : _useFetchDaily$data2$,
656
- isLoading = _useFetchDaily.isLoading;
731
+ isFetching = _useFetchDaily.isFetching;
657
732
  var _ref2 = metadata || {},
658
733
  _ref2$apiKey = _ref2.apiKey,
659
734
  apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
@@ -667,24 +742,33 @@ var Manage = function Manage(_ref) {
667
742
  }),
668
743
  destroyIntegration = _useDestroyDaily.mutate,
669
744
  isDisconnecting = _useDestroyDaily.isLoading;
745
+ var isConnected = neetoCist.isPresent(apiKey);
670
746
  var handleDisconnect = function handleDisconnect() {
671
747
  return destroyIntegration("daily");
672
748
  };
673
- if (isLoading || isDisconnecting) {
674
- return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
675
- }
676
- if (neetoCist.isNotPresent(apiKey)) {
677
- onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
678
- }
749
+ if (isFetching || isDisconnecting) return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
679
750
  return /*#__PURE__*/React__default["default"].createElement(Manage$1, {
751
+ isConnected: isConnected,
680
752
  isDisconnectAlertOpen: isDisconnectAlertOpen,
681
753
  isDisconnecting: isDisconnecting,
682
754
  setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
683
- description: t("neetoIntegrations.daily.yourApiKey", {
684
- apiKey: apiKey
755
+ Icon: misc.Daily,
756
+ connectPath: utils.buildUrl(window.location.pathname, {
757
+ connect: true
685
758
  }),
686
759
  integration: "daily",
687
- title: t("neetoIntegrations.daily.connected"),
760
+ description: isConnected ? /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
761
+ components: {
762
+ underline: /*#__PURE__*/React__default["default"].createElement("u", {
763
+ className: "font-medium"
764
+ })
765
+ },
766
+ i18nKey: "neetoIntegrations.daily.yourApiKey",
767
+ values: {
768
+ apiKey: apiKey
769
+ }
770
+ }) : description,
771
+ title: isConnected ? t("neetoIntegrations.daily.connected") : t("neetoIntegrations.daily.connect"),
688
772
  onClose: function onClose() {
689
773
  return setIsDisconnectAlertOpen(false);
690
774
  },
@@ -699,10 +783,14 @@ var Daily = function Daily(_ref) {
699
783
  helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
700
784
  _ref$videoUrl = _ref.videoUrl,
701
785
  videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
786
+ _ref$description = _ref.description,
787
+ description = _ref$description === void 0 ? "" : _ref$description,
702
788
  _ref$onConnect = _ref.onConnect,
703
789
  onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect,
704
790
  _ref$onDisconnect = _ref.onDisconnect,
705
791
  onDisconnect = _ref$onDisconnect === void 0 ? neetoCist.noop : _ref$onDisconnect;
792
+ var _useQueryParams = reactUtils.useQueryParams(),
793
+ connect = _useQueryParams.connect;
706
794
  var _useFetchDaily = useFetchDaily(),
707
795
  _useFetchDaily$data = _useFetchDaily.data,
708
796
  _useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
@@ -711,8 +799,9 @@ var Daily = function Daily(_ref) {
711
799
  var _ref2 = metadata || {},
712
800
  _ref2$apiKey = _ref2.apiKey,
713
801
  apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
714
- if (neetoCist.isPresent(apiKey) && !isOnboarding) {
802
+ if (neetoCist.isPresent(apiKey) && !isOnboarding || !connect) {
715
803
  return /*#__PURE__*/React__default["default"].createElement(Manage, {
804
+ description: description,
716
805
  onDisconnect: onDisconnect
717
806
  });
718
807
  }