@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
|
@@ -10,7 +10,6 @@ var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
|
10
10
|
var constants = require('@bigbinary/neeto-commons-frontend/constants');
|
|
11
11
|
var reactQuery = require('react-query');
|
|
12
12
|
var axios = require('axios');
|
|
13
|
-
var pure = require('@bigbinary/neeto-commons-frontend/pure');
|
|
14
13
|
var utils = require('@bigbinary/neeto-commons-frontend/utils');
|
|
15
14
|
var misc = require('@bigbinary/neeto-icons/misc');
|
|
16
15
|
var neetoui = require('@bigbinary/neetoui');
|
|
@@ -20,6 +19,7 @@ require('ramda');
|
|
|
20
19
|
var yup = require('yup');
|
|
21
20
|
var PageLoader = require('@bigbinary/neeto-molecules/PageLoader');
|
|
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
|
|
|
@@ -163,6 +163,115 @@ function _slicedToArray(arr, i) {
|
|
|
163
163
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
+
var Manage$1 = reactUtils.withT(function (_ref) {
|
|
167
|
+
var t = _ref.t,
|
|
168
|
+
_ref$title = _ref.title,
|
|
169
|
+
title = _ref$title === void 0 ? "" : _ref$title,
|
|
170
|
+
_ref$description = _ref.description,
|
|
171
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
172
|
+
_ref$integration = _ref.integration,
|
|
173
|
+
integration = _ref$integration === void 0 ? "" : _ref$integration,
|
|
174
|
+
_ref$isDisconnectAler = _ref.isDisconnectAlertOpen,
|
|
175
|
+
isDisconnectAlertOpen = _ref$isDisconnectAler === void 0 ? false : _ref$isDisconnectAler,
|
|
176
|
+
_ref$setIsDisconnectA = _ref.setIsDisconnectAlertOpen,
|
|
177
|
+
setIsDisconnectAlertOpen = _ref$setIsDisconnectA === void 0 ? neetoCist.noop : _ref$setIsDisconnectA,
|
|
178
|
+
_ref$isDisconnecting = _ref.isDisconnecting,
|
|
179
|
+
isDisconnecting = _ref$isDisconnecting === void 0 ? false : _ref$isDisconnecting,
|
|
180
|
+
_ref$onDisconnect = _ref.onDisconnect,
|
|
181
|
+
onDisconnect = _ref$onDisconnect === void 0 ? neetoCist.noop : _ref$onDisconnect,
|
|
182
|
+
_ref$onClose = _ref.onClose,
|
|
183
|
+
onClose = _ref$onClose === void 0 ? neetoCist.noop : _ref$onClose,
|
|
184
|
+
_ref$Icon = _ref.Icon,
|
|
185
|
+
Icon = _ref$Icon === void 0 ? null : _ref$Icon,
|
|
186
|
+
_ref$isConnected = _ref.isConnected,
|
|
187
|
+
isConnected = _ref$isConnected === void 0 ? false : _ref$isConnected,
|
|
188
|
+
_ref$connectPath = _ref.connectPath,
|
|
189
|
+
connectPath = _ref$connectPath === void 0 ? "" : _ref$connectPath,
|
|
190
|
+
_ref$connectUrl = _ref.connectUrl,
|
|
191
|
+
connectUrl = _ref$connectUrl === void 0 ? "" : _ref$connectUrl,
|
|
192
|
+
_ref$helpDocUrl = _ref.helpDocUrl,
|
|
193
|
+
helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
|
|
194
|
+
_ref$managePath = _ref.managePath,
|
|
195
|
+
managePath = _ref$managePath === void 0 ? "" : _ref$managePath,
|
|
196
|
+
_ref$integrationName = _ref.integrationName,
|
|
197
|
+
integrationName = _ref$integrationName === void 0 ? "" : _ref$integrationName,
|
|
198
|
+
_ref$disconnectMessag = _ref.disconnectMessage,
|
|
199
|
+
disconnectMessage = _ref$disconnectMessag === void 0 ? "" : _ref$disconnectMessag,
|
|
200
|
+
_ref$isConnectDisable = _ref.isConnectDisabled,
|
|
201
|
+
isConnectDisabled = _ref$isConnectDisable === void 0 ? false : _ref$isConnectDisable,
|
|
202
|
+
_ref$connectTooltipPr = _ref.connectTooltipProps,
|
|
203
|
+
connectTooltipProps = _ref$connectTooltipPr === void 0 ? null : _ref$connectTooltipPr;
|
|
204
|
+
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
205
|
+
className: "mx-auto w-full max-w-3xl"
|
|
206
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
207
|
+
className: "neeto-ui-border-gray-300 neeto-ui-rounded-xl mt-10 w-full space-y-4 border p-6"
|
|
208
|
+
}, Icon && /*#__PURE__*/React__default["default"].createElement(Icon, {
|
|
209
|
+
className: "neeto-ui-text-gray-600",
|
|
210
|
+
size: 60
|
|
211
|
+
}), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
212
|
+
className: "space-y-2"
|
|
213
|
+
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
214
|
+
className: "flex items-center space-x-4"
|
|
215
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
216
|
+
className: "neeto-ui-text-gray-800 mb-0.5",
|
|
217
|
+
style: "h2",
|
|
218
|
+
weight: "semibold"
|
|
219
|
+
}, title), isConnected && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
220
|
+
className: "neeto-ui-bg-success-500 neeto-ui-text-white neeto-ui-rounded-full flex items-center justify-center p-1"
|
|
221
|
+
}, /*#__PURE__*/React__default["default"].createElement(neetoIcons.Check, {
|
|
222
|
+
size: 24
|
|
223
|
+
}))), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
224
|
+
className: "neeto-ui-text-gray-800 break-all",
|
|
225
|
+
style: "body1",
|
|
226
|
+
weight: "normal"
|
|
227
|
+
}, description), helpDocUrl && /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
228
|
+
className: "neeto-ui-text-gray-800 break-all",
|
|
229
|
+
style: "body2",
|
|
230
|
+
weight: "normal"
|
|
231
|
+
}, /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
232
|
+
i18nKey: "settings.integrations.common.helpDocUrl",
|
|
233
|
+
components: {
|
|
234
|
+
helpLink: /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
235
|
+
href: helpDocUrl,
|
|
236
|
+
style: "link"
|
|
237
|
+
})
|
|
238
|
+
},
|
|
239
|
+
values: {
|
|
240
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
241
|
+
}
|
|
242
|
+
}))), isConnected ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
243
|
+
className: "space-x-2"
|
|
244
|
+
}, managePath && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
245
|
+
to: managePath,
|
|
246
|
+
label: t("settings.integrations.common.manageIntegration", {
|
|
247
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
248
|
+
})
|
|
249
|
+
}), onDisconnect && /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
250
|
+
style: "danger",
|
|
251
|
+
label: t("settings.integrations.common.disconnectIntegration", {
|
|
252
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
253
|
+
}),
|
|
254
|
+
onClick: function onClick() {
|
|
255
|
+
return setIsDisconnectAlertOpen(true);
|
|
256
|
+
}
|
|
257
|
+
})) : /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
258
|
+
disabled: isConnectDisabled,
|
|
259
|
+
href: connectUrl,
|
|
260
|
+
to: connectPath,
|
|
261
|
+
tooltipProps: connectTooltipProps,
|
|
262
|
+
label: t("settings.integrations.common.connectIntegration", {
|
|
263
|
+
integration: integrationName !== null && integrationName !== void 0 ? integrationName : neetoCist.humanize(integration)
|
|
264
|
+
})
|
|
265
|
+
}))), /*#__PURE__*/React__default["default"].createElement(DisconnectAlert__default["default"], {
|
|
266
|
+
isDisconnecting: isDisconnecting,
|
|
267
|
+
onClose: onClose,
|
|
268
|
+
onDisconnect: onDisconnect,
|
|
269
|
+
isOpen: isDisconnectAlertOpen,
|
|
270
|
+
title: t("settings.integrations.".concat(integration, ".disconnect.title")),
|
|
271
|
+
message: disconnectMessage !== null && disconnectMessage !== void 0 ? disconnectMessage : t("settings.integrations.".concat(integration, ".disconnect.message"))
|
|
272
|
+
}));
|
|
273
|
+
});
|
|
274
|
+
|
|
166
275
|
var INTEGRATIONS_ENGINE_BASE_URL = "/neeto_integrations";
|
|
167
276
|
var INTEGRATIONS_ENGINE_DAILY_URL = "".concat(INTEGRATIONS_ENGINE_BASE_URL, "/daily");
|
|
168
277
|
|
|
@@ -323,6 +432,7 @@ var Form = function Form(_ref) {
|
|
|
323
432
|
i18nKey: "neetoIntegrations.daily.helpDoc",
|
|
324
433
|
components: {
|
|
325
434
|
externalLink: /*#__PURE__*/React__default["default"].createElement(ExternalLink$1, {
|
|
435
|
+
"data-cy": "api-key-help-doc-link",
|
|
326
436
|
href: helpDocUrl,
|
|
327
437
|
rel: "noreferrer",
|
|
328
438
|
target: "_blank"
|
|
@@ -352,46 +462,9 @@ var Form = function Form(_ref) {
|
|
|
352
462
|
};
|
|
353
463
|
var Form$1 = reactUtils.withTitle(Form, i18next__default["default"].t("neetoIntegrations.browserTitles.integrations.dailyco"));
|
|
354
464
|
|
|
355
|
-
var Manage$1 = reactUtils.withT(function (_ref) {
|
|
356
|
-
var t = _ref.t,
|
|
357
|
-
title = _ref.title,
|
|
358
|
-
description = _ref.description,
|
|
359
|
-
integration = _ref.integration,
|
|
360
|
-
isDisconnectAlertOpen = _ref.isDisconnectAlertOpen,
|
|
361
|
-
setIsDisconnectAlertOpen = _ref.setIsDisconnectAlertOpen,
|
|
362
|
-
isDisconnecting = _ref.isDisconnecting,
|
|
363
|
-
onDisconnect = _ref.onDisconnect,
|
|
364
|
-
onClose = _ref.onClose;
|
|
365
|
-
return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
366
|
-
className: "mx-auto w-full max-w-md"
|
|
367
|
-
}, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
368
|
-
className: "mt-10 w-full space-y-4"
|
|
369
|
-
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
370
|
-
className: "neeto-ui-text-gray-800 mb-0.5",
|
|
371
|
-
style: "h3",
|
|
372
|
-
weight: "semibold"
|
|
373
|
-
}, title), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
374
|
-
className: "neeto-ui-text-gray-600 break-all",
|
|
375
|
-
style: "body1",
|
|
376
|
-
weight: "normal"
|
|
377
|
-
}, description), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|
|
378
|
-
label: t("neetoIntegrations.common.disconnect"),
|
|
379
|
-
style: "danger",
|
|
380
|
-
onClick: function onClick() {
|
|
381
|
-
return setIsDisconnectAlertOpen(true);
|
|
382
|
-
}
|
|
383
|
-
}))), /*#__PURE__*/React__default["default"].createElement(DisconnectAlert__default["default"], {
|
|
384
|
-
isDisconnecting: isDisconnecting,
|
|
385
|
-
onClose: onClose,
|
|
386
|
-
onDisconnect: onDisconnect,
|
|
387
|
-
isOpen: isDisconnectAlertOpen,
|
|
388
|
-
message: t("neetoIntegrations.".concat(integration, ".disconnect.message")),
|
|
389
|
-
title: t("neetoIntegrations.".concat(integration, ".disconnect.title"))
|
|
390
|
-
}));
|
|
391
|
-
});
|
|
392
|
-
|
|
393
465
|
var Manage = function Manage(_ref) {
|
|
394
|
-
var
|
|
466
|
+
var description = _ref.description,
|
|
467
|
+
onDisconnect = _ref.onDisconnect;
|
|
395
468
|
var _useState = React.useState(false),
|
|
396
469
|
_useState2 = _slicedToArray(_useState, 2),
|
|
397
470
|
isDisconnectAlertOpen = _useState2[0],
|
|
@@ -401,7 +474,7 @@ var Manage = function Manage(_ref) {
|
|
|
401
474
|
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
402
475
|
_useFetchDaily$data2$ = _useFetchDaily$data2.metadata,
|
|
403
476
|
metadata = _useFetchDaily$data2$ === void 0 ? {} : _useFetchDaily$data2$,
|
|
404
|
-
|
|
477
|
+
isFetching = _useFetchDaily.isFetching;
|
|
405
478
|
var _ref2 = metadata || {},
|
|
406
479
|
_ref2$apiKey = _ref2.apiKey,
|
|
407
480
|
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
@@ -415,24 +488,33 @@ var Manage = function Manage(_ref) {
|
|
|
415
488
|
}),
|
|
416
489
|
destroyIntegration = _useDestroyDaily.mutate,
|
|
417
490
|
isDisconnecting = _useDestroyDaily.isLoading;
|
|
491
|
+
var isConnected = neetoCist.isPresent(apiKey);
|
|
418
492
|
var handleDisconnect = function handleDisconnect() {
|
|
419
493
|
return destroyIntegration("daily");
|
|
420
494
|
};
|
|
421
|
-
if (
|
|
422
|
-
return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
423
|
-
}
|
|
424
|
-
if (neetoCist.isNotPresent(apiKey)) {
|
|
425
|
-
onDisconnect === null || onDisconnect === void 0 ? void 0 : onDisconnect();
|
|
426
|
-
}
|
|
495
|
+
if (isFetching || isDisconnecting) return /*#__PURE__*/React__default["default"].createElement(PageLoader__default["default"], null);
|
|
427
496
|
return /*#__PURE__*/React__default["default"].createElement(Manage$1, {
|
|
497
|
+
isConnected: isConnected,
|
|
428
498
|
isDisconnectAlertOpen: isDisconnectAlertOpen,
|
|
429
499
|
isDisconnecting: isDisconnecting,
|
|
430
500
|
setIsDisconnectAlertOpen: setIsDisconnectAlertOpen,
|
|
431
|
-
|
|
432
|
-
|
|
501
|
+
Icon: misc.Daily,
|
|
502
|
+
connectPath: utils.buildUrl(window.location.pathname, {
|
|
503
|
+
connect: true
|
|
433
504
|
}),
|
|
434
505
|
integration: "daily",
|
|
435
|
-
|
|
506
|
+
description: isConnected ? /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
507
|
+
components: {
|
|
508
|
+
underline: /*#__PURE__*/React__default["default"].createElement("u", {
|
|
509
|
+
className: "font-medium"
|
|
510
|
+
})
|
|
511
|
+
},
|
|
512
|
+
i18nKey: "neetoIntegrations.daily.yourApiKey",
|
|
513
|
+
values: {
|
|
514
|
+
apiKey: apiKey
|
|
515
|
+
}
|
|
516
|
+
}) : description,
|
|
517
|
+
title: isConnected ? t("neetoIntegrations.daily.connected") : t("neetoIntegrations.daily.connect"),
|
|
436
518
|
onClose: function onClose() {
|
|
437
519
|
return setIsDisconnectAlertOpen(false);
|
|
438
520
|
},
|
|
@@ -447,10 +529,14 @@ var Daily = function Daily(_ref) {
|
|
|
447
529
|
helpDocUrl = _ref$helpDocUrl === void 0 ? "" : _ref$helpDocUrl,
|
|
448
530
|
_ref$videoUrl = _ref.videoUrl,
|
|
449
531
|
videoUrl = _ref$videoUrl === void 0 ? "" : _ref$videoUrl,
|
|
532
|
+
_ref$description = _ref.description,
|
|
533
|
+
description = _ref$description === void 0 ? "" : _ref$description,
|
|
450
534
|
_ref$onConnect = _ref.onConnect,
|
|
451
535
|
onConnect = _ref$onConnect === void 0 ? neetoCist.noop : _ref$onConnect,
|
|
452
536
|
_ref$onDisconnect = _ref.onDisconnect,
|
|
453
537
|
onDisconnect = _ref$onDisconnect === void 0 ? neetoCist.noop : _ref$onDisconnect;
|
|
538
|
+
var _useQueryParams = reactUtils.useQueryParams(),
|
|
539
|
+
connect = _useQueryParams.connect;
|
|
454
540
|
var _useFetchDaily = useFetchDaily(),
|
|
455
541
|
_useFetchDaily$data = _useFetchDaily.data,
|
|
456
542
|
_useFetchDaily$data2 = _useFetchDaily$data === void 0 ? {} : _useFetchDaily$data,
|
|
@@ -459,8 +545,9 @@ var Daily = function Daily(_ref) {
|
|
|
459
545
|
var _ref2 = metadata || {},
|
|
460
546
|
_ref2$apiKey = _ref2.apiKey,
|
|
461
547
|
apiKey = _ref2$apiKey === void 0 ? null : _ref2$apiKey;
|
|
462
|
-
if (neetoCist.isPresent(apiKey) && !isOnboarding) {
|
|
548
|
+
if (neetoCist.isPresent(apiKey) && !isOnboarding || !connect) {
|
|
463
549
|
return /*#__PURE__*/React__default["default"].createElement(Manage, {
|
|
550
|
+
description: description,
|
|
464
551
|
onDisconnect: onDisconnect
|
|
465
552
|
});
|
|
466
553
|
}
|
|
@@ -822,7 +909,7 @@ var GoogleCalendar = function GoogleCalendar(_ref) {
|
|
|
822
909
|
setSteps = _useState2[1];
|
|
823
910
|
var _getQueryParams = utils.getQueryParams(),
|
|
824
911
|
status = _getQueryParams.status;
|
|
825
|
-
var activeTab =
|
|
912
|
+
var activeTab = neetoCist.isPresent(status) ? STEPS.finish : STEPS.connect;
|
|
826
913
|
React.useEffect(function () {
|
|
827
914
|
setSteps(function () {
|
|
828
915
|
var stepsClone = _toConsumableArray(steps);
|
|
@@ -842,15 +929,15 @@ var GoogleCalendar = function GoogleCalendar(_ref) {
|
|
|
842
929
|
isOpen: true,
|
|
843
930
|
onClose: handleClose
|
|
844
931
|
}, activeTab === STEPS.connect && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
845
|
-
className: "
|
|
932
|
+
className: "w-full max-w-2xl mx-auto"
|
|
846
933
|
}, /*#__PURE__*/React__default["default"].createElement(misc.GoogleCalendar, {
|
|
847
934
|
size: 42
|
|
848
935
|
}), /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
|
|
849
|
-
className: "neeto-ui-text-gray-800
|
|
936
|
+
className: "mt-6 mb-3 neeto-ui-text-gray-800",
|
|
850
937
|
style: "h2",
|
|
851
938
|
weight: "semibold"
|
|
852
939
|
}, t("neetoIntegrations.google.connect.title")), /*#__PURE__*/React__default["default"].createElement("div", {
|
|
853
|
-
className: "flex
|
|
940
|
+
className: "flex flex-col items-start w-full pt-2"
|
|
854
941
|
}, /*#__PURE__*/React__default["default"].createElement(neetoui.Callout, {
|
|
855
942
|
className: "block leading-5"
|
|
856
943
|
}, /*#__PURE__*/React__default["default"].createElement(reactI18next.Trans, {
|
|
@@ -862,7 +949,7 @@ var GoogleCalendar = function GoogleCalendar(_ref) {
|
|
|
862
949
|
selectCheckbox: t("neetoIntegrations.google.connect.selectCheckbox")
|
|
863
950
|
}
|
|
864
951
|
})), permissionImage && /*#__PURE__*/React__default["default"].createElement("div", {
|
|
865
|
-
className: "neeto-ui-border-gray-300
|
|
952
|
+
className: "my-4 border neeto-ui-border-gray-300"
|
|
866
953
|
}, /*#__PURE__*/React__default["default"].createElement("img", {
|
|
867
954
|
src: permissionImage
|
|
868
955
|
}))), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
|