@bigbinary/neeto-access-control-frontend 1.2.3 → 1.3.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/README.md +97 -1
- package/dist/index.cjs.js +64 -147
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +53 -141
- package/dist/index.js.map +1 -1
- package/package.json +98 -81
- package/types.d.ts +22 -0
package/README.md
CHANGED
|
@@ -175,10 +175,87 @@ The engine is used to manage access control across neeto products.
|
|
|
175
175
|
- `onReset`: Callback function that is triggered when the reset button is clicked.
|
|
176
176
|
- `onSuccess`: Callback function that is triggered when the configuration is successfully updated.
|
|
177
177
|
- `handleCancel`: Callback function that is triggered when the cancel button is clicked.
|
|
178
|
-
- `
|
|
178
|
+
- `invitationsTableExtraColumnsData`: Prop to add column data for invitations table. This will override the existing column if the key is already present. Refer [Column data](https://neeto-ui.neeto.com/?path=/docs/components-table--docs#columndata-a-idcolumndata-)
|
|
179
179
|
- `onConfigurationChangedToInviteOnly`: Callback function that is triggered when configuration is changed to `invited`. Default: `noop`.
|
|
180
180
|
- `headerProps`: Props passed to the [`Header`](https://neeto-molecules.neeto.com/?path=/docs/layouts-header--docs) component from neetoMolecules.
|
|
181
|
+
- `hideAddEmailsFromInvitationPane`: Prop to hide the add emails form from invitation pane. Default: `false`.
|
|
181
182
|
- `className`: Additional classes to be added to the form.
|
|
183
|
+
- `onDestroyInvitationsSuccess`: Callback function that is triggered when the invitations are successfully destroyed.
|
|
184
|
+
|
|
185
|
+
#### 2. `Invitations` Object
|
|
186
|
+
The `Invitations` object provides access to invitation-related components, hooks, and constants.
|
|
187
|
+
|
|
188
|
+
#### Components
|
|
189
|
+
|
|
190
|
+
#### `InvitationsPane` ([source code](/app/javascript/src/components/Configuration/Invitations/index.jsx))
|
|
191
|
+
|
|
192
|
+
**Props**
|
|
193
|
+
|
|
194
|
+
> Check source code for default values
|
|
195
|
+
- `onClose`: Callback function that is triggered when the close button is clicked.
|
|
196
|
+
- `isOpen`: Prop for pane, will reflect state of the pane.
|
|
197
|
+
- `extraColumnsData`: Prop to add column data for invitations table. This will override the existing column if the key is already present. Refer [Column data](https://neeto-ui.neeto.com/?path=/docs/components-table--docs#columndata-a-idcolumndata-)
|
|
198
|
+
- `ownerId`: To specify the ID of the instance of the model. The ID is used to fetch and update access control configuration.
|
|
199
|
+
- `ownerType`: Type of the model.
|
|
200
|
+
- `hideAddEmailsForm`: Prop to hide the add emails form from invitation pane.
|
|
201
|
+
- `configurationId`: Prop to specify the ID of the instance of the model. The ID is used to load access control configuration. **NOTE: If this prop is not passed, make sure `invitations_controller_override.rb` is added with `access_control_configuration` method as mentioned above in adding overrides section.**
|
|
202
|
+
- `onDestroyInvitationsSuccess`: Callback function that is triggered when the invitations are successfully destroyed.
|
|
203
|
+
|
|
204
|
+
#### Hooks
|
|
205
|
+
- `useBulkCreateInvitations` [source code](/app/javascript/src/hooks/reactQuery/useInvitationsApi.js): Bulk create invitations.Check [usage](app/javascript/src/components/Configuration/Invitations/index.jsx).
|
|
206
|
+
|
|
207
|
+
#### Constants
|
|
208
|
+
- `INVITATIONS_QUERY_KEY`: For react query cache of invitations
|
|
209
|
+
|
|
210
|
+
#### Invitations object usage
|
|
211
|
+
|
|
212
|
+
```jsx
|
|
213
|
+
/* Required imports */
|
|
214
|
+
import { Invitations } from "@bigbinary/neeto-access-control-frontend";
|
|
215
|
+
|
|
216
|
+
const { InvitationsPane, useBulkCreateInvitations, INVITATIONS_QUERY_KEY } =
|
|
217
|
+
Invitations;
|
|
218
|
+
|
|
219
|
+
const MyComponent = () => {
|
|
220
|
+
const [showInviationsPane, setShowInviationsPane] = useState(false);
|
|
221
|
+
const [emails, setEmails] = useState("");
|
|
222
|
+
|
|
223
|
+
const { mutateAsync: addEmails } = useBulkCreateInvitations({
|
|
224
|
+
configurationId: null,
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
const queryClient = useQueryClient();
|
|
228
|
+
|
|
229
|
+
const addTestEmails = async () => {
|
|
230
|
+
const payload = { emails: emails.split(",") };
|
|
231
|
+
await addEmails(payload);
|
|
232
|
+
setEmails("");
|
|
233
|
+
queryClient.invalidateQueries({
|
|
234
|
+
queryKey: [INVITATIONS_QUERY_KEY],
|
|
235
|
+
});
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
return (
|
|
239
|
+
<div className="space-4 p-5">
|
|
240
|
+
<Input
|
|
241
|
+
label="Email"
|
|
242
|
+
value={emails}
|
|
243
|
+
onChange={e => setEmails(e.target.value)}
|
|
244
|
+
/>
|
|
245
|
+
<Button label="Add test email " onClick={addTestEmails} />
|
|
246
|
+
<Button
|
|
247
|
+
label="Open Invitation pane"
|
|
248
|
+
onClick={() => setShowInviationsPane(true)}
|
|
249
|
+
/>
|
|
250
|
+
<InvitationsPane
|
|
251
|
+
hideAddEmailsForm
|
|
252
|
+
isOpen={showInviationsPane}
|
|
253
|
+
onClose={() => setShowInviationsPane(false)}
|
|
254
|
+
/>
|
|
255
|
+
</div>
|
|
256
|
+
);
|
|
257
|
+
};
|
|
258
|
+
```
|
|
182
259
|
|
|
183
260
|
**Usage**
|
|
184
261
|
|
|
@@ -213,6 +290,25 @@ const AccessControl = () => {
|
|
|
213
290
|
export default AccessControl;
|
|
214
291
|
```
|
|
215
292
|
|
|
293
|
+
### Hooks
|
|
294
|
+
|
|
295
|
+
#### 1. `useShowConfiguration`
|
|
296
|
+
|
|
297
|
+
This is a React Query hook for fetching access control configuration of specified owner.
|
|
298
|
+
|
|
299
|
+
#### Arguments
|
|
300
|
+
|
|
301
|
+
- `ownerId`: To specify the ID of the model instance. This ID will be used to fetch access control configuration.
|
|
302
|
+
- `ownerType`: Type of the model.
|
|
303
|
+
|
|
304
|
+
#### Usage
|
|
305
|
+
|
|
306
|
+
```jsx
|
|
307
|
+
const {
|
|
308
|
+
data: { configuration },
|
|
309
|
+
} = useShowConfiguration({ ownerId, ownerType });
|
|
310
|
+
```
|
|
311
|
+
|
|
216
312
|
### Customize option labels in the host application with translations
|
|
217
313
|
|
|
218
314
|
To customize option labels for authentication, you can set the translations from the host application.
|
package/dist/index.cjs.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
|
+
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
5
7
|
var react = require('react');
|
|
6
8
|
var classNames = require('classnames');
|
|
7
9
|
var neetoCist = require('@bigbinary/neeto-cist');
|
|
@@ -25,6 +27,7 @@ var Pane = require('@bigbinary/neetoui/Pane');
|
|
|
25
27
|
var Table = require('@bigbinary/neetoui/Table');
|
|
26
28
|
var Typography = require('@bigbinary/neetoui/Typography');
|
|
27
29
|
var ramda = require('ramda');
|
|
30
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
28
31
|
var reactQuery = require('@tanstack/react-query');
|
|
29
32
|
var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
|
|
30
33
|
var axios = require('axios');
|
|
@@ -59,6 +62,8 @@ function _interopNamespace(e) {
|
|
|
59
62
|
return Object.freeze(n);
|
|
60
63
|
}
|
|
61
64
|
|
|
65
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
66
|
+
var _slicedToArray__default = /*#__PURE__*/_interopDefaultLegacy(_slicedToArray);
|
|
62
67
|
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
63
68
|
var Container__default = /*#__PURE__*/_interopDefaultLegacy(Container);
|
|
64
69
|
var Scrollable__default = /*#__PURE__*/_interopDefaultLegacy(Scrollable);
|
|
@@ -77,6 +82,7 @@ var NoData__default = /*#__PURE__*/_interopDefaultLegacy(NoData);
|
|
|
77
82
|
var Pane__default = /*#__PURE__*/_interopDefaultLegacy(Pane);
|
|
78
83
|
var Table__default = /*#__PURE__*/_interopDefaultLegacy(Table);
|
|
79
84
|
var Typography__default = /*#__PURE__*/_interopDefaultLegacy(Typography);
|
|
85
|
+
var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutProperties);
|
|
80
86
|
var axios__default = /*#__PURE__*/_interopDefaultLegacy(axios);
|
|
81
87
|
var MultiEmailInput__default = /*#__PURE__*/_interopDefaultLegacy(MultiEmailInput);
|
|
82
88
|
var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
@@ -86,131 +92,6 @@ var Tooltip__default = /*#__PURE__*/_interopDefaultLegacy(Tooltip);
|
|
|
86
92
|
var NeetoHeader__default = /*#__PURE__*/_interopDefaultLegacy(NeetoHeader);
|
|
87
93
|
var HelpPopover__default = /*#__PURE__*/_interopDefaultLegacy(HelpPopover);
|
|
88
94
|
|
|
89
|
-
function _typeof(o) {
|
|
90
|
-
"@babel/helpers - typeof";
|
|
91
|
-
|
|
92
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
93
|
-
return typeof o;
|
|
94
|
-
} : function (o) {
|
|
95
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
96
|
-
}, _typeof(o);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
function _toPrimitive(input, hint) {
|
|
100
|
-
if (_typeof(input) !== "object" || input === null) return input;
|
|
101
|
-
var prim = input[Symbol.toPrimitive];
|
|
102
|
-
if (prim !== undefined) {
|
|
103
|
-
var res = prim.call(input, hint || "default");
|
|
104
|
-
if (_typeof(res) !== "object") return res;
|
|
105
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
106
|
-
}
|
|
107
|
-
return (hint === "string" ? String : Number)(input);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
function _toPropertyKey(arg) {
|
|
111
|
-
var key = _toPrimitive(arg, "string");
|
|
112
|
-
return _typeof(key) === "symbol" ? key : String(key);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
function _defineProperty(obj, key, value) {
|
|
116
|
-
key = _toPropertyKey(key);
|
|
117
|
-
if (key in obj) {
|
|
118
|
-
Object.defineProperty(obj, key, {
|
|
119
|
-
value: value,
|
|
120
|
-
enumerable: true,
|
|
121
|
-
configurable: true,
|
|
122
|
-
writable: true
|
|
123
|
-
});
|
|
124
|
-
} else {
|
|
125
|
-
obj[key] = value;
|
|
126
|
-
}
|
|
127
|
-
return obj;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function _arrayWithHoles(arr) {
|
|
131
|
-
if (Array.isArray(arr)) return arr;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function _iterableToArrayLimit(r, l) {
|
|
135
|
-
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
136
|
-
if (null != t) {
|
|
137
|
-
var e,
|
|
138
|
-
n,
|
|
139
|
-
i,
|
|
140
|
-
u,
|
|
141
|
-
a = [],
|
|
142
|
-
f = !0,
|
|
143
|
-
o = !1;
|
|
144
|
-
try {
|
|
145
|
-
if (i = (t = t.call(r)).next, 0 === l) {
|
|
146
|
-
if (Object(t) !== t) return;
|
|
147
|
-
f = !1;
|
|
148
|
-
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
149
|
-
} catch (r) {
|
|
150
|
-
o = !0, n = r;
|
|
151
|
-
} finally {
|
|
152
|
-
try {
|
|
153
|
-
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
154
|
-
} finally {
|
|
155
|
-
if (o) throw n;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
return a;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function _arrayLikeToArray(arr, len) {
|
|
163
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
164
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
165
|
-
return arr2;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
169
|
-
if (!o) return;
|
|
170
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
171
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
172
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
173
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
174
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
function _nonIterableRest() {
|
|
178
|
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
function _slicedToArray(arr, i) {
|
|
182
|
-
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
186
|
-
if (source == null) return {};
|
|
187
|
-
var target = {};
|
|
188
|
-
var sourceKeys = Object.keys(source);
|
|
189
|
-
var key, i;
|
|
190
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
191
|
-
key = sourceKeys[i];
|
|
192
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
193
|
-
target[key] = source[key];
|
|
194
|
-
}
|
|
195
|
-
return target;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function _objectWithoutProperties(source, excluded) {
|
|
199
|
-
if (source == null) return {};
|
|
200
|
-
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
201
|
-
var key, i;
|
|
202
|
-
if (Object.getOwnPropertySymbols) {
|
|
203
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
204
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
205
|
-
key = sourceSymbolKeys[i];
|
|
206
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
207
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
208
|
-
target[key] = source[key];
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return target;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
95
|
var ACCESS_CONTROL_BASE_PATH = "/secure/api/v1";
|
|
215
96
|
|
|
216
97
|
var invitationsPath = "".concat(ACCESS_CONTROL_BASE_PATH, "/configuration/invitations");
|
|
@@ -250,12 +131,12 @@ var QUERY_KEYS = {
|
|
|
250
131
|
|
|
251
132
|
var _excluded = ["ownerId", "ownerType"];
|
|
252
133
|
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; }
|
|
253
|
-
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) {
|
|
134
|
+
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__default["default"](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; }
|
|
254
135
|
var ACCESS_CONTROL_CONFIGURATION_INVITATIONS$1 = QUERY_KEYS.ACCESS_CONTROL_CONFIGURATION_INVITATIONS;
|
|
255
136
|
var useListInvitations = function useListInvitations(_ref, options) {
|
|
256
137
|
var ownerId = _ref.ownerId,
|
|
257
138
|
ownerType = _ref.ownerType,
|
|
258
|
-
otherParams =
|
|
139
|
+
otherParams = _objectWithoutProperties__default["default"](_ref, _excluded);
|
|
259
140
|
return reactQuery.useQuery(_objectSpread$3({
|
|
260
141
|
queryKey: [ACCESS_CONTROL_CONFIGURATION_INVITATIONS$1, ownerType, ownerId, otherParams],
|
|
261
142
|
queryFn: function queryFn() {
|
|
@@ -355,7 +236,7 @@ var AddEmails = function AddEmails(_ref) {
|
|
|
355
236
|
});
|
|
356
237
|
};
|
|
357
238
|
|
|
358
|
-
var
|
|
239
|
+
var defaultColumnData = function defaultColumnData(_ref) {
|
|
359
240
|
var onDelete = _ref.onDelete;
|
|
360
241
|
return [{
|
|
361
242
|
title: i18next.t("neetoAccessControl.titles.emails"),
|
|
@@ -396,25 +277,44 @@ var renderColumnData = function renderColumnData(_ref) {
|
|
|
396
277
|
}
|
|
397
278
|
}];
|
|
398
279
|
};
|
|
280
|
+
var mergeByKey = function mergeByKey(key, a, b) {
|
|
281
|
+
var merge = ramda.mergeDeepRight(ramda.indexBy(ramda.prop(key), a), ramda.indexBy(ramda.prop(key), b));
|
|
282
|
+
return ramda.values(merge);
|
|
283
|
+
};
|
|
284
|
+
var renderColumnData = function renderColumnData(_ref2) {
|
|
285
|
+
var onDelete = _ref2.onDelete,
|
|
286
|
+
_ref2$extraColumnsDat = _ref2.extraColumnsData,
|
|
287
|
+
extraColumnsData = _ref2$extraColumnsDat === void 0 ? [] : _ref2$extraColumnsDat;
|
|
288
|
+
return mergeByKey("key", defaultColumnData({
|
|
289
|
+
onDelete: onDelete
|
|
290
|
+
}), extraColumnsData);
|
|
291
|
+
};
|
|
399
292
|
|
|
400
|
-
var Invitations = function Invitations(_ref) {
|
|
293
|
+
var Invitations$1 = function Invitations(_ref) {
|
|
401
294
|
var _selectedEmails$;
|
|
402
|
-
var
|
|
295
|
+
var _ref$extraColumnsData = _ref.extraColumnsData,
|
|
296
|
+
extraColumnsData = _ref$extraColumnsData === void 0 ? [] : _ref$extraColumnsData,
|
|
403
297
|
configurationId = _ref.configurationId,
|
|
404
|
-
ownerType = _ref.ownerType,
|
|
405
|
-
|
|
298
|
+
_ref$ownerType = _ref.ownerType,
|
|
299
|
+
ownerType = _ref$ownerType === void 0 ? null : _ref$ownerType,
|
|
300
|
+
_ref$ownerId = _ref.ownerId,
|
|
301
|
+
ownerId = _ref$ownerId === void 0 ? null : _ref$ownerId,
|
|
406
302
|
isOpen = _ref.isOpen,
|
|
407
|
-
onClose = _ref.onClose
|
|
303
|
+
onClose = _ref.onClose,
|
|
304
|
+
_ref$hideAddEmailsFor = _ref.hideAddEmailsForm,
|
|
305
|
+
hideAddEmailsForm = _ref$hideAddEmailsFor === void 0 ? false : _ref$hideAddEmailsFor,
|
|
306
|
+
_ref$onDestroyInvitat = _ref.onDestroyInvitationsSuccess,
|
|
307
|
+
onDestroyInvitationsSuccess = _ref$onDestroyInvitat === void 0 ? neetoCist.noop : _ref$onDestroyInvitat;
|
|
408
308
|
var _useState = react.useState([]),
|
|
409
|
-
_useState2 =
|
|
309
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
410
310
|
selectedEmails = _useState2[0],
|
|
411
311
|
setSelectedEmails = _useState2[1];
|
|
412
312
|
var _useState3 = react.useState(false),
|
|
413
|
-
_useState4 =
|
|
313
|
+
_useState4 = _slicedToArray__default["default"](_useState3, 2),
|
|
414
314
|
showDeleteAlert = _useState4[0],
|
|
415
315
|
setShowDeleteAlert = _useState4[1];
|
|
416
316
|
var _useState5 = react.useState(constants.DEFAULT_PAGE_INDEX),
|
|
417
|
-
_useState6 =
|
|
317
|
+
_useState6 = _slicedToArray__default["default"](_useState5, 2),
|
|
418
318
|
page = _useState6[0],
|
|
419
319
|
setPage = _useState6[1];
|
|
420
320
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -455,6 +355,7 @@ var Invitations = function Invitations(_ref) {
|
|
|
455
355
|
onSuccess: function onSuccess() {
|
|
456
356
|
setSelectedEmails([]);
|
|
457
357
|
setShowDeleteAlert(false);
|
|
358
|
+
onDestroyInvitationsSuccess();
|
|
458
359
|
}
|
|
459
360
|
});
|
|
460
361
|
};
|
|
@@ -475,7 +376,7 @@ var Invitations = function Invitations(_ref) {
|
|
|
475
376
|
})
|
|
476
377
|
}), /*#__PURE__*/jsxRuntime.jsxs(Pane__default["default"].Body, {
|
|
477
378
|
className: "pt-2",
|
|
478
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(AddEmails, {
|
|
379
|
+
children: [!hideAddEmailsForm && /*#__PURE__*/jsxRuntime.jsx(AddEmails, {
|
|
479
380
|
configurationId: configurationId,
|
|
480
381
|
ownerId: ownerId,
|
|
481
382
|
ownerType: ownerType
|
|
@@ -518,8 +419,9 @@ var Invitations = function Invitations(_ref) {
|
|
|
518
419
|
loading: isFetching,
|
|
519
420
|
rowData: invitations,
|
|
520
421
|
selectedRowKeys: ramda.pluck("id", selectedEmails),
|
|
521
|
-
columnData:
|
|
522
|
-
onDelete: handleDeleteAction
|
|
422
|
+
columnData: renderColumnData({
|
|
423
|
+
onDelete: handleDeleteAction,
|
|
424
|
+
extraColumnsData: extraColumnsData
|
|
523
425
|
}),
|
|
524
426
|
onRowSelect: function onRowSelect(_, selectedRows) {
|
|
525
427
|
return setSelectedEmails(selectedRows);
|
|
@@ -586,7 +488,7 @@ var configurationsApi = {
|
|
|
586
488
|
};
|
|
587
489
|
|
|
588
490
|
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; }
|
|
589
|
-
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) {
|
|
491
|
+
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__default["default"](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; }
|
|
590
492
|
var ACCESS_CONTROL_CONFIGURATION = QUERY_KEYS.ACCESS_CONTROL_CONFIGURATION,
|
|
591
493
|
ACCESS_CONTROL_CONFIGURATION_INVITATIONS = QUERY_KEYS.ACCESS_CONTROL_CONFIGURATION_INVITATIONS;
|
|
592
494
|
var useShowConfiguration = function useShowConfiguration(_ref) {
|
|
@@ -761,7 +663,7 @@ var AllowedKeywords = reactUtils.withT(function (_ref) {
|
|
|
761
663
|
});
|
|
762
664
|
|
|
763
665
|
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; }
|
|
764
|
-
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), !0).forEach(function (r) {
|
|
666
|
+
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), !0).forEach(function (r) { _defineProperty__default["default"](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; }
|
|
765
667
|
var Header = function Header(_ref) {
|
|
766
668
|
var headerProps = _ref.headerProps;
|
|
767
669
|
var title = headerProps.title,
|
|
@@ -783,7 +685,7 @@ var Header = function Header(_ref) {
|
|
|
783
685
|
};
|
|
784
686
|
|
|
785
687
|
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; }
|
|
786
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
688
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](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; }
|
|
787
689
|
var Configuration = function Configuration(_ref) {
|
|
788
690
|
var ownerId = _ref.ownerId,
|
|
789
691
|
ownerType = _ref.ownerType,
|
|
@@ -795,10 +697,14 @@ var Configuration = function Configuration(_ref) {
|
|
|
795
697
|
handleCancel = _ref$handleCancel === void 0 ? neetoCist.noop : _ref$handleCancel,
|
|
796
698
|
_ref$onConfigurationC = _ref.onConfigurationChangedToInviteOnly,
|
|
797
699
|
onConfigurationChangedToInviteOnly = _ref$onConfigurationC === void 0 ? neetoCist.noop : _ref$onConfigurationC,
|
|
798
|
-
_ref$invitationsTable = _ref.
|
|
799
|
-
|
|
700
|
+
_ref$invitationsTable = _ref.invitationsTableExtraColumnsData,
|
|
701
|
+
invitationsTableExtraColumnsData = _ref$invitationsTable === void 0 ? [] : _ref$invitationsTable,
|
|
702
|
+
_ref$hideAddEmailsFro = _ref.hideAddEmailsFromInvitationPane,
|
|
703
|
+
hideAddEmailsFromInvitationPane = _ref$hideAddEmailsFro === void 0 ? false : _ref$hideAddEmailsFro,
|
|
704
|
+
_ref$onDestroyInvitat = _ref.onDestroyInvitationsSuccess,
|
|
705
|
+
onDestroyInvitationsSuccess = _ref$onDestroyInvitat === void 0 ? neetoCist.noop : _ref$onDestroyInvitat;
|
|
800
706
|
var _useState = react.useState(false),
|
|
801
|
-
_useState2 =
|
|
707
|
+
_useState2 = _slicedToArray__default["default"](_useState, 2),
|
|
802
708
|
showInviationsPane = _useState2[0],
|
|
803
709
|
setShowInviationsPane = _useState2[1];
|
|
804
710
|
var _useTranslation = reactI18next.useTranslation(),
|
|
@@ -907,11 +813,13 @@ var Configuration = function Configuration(_ref) {
|
|
|
907
813
|
})]
|
|
908
814
|
});
|
|
909
815
|
}
|
|
910
|
-
}), /*#__PURE__*/jsxRuntime.jsx(Invitations, {
|
|
911
|
-
|
|
816
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Invitations$1, {
|
|
817
|
+
onDestroyInvitationsSuccess: onDestroyInvitationsSuccess,
|
|
912
818
|
ownerId: ownerId,
|
|
913
819
|
ownerType: ownerType,
|
|
914
820
|
configurationId: configuration.id,
|
|
821
|
+
extraColumnsData: invitationsTableExtraColumnsData,
|
|
822
|
+
hideAddEmailsForm: hideAddEmailsFromInvitationPane,
|
|
915
823
|
isOpen: showInviationsPane && !isFetching,
|
|
916
824
|
onClose: function onClose() {
|
|
917
825
|
return setShowInviationsPane(false);
|
|
@@ -921,5 +829,14 @@ var Configuration = function Configuration(_ref) {
|
|
|
921
829
|
});
|
|
922
830
|
};
|
|
923
831
|
|
|
832
|
+
var INVITATIONS_QUERY_KEY = QUERY_KEYS.ACCESS_CONTROL_CONFIGURATION_INVITATIONS;
|
|
833
|
+
var Invitations = {
|
|
834
|
+
InvitationsPane: Invitations$1,
|
|
835
|
+
useBulkCreateInvitations: useBulkCreateInvitations,
|
|
836
|
+
INVITATIONS_QUERY_KEY: INVITATIONS_QUERY_KEY
|
|
837
|
+
};
|
|
838
|
+
|
|
924
839
|
exports.Configuration = Configuration;
|
|
840
|
+
exports.Invitations = Invitations;
|
|
841
|
+
exports.useShowConfiguration = useShowConfiguration;
|
|
925
842
|
//# sourceMappingURL=index.cjs.js.map
|