@bigbinary/neeto-access-control-frontend 1.7.7 → 2.0.0
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 +3 -0
- 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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
4
4
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
5
5
|
var _toConsumableArray = require('@babel/runtime/helpers/toConsumableArray');
|
|
6
6
|
var reactQuery = require('@tanstack/react-query');
|
|
@@ -11,8 +11,6 @@ var ramda = require('ramda');
|
|
|
11
11
|
|
|
12
12
|
var ACCESS_CONTROL_BASE_PATH = "/secure/api/v1";
|
|
13
13
|
|
|
14
|
-
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; }
|
|
15
|
-
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; }
|
|
16
14
|
var invitationsPath = "".concat(ACCESS_CONTROL_BASE_PATH, "/configuration/invitations");
|
|
17
15
|
var list = function list(params) {
|
|
18
16
|
return axios.get(invitationsPath, {
|
|
@@ -24,7 +22,7 @@ var bulkCreate = function bulkCreate(_ref) {
|
|
|
24
22
|
payload = _ref.payload,
|
|
25
23
|
_ref$config = _ref.config,
|
|
26
24
|
config = _ref$config === void 0 ? {} : _ref$config;
|
|
27
|
-
return axios.post("".concat(invitationsPath, "/bulk_create"), payload, _objectSpread
|
|
25
|
+
return axios.post("".concat(invitationsPath, "/bulk_create"), payload, _objectSpread({
|
|
28
26
|
params: {
|
|
29
27
|
neetoAccessControlConfigurationId: configurationId
|
|
30
28
|
}
|
|
@@ -35,7 +33,7 @@ var bulkDestroy = function bulkDestroy(_ref2) {
|
|
|
35
33
|
payload = _ref2.payload,
|
|
36
34
|
_ref2$config = _ref2.config,
|
|
37
35
|
config = _ref2$config === void 0 ? {} : _ref2$config;
|
|
38
|
-
return axios.post("".concat(invitationsPath, "/bulk_destroy"), payload, _objectSpread
|
|
36
|
+
return axios.post("".concat(invitationsPath, "/bulk_destroy"), payload, _objectSpread({
|
|
39
37
|
params: {
|
|
40
38
|
neetoAccessControlConfigurationId: configurationId
|
|
41
39
|
}
|
|
@@ -64,8 +62,6 @@ var QUERY_KEYS = {
|
|
|
64
62
|
};
|
|
65
63
|
|
|
66
64
|
var _excluded = ["ownerId", "ownerType"];
|
|
67
|
-
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; }
|
|
68
|
-
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; }
|
|
69
65
|
var ACCESS_CONTROL_CONFIGURATION$1 = QUERY_KEYS.ACCESS_CONTROL_CONFIGURATION,
|
|
70
66
|
ACCESS_CONTROL_CONFIGURATION_INVITATIONS$1 = QUERY_KEYS.ACCESS_CONTROL_CONFIGURATION_INVITATIONS;
|
|
71
67
|
var invitationKeys = function invitationKeys(_ref) {
|
|
@@ -79,7 +75,7 @@ var useListInvitations = function useListInvitations(_ref2, options) {
|
|
|
79
75
|
var ownerId = _ref2.ownerId,
|
|
80
76
|
ownerType = _ref2.ownerType,
|
|
81
77
|
otherParams = _objectWithoutProperties(_ref2, _excluded);
|
|
82
|
-
return reactQuery.useQuery(_objectSpread
|
|
78
|
+
return reactQuery.useQuery(_objectSpread({
|
|
83
79
|
queryKey: [ACCESS_CONTROL_CONFIGURATION_INVITATIONS$1, ownerType, ownerId, otherParams],
|
|
84
80
|
queryFn: function queryFn() {
|
|
85
81
|
return invitationsApi.list(otherParams);
|
|
@@ -99,7 +95,7 @@ var useBulkCreateInvitations = function useBulkCreateInvitations(_ref3, options)
|
|
|
99
95
|
payload: payload,
|
|
100
96
|
config: config
|
|
101
97
|
});
|
|
102
|
-
}, _objectSpread
|
|
98
|
+
}, _objectSpread({
|
|
103
99
|
keysToInvalidate: invitationKeys({
|
|
104
100
|
ownerId: ownerId,
|
|
105
101
|
ownerType: ownerType,
|
|
@@ -119,7 +115,7 @@ var useBulkDestroyInvitations = function useBulkDestroyInvitations(_ref4, option
|
|
|
119
115
|
payload: payload,
|
|
120
116
|
config: config
|
|
121
117
|
});
|
|
122
|
-
}, _objectSpread
|
|
118
|
+
}, _objectSpread({
|
|
123
119
|
keysToInvalidate: invitationKeys({
|
|
124
120
|
ownerId: ownerId,
|
|
125
121
|
ownerType: ownerType,
|
|
@@ -136,14 +132,14 @@ var useResendInvitations = function useResendInvitations(_ref5, options) {
|
|
|
136
132
|
configurationId: configurationId,
|
|
137
133
|
payload: payload
|
|
138
134
|
});
|
|
139
|
-
}, _objectSpread
|
|
135
|
+
}, _objectSpread({
|
|
140
136
|
keysToInvalidate: [[ACCESS_CONTROL_CONFIGURATION_INVITATIONS$1, ownerType, ownerId]]
|
|
141
137
|
}, options));
|
|
142
138
|
};
|
|
143
139
|
var useCreateConfigurationInvitations = function useCreateConfigurationInvitations(_ref6, options) {
|
|
144
140
|
var ownerId = _ref6.ownerId,
|
|
145
141
|
ownerType = _ref6.ownerType;
|
|
146
|
-
return reactUtils.useMutationWithInvalidation(invitationsApi.bulkCreate, _objectSpread
|
|
142
|
+
return reactUtils.useMutationWithInvalidation(invitationsApi.bulkCreate, _objectSpread({
|
|
147
143
|
keysToInvalidate: invitationKeys({
|
|
148
144
|
ownerId: ownerId,
|
|
149
145
|
ownerType: ownerType,
|
|
@@ -152,8 +148,6 @@ var useCreateConfigurationInvitations = function useCreateConfigurationInvitatio
|
|
|
152
148
|
}, options));
|
|
153
149
|
};
|
|
154
150
|
|
|
155
|
-
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; }
|
|
156
|
-
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; }
|
|
157
151
|
var configurationPath = "".concat(ACCESS_CONTROL_BASE_PATH, "/configuration");
|
|
158
152
|
var show = function show(params) {
|
|
159
153
|
return axios.get(configurationPath, {
|
|
@@ -168,7 +162,7 @@ var update = function update(_ref) {
|
|
|
168
162
|
config = _ref$config === void 0 ? {} : _ref$config;
|
|
169
163
|
return axios.put(configurationPath, {
|
|
170
164
|
configuration: payload
|
|
171
|
-
}, _objectSpread
|
|
165
|
+
}, _objectSpread({
|
|
172
166
|
params: {
|
|
173
167
|
ownerId: ownerId,
|
|
174
168
|
ownerType: ownerType
|
|
@@ -180,8 +174,6 @@ var configurationsApi = {
|
|
|
180
174
|
update: update
|
|
181
175
|
};
|
|
182
176
|
|
|
183
|
-
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; }
|
|
184
|
-
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; }
|
|
185
177
|
var ACCESS_CONTROL_CONFIGURATION = QUERY_KEYS.ACCESS_CONTROL_CONFIGURATION,
|
|
186
178
|
ACCESS_CONTROL_CONFIGURATION_INVITATIONS = QUERY_KEYS.ACCESS_CONTROL_CONFIGURATION_INVITATIONS;
|
|
187
179
|
var useShowConfiguration = function useShowConfiguration(_ref) {
|
|
@@ -224,4 +216,4 @@ exports.useListInvitations = useListInvitations;
|
|
|
224
216
|
exports.useResendInvitations = useResendInvitations;
|
|
225
217
|
exports.useShowConfiguration = useShowConfiguration;
|
|
226
218
|
exports.useUpdateConfiguration = useUpdateConfiguration;
|
|
227
|
-
//# sourceMappingURL=useConfigurationsApi-
|
|
219
|
+
//# sourceMappingURL=useConfigurationsApi-DwcTDXck.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useConfigurationsApi-DwcTDXck.js","sources":["../app/javascript/src/constants/index.js","../app/javascript/src/apis/invitations.js","../app/javascript/src/constants/query.js","../app/javascript/src/hooks/reactQuery/useInvitationsApi.js","../app/javascript/src/apis/configurations.js","../app/javascript/src/hooks/reactQuery/useConfigurationsApi.js"],"sourcesContent":["export const ACCESS_CONTROL_BASE_PATH = \"/secure/api/v1\";\n","import axios from \"axios\";\n\nimport { ACCESS_CONTROL_BASE_PATH } from \"src/constants\";\n\nconst invitationsPath = `${ACCESS_CONTROL_BASE_PATH}/configuration/invitations`;\n\nconst list = params => axios.get(invitationsPath, { params });\n\nconst bulkCreate = ({ configurationId, payload, config = {} }) =>\n axios.post(`${invitationsPath}/bulk_create`, payload, {\n params: { neetoAccessControlConfigurationId: configurationId },\n ...config,\n });\n\nconst bulkDestroy = ({ configurationId, payload, config = {} }) =>\n axios.post(`${invitationsPath}/bulk_destroy`, payload, {\n params: { neetoAccessControlConfigurationId: configurationId },\n ...config,\n });\n\nconst resend = ({ configurationId, payload }) =>\n axios.post(`${invitationsPath}/resend`, payload, {\n params: { neetoAccessControlConfigurationId: configurationId },\n showToastr: false,\n });\n\nconst invitationsApi = { list, bulkDestroy, bulkCreate, resend };\n\nexport default invitationsApi;\n","export const QUERY_KEYS = {\n ACCESS_CONTROL_CONFIGURATION: \"access-control-configuration\",\n ACCESS_CONTROL_CONFIGURATION_INVITATIONS:\n \"access-control-configuration-invitations\",\n};\n","import { useQuery } from \"@tanstack/react-query\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\n\nimport invitationsApi from \"apis/invitations\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nconst {\n ACCESS_CONTROL_CONFIGURATION,\n ACCESS_CONTROL_CONFIGURATION_INVITATIONS,\n} = QUERY_KEYS;\n\nconst invitationKeys = ({ ownerId, ownerType, withConfiguration = false }) => [\n [ACCESS_CONTROL_CONFIGURATION_INVITATIONS, ownerType, ownerId],\n ...(withConfiguration\n ? [[ACCESS_CONTROL_CONFIGURATION, ownerType, ownerId]]\n : []),\n];\n\nexport const useListInvitations = (\n { ownerId, ownerType, ...otherParams },\n options\n) =>\n useQuery({\n queryKey: [\n ACCESS_CONTROL_CONFIGURATION_INVITATIONS,\n ownerType,\n ownerId,\n otherParams,\n ],\n queryFn: () => invitationsApi.list(otherParams),\n staleTime: DEFAULT_STALE_TIME,\n ...options,\n });\n\nexport const useBulkCreateInvitations = (\n { configurationId, ownerId, ownerType, config, withConfiguration },\n options\n) =>\n useMutationWithInvalidation(\n payload => invitationsApi.bulkCreate({ configurationId, payload, config }),\n {\n keysToInvalidate: invitationKeys({\n ownerId,\n ownerType,\n withConfiguration,\n }),\n ...options,\n }\n );\n\nexport const useBulkDestroyInvitations = (\n { configurationId, ownerId, ownerType, config, withConfiguration },\n options\n) =>\n useMutationWithInvalidation(\n payload => invitationsApi.bulkDestroy({ configurationId, payload, config }),\n {\n keysToInvalidate: invitationKeys({\n ownerId,\n ownerType,\n withConfiguration,\n }),\n ...options,\n }\n );\n\nexport const useResendInvitations = (\n { configurationId, ownerId, ownerType },\n options\n) =>\n useMutationWithInvalidation(\n payload => invitationsApi.resend({ configurationId, payload }),\n {\n keysToInvalidate: [\n [ACCESS_CONTROL_CONFIGURATION_INVITATIONS, ownerType, ownerId],\n ],\n ...options,\n }\n );\n\nexport const useCreateConfigurationInvitations = (\n { ownerId, ownerType },\n options\n) =>\n useMutationWithInvalidation(invitationsApi.bulkCreate, {\n keysToInvalidate: invitationKeys({\n ownerId,\n ownerType,\n withConfiguration: true,\n }),\n ...options,\n });\n","import axios from \"axios\";\n\nimport { ACCESS_CONTROL_BASE_PATH } from \"src/constants\";\n\nconst configurationPath = `${ACCESS_CONTROL_BASE_PATH}/configuration`;\n\nconst show = params => axios.get(configurationPath, { params });\n\nconst update = ({ ownerId, ownerType, payload, config = {} }) =>\n axios.put(\n configurationPath,\n { configuration: payload },\n { params: { ownerId, ownerType }, ...config }\n );\n\nconst configurationsApi = { show, update };\n\nexport default configurationsApi;\n","import { useQuery } from \"@tanstack/react-query\";\nimport { DEFAULT_STALE_TIME } from \"neetocommons/constants\";\nimport { useMutationWithInvalidation } from \"neetocommons/react-utils\";\nimport { prop } from \"ramda\";\n\nimport configurationsApi from \"apis/configurations\";\nimport { QUERY_KEYS } from \"src/constants/query\";\n\nconst {\n ACCESS_CONTROL_CONFIGURATION,\n ACCESS_CONTROL_CONFIGURATION_INVITATIONS,\n} = QUERY_KEYS;\n\nexport const useShowConfiguration = ({ ownerId, ownerType }) =>\n useQuery({\n queryKey: [ACCESS_CONTROL_CONFIGURATION, ownerType, ownerId],\n queryFn: () => configurationsApi.show({ ownerType, ownerId }),\n select: prop(\"configuration\"),\n staleTime: DEFAULT_STALE_TIME,\n });\n\nexport const useUpdateConfiguration = ({ ownerId, ownerType }, options) =>\n useMutationWithInvalidation(\n ({ payload, config }) =>\n configurationsApi.update({ ownerId, ownerType, payload, config }),\n {\n keysToInvalidate: [\n [ACCESS_CONTROL_CONFIGURATION, ownerType, ownerId],\n [ACCESS_CONTROL_CONFIGURATION_INVITATIONS, ownerType, ownerId],\n ],\n ...options,\n }\n );\n"],"names":["ACCESS_CONTROL_CONFIGURATION","ACCESS_CONTROL_CONFIGURATION_INVITATIONS","useQuery","DEFAULT_STALE_TIME","useMutationWithInvalidation","prop"],"mappings":";;;;;;;;;;;AAAO,IAAM,wBAAwB,GAAG,gBAAgB;;ACIxD,IAAM,eAAe,GAAA,EAAA,CAAA,MAAA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B,iBAAiB,CAAC,MAAM,CAAC;AAAE,MAAA,OAAO,EAAP,OAAO;AAAE,MAAA,SAAS,EAAT,SAAS;AAAE,MAAA,OAAO,EAAP,OAAO;AAAE,MAAA,MAAM,EAAN;AAAO,KAAC,CAAC;AAAA,EAAA,CAAA,EAAA,aAAA,CAAA;AAEjE,IAAA,gBAAgB,EAAE,CAChB,CAAC,4BAA4B,EAAE,SAAS,EAAE,OAAO,CAAC,EAClD,CAAC,wCAAwC,EAAE,SAAS,EAAE,OAAO,CAAC;GAC/D,EACE,OAAO,CAEd,CAAC;AAAA;;;;;;;;;;;"}
|
package/dist/v2/index.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { a as useListInvitations, u as useBulkCreateInvitations, b as useBulkDestroyInvitations, e as useResendInvitations, c as useShowConfiguration, d as useUpdateConfiguration, f as useCreateConfigurationInvitations, Q as QUERY_KEYS } from '../useConfigurationsApi-
|
|
2
|
-
import
|
|
1
|
+
import { a as useListInvitations, u as useBulkCreateInvitations, b as useBulkDestroyInvitations, e as useResendInvitations, c as useShowConfiguration, d as useUpdateConfiguration, f as useCreateConfigurationInvitations, Q as QUERY_KEYS } from '../useConfigurationsApi-BL4w-Zvl.js';
|
|
2
|
+
import _regenerator from '@babel/runtime/helpers/regenerator';
|
|
3
|
+
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
4
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
4
5
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
5
6
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
6
|
-
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
7
7
|
import { useState, useRef, createElement, useEffect, useMemo, Fragment as Fragment$1 } from 'react';
|
|
8
8
|
import classNames from 'classnames';
|
|
9
|
+
import { Users, Search, Trash2, Plus, EyeOff, Eye } from 'lucide-react';
|
|
9
10
|
import { Tooltip, Typography, Button, Sheet, Spinner, Empty, Input as Input$1, DataTable, Alert, Tabs, Toastr, Callout, Label, RadioGroup as RadioGroup$1 } from '@bigbinary/neeto-atoms';
|
|
10
11
|
import { Input, Form, ActionBlock, MultiEmailInput, Checkbox, RadioGroup, BlockNavigation } from '@bigbinary/neeto-atoms/formik';
|
|
11
12
|
import { humanize, isNotEmpty, noop, nullSafe, filterBy, findBy, isPresent } from '@bigbinary/neeto-cist';
|
|
@@ -21,7 +22,6 @@ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
|
|
|
21
22
|
import MoreDropdown from '@bigbinary/neeto-molecules/v2/MoreDropdown';
|
|
22
23
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
23
24
|
import { keepPreviousData } from '@tanstack/react-query';
|
|
24
|
-
import { Users, Search, Trash2, Plus } from 'lucide-react';
|
|
25
25
|
import { useDebounce } from '@bigbinary/neeto-commons-frontend/react-utils';
|
|
26
26
|
import { DEFAULT_PAGE_INDEX, DEFAULT_PAGE_SIZE } from '@bigbinary/neeto-commons-frontend/v2/constants';
|
|
27
27
|
import SubHeader from '@bigbinary/neeto-molecules/v2/SubHeader';
|
|
@@ -116,7 +116,8 @@ var defaultColumnData = function defaultColumnData(_ref) {
|
|
|
116
116
|
"data-testid": "invitation-delete-menu-item",
|
|
117
117
|
onClick: function onClick() {
|
|
118
118
|
return onRevoke(inviteData);
|
|
119
|
-
}
|
|
119
|
+
},
|
|
120
|
+
variant: "destructive"
|
|
120
121
|
}])
|
|
121
122
|
})]
|
|
122
123
|
});
|
|
@@ -456,6 +457,7 @@ var InvitedList = function InvitedList(_ref) {
|
|
|
456
457
|
className: "flex h-full w-full justify-center",
|
|
457
458
|
children: /*#__PURE__*/jsx(Empty, {
|
|
458
459
|
icon: Users,
|
|
460
|
+
illustration: "contacts",
|
|
459
461
|
title: t("neetoAccessControl.labels.noOneInvitedYet")
|
|
460
462
|
})
|
|
461
463
|
});
|
|
@@ -465,7 +467,7 @@ var InvitedList = function InvitedList(_ref) {
|
|
|
465
467
|
children: [showSearch && /*#__PURE__*/jsx(Input$1, {
|
|
466
468
|
"aria-label": t("neetoAccessControl.labels.searchEmails"),
|
|
467
469
|
dataTestId: "search-invitations-input",
|
|
468
|
-
placeholder: t("neetoAccessControl.labels.
|
|
470
|
+
placeholder: t("neetoAccessControl.labels.search"),
|
|
469
471
|
prefix: /*#__PURE__*/jsx(Search, {
|
|
470
472
|
className: "size-4"
|
|
471
473
|
}),
|
|
@@ -533,8 +535,6 @@ var InvitedList = function InvitedList(_ref) {
|
|
|
533
535
|
});
|
|
534
536
|
};
|
|
535
537
|
|
|
536
|
-
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; }
|
|
537
|
-
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; }
|
|
538
538
|
var Invitations$1 = function Invitations(_ref) {
|
|
539
539
|
var _ref2, _emailTemplate$subjec, _ref3, _emailTemplate$messag, _stagedInvitations$em, _emailsToRevoke$;
|
|
540
540
|
var _ref$extraColumnsData = _ref.extraColumnsData,
|
|
@@ -606,10 +606,10 @@ var Invitations$1 = function Invitations(_ref) {
|
|
|
606
606
|
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 : "",
|
|
607
607
|
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 : ""
|
|
608
608
|
};
|
|
609
|
-
var addEmailsInitialValues = isSetup ? _objectSpread
|
|
609
|
+
var addEmailsInitialValues = isSetup ? _objectSpread({
|
|
610
610
|
emails: buildEmailValues((_stagedInvitations$em = stagedInvitations === null || stagedInvitations === void 0 ? void 0 : stagedInvitations.emails) !== null && _stagedInvitations$em !== void 0 ? _stagedInvitations$em : []),
|
|
611
611
|
skipEmail: stagedInvitations ? !stagedInvitations.sendEmail : false
|
|
612
|
-
}, templateValues) : _objectSpread
|
|
612
|
+
}, templateValues) : _objectSpread({
|
|
613
613
|
emails: [],
|
|
614
614
|
skipEmail: false
|
|
615
615
|
}, templateValues);
|
|
@@ -618,7 +618,7 @@ var Invitations$1 = function Invitations(_ref) {
|
|
|
618
618
|
skipEmail = _ref4.skipEmail,
|
|
619
619
|
subject = _ref4.subject,
|
|
620
620
|
message = _ref4.message;
|
|
621
|
-
onStage(_objectSpread
|
|
621
|
+
onStage(_objectSpread({
|
|
622
622
|
emails: pluck("value", emails),
|
|
623
623
|
sendEmail: !skipEmail
|
|
624
624
|
}, invitationEmailProps && !skipEmail ? buildTemplatePayload({
|
|
@@ -628,10 +628,10 @@ var Invitations$1 = function Invitations(_ref) {
|
|
|
628
628
|
onClose();
|
|
629
629
|
};
|
|
630
630
|
var handleInvite = /*#__PURE__*/function () {
|
|
631
|
-
var
|
|
632
|
-
var emails, skipEmail, subject, message, resetForm, sendEmail, payload, _yield$createInvitati, _yield$createInvitati2, invitedEmails, count;
|
|
633
|
-
return
|
|
634
|
-
while (1) switch (_context.
|
|
631
|
+
var _handleInvite = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(_ref5, _ref6) {
|
|
632
|
+
var emails, skipEmail, subject, message, resetForm, sendEmail, payload, _yield$createInvitati, _yield$createInvitati2, invitedEmails, count, _t;
|
|
633
|
+
return _regenerator().w(function (_context) {
|
|
634
|
+
while (1) switch (_context.p = _context.n) {
|
|
635
635
|
case 0:
|
|
636
636
|
emails = _ref5.emails, skipEmail = _ref5.skipEmail, subject = _ref5.subject, message = _ref5.message;
|
|
637
637
|
resetForm = _ref6.resetForm;
|
|
@@ -646,11 +646,11 @@ var Invitations$1 = function Invitations(_ref) {
|
|
|
646
646
|
message: message
|
|
647
647
|
}, invitationEmailProps);
|
|
648
648
|
}
|
|
649
|
-
_context.
|
|
650
|
-
_context.
|
|
649
|
+
_context.p = 1;
|
|
650
|
+
_context.n = 2;
|
|
651
651
|
return createInvitations(payload);
|
|
652
|
-
case
|
|
653
|
-
_yield$createInvitati = _context.
|
|
652
|
+
case 2:
|
|
653
|
+
_yield$createInvitati = _context.v;
|
|
654
654
|
_yield$createInvitati2 = _yield$createInvitati.invitedEmails;
|
|
655
655
|
invitedEmails = _yield$createInvitati2 === void 0 ? [] : _yield$createInvitati2;
|
|
656
656
|
count = invitedEmails.length;
|
|
@@ -667,21 +667,21 @@ var Invitations$1 = function Invitations(_ref) {
|
|
|
667
667
|
message: message
|
|
668
668
|
}
|
|
669
669
|
});
|
|
670
|
-
_context.
|
|
670
|
+
_context.n = 4;
|
|
671
671
|
break;
|
|
672
|
-
case
|
|
673
|
-
_context.
|
|
674
|
-
|
|
675
|
-
Toastr.error(
|
|
676
|
-
case
|
|
677
|
-
|
|
678
|
-
return _context.stop();
|
|
672
|
+
case 3:
|
|
673
|
+
_context.p = 3;
|
|
674
|
+
_t = _context.v;
|
|
675
|
+
Toastr.error(_t);
|
|
676
|
+
case 4:
|
|
677
|
+
return _context.a(2);
|
|
679
678
|
}
|
|
680
|
-
}, _callee, null, [[
|
|
679
|
+
}, _callee, null, [[1, 3]]);
|
|
681
680
|
}));
|
|
682
|
-
|
|
683
|
-
return
|
|
684
|
-
}
|
|
681
|
+
function handleInvite(_x, _x2) {
|
|
682
|
+
return _handleInvite.apply(this, arguments);
|
|
683
|
+
}
|
|
684
|
+
return handleInvite;
|
|
685
685
|
}();
|
|
686
686
|
var handleRevoke = function handleRevoke() {
|
|
687
687
|
var count = emailsToRevoke.length;
|
|
@@ -699,9 +699,9 @@ var Invitations$1 = function Invitations(_ref) {
|
|
|
699
699
|
onError: Toastr.error
|
|
700
700
|
});
|
|
701
701
|
};
|
|
702
|
-
var handleResend = function handleResend(
|
|
702
|
+
var handleResend = function handleResend(_ref7) {
|
|
703
703
|
var _resendingPayload$ema;
|
|
704
|
-
var email =
|
|
704
|
+
var email = _ref7.email;
|
|
705
705
|
if (isResending && includes(email, (_resendingPayload$ema = resendingPayload === null || resendingPayload === void 0 ? void 0 : resendingPayload.emails) !== null && _resendingPayload$ema !== void 0 ? _resendingPayload$ema : [])) return;
|
|
706
706
|
resendInvitations({
|
|
707
707
|
emails: [email]
|
|
@@ -734,7 +734,7 @@ var Invitations$1 = function Invitations(_ref) {
|
|
|
734
734
|
});
|
|
735
735
|
var inviteButton = isNotEmpty(inviteButtonProps) && /*#__PURE__*/jsx("div", {
|
|
736
736
|
className: "flex w-full justify-end",
|
|
737
|
-
children: /*#__PURE__*/jsx(Button, _objectSpread
|
|
737
|
+
children: /*#__PURE__*/jsx(Button, _objectSpread({}, inviteButtonProps))
|
|
738
738
|
});
|
|
739
739
|
var renderBody = function renderBody() {
|
|
740
740
|
if (isSetup) {
|
|
@@ -872,8 +872,6 @@ var DEFAULT_CONFIGURATION_VALUES = {
|
|
|
872
872
|
};
|
|
873
873
|
var INVITATION_FIELDS = ["invitationsCount", "invitationEmailSubject", "invitationEmailMessage"];
|
|
874
874
|
|
|
875
|
-
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; }
|
|
876
|
-
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; }
|
|
877
875
|
var buildVariableTag = function buildVariableTag(_ref) {
|
|
878
876
|
var key = _ref.key,
|
|
879
877
|
label = _ref.label;
|
|
@@ -888,7 +886,7 @@ var renderOneTimeLinkLabel = function renderOneTimeLinkLabel(_ref2) {
|
|
|
888
886
|
className: "inline-flex items-center gap-2",
|
|
889
887
|
variant: "body2",
|
|
890
888
|
weight: "medium",
|
|
891
|
-
children: [/*#__PURE__*/jsx(Trans, _objectSpread
|
|
889
|
+
children: [/*#__PURE__*/jsx(Trans, _objectSpread({
|
|
892
890
|
context: translationContext,
|
|
893
891
|
i18nKey: "neetoAccessControl.auth.oneTimeLink"
|
|
894
892
|
}, transProps[AUTH.ONE_TIME_LINK])), /*#__PURE__*/jsx(HelpPopover, {
|
|
@@ -1027,35 +1025,35 @@ var getAuthOptions = function getAuthOptions(_ref7) {
|
|
|
1027
1025
|
showOneTimeLinkOption = _ref7$showOneTimeLink === void 0 ? false : _ref7$showOneTimeLink,
|
|
1028
1026
|
oneTimeLinkHelpText = _ref7.oneTimeLinkHelpText;
|
|
1029
1027
|
return [{
|
|
1030
|
-
label: /*#__PURE__*/jsx(Trans, _objectSpread
|
|
1028
|
+
label: /*#__PURE__*/jsx(Trans, _objectSpread({
|
|
1031
1029
|
context: translationContext,
|
|
1032
1030
|
i18nKey: "neetoAccessControl.auth.no"
|
|
1033
1031
|
}, transProps[AUTH.NO])),
|
|
1034
1032
|
value: AUTH.NO,
|
|
1035
1033
|
"data-testid": "access-control-public-access-radio-input"
|
|
1036
1034
|
}, {
|
|
1037
|
-
label: /*#__PURE__*/jsx(Trans, _objectSpread
|
|
1035
|
+
label: /*#__PURE__*/jsx(Trans, _objectSpread({
|
|
1038
1036
|
context: translationContext,
|
|
1039
1037
|
i18nKey: "neetoAccessControl.auth.basic"
|
|
1040
1038
|
}, transProps[AUTH.BASIC])),
|
|
1041
1039
|
value: AUTH.BASIC,
|
|
1042
1040
|
"data-testid": "access-control-password-protected-radio-input"
|
|
1043
1041
|
}, {
|
|
1044
|
-
label: /*#__PURE__*/jsx(Trans, _objectSpread
|
|
1042
|
+
label: /*#__PURE__*/jsx(Trans, _objectSpread({
|
|
1045
1043
|
context: translationContext,
|
|
1046
1044
|
i18nKey: "neetoAccessControl.auth.invited"
|
|
1047
1045
|
}, transProps[AUTH.INVITED])),
|
|
1048
1046
|
value: AUTH.INVITED,
|
|
1049
1047
|
"data-testid": "access-control-only-invited-people-radio-input"
|
|
1050
1048
|
}, {
|
|
1051
|
-
label: /*#__PURE__*/jsx(Trans, _objectSpread
|
|
1049
|
+
label: /*#__PURE__*/jsx(Trans, _objectSpread({
|
|
1052
1050
|
context: translationContext,
|
|
1053
1051
|
i18nKey: "neetoAccessControl.auth.email"
|
|
1054
1052
|
}, transProps[AUTH.EMAIL])),
|
|
1055
1053
|
value: AUTH.EMAIL,
|
|
1056
1054
|
"data-testid": "access-control-secure-by-email-patterns-radio-input"
|
|
1057
1055
|
}, {
|
|
1058
|
-
label: /*#__PURE__*/jsx(Trans, _objectSpread
|
|
1056
|
+
label: /*#__PURE__*/jsx(Trans, _objectSpread({
|
|
1059
1057
|
context: translationContext,
|
|
1060
1058
|
i18nKey: "neetoAccessControl.auth.session"
|
|
1061
1059
|
}, transProps[AUTH.SESSION])),
|
|
@@ -1080,7 +1078,7 @@ var withDefaultInvitationEmail = function withDefaultInvitationEmail(invitationE
|
|
|
1080
1078
|
subject = _ref8$subject === void 0 ? "" : _ref8$subject,
|
|
1081
1079
|
_ref8$message = _ref8.message,
|
|
1082
1080
|
message = _ref8$message === void 0 ? "" : _ref8$message;
|
|
1083
|
-
return _objectSpread
|
|
1081
|
+
return _objectSpread(_objectSpread({}, invitationEmailProps), {}, {
|
|
1084
1082
|
defaultSubject: subject,
|
|
1085
1083
|
defaultMessage: message.replace(/{{\s*([\w.]+)\s*}}/g, function (tag, key) {
|
|
1086
1084
|
var variable = findBy({
|
|
@@ -1110,9 +1108,9 @@ var AllowedKeywords = withT(function (_ref) {
|
|
|
1110
1108
|
return /*#__PURE__*/jsx("div", {
|
|
1111
1109
|
className: "pt-4",
|
|
1112
1110
|
children: /*#__PURE__*/jsxs("div", {
|
|
1113
|
-
className: "border-border bg-card space-y-3 rounded-
|
|
1111
|
+
className: "border-border bg-card space-y-3 rounded-xl border p-6",
|
|
1114
1112
|
children: [/*#__PURE__*/jsx(Label, {
|
|
1115
|
-
className: "leading-snug",
|
|
1113
|
+
className: "text-muted-foreground font-normal leading-snug",
|
|
1116
1114
|
children: label
|
|
1117
1115
|
}), allowedKeywords.map(function (_, index) {
|
|
1118
1116
|
return /*#__PURE__*/jsx("div", {
|
|
@@ -1151,8 +1149,6 @@ var AllowedKeywords = withT(function (_ref) {
|
|
|
1151
1149
|
});
|
|
1152
1150
|
|
|
1153
1151
|
var _excluded$1 = ["savedAuth", "onViewInvites", "inviteOnlyProps", "label"];
|
|
1154
|
-
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; }
|
|
1155
|
-
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; }
|
|
1156
1152
|
var AuthOption = function AuthOption(_ref) {
|
|
1157
1153
|
var savedAuth = _ref.savedAuth,
|
|
1158
1154
|
onViewInvites = _ref.onViewInvites,
|
|
@@ -1166,7 +1162,7 @@ var AuthOption = function AuthOption(_ref) {
|
|
|
1166
1162
|
var renderLabel = function renderLabel() {
|
|
1167
1163
|
if (!isInviteOnlyOption) return label;
|
|
1168
1164
|
if (inviteOnlyProps !== null && inviteOnlyProps !== void 0 && inviteOnlyProps.supportsSetup) {
|
|
1169
|
-
return values.auth === AUTH.INVITED ? renderInviteOnlyLabel(_objectSpread
|
|
1165
|
+
return values.auth === AUTH.INVITED ? renderInviteOnlyLabel(_objectSpread({
|
|
1170
1166
|
label: label,
|
|
1171
1167
|
isSavedInviteOnly: isSavedInviteOnly
|
|
1172
1168
|
}, inviteOnlyProps)) : label;
|
|
@@ -1175,7 +1171,7 @@ var AuthOption = function AuthOption(_ref) {
|
|
|
1175
1171
|
onViewInvites: onViewInvites
|
|
1176
1172
|
}) : label;
|
|
1177
1173
|
};
|
|
1178
|
-
return /*#__PURE__*/jsx(RadioGroup.Item, _objectSpread
|
|
1174
|
+
return /*#__PURE__*/jsx(RadioGroup.Item, _objectSpread(_objectSpread({}, props), {}, {
|
|
1179
1175
|
className: classNames({
|
|
1180
1176
|
"items-start": isInviteOnlyOption
|
|
1181
1177
|
}),
|
|
@@ -1184,14 +1180,12 @@ var AuthOption = function AuthOption(_ref) {
|
|
|
1184
1180
|
}));
|
|
1185
1181
|
};
|
|
1186
1182
|
|
|
1187
|
-
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; }
|
|
1188
|
-
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; }
|
|
1189
1183
|
var Header = function Header(_ref) {
|
|
1190
1184
|
var headerProps = _ref.headerProps;
|
|
1191
1185
|
var title = headerProps.title,
|
|
1192
1186
|
helpLink = headerProps.helpLink,
|
|
1193
1187
|
description = headerProps.description;
|
|
1194
|
-
return /*#__PURE__*/jsx(NeetoHeader, _objectSpread
|
|
1188
|
+
return /*#__PURE__*/jsx(NeetoHeader, _objectSpread(_objectSpread({}, _objectSpread(_objectSpread({}, headerProps), {}, {
|
|
1195
1189
|
title: title
|
|
1196
1190
|
})), {}, {
|
|
1197
1191
|
titleHelpPopoverProps: {
|
|
@@ -1205,8 +1199,6 @@ var Header = function Header(_ref) {
|
|
|
1205
1199
|
};
|
|
1206
1200
|
|
|
1207
1201
|
var _excluded = ["emails", "sendEmail"];
|
|
1208
|
-
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; }
|
|
1209
|
-
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; }
|
|
1210
1202
|
var InviteOnlySelectionWatcher = function InviteOnlySelectionWatcher(_ref) {
|
|
1211
1203
|
var auth = _ref.auth,
|
|
1212
1204
|
onChange = _ref.onChange;
|
|
@@ -1259,14 +1251,18 @@ var Configuration = function Configuration(_ref2) {
|
|
|
1259
1251
|
_useState2 = _slicedToArray(_useState, 2),
|
|
1260
1252
|
showInvitationsPane = _useState2[0],
|
|
1261
1253
|
setShowInvitationsPane = _useState2[1];
|
|
1262
|
-
var _useState3 = useState(
|
|
1254
|
+
var _useState3 = useState(false),
|
|
1263
1255
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
var _useState5 = useState(
|
|
1256
|
+
isPasswordVisible = _useState4[0],
|
|
1257
|
+
setIsPasswordVisible = _useState4[1];
|
|
1258
|
+
var _useState5 = useState(TABS.ADD_PEOPLE),
|
|
1267
1259
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
1268
|
-
|
|
1269
|
-
|
|
1260
|
+
invitationsPaneTab = _useState6[0],
|
|
1261
|
+
setInvitationsPaneTab = _useState6[1];
|
|
1262
|
+
var _useState7 = useState(null),
|
|
1263
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
1264
|
+
stagedInvitations = _useState8[0],
|
|
1265
|
+
setStagedInvitations = _useState8[1];
|
|
1270
1266
|
var FieldsWrapper = fieldsWrapper || Fragment$1;
|
|
1271
1267
|
var _useTranslation = useTranslation(),
|
|
1272
1268
|
t = _useTranslation.t;
|
|
@@ -1306,22 +1302,22 @@ var Configuration = function Configuration(_ref2) {
|
|
|
1306
1302
|
}),
|
|
1307
1303
|
createInvitations = _useCreateConfigurati.mutateAsync;
|
|
1308
1304
|
var saveWithStagedInvitations = /*#__PURE__*/function () {
|
|
1309
|
-
var
|
|
1310
|
-
var emails, sendEmail, emailTemplate, config, invitedEmails, _yield$updateConfigur, _yield$updateConfigur2, _yield$updateConfigur3, savedConfiguration, _yield$createInvitati, _yield$createInvitati2;
|
|
1311
|
-
return
|
|
1312
|
-
while (1) switch (_context.
|
|
1305
|
+
var _saveWithStagedInvitations = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee(payload) {
|
|
1306
|
+
var emails, sendEmail, emailTemplate, config, invitedEmails, _yield$updateConfigur, _yield$updateConfigur2, _yield$updateConfigur3, savedConfiguration, _yield$createInvitati, _yield$createInvitati2, _t;
|
|
1307
|
+
return _regenerator().w(function (_context) {
|
|
1308
|
+
while (1) switch (_context.p = _context.n) {
|
|
1313
1309
|
case 0:
|
|
1314
1310
|
emails = stagedInvitations.emails, sendEmail = stagedInvitations.sendEmail, emailTemplate = _objectWithoutProperties(stagedInvitations, _excluded);
|
|
1315
1311
|
config = {
|
|
1316
1312
|
showToastr: false
|
|
1317
1313
|
};
|
|
1318
|
-
_context.
|
|
1314
|
+
_context.p = 1;
|
|
1319
1315
|
invitedEmails = [];
|
|
1320
1316
|
if (!invitationEmailProps) {
|
|
1321
|
-
_context.
|
|
1317
|
+
_context.n = 3;
|
|
1322
1318
|
break;
|
|
1323
1319
|
}
|
|
1324
|
-
_context.
|
|
1320
|
+
_context.n = 2;
|
|
1325
1321
|
return updateConfiguration({
|
|
1326
1322
|
payload: _objectSpread(_objectSpread(_objectSpread({}, payload), emailTemplate), {}, {
|
|
1327
1323
|
invitations: {
|
|
@@ -1331,22 +1327,22 @@ var Configuration = function Configuration(_ref2) {
|
|
|
1331
1327
|
}),
|
|
1332
1328
|
config: config
|
|
1333
1329
|
});
|
|
1334
|
-
case
|
|
1335
|
-
_yield$updateConfigur = _context.
|
|
1330
|
+
case 2:
|
|
1331
|
+
_yield$updateConfigur = _context.v;
|
|
1336
1332
|
_yield$updateConfigur2 = _yield$updateConfigur.invitedEmails;
|
|
1337
1333
|
invitedEmails = _yield$updateConfigur2 === void 0 ? [] : _yield$updateConfigur2;
|
|
1338
|
-
_context.
|
|
1334
|
+
_context.n = 6;
|
|
1339
1335
|
break;
|
|
1340
|
-
case
|
|
1341
|
-
_context.
|
|
1336
|
+
case 3:
|
|
1337
|
+
_context.n = 4;
|
|
1342
1338
|
return updateConfiguration({
|
|
1343
1339
|
payload: payload,
|
|
1344
1340
|
config: config
|
|
1345
1341
|
});
|
|
1346
|
-
case
|
|
1347
|
-
_yield$updateConfigur3 = _context.
|
|
1342
|
+
case 4:
|
|
1343
|
+
_yield$updateConfigur3 = _context.v;
|
|
1348
1344
|
savedConfiguration = _yield$updateConfigur3.configuration;
|
|
1349
|
-
_context.
|
|
1345
|
+
_context.n = 5;
|
|
1350
1346
|
return createInvitations({
|
|
1351
1347
|
configurationId: savedConfiguration.id,
|
|
1352
1348
|
payload: {
|
|
@@ -1354,31 +1350,31 @@ var Configuration = function Configuration(_ref2) {
|
|
|
1354
1350
|
},
|
|
1355
1351
|
config: config
|
|
1356
1352
|
});
|
|
1357
|
-
case
|
|
1358
|
-
_yield$createInvitati = _context.
|
|
1353
|
+
case 5:
|
|
1354
|
+
_yield$createInvitati = _context.v;
|
|
1359
1355
|
_yield$createInvitati2 = _yield$createInvitati.invitedEmails;
|
|
1360
1356
|
invitedEmails = _yield$createInvitati2 === void 0 ? [] : _yield$createInvitati2;
|
|
1361
|
-
case
|
|
1357
|
+
case 6:
|
|
1362
1358
|
setStagedInvitations(null);
|
|
1363
1359
|
Toastr.success(buildSetupToastMessage({
|
|
1364
1360
|
count: invitedEmails.length,
|
|
1365
1361
|
sendEmail: sendEmail
|
|
1366
1362
|
}));
|
|
1367
|
-
_context.
|
|
1363
|
+
_context.n = 8;
|
|
1368
1364
|
break;
|
|
1369
|
-
case
|
|
1370
|
-
_context.
|
|
1371
|
-
|
|
1372
|
-
Toastr.error(
|
|
1373
|
-
case
|
|
1374
|
-
|
|
1375
|
-
return _context.stop();
|
|
1365
|
+
case 7:
|
|
1366
|
+
_context.p = 7;
|
|
1367
|
+
_t = _context.v;
|
|
1368
|
+
Toastr.error(_t);
|
|
1369
|
+
case 8:
|
|
1370
|
+
return _context.a(2);
|
|
1376
1371
|
}
|
|
1377
|
-
}, _callee, null, [[
|
|
1372
|
+
}, _callee, null, [[1, 7]]);
|
|
1378
1373
|
}));
|
|
1379
|
-
|
|
1380
|
-
return
|
|
1381
|
-
}
|
|
1374
|
+
function saveWithStagedInvitations(_x) {
|
|
1375
|
+
return _saveWithStagedInvitations.apply(this, arguments);
|
|
1376
|
+
}
|
|
1377
|
+
return saveWithStagedInvitations;
|
|
1382
1378
|
}();
|
|
1383
1379
|
var handleSubmit = function handleSubmit(values) {
|
|
1384
1380
|
var payload = mergeLeft(buildPayload(values), pick(keys(additionalFieldsInitialValues), values));
|
|
@@ -1436,10 +1432,10 @@ var Configuration = function Configuration(_ref2) {
|
|
|
1436
1432
|
onOpenInvitations: handleOpenInvitations
|
|
1437
1433
|
}
|
|
1438
1434
|
};
|
|
1439
|
-
var getSubmitButtonProps = function getSubmitButtonProps(
|
|
1440
|
-
var auth =
|
|
1441
|
-
var dirty =
|
|
1442
|
-
isSubmitting =
|
|
1435
|
+
var getSubmitButtonProps = function getSubmitButtonProps(_ref3, _ref4) {
|
|
1436
|
+
var auth = _ref3.auth;
|
|
1437
|
+
var dirty = _ref4.dirty,
|
|
1438
|
+
isSubmitting = _ref4.isSubmitting;
|
|
1443
1439
|
if (auth !== AUTH.INVITED) return {};
|
|
1444
1440
|
if (!supportsSetup) {
|
|
1445
1441
|
return {
|
|
@@ -1472,11 +1468,11 @@ var Configuration = function Configuration(_ref2) {
|
|
|
1472
1468
|
onReset: handleReset,
|
|
1473
1469
|
enableReinitialize: true
|
|
1474
1470
|
},
|
|
1475
|
-
children: function children(
|
|
1476
|
-
var values =
|
|
1477
|
-
setFieldValue =
|
|
1478
|
-
dirty =
|
|
1479
|
-
isSubmitting =
|
|
1471
|
+
children: function children(_ref5) {
|
|
1472
|
+
var values = _ref5.values,
|
|
1473
|
+
setFieldValue = _ref5.setFieldValue,
|
|
1474
|
+
dirty = _ref5.dirty,
|
|
1475
|
+
isSubmitting = _ref5.isSubmitting;
|
|
1480
1476
|
return /*#__PURE__*/jsxs(CardLayout, {
|
|
1481
1477
|
actionBlock: /*#__PURE__*/jsx(ActionBlock, {
|
|
1482
1478
|
cancelButtonProps: {
|
|
@@ -1513,7 +1509,7 @@ var Configuration = function Configuration(_ref2) {
|
|
|
1513
1509
|
value: AUTH.SESSION
|
|
1514
1510
|
})
|
|
1515
1511
|
}), SIGNED_IN_AUTHS.includes(values.auth) && /*#__PURE__*/jsxs("div", {
|
|
1516
|
-
className: "
|
|
1512
|
+
className: "ms-7 space-y-4",
|
|
1517
1513
|
children: [/*#__PURE__*/jsxs(RadioGroup$1, {
|
|
1518
1514
|
className: "data-[orientation=vertical]:gap-4",
|
|
1519
1515
|
orientation: "vertical",
|
|
@@ -1556,11 +1552,25 @@ var Configuration = function Configuration(_ref2) {
|
|
|
1556
1552
|
autoFocus: true,
|
|
1557
1553
|
required: true,
|
|
1558
1554
|
unlimitedChars: true,
|
|
1555
|
+
autoComplete: "new-password",
|
|
1559
1556
|
className: "w-7/12",
|
|
1560
1557
|
dataTestId: "password",
|
|
1561
1558
|
label: t("neetoAccessControl.inputs.labels.password"),
|
|
1562
1559
|
name: "password",
|
|
1563
|
-
|
|
1560
|
+
type: isPasswordVisible ? "text" : "password",
|
|
1561
|
+
placeholder: t("neetoAccessControl.inputs.placeholders.enterPassword"),
|
|
1562
|
+
suffix: /*#__PURE__*/jsx("button", {
|
|
1563
|
+
className: "text-muted-foreground hover:text-foreground cursor-pointer",
|
|
1564
|
+
"data-testid": "toggle-password-visibility-button",
|
|
1565
|
+
type: "button",
|
|
1566
|
+
"aria-label": t(isPasswordVisible ? "neetoAccessControl.inputs.labels.hidePassword" : "neetoAccessControl.inputs.labels.showPassword"),
|
|
1567
|
+
onClick: function onClick() {
|
|
1568
|
+
return setIsPasswordVisible(function (isVisible) {
|
|
1569
|
+
return !isVisible;
|
|
1570
|
+
});
|
|
1571
|
+
},
|
|
1572
|
+
children: isPasswordVisible ? /*#__PURE__*/jsx(EyeOff, {}) : /*#__PURE__*/jsx(Eye, {})
|
|
1573
|
+
})
|
|
1564
1574
|
})
|
|
1565
1575
|
})]
|
|
1566
1576
|
}), enableNavigationBlocking && /*#__PURE__*/jsx(BlockNavigation, {})]
|