@bigbinary/neeto-access-control-frontend 1.7.7 → 2.0.1
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/ar.json +5 -2
- package/app/javascript/src/translations/bg.json +5 -2
- package/app/javascript/src/translations/ca.json +5 -2
- package/app/javascript/src/translations/cs.json +5 -2
- package/app/javascript/src/translations/da.json +5 -2
- package/app/javascript/src/translations/de.json +5 -2
- package/app/javascript/src/translations/en.json +3 -0
- package/app/javascript/src/translations/es-MX.json +5 -2
- package/app/javascript/src/translations/es.json +5 -2
- package/app/javascript/src/translations/et.json +5 -2
- package/app/javascript/src/translations/fi.json +5 -2
- package/app/javascript/src/translations/fil.json +5 -2
- package/app/javascript/src/translations/fr.json +5 -2
- package/app/javascript/src/translations/he.json +5 -2
- package/app/javascript/src/translations/hi.json +5 -2
- package/app/javascript/src/translations/hr.json +5 -2
- package/app/javascript/src/translations/hu.json +5 -2
- package/app/javascript/src/translations/id.json +5 -2
- package/app/javascript/src/translations/it.json +5 -2
- package/app/javascript/src/translations/ja.json +5 -2
- package/app/javascript/src/translations/ko.json +5 -2
- package/app/javascript/src/translations/lv.json +5 -2
- package/app/javascript/src/translations/nl.json +5 -2
- package/app/javascript/src/translations/pl.json +5 -2
- package/app/javascript/src/translations/pt-BR.json +5 -2
- package/app/javascript/src/translations/pt.json +5 -2
- package/app/javascript/src/translations/ro.json +5 -2
- package/app/javascript/src/translations/ru.json +5 -2
- package/app/javascript/src/translations/sk.json +5 -2
- package/app/javascript/src/translations/sl.json +5 -2
- package/app/javascript/src/translations/sv.json +5 -2
- package/app/javascript/src/translations/th.json +5 -2
- package/app/javascript/src/translations/tr.json +7 -3
- package/app/javascript/src/translations/uk.json +5 -2
- package/app/javascript/src/translations/vi.json +5 -2
- package/app/javascript/src/translations/zh-CN.json +5 -2
- package/app/javascript/src/translations/zh-TW.json +5 -2
- package/dist/.ready +1 -1
- package/dist/cjs/index.js +10 -20
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/v2/index.js +111 -101
- package/dist/cjs/v2/index.js.map +1 -1
- package/dist/index.js +10 -20
- package/dist/index.js.map +1 -1
- package/dist/{useConfigurationsApi-DGFFiq3w.js → useConfigurationsApi-BL4w-Zvl.js} +10 -18
- package/dist/useConfigurationsApi-BL4w-Zvl.js.map +1 -0
- package/dist/{useConfigurationsApi-DeqVxieL.js → useConfigurationsApi-DwcTDXck.js} +10 -18
- package/dist/useConfigurationsApi-DwcTDXck.js.map +1 -0
- package/dist/v2/index.js +111 -101
- package/dist/v2/index.js.map +1 -1
- package/package.json +13 -12
- package/dist/useConfigurationsApi-DGFFiq3w.js.map +0 -1
- package/dist/useConfigurationsApi-DeqVxieL.js.map +0 -1
package/dist/cjs/v2/index.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var useConfigurationsApi = require('../../useConfigurationsApi-
|
|
4
|
-
var
|
|
3
|
+
var useConfigurationsApi = require('../../useConfigurationsApi-DwcTDXck.js');
|
|
4
|
+
var _regenerator = require('@babel/runtime/helpers/regenerator');
|
|
5
|
+
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
5
6
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
7
|
var _asyncToGenerator = require('@babel/runtime/helpers/asyncToGenerator');
|
|
7
8
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
8
|
-
var _regeneratorRuntime = require('@babel/runtime/regenerator');
|
|
9
9
|
var react = require('react');
|
|
10
10
|
var classNames = require('classnames');
|
|
11
|
+
var lucideReact = require('lucide-react');
|
|
11
12
|
var neetoAtoms = require('@bigbinary/neeto-atoms');
|
|
12
13
|
var formik$1 = require('@bigbinary/neeto-atoms/formik');
|
|
13
14
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
@@ -23,7 +24,6 @@ var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
|
23
24
|
var MoreDropdown = require('@bigbinary/neeto-molecules/v2/MoreDropdown');
|
|
24
25
|
var jsxRuntime = require('react/jsx-runtime');
|
|
25
26
|
var reactQuery = require('@tanstack/react-query');
|
|
26
|
-
var lucideReact = require('lucide-react');
|
|
27
27
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
28
28
|
var constants = require('@bigbinary/neeto-commons-frontend/v2/constants');
|
|
29
29
|
var SubHeader = require('@bigbinary/neeto-molecules/v2/SubHeader');
|
|
@@ -137,7 +137,8 @@ var defaultColumnData = function defaultColumnData(_ref) {
|
|
|
137
137
|
"data-testid": "invitation-delete-menu-item",
|
|
138
138
|
onClick: function onClick() {
|
|
139
139
|
return onRevoke(inviteData);
|
|
140
|
-
}
|
|
140
|
+
},
|
|
141
|
+
variant: "destructive"
|
|
141
142
|
}])
|
|
142
143
|
})]
|
|
143
144
|
});
|
|
@@ -477,6 +478,7 @@ var InvitedList = function InvitedList(_ref) {
|
|
|
477
478
|
className: "flex h-full w-full justify-center",
|
|
478
479
|
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Empty, {
|
|
479
480
|
icon: lucideReact.Users,
|
|
481
|
+
illustration: "contacts",
|
|
480
482
|
title: t("neetoAccessControl.labels.noOneInvitedYet")
|
|
481
483
|
})
|
|
482
484
|
});
|
|
@@ -486,7 +488,7 @@ var InvitedList = function InvitedList(_ref) {
|
|
|
486
488
|
children: [showSearch && /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Input, {
|
|
487
489
|
"aria-label": t("neetoAccessControl.labels.searchEmails"),
|
|
488
490
|
dataTestId: "search-invitations-input",
|
|
489
|
-
placeholder: t("neetoAccessControl.labels.
|
|
491
|
+
placeholder: t("neetoAccessControl.labels.search"),
|
|
490
492
|
prefix: /*#__PURE__*/jsxRuntime.jsx(lucideReact.Search, {
|
|
491
493
|
className: "size-4"
|
|
492
494
|
}),
|
|
@@ -554,8 +556,6 @@ var InvitedList = function InvitedList(_ref) {
|
|
|
554
556
|
});
|
|
555
557
|
};
|
|
556
558
|
|
|
557
|
-
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; }
|
|
558
|
-
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), true).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; }
|
|
559
559
|
var Invitations$1 = function Invitations(_ref) {
|
|
560
560
|
var _ref2, _emailTemplate$subjec, _ref3, _emailTemplate$messag, _stagedInvitations$em, _emailsToRevoke$;
|
|
561
561
|
var _ref$extraColumnsData = _ref.extraColumnsData,
|
|
@@ -627,10 +627,10 @@ var Invitations$1 = function Invitations(_ref) {
|
|
|
627
627
|
subject: (_ref2 = (_emailTemplate$subjec = emailTemplate.subject) !== null && _emailTemplate$subjec !== void 0 ? _emailTemplate$subjec : invitationEmailProps === null || invitationEmailProps === void 0 ? void 0 : invitationEmailProps.defaultSubject) !== null && _ref2 !== void 0 ? _ref2 : "",
|
|
628
628
|
message: (_ref3 = (_emailTemplate$messag = emailTemplate.message) !== null && _emailTemplate$messag !== void 0 ? _emailTemplate$messag : invitationEmailProps === null || invitationEmailProps === void 0 ? void 0 : invitationEmailProps.defaultMessage) !== null && _ref3 !== void 0 ? _ref3 : ""
|
|
629
629
|
};
|
|
630
|
-
var addEmailsInitialValues = isSetup ? _objectSpread
|
|
630
|
+
var addEmailsInitialValues = isSetup ? _objectSpread({
|
|
631
631
|
emails: buildEmailValues((_stagedInvitations$em = stagedInvitations === null || stagedInvitations === void 0 ? void 0 : stagedInvitations.emails) !== null && _stagedInvitations$em !== void 0 ? _stagedInvitations$em : []),
|
|
632
632
|
skipEmail: stagedInvitations ? !stagedInvitations.sendEmail : false
|
|
633
|
-
}, templateValues) : _objectSpread
|
|
633
|
+
}, templateValues) : _objectSpread({
|
|
634
634
|
emails: [],
|
|
635
635
|
skipEmail: false
|
|
636
636
|
}, templateValues);
|
|
@@ -639,7 +639,7 @@ var Invitations$1 = function Invitations(_ref) {
|
|
|
639
639
|
skipEmail = _ref4.skipEmail,
|
|
640
640
|
subject = _ref4.subject,
|
|
641
641
|
message = _ref4.message;
|
|
642
|
-
onStage(_objectSpread
|
|
642
|
+
onStage(_objectSpread({
|
|
643
643
|
emails: ramda.pluck("value", emails),
|
|
644
644
|
sendEmail: !skipEmail
|
|
645
645
|
}, invitationEmailProps && !skipEmail ? buildTemplatePayload({
|
|
@@ -649,10 +649,10 @@ var Invitations$1 = function Invitations(_ref) {
|
|
|
649
649
|
onClose();
|
|
650
650
|
};
|
|
651
651
|
var handleInvite = /*#__PURE__*/function () {
|
|
652
|
-
var
|
|
653
|
-
var emails, skipEmail, subject, message, resetForm, sendEmail, payload, _yield$createInvitati, _yield$createInvitati2, invitedEmails, count;
|
|
654
|
-
return
|
|
655
|
-
while (1) switch (_context.
|
|
652
|
+
var _handleInvite = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref5, _ref6) {
|
|
653
|
+
var emails, skipEmail, subject, message, resetForm, sendEmail, payload, _yield$createInvitati, _yield$createInvitati2, invitedEmails, count, _t;
|
|
654
|
+
return _regenerator().w(function (_context) {
|
|
655
|
+
while (1) switch (_context.p = _context.n) {
|
|
656
656
|
case 0:
|
|
657
657
|
emails = _ref5.emails, skipEmail = _ref5.skipEmail, subject = _ref5.subject, message = _ref5.message;
|
|
658
658
|
resetForm = _ref6.resetForm;
|
|
@@ -667,11 +667,11 @@ var Invitations$1 = function Invitations(_ref) {
|
|
|
667
667
|
message: message
|
|
668
668
|
}, invitationEmailProps);
|
|
669
669
|
}
|
|
670
|
-
_context.
|
|
671
|
-
_context.
|
|
670
|
+
_context.p = 1;
|
|
671
|
+
_context.n = 2;
|
|
672
672
|
return createInvitations(payload);
|
|
673
|
-
case
|
|
674
|
-
_yield$createInvitati = _context.
|
|
673
|
+
case 2:
|
|
674
|
+
_yield$createInvitati = _context.v;
|
|
675
675
|
_yield$createInvitati2 = _yield$createInvitati.invitedEmails;
|
|
676
676
|
invitedEmails = _yield$createInvitati2 === void 0 ? [] : _yield$createInvitati2;
|
|
677
677
|
count = invitedEmails.length;
|
|
@@ -688,21 +688,21 @@ var Invitations$1 = function Invitations(_ref) {
|
|
|
688
688
|
message: message
|
|
689
689
|
}
|
|
690
690
|
});
|
|
691
|
-
_context.
|
|
691
|
+
_context.n = 4;
|
|
692
692
|
break;
|
|
693
|
-
case
|
|
694
|
-
_context.
|
|
695
|
-
|
|
696
|
-
neetoAtoms.Toastr.error(
|
|
697
|
-
case
|
|
698
|
-
|
|
699
|
-
return _context.stop();
|
|
693
|
+
case 3:
|
|
694
|
+
_context.p = 3;
|
|
695
|
+
_t = _context.v;
|
|
696
|
+
neetoAtoms.Toastr.error(_t);
|
|
697
|
+
case 4:
|
|
698
|
+
return _context.a(2);
|
|
700
699
|
}
|
|
701
|
-
}, _callee, null, [[
|
|
700
|
+
}, _callee, null, [[1, 3]]);
|
|
702
701
|
}));
|
|
703
|
-
|
|
704
|
-
return
|
|
705
|
-
}
|
|
702
|
+
function handleInvite(_x, _x2) {
|
|
703
|
+
return _handleInvite.apply(this, arguments);
|
|
704
|
+
}
|
|
705
|
+
return handleInvite;
|
|
706
706
|
}();
|
|
707
707
|
var handleRevoke = function handleRevoke() {
|
|
708
708
|
var count = emailsToRevoke.length;
|
|
@@ -720,9 +720,9 @@ var Invitations$1 = function Invitations(_ref) {
|
|
|
720
720
|
onError: neetoAtoms.Toastr.error
|
|
721
721
|
});
|
|
722
722
|
};
|
|
723
|
-
var handleResend = function handleResend(
|
|
723
|
+
var handleResend = function handleResend(_ref7) {
|
|
724
724
|
var _resendingPayload$ema;
|
|
725
|
-
var email =
|
|
725
|
+
var email = _ref7.email;
|
|
726
726
|
if (isResending && ramda.includes(email, (_resendingPayload$ema = resendingPayload === null || resendingPayload === void 0 ? void 0 : resendingPayload.emails) !== null && _resendingPayload$ema !== void 0 ? _resendingPayload$ema : [])) return;
|
|
727
727
|
resendInvitations({
|
|
728
728
|
emails: [email]
|
|
@@ -755,7 +755,7 @@ var Invitations$1 = function Invitations(_ref) {
|
|
|
755
755
|
});
|
|
756
756
|
var inviteButton = neetoCist.isNotEmpty(inviteButtonProps) && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
757
757
|
className: "flex w-full justify-end",
|
|
758
|
-
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, _objectSpread
|
|
758
|
+
children: /*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Button, _objectSpread({}, inviteButtonProps))
|
|
759
759
|
});
|
|
760
760
|
var renderBody = function renderBody() {
|
|
761
761
|
if (isSetup) {
|
|
@@ -893,8 +893,6 @@ var DEFAULT_CONFIGURATION_VALUES = {
|
|
|
893
893
|
};
|
|
894
894
|
var INVITATION_FIELDS = ["invitationsCount", "invitationEmailSubject", "invitationEmailMessage"];
|
|
895
895
|
|
|
896
|
-
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; }
|
|
897
|
-
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), true).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; }
|
|
898
896
|
var buildVariableTag = function buildVariableTag(_ref) {
|
|
899
897
|
var key = _ref.key,
|
|
900
898
|
label = _ref.label;
|
|
@@ -909,7 +907,7 @@ var renderOneTimeLinkLabel = function renderOneTimeLinkLabel(_ref2) {
|
|
|
909
907
|
className: "inline-flex items-center gap-2",
|
|
910
908
|
variant: "body2",
|
|
911
909
|
weight: "medium",
|
|
912
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread
|
|
910
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread({
|
|
913
911
|
context: translationContext,
|
|
914
912
|
i18nKey: "neetoAccessControl.auth.oneTimeLink"
|
|
915
913
|
}, transProps[AUTH.ONE_TIME_LINK])), /*#__PURE__*/jsxRuntime.jsx(HelpPopover, {
|
|
@@ -1048,35 +1046,35 @@ var getAuthOptions = function getAuthOptions(_ref7) {
|
|
|
1048
1046
|
showOneTimeLinkOption = _ref7$showOneTimeLink === void 0 ? false : _ref7$showOneTimeLink,
|
|
1049
1047
|
oneTimeLinkHelpText = _ref7.oneTimeLinkHelpText;
|
|
1050
1048
|
return [{
|
|
1051
|
-
label: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread
|
|
1049
|
+
label: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread({
|
|
1052
1050
|
context: translationContext,
|
|
1053
1051
|
i18nKey: "neetoAccessControl.auth.no"
|
|
1054
1052
|
}, transProps[AUTH.NO])),
|
|
1055
1053
|
value: AUTH.NO,
|
|
1056
1054
|
"data-testid": "access-control-public-access-radio-input"
|
|
1057
1055
|
}, {
|
|
1058
|
-
label: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread
|
|
1056
|
+
label: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread({
|
|
1059
1057
|
context: translationContext,
|
|
1060
1058
|
i18nKey: "neetoAccessControl.auth.basic"
|
|
1061
1059
|
}, transProps[AUTH.BASIC])),
|
|
1062
1060
|
value: AUTH.BASIC,
|
|
1063
1061
|
"data-testid": "access-control-password-protected-radio-input"
|
|
1064
1062
|
}, {
|
|
1065
|
-
label: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread
|
|
1063
|
+
label: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread({
|
|
1066
1064
|
context: translationContext,
|
|
1067
1065
|
i18nKey: "neetoAccessControl.auth.invited"
|
|
1068
1066
|
}, transProps[AUTH.INVITED])),
|
|
1069
1067
|
value: AUTH.INVITED,
|
|
1070
1068
|
"data-testid": "access-control-only-invited-people-radio-input"
|
|
1071
1069
|
}, {
|
|
1072
|
-
label: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread
|
|
1070
|
+
label: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread({
|
|
1073
1071
|
context: translationContext,
|
|
1074
1072
|
i18nKey: "neetoAccessControl.auth.email"
|
|
1075
1073
|
}, transProps[AUTH.EMAIL])),
|
|
1076
1074
|
value: AUTH.EMAIL,
|
|
1077
1075
|
"data-testid": "access-control-secure-by-email-patterns-radio-input"
|
|
1078
1076
|
}, {
|
|
1079
|
-
label: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread
|
|
1077
|
+
label: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread({
|
|
1080
1078
|
context: translationContext,
|
|
1081
1079
|
i18nKey: "neetoAccessControl.auth.session"
|
|
1082
1080
|
}, transProps[AUTH.SESSION])),
|
|
@@ -1101,7 +1099,7 @@ var withDefaultInvitationEmail = function withDefaultInvitationEmail(invitationE
|
|
|
1101
1099
|
subject = _ref8$subject === void 0 ? "" : _ref8$subject,
|
|
1102
1100
|
_ref8$message = _ref8.message,
|
|
1103
1101
|
message = _ref8$message === void 0 ? "" : _ref8$message;
|
|
1104
|
-
return _objectSpread
|
|
1102
|
+
return _objectSpread(_objectSpread({}, invitationEmailProps), {}, {
|
|
1105
1103
|
defaultSubject: subject,
|
|
1106
1104
|
defaultMessage: message.replace(/{{\s*([\w.]+)\s*}}/g, function (tag, key) {
|
|
1107
1105
|
var variable = neetoCist.findBy({
|
|
@@ -1131,9 +1129,9 @@ var AllowedKeywords = reactUtils$1.withT(function (_ref) {
|
|
|
1131
1129
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
1132
1130
|
className: "pt-4",
|
|
1133
1131
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1134
|
-
className: "border-border bg-card space-y-3 rounded-
|
|
1132
|
+
className: "border-border bg-card space-y-3 rounded-xl border p-6",
|
|
1135
1133
|
children: [/*#__PURE__*/jsxRuntime.jsx(neetoAtoms.Label, {
|
|
1136
|
-
className: "leading-snug",
|
|
1134
|
+
className: "text-muted-foreground font-normal leading-snug",
|
|
1137
1135
|
children: label
|
|
1138
1136
|
}), allowedKeywords.map(function (_, index) {
|
|
1139
1137
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -1172,8 +1170,6 @@ var AllowedKeywords = reactUtils$1.withT(function (_ref) {
|
|
|
1172
1170
|
});
|
|
1173
1171
|
|
|
1174
1172
|
var _excluded$1 = ["savedAuth", "onViewInvites", "inviteOnlyProps", "label"];
|
|
1175
|
-
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; }
|
|
1176
|
-
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), true).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; }
|
|
1177
1173
|
var AuthOption = function AuthOption(_ref) {
|
|
1178
1174
|
var savedAuth = _ref.savedAuth,
|
|
1179
1175
|
onViewInvites = _ref.onViewInvites,
|
|
@@ -1187,7 +1183,7 @@ var AuthOption = function AuthOption(_ref) {
|
|
|
1187
1183
|
var renderLabel = function renderLabel() {
|
|
1188
1184
|
if (!isInviteOnlyOption) return label;
|
|
1189
1185
|
if (inviteOnlyProps !== null && inviteOnlyProps !== void 0 && inviteOnlyProps.supportsSetup) {
|
|
1190
|
-
return values.auth === AUTH.INVITED ? renderInviteOnlyLabel(_objectSpread
|
|
1186
|
+
return values.auth === AUTH.INVITED ? renderInviteOnlyLabel(_objectSpread({
|
|
1191
1187
|
label: label,
|
|
1192
1188
|
isSavedInviteOnly: isSavedInviteOnly
|
|
1193
1189
|
}, inviteOnlyProps)) : label;
|
|
@@ -1196,7 +1192,7 @@ var AuthOption = function AuthOption(_ref) {
|
|
|
1196
1192
|
onViewInvites: onViewInvites
|
|
1197
1193
|
}) : label;
|
|
1198
1194
|
};
|
|
1199
|
-
return /*#__PURE__*/jsxRuntime.jsx(formik$1.RadioGroup.Item, _objectSpread
|
|
1195
|
+
return /*#__PURE__*/jsxRuntime.jsx(formik$1.RadioGroup.Item, _objectSpread(_objectSpread({}, props), {}, {
|
|
1200
1196
|
className: classNames({
|
|
1201
1197
|
"items-start": isInviteOnlyOption
|
|
1202
1198
|
}),
|
|
@@ -1205,14 +1201,12 @@ var AuthOption = function AuthOption(_ref) {
|
|
|
1205
1201
|
}));
|
|
1206
1202
|
};
|
|
1207
1203
|
|
|
1208
|
-
function ownKeys$1(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; }
|
|
1209
|
-
function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1210
1204
|
var Header = function Header(_ref) {
|
|
1211
1205
|
var headerProps = _ref.headerProps;
|
|
1212
1206
|
var title = headerProps.title,
|
|
1213
1207
|
helpLink = headerProps.helpLink,
|
|
1214
1208
|
description = headerProps.description;
|
|
1215
|
-
return /*#__PURE__*/jsxRuntime.jsx(NeetoHeader, _objectSpread
|
|
1209
|
+
return /*#__PURE__*/jsxRuntime.jsx(NeetoHeader, _objectSpread(_objectSpread({}, _objectSpread(_objectSpread({}, headerProps), {}, {
|
|
1216
1210
|
title: title
|
|
1217
1211
|
})), {}, {
|
|
1218
1212
|
titleHelpPopoverProps: {
|
|
@@ -1226,8 +1220,6 @@ var Header = function Header(_ref) {
|
|
|
1226
1220
|
};
|
|
1227
1221
|
|
|
1228
1222
|
var _excluded = ["emails", "sendEmail"];
|
|
1229
|
-
function ownKeys(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; }
|
|
1230
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1231
1223
|
var InviteOnlySelectionWatcher = function InviteOnlySelectionWatcher(_ref) {
|
|
1232
1224
|
var auth = _ref.auth,
|
|
1233
1225
|
onChange = _ref.onChange;
|
|
@@ -1280,14 +1272,18 @@ var Configuration = function Configuration(_ref2) {
|
|
|
1280
1272
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1281
1273
|
showInvitationsPane = _useState2[0],
|
|
1282
1274
|
setShowInvitationsPane = _useState2[1];
|
|
1283
|
-
var _useState3 = react.useState(
|
|
1275
|
+
var _useState3 = react.useState(false),
|
|
1284
1276
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
var _useState5 = react.useState(
|
|
1277
|
+
isPasswordVisible = _useState4[0],
|
|
1278
|
+
setIsPasswordVisible = _useState4[1];
|
|
1279
|
+
var _useState5 = react.useState(TABS.ADD_PEOPLE),
|
|
1288
1280
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
1289
|
-
|
|
1290
|
-
|
|
1281
|
+
invitationsPaneTab = _useState6[0],
|
|
1282
|
+
setInvitationsPaneTab = _useState6[1];
|
|
1283
|
+
var _useState7 = react.useState(null),
|
|
1284
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
1285
|
+
stagedInvitations = _useState8[0],
|
|
1286
|
+
setStagedInvitations = _useState8[1];
|
|
1291
1287
|
var FieldsWrapper = fieldsWrapper || react.Fragment;
|
|
1292
1288
|
var _useTranslation = reactI18next.useTranslation(),
|
|
1293
1289
|
t = _useTranslation.t;
|
|
@@ -1327,22 +1323,22 @@ var Configuration = function Configuration(_ref2) {
|
|
|
1327
1323
|
}),
|
|
1328
1324
|
createInvitations = _useCreateConfigurati.mutateAsync;
|
|
1329
1325
|
var saveWithStagedInvitations = /*#__PURE__*/function () {
|
|
1330
|
-
var
|
|
1331
|
-
var emails, sendEmail, emailTemplate, config, invitedEmails, _yield$updateConfigur, _yield$updateConfigur2, _yield$updateConfigur3, savedConfiguration, _yield$createInvitati, _yield$createInvitati2;
|
|
1332
|
-
return
|
|
1333
|
-
while (1) switch (_context.
|
|
1326
|
+
var _saveWithStagedInvitations = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(payload) {
|
|
1327
|
+
var emails, sendEmail, emailTemplate, config, invitedEmails, _yield$updateConfigur, _yield$updateConfigur2, _yield$updateConfigur3, savedConfiguration, _yield$createInvitati, _yield$createInvitati2, _t;
|
|
1328
|
+
return _regenerator().w(function (_context) {
|
|
1329
|
+
while (1) switch (_context.p = _context.n) {
|
|
1334
1330
|
case 0:
|
|
1335
1331
|
emails = stagedInvitations.emails, sendEmail = stagedInvitations.sendEmail, emailTemplate = _objectWithoutProperties(stagedInvitations, _excluded);
|
|
1336
1332
|
config = {
|
|
1337
1333
|
showToastr: false
|
|
1338
1334
|
};
|
|
1339
|
-
_context.
|
|
1335
|
+
_context.p = 1;
|
|
1340
1336
|
invitedEmails = [];
|
|
1341
1337
|
if (!invitationEmailProps) {
|
|
1342
|
-
_context.
|
|
1338
|
+
_context.n = 3;
|
|
1343
1339
|
break;
|
|
1344
1340
|
}
|
|
1345
|
-
_context.
|
|
1341
|
+
_context.n = 2;
|
|
1346
1342
|
return updateConfiguration({
|
|
1347
1343
|
payload: _objectSpread(_objectSpread(_objectSpread({}, payload), emailTemplate), {}, {
|
|
1348
1344
|
invitations: {
|
|
@@ -1352,22 +1348,22 @@ var Configuration = function Configuration(_ref2) {
|
|
|
1352
1348
|
}),
|
|
1353
1349
|
config: config
|
|
1354
1350
|
});
|
|
1355
|
-
case
|
|
1356
|
-
_yield$updateConfigur = _context.
|
|
1351
|
+
case 2:
|
|
1352
|
+
_yield$updateConfigur = _context.v;
|
|
1357
1353
|
_yield$updateConfigur2 = _yield$updateConfigur.invitedEmails;
|
|
1358
1354
|
invitedEmails = _yield$updateConfigur2 === void 0 ? [] : _yield$updateConfigur2;
|
|
1359
|
-
_context.
|
|
1355
|
+
_context.n = 6;
|
|
1360
1356
|
break;
|
|
1361
|
-
case
|
|
1362
|
-
_context.
|
|
1357
|
+
case 3:
|
|
1358
|
+
_context.n = 4;
|
|
1363
1359
|
return updateConfiguration({
|
|
1364
1360
|
payload: payload,
|
|
1365
1361
|
config: config
|
|
1366
1362
|
});
|
|
1367
|
-
case
|
|
1368
|
-
_yield$updateConfigur3 = _context.
|
|
1363
|
+
case 4:
|
|
1364
|
+
_yield$updateConfigur3 = _context.v;
|
|
1369
1365
|
savedConfiguration = _yield$updateConfigur3.configuration;
|
|
1370
|
-
_context.
|
|
1366
|
+
_context.n = 5;
|
|
1371
1367
|
return createInvitations({
|
|
1372
1368
|
configurationId: savedConfiguration.id,
|
|
1373
1369
|
payload: {
|
|
@@ -1375,31 +1371,31 @@ var Configuration = function Configuration(_ref2) {
|
|
|
1375
1371
|
},
|
|
1376
1372
|
config: config
|
|
1377
1373
|
});
|
|
1378
|
-
case
|
|
1379
|
-
_yield$createInvitati = _context.
|
|
1374
|
+
case 5:
|
|
1375
|
+
_yield$createInvitati = _context.v;
|
|
1380
1376
|
_yield$createInvitati2 = _yield$createInvitati.invitedEmails;
|
|
1381
1377
|
invitedEmails = _yield$createInvitati2 === void 0 ? [] : _yield$createInvitati2;
|
|
1382
|
-
case
|
|
1378
|
+
case 6:
|
|
1383
1379
|
setStagedInvitations(null);
|
|
1384
1380
|
neetoAtoms.Toastr.success(buildSetupToastMessage({
|
|
1385
1381
|
count: invitedEmails.length,
|
|
1386
1382
|
sendEmail: sendEmail
|
|
1387
1383
|
}));
|
|
1388
|
-
_context.
|
|
1384
|
+
_context.n = 8;
|
|
1389
1385
|
break;
|
|
1390
|
-
case
|
|
1391
|
-
_context.
|
|
1392
|
-
|
|
1393
|
-
neetoAtoms.Toastr.error(
|
|
1394
|
-
case
|
|
1395
|
-
|
|
1396
|
-
return _context.stop();
|
|
1386
|
+
case 7:
|
|
1387
|
+
_context.p = 7;
|
|
1388
|
+
_t = _context.v;
|
|
1389
|
+
neetoAtoms.Toastr.error(_t);
|
|
1390
|
+
case 8:
|
|
1391
|
+
return _context.a(2);
|
|
1397
1392
|
}
|
|
1398
|
-
}, _callee, null, [[
|
|
1393
|
+
}, _callee, null, [[1, 7]]);
|
|
1399
1394
|
}));
|
|
1400
|
-
|
|
1401
|
-
return
|
|
1402
|
-
}
|
|
1395
|
+
function saveWithStagedInvitations(_x) {
|
|
1396
|
+
return _saveWithStagedInvitations.apply(this, arguments);
|
|
1397
|
+
}
|
|
1398
|
+
return saveWithStagedInvitations;
|
|
1403
1399
|
}();
|
|
1404
1400
|
var handleSubmit = function handleSubmit(values) {
|
|
1405
1401
|
var payload = ramda.mergeLeft(buildPayload(values), ramda.pick(ramda.keys(additionalFieldsInitialValues), values));
|
|
@@ -1457,10 +1453,10 @@ var Configuration = function Configuration(_ref2) {
|
|
|
1457
1453
|
onOpenInvitations: handleOpenInvitations
|
|
1458
1454
|
}
|
|
1459
1455
|
};
|
|
1460
|
-
var getSubmitButtonProps = function getSubmitButtonProps(
|
|
1461
|
-
var auth =
|
|
1462
|
-
var dirty =
|
|
1463
|
-
isSubmitting =
|
|
1456
|
+
var getSubmitButtonProps = function getSubmitButtonProps(_ref3, _ref4) {
|
|
1457
|
+
var auth = _ref3.auth;
|
|
1458
|
+
var dirty = _ref4.dirty,
|
|
1459
|
+
isSubmitting = _ref4.isSubmitting;
|
|
1464
1460
|
if (auth !== AUTH.INVITED) return {};
|
|
1465
1461
|
if (!supportsSetup) {
|
|
1466
1462
|
return {
|
|
@@ -1493,11 +1489,11 @@ var Configuration = function Configuration(_ref2) {
|
|
|
1493
1489
|
onReset: handleReset,
|
|
1494
1490
|
enableReinitialize: true
|
|
1495
1491
|
},
|
|
1496
|
-
children: function children(
|
|
1497
|
-
var values =
|
|
1498
|
-
setFieldValue =
|
|
1499
|
-
dirty =
|
|
1500
|
-
isSubmitting =
|
|
1492
|
+
children: function children(_ref5) {
|
|
1493
|
+
var values = _ref5.values,
|
|
1494
|
+
setFieldValue = _ref5.setFieldValue,
|
|
1495
|
+
dirty = _ref5.dirty,
|
|
1496
|
+
isSubmitting = _ref5.isSubmitting;
|
|
1501
1497
|
return /*#__PURE__*/jsxRuntime.jsxs(CardLayout, {
|
|
1502
1498
|
actionBlock: /*#__PURE__*/jsxRuntime.jsx(formik$1.ActionBlock, {
|
|
1503
1499
|
cancelButtonProps: {
|
|
@@ -1534,7 +1530,7 @@ var Configuration = function Configuration(_ref2) {
|
|
|
1534
1530
|
value: AUTH.SESSION
|
|
1535
1531
|
})
|
|
1536
1532
|
}), SIGNED_IN_AUTHS.includes(values.auth) && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
1537
|
-
className: "
|
|
1533
|
+
className: "ms-7 space-y-4",
|
|
1538
1534
|
children: [/*#__PURE__*/jsxRuntime.jsxs(neetoAtoms.RadioGroup, {
|
|
1539
1535
|
className: "data-[orientation=vertical]:gap-4",
|
|
1540
1536
|
orientation: "vertical",
|
|
@@ -1577,11 +1573,25 @@ var Configuration = function Configuration(_ref2) {
|
|
|
1577
1573
|
autoFocus: true,
|
|
1578
1574
|
required: true,
|
|
1579
1575
|
unlimitedChars: true,
|
|
1576
|
+
autoComplete: "new-password",
|
|
1580
1577
|
className: "w-7/12",
|
|
1581
1578
|
dataTestId: "password",
|
|
1582
1579
|
label: t("neetoAccessControl.inputs.labels.password"),
|
|
1583
1580
|
name: "password",
|
|
1584
|
-
|
|
1581
|
+
type: isPasswordVisible ? "text" : "password",
|
|
1582
|
+
placeholder: t("neetoAccessControl.inputs.placeholders.enterPassword"),
|
|
1583
|
+
suffix: /*#__PURE__*/jsxRuntime.jsx("button", {
|
|
1584
|
+
className: "text-muted-foreground hover:text-foreground cursor-pointer",
|
|
1585
|
+
"data-testid": "toggle-password-visibility-button",
|
|
1586
|
+
type: "button",
|
|
1587
|
+
"aria-label": t(isPasswordVisible ? "neetoAccessControl.inputs.labels.hidePassword" : "neetoAccessControl.inputs.labels.showPassword"),
|
|
1588
|
+
onClick: function onClick() {
|
|
1589
|
+
return setIsPasswordVisible(function (isVisible) {
|
|
1590
|
+
return !isVisible;
|
|
1591
|
+
});
|
|
1592
|
+
},
|
|
1593
|
+
children: isPasswordVisible ? /*#__PURE__*/jsxRuntime.jsx(lucideReact.EyeOff, {}) : /*#__PURE__*/jsxRuntime.jsx(lucideReact.Eye, {})
|
|
1594
|
+
})
|
|
1585
1595
|
})
|
|
1586
1596
|
})]
|
|
1587
1597
|
}), enableNavigationBlocking && /*#__PURE__*/jsxRuntime.jsx(formik$1.BlockNavigation, {})]
|