@bigbinary/neeto-access-control-frontend 1.3.3 → 1.3.5
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/README.md +10 -0
- package/dist/index.cjs.js +118 -78
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +119 -79
- package/dist/index.js.map +1 -1
- package/package.json +54 -50
- package/types.d.ts +8 -0
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
3
|
-
import { useRef, useState, createElement } from 'react';
|
|
3
|
+
import { useRef, useState, createElement, Fragment as Fragment$1 } from 'react';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { truncate, humanize, isNotEmpty, noop } from '@bigbinary/neeto-cist';
|
|
6
6
|
import Container from '@bigbinary/neeto-molecules/Container';
|
|
7
7
|
import Scrollable from '@bigbinary/neeto-molecules/Scrollable';
|
|
8
|
-
import Label from '@bigbinary/neetoui/Label';
|
|
9
8
|
import Spinner from '@bigbinary/neetoui/Spinner';
|
|
10
9
|
import ActionBlock from '@bigbinary/neetoui/formik/ActionBlock';
|
|
11
10
|
import Form from '@bigbinary/neetoui/formik/Form';
|
|
12
11
|
import Input from '@bigbinary/neetoui/formik/Input';
|
|
13
12
|
import Radio from '@bigbinary/neetoui/formik/Radio';
|
|
13
|
+
import { prop, pluck, mergeDeepRight, indexBy, values, isEmpty, equals, pick, reject, pipe, trim, mergeLeft, keys } from 'ramda';
|
|
14
14
|
import { useTranslation, Trans } from 'react-i18next';
|
|
15
15
|
import { DEFAULT_STALE_TIME, DEFAULT_PAGE_INDEX, DEFAULT_PAGE_SIZE } from '@bigbinary/neeto-commons-frontend/constants';
|
|
16
16
|
import Delete from '@bigbinary/neeto-icons/Delete';
|
|
@@ -22,7 +22,6 @@ import NoData from '@bigbinary/neetoui/NoData';
|
|
|
22
22
|
import Pane from '@bigbinary/neetoui/Pane';
|
|
23
23
|
import Table from '@bigbinary/neetoui/Table';
|
|
24
24
|
import Typography from '@bigbinary/neetoui/Typography';
|
|
25
|
-
import { prop, pluck, mergeDeepRight, indexBy, values, isEmpty, equals, pick, reject, pipe, trim } from 'ramda';
|
|
26
25
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
27
26
|
import { useQuery } from '@tanstack/react-query';
|
|
28
27
|
import { useMutationWithInvalidation, withT } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
@@ -35,6 +34,7 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
|
35
34
|
import MoreDropdown from '@bigbinary/neeto-molecules/MoreDropdown';
|
|
36
35
|
import Tooltip from '@bigbinary/neetoui/Tooltip';
|
|
37
36
|
import { FieldArray } from 'formik';
|
|
37
|
+
import Label from '@bigbinary/neetoui/Label';
|
|
38
38
|
import NeetoHeader from '@bigbinary/neeto-molecules/Header';
|
|
39
39
|
import HelpPopover from '@bigbinary/neeto-molecules/HelpPopover';
|
|
40
40
|
|
|
@@ -76,14 +76,14 @@ var QUERY_KEYS = {
|
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
var _excluded = ["ownerId", "ownerType"];
|
|
79
|
-
function ownKeys$
|
|
80
|
-
function _objectSpread$
|
|
79
|
+
function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
80
|
+
function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
81
81
|
var ACCESS_CONTROL_CONFIGURATION_INVITATIONS$1 = QUERY_KEYS.ACCESS_CONTROL_CONFIGURATION_INVITATIONS;
|
|
82
82
|
var useListInvitations = function useListInvitations(_ref, options) {
|
|
83
83
|
var ownerId = _ref.ownerId,
|
|
84
84
|
ownerType = _ref.ownerType,
|
|
85
85
|
otherParams = _objectWithoutProperties(_ref, _excluded);
|
|
86
|
-
return useQuery(_objectSpread$
|
|
86
|
+
return useQuery(_objectSpread$5({
|
|
87
87
|
queryKey: [ACCESS_CONTROL_CONFIGURATION_INVITATIONS$1, ownerType, ownerId, otherParams],
|
|
88
88
|
queryFn: function queryFn() {
|
|
89
89
|
return invitationsApi.list(otherParams);
|
|
@@ -100,7 +100,7 @@ var useBulkCreateInvitations = function useBulkCreateInvitations(_ref2, options)
|
|
|
100
100
|
configurationId: configurationId,
|
|
101
101
|
payload: payload
|
|
102
102
|
});
|
|
103
|
-
}, _objectSpread$
|
|
103
|
+
}, _objectSpread$5({
|
|
104
104
|
keysToInvalidate: [[ACCESS_CONTROL_CONFIGURATION_INVITATIONS$1, ownerType, ownerId]]
|
|
105
105
|
}, options));
|
|
106
106
|
};
|
|
@@ -113,7 +113,7 @@ var useBulkDestroyInvitations = function useBulkDestroyInvitations(_ref3, option
|
|
|
113
113
|
configurationId: configurationId,
|
|
114
114
|
payload: payload
|
|
115
115
|
});
|
|
116
|
-
}, _objectSpread$
|
|
116
|
+
}, _objectSpread$5({
|
|
117
117
|
keysToInvalidate: [[ACCESS_CONTROL_CONFIGURATION_INVITATIONS$1, ownerType, ownerId]]
|
|
118
118
|
}, options));
|
|
119
119
|
};
|
|
@@ -236,6 +236,8 @@ var renderColumnData = function renderColumnData(_ref2) {
|
|
|
236
236
|
}), extraColumnsData);
|
|
237
237
|
};
|
|
238
238
|
|
|
239
|
+
function ownKeys$4(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
240
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
239
241
|
var Invitations$1 = function Invitations(_ref) {
|
|
240
242
|
var _selectedEmails$;
|
|
241
243
|
var _ref$extraColumnsData = _ref.extraColumnsData,
|
|
@@ -249,6 +251,8 @@ var Invitations$1 = function Invitations(_ref) {
|
|
|
249
251
|
onClose = _ref.onClose,
|
|
250
252
|
_ref$hideAddEmailsFor = _ref.hideAddEmailsForm,
|
|
251
253
|
hideAddEmailsForm = _ref$hideAddEmailsFor === void 0 ? false : _ref$hideAddEmailsFor,
|
|
254
|
+
_ref$inviteButtonProp = _ref.inviteButtonProps,
|
|
255
|
+
inviteButtonProps = _ref$inviteButtonProp === void 0 ? {} : _ref$inviteButtonProp,
|
|
252
256
|
_ref$onDestroyInvitat = _ref.onDestroyInvitationsSuccess,
|
|
253
257
|
onDestroyInvitationsSuccess = _ref$onDestroyInvitat === void 0 ? noop : _ref$onDestroyInvitat;
|
|
254
258
|
var _useState = useState([]),
|
|
@@ -321,8 +325,11 @@ var Invitations$1 = function Invitations(_ref) {
|
|
|
321
325
|
children: t("neetoAccessControl.titles.invitations")
|
|
322
326
|
})
|
|
323
327
|
}), /*#__PURE__*/jsxs(Pane.Body, {
|
|
324
|
-
className: "pt-2",
|
|
325
|
-
children: [
|
|
328
|
+
className: "space-y-4 pt-2",
|
|
329
|
+
children: [isNotEmpty(inviteButtonProps) && /*#__PURE__*/jsx("div", {
|
|
330
|
+
className: "flex w-full justify-end",
|
|
331
|
+
children: /*#__PURE__*/jsx(Button$1, _objectSpread$4({}, inviteButtonProps))
|
|
332
|
+
}), !hideAddEmailsForm && /*#__PURE__*/jsx(AddEmails, {
|
|
326
333
|
configurationId: configurationId,
|
|
327
334
|
ownerId: ownerId,
|
|
328
335
|
ownerType: ownerType
|
|
@@ -433,8 +440,8 @@ var configurationsApi = {
|
|
|
433
440
|
update: update
|
|
434
441
|
};
|
|
435
442
|
|
|
436
|
-
function ownKeys$
|
|
437
|
-
function _objectSpread$
|
|
443
|
+
function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
444
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
438
445
|
var ACCESS_CONTROL_CONFIGURATION = QUERY_KEYS.ACCESS_CONTROL_CONFIGURATION,
|
|
439
446
|
ACCESS_CONTROL_CONFIGURATION_INVITATIONS = QUERY_KEYS.ACCESS_CONTROL_CONFIGURATION_INVITATIONS;
|
|
440
447
|
var useShowConfiguration = function useShowConfiguration(_ref) {
|
|
@@ -461,7 +468,7 @@ var useUpdateConfiguration = function useUpdateConfiguration(_ref2, options) {
|
|
|
461
468
|
ownerType: ownerType,
|
|
462
469
|
payload: payload
|
|
463
470
|
});
|
|
464
|
-
}, _objectSpread$
|
|
471
|
+
}, _objectSpread$3({
|
|
465
472
|
keysToInvalidate: [[ACCESS_CONTROL_CONFIGURATION, ownerType, ownerId], [ACCESS_CONTROL_CONFIGURATION_INVITATIONS, ownerType, ownerId]]
|
|
466
473
|
}, options));
|
|
467
474
|
};
|
|
@@ -473,27 +480,6 @@ var AUTH = {
|
|
|
473
480
|
SESSION: "session",
|
|
474
481
|
INVITED: "invited"
|
|
475
482
|
};
|
|
476
|
-
var AUTH_OPTIONS = [{
|
|
477
|
-
label: t("neetoAccessControl.auth.no"),
|
|
478
|
-
value: AUTH.NO,
|
|
479
|
-
"data-cy": "access-control-public-access-radio-input"
|
|
480
|
-
}, {
|
|
481
|
-
label: t("neetoAccessControl.auth.basic"),
|
|
482
|
-
value: AUTH.BASIC,
|
|
483
|
-
"data-cy": "access-control-password-protected-radio-input"
|
|
484
|
-
}, {
|
|
485
|
-
label: t("neetoAccessControl.auth.invited"),
|
|
486
|
-
value: AUTH.INVITED,
|
|
487
|
-
"data-cy": "access-control-only-invited-people-radio-input"
|
|
488
|
-
}, {
|
|
489
|
-
label: t("neetoAccessControl.auth.email"),
|
|
490
|
-
value: AUTH.EMAIL,
|
|
491
|
-
"data-cy": "access-control-secure-by-email-patterns-radio-input"
|
|
492
|
-
}, {
|
|
493
|
-
label: t("neetoAccessControl.auth.session"),
|
|
494
|
-
value: AUTH.SESSION,
|
|
495
|
-
"data-cy": "access-control-logged-in-members-only-radio-input"
|
|
496
|
-
}];
|
|
497
483
|
var CONFIGURATION_VALIDATION_SCHEMA = yup.object({
|
|
498
484
|
auth: yup.string().required(t("neetoAccessControl.inputs.validation.authRequired")),
|
|
499
485
|
password: yup.string().nullable().when("auth", {
|
|
@@ -511,6 +497,8 @@ var DEFAULT_CONFIGURATION_VALUES = {
|
|
|
511
497
|
allowedKeywords: [""]
|
|
512
498
|
};
|
|
513
499
|
|
|
500
|
+
function ownKeys$2(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
501
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
514
502
|
var buildConfigurationInitialValues = function buildConfigurationInitialValues(configuration) {
|
|
515
503
|
if (configuration.auth === AUTH.NO) {
|
|
516
504
|
return DEFAULT_CONFIGURATION_VALUES;
|
|
@@ -558,6 +546,46 @@ var renderLabelWithViewInvitation = function renderLabelWithViewInvitation(_ref2
|
|
|
558
546
|
}
|
|
559
547
|
});
|
|
560
548
|
};
|
|
549
|
+
var getAuthOptions = function getAuthOptions(_ref3) {
|
|
550
|
+
var translationContext = _ref3.translationContext,
|
|
551
|
+
transProps = _ref3.transProps;
|
|
552
|
+
return [{
|
|
553
|
+
label: /*#__PURE__*/jsx(Trans, _objectSpread$2({
|
|
554
|
+
context: translationContext,
|
|
555
|
+
i18nKey: "neetoAccessControl.auth.no"
|
|
556
|
+
}, transProps[AUTH.NO])),
|
|
557
|
+
value: AUTH.NO,
|
|
558
|
+
"data-cy": "access-control-public-access-radio-input"
|
|
559
|
+
}, {
|
|
560
|
+
label: /*#__PURE__*/jsx(Trans, _objectSpread$2({
|
|
561
|
+
context: translationContext,
|
|
562
|
+
i18nKey: "neetoAccessControl.auth.basic"
|
|
563
|
+
}, transProps[AUTH.BASIC])),
|
|
564
|
+
value: AUTH.BASIC,
|
|
565
|
+
"data-cy": "access-control-password-protected-radio-input"
|
|
566
|
+
}, {
|
|
567
|
+
label: /*#__PURE__*/jsx(Trans, _objectSpread$2({
|
|
568
|
+
context: translationContext,
|
|
569
|
+
i18nKey: "neetoAccessControl.auth.invited"
|
|
570
|
+
}, transProps[AUTH.INVITED])),
|
|
571
|
+
value: AUTH.INVITED,
|
|
572
|
+
"data-cy": "access-control-only-invited-people-radio-input"
|
|
573
|
+
}, {
|
|
574
|
+
label: /*#__PURE__*/jsx(Trans, _objectSpread$2({
|
|
575
|
+
context: translationContext,
|
|
576
|
+
i18nKey: "neetoAccessControl.auth.email"
|
|
577
|
+
}, transProps[AUTH.EMAIL])),
|
|
578
|
+
value: AUTH.EMAIL,
|
|
579
|
+
"data-cy": "access-control-secure-by-email-patterns-radio-input"
|
|
580
|
+
}, {
|
|
581
|
+
label: /*#__PURE__*/jsx(Trans, _objectSpread$2({
|
|
582
|
+
context: translationContext,
|
|
583
|
+
i18nKey: "neetoAccessControl.auth.session"
|
|
584
|
+
}, transProps[AUTH.SESSION])),
|
|
585
|
+
value: AUTH.SESSION,
|
|
586
|
+
"data-cy": "access-control-logged-in-members-only-radio-input"
|
|
587
|
+
}];
|
|
588
|
+
};
|
|
561
589
|
|
|
562
590
|
var AllowedKeywords = withT(function (_ref) {
|
|
563
591
|
var t = _ref.t,
|
|
@@ -650,11 +678,20 @@ var Configuration = function Configuration(_ref) {
|
|
|
650
678
|
hideAddEmailsFromInvitationPane = _ref$hideAddEmailsFro === void 0 ? false : _ref$hideAddEmailsFro,
|
|
651
679
|
_ref$onDestroyInvitat = _ref.onDestroyInvitationsSuccess,
|
|
652
680
|
onDestroyInvitationsSuccess = _ref$onDestroyInvitat === void 0 ? noop : _ref$onDestroyInvitat,
|
|
653
|
-
|
|
681
|
+
_ref$inviteButtonProp = _ref.inviteButtonProps,
|
|
682
|
+
inviteButtonProps = _ref$inviteButtonProp === void 0 ? {} : _ref$inviteButtonProp,
|
|
683
|
+
_ref$additionalFields = _ref.additionalFieldsInitialValues,
|
|
684
|
+
additionalFieldsInitialValues = _ref$additionalFields === void 0 ? {} : _ref$additionalFields,
|
|
685
|
+
children = _ref.children,
|
|
686
|
+
fieldsWrapper = _ref.fieldsWrapper,
|
|
687
|
+
translationContext = _ref.translationContext,
|
|
688
|
+
_ref$transProps = _ref.transProps,
|
|
689
|
+
transProps = _ref$transProps === void 0 ? {} : _ref$transProps;
|
|
654
690
|
var _useState = useState(false),
|
|
655
691
|
_useState2 = _slicedToArray(_useState, 2),
|
|
656
|
-
|
|
657
|
-
|
|
692
|
+
showInvitationsPane = _useState2[0],
|
|
693
|
+
setShowInvitationsPane = _useState2[1];
|
|
694
|
+
var FieldsWrapper = fieldsWrapper || Fragment$1;
|
|
658
695
|
var _useTranslation = useTranslation(),
|
|
659
696
|
t = _useTranslation.t;
|
|
660
697
|
var _useShowConfiguration = useShowConfiguration({
|
|
@@ -665,7 +702,7 @@ var Configuration = function Configuration(_ref) {
|
|
|
665
702
|
configuration = _useShowConfiguration2 === void 0 ? {} : _useShowConfiguration2,
|
|
666
703
|
isLoading = _useShowConfiguration.isLoading,
|
|
667
704
|
isFetching = _useShowConfiguration.isFetching;
|
|
668
|
-
var configurationInitialValues = buildConfigurationInitialValues(configuration);
|
|
705
|
+
var configurationInitialValues = mergeLeft(buildConfigurationInitialValues(configuration), additionalFieldsInitialValues);
|
|
669
706
|
var _useUpdateConfigurati = useUpdateConfiguration({
|
|
670
707
|
ownerId: ownerId,
|
|
671
708
|
ownerType: ownerType
|
|
@@ -683,7 +720,7 @@ var Configuration = function Configuration(_ref) {
|
|
|
683
720
|
updateConfiguration = _useUpdateConfigurati.mutate;
|
|
684
721
|
var handleSubmit = function handleSubmit(values, _ref2) {
|
|
685
722
|
var setSubmitting = _ref2.setSubmitting;
|
|
686
|
-
var payload = buildPayload(values);
|
|
723
|
+
var payload = mergeLeft(buildPayload(values), pick(keys(additionalFieldsInitialValues), values));
|
|
687
724
|
updateConfiguration(payload, {
|
|
688
725
|
onSettled: function onSettled() {
|
|
689
726
|
return setSubmitting(false);
|
|
@@ -691,7 +728,7 @@ var Configuration = function Configuration(_ref) {
|
|
|
691
728
|
});
|
|
692
729
|
};
|
|
693
730
|
var handleShowInvitations = onConfigurationChangedToInviteOnly === noop ? function () {
|
|
694
|
-
return
|
|
731
|
+
return setShowInvitationsPane(true);
|
|
695
732
|
} : onConfigurationChangedToInviteOnly;
|
|
696
733
|
return /*#__PURE__*/jsxs(Container, {
|
|
697
734
|
children: [/*#__PURE__*/jsx(Header, {
|
|
@@ -713,44 +750,46 @@ var Configuration = function Configuration(_ref) {
|
|
|
713
750
|
children: function children(_ref3) {
|
|
714
751
|
var values = _ref3.values;
|
|
715
752
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
716
|
-
children: [/*#__PURE__*/
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
"items-start": (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === props.value && (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === AUTH.INVITED
|
|
727
|
-
}),
|
|
728
|
-
label: (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === props.value && (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === AUTH.INVITED ? renderLabelWithViewInvitation({
|
|
729
|
-
onViewInvites: function onViewInvites() {
|
|
730
|
-
return setShowInviationsPane(true);
|
|
731
|
-
}
|
|
732
|
-
}) : props.label,
|
|
733
|
-
labelProps: {
|
|
753
|
+
children: [/*#__PURE__*/jsxs(FieldsWrapper, {
|
|
754
|
+
children: [/*#__PURE__*/jsx(Radio, {
|
|
755
|
+
stacked: true,
|
|
756
|
+
name: "auth",
|
|
757
|
+
children: getAuthOptions({
|
|
758
|
+
translationContext: translationContext,
|
|
759
|
+
transProps: transProps
|
|
760
|
+
}).map(function (props) {
|
|
761
|
+
return /*#__PURE__*/createElement(Radio.Item, _objectSpread(_objectSpread({}, props), {}, {
|
|
762
|
+
key: props.value,
|
|
734
763
|
className: classNames({
|
|
735
|
-
"
|
|
736
|
-
})
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
764
|
+
"items-start": (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === props.value && (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === AUTH.INVITED
|
|
765
|
+
}),
|
|
766
|
+
label: (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === props.value && (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === AUTH.INVITED ? renderLabelWithViewInvitation({
|
|
767
|
+
onViewInvites: function onViewInvites() {
|
|
768
|
+
return setShowInvitationsPane(true);
|
|
769
|
+
}
|
|
770
|
+
}) : props.label,
|
|
771
|
+
labelProps: {
|
|
772
|
+
className: classNames({
|
|
773
|
+
"flex flex-col items-start justify-start": (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === props.value && (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === AUTH.INVITED
|
|
774
|
+
})
|
|
775
|
+
}
|
|
776
|
+
}));
|
|
777
|
+
})
|
|
778
|
+
}), values.auth === AUTH.BASIC && /*#__PURE__*/jsx("div", {
|
|
779
|
+
className: "space-y-4 pb-2",
|
|
780
|
+
children: /*#__PURE__*/jsx(Input, {
|
|
781
|
+
autoFocus: true,
|
|
782
|
+
required: true,
|
|
783
|
+
unlimitedChars: true,
|
|
784
|
+
className: "w-7/12",
|
|
785
|
+
label: t("neetoAccessControl.inputs.labels.password"),
|
|
786
|
+
name: "password",
|
|
787
|
+
placeholder: t("neetoAccessControl.inputs.placeholders.enterPassword")
|
|
788
|
+
})
|
|
789
|
+
}), values.auth === AUTH.EMAIL && /*#__PURE__*/jsx(AllowedKeywords, {
|
|
790
|
+
label: t("neetoAccessControl.inputs.labels.keywords"),
|
|
791
|
+
name: "allowedKeywords"
|
|
792
|
+
})]
|
|
754
793
|
}), /*#__PURE__*/jsx(ActionBlock, {
|
|
755
794
|
cancelButtonProps: {
|
|
756
795
|
onClick: handleCancel
|
|
@@ -762,15 +801,16 @@ var Configuration = function Configuration(_ref) {
|
|
|
762
801
|
});
|
|
763
802
|
}
|
|
764
803
|
}), /*#__PURE__*/jsx(Invitations$1, {
|
|
804
|
+
inviteButtonProps: inviteButtonProps,
|
|
765
805
|
onDestroyInvitationsSuccess: onDestroyInvitationsSuccess,
|
|
766
806
|
ownerId: ownerId,
|
|
767
807
|
ownerType: ownerType,
|
|
768
808
|
configurationId: configuration.id,
|
|
769
809
|
extraColumnsData: invitationsTableExtraColumnsData,
|
|
770
810
|
hideAddEmailsForm: hideAddEmailsFromInvitationPane,
|
|
771
|
-
isOpen:
|
|
811
|
+
isOpen: showInvitationsPane && !isFetching,
|
|
772
812
|
onClose: function onClose() {
|
|
773
|
-
return
|
|
813
|
+
return setShowInvitationsPane(false);
|
|
774
814
|
}
|
|
775
815
|
}), children]
|
|
776
816
|
})]
|