@bigbinary/neeto-access-control-frontend 1.3.3 → 1.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -137,6 +137,10 @@ The engine is used to manage access control across neeto products.
137
137
  def owner
138
138
  @organization
139
139
  end
140
+
141
+ def update_owner!
142
+ # Optional override to update the owner if required when configuration is updated
143
+ end
140
144
  end
141
145
  ```
142
146
 
@@ -181,6 +185,11 @@ The engine is used to manage access control across neeto products.
181
185
  - `hideAddEmailsFromInvitationPane`: Prop to hide the add emails form from invitation pane. Default: `false`.
182
186
  - `className`: Additional classes to be added to the form.
183
187
  - `onDestroyInvitationsSuccess`: Callback function that is triggered when the invitations are successfully destroyed.
188
+ - `inviteButtonProps`: If specified, this will show a button on the top of the Pane. It can be used to take the users to invitation forms outside the InvitationsPane.
189
+ - `additionalFieldsInitialValues`: Prop to add additional custom fields to the form.
190
+ - `fieldsWrapper`: A component that wraps the fields in the form. Useful for adding custom fields to the form.
191
+ - `translationContext`: Context for translations, it can be used to override the translations of the field labels. Ref: https://www.i18next.com/translation-function/context
192
+ - `transProps`: Props for the `Trans` component used in the form field labels. Each field label can be customized by passing the props in the `transProps` object mapped to the auth type: `no`, `basic`, `email`, `session`, `invited`.
184
193
 
185
194
  #### 2. `Invitations` Object
186
195
  The `Invitations` object provides access to invitation-related components, hooks, and constants.
@@ -200,6 +209,7 @@ The `Invitations` object provides access to invitation-related components, hooks
200
209
  - `hideAddEmailsForm`: Prop to hide the add emails form from invitation pane.
201
210
  - `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
211
  - `onDestroyInvitationsSuccess`: Callback function that is triggered when the invitations are successfully destroyed.
212
+ - `inviteButtonProps`: If specified, this will show a button on the top of the Pane. It can be used to take the users to invitation forms outside the InvitationsPane.
203
213
 
204
214
  #### Hooks
205
215
  - `useBulkCreateInvitations` [source code](/app/javascript/src/hooks/reactQuery/useInvitationsApi.js): Bulk create invitations.Check [usage](app/javascript/src/components/Configuration/Invitations/index.jsx).
package/dist/index.cjs.js CHANGED
@@ -7,12 +7,12 @@ var classNames = require('classnames');
7
7
  var neetoCist = require('@bigbinary/neeto-cist');
8
8
  var Container = require('@bigbinary/neeto-molecules/Container');
9
9
  var Scrollable = require('@bigbinary/neeto-molecules/Scrollable');
10
- var Label = require('@bigbinary/neetoui/Label');
11
10
  var Spinner = require('@bigbinary/neetoui/Spinner');
12
11
  var ActionBlock = require('@bigbinary/neetoui/formik/ActionBlock');
13
12
  var Form = require('@bigbinary/neetoui/formik/Form');
14
13
  var Input = require('@bigbinary/neetoui/formik/Input');
15
14
  var Radio = require('@bigbinary/neetoui/formik/Radio');
15
+ var ramda = require('ramda');
16
16
  var reactI18next = require('react-i18next');
17
17
  var constants = require('@bigbinary/neeto-commons-frontend/constants');
18
18
  var Delete = require('@bigbinary/neeto-icons/Delete');
@@ -24,7 +24,6 @@ var NoData = require('@bigbinary/neetoui/NoData');
24
24
  var Pane = require('@bigbinary/neetoui/Pane');
25
25
  var Table = require('@bigbinary/neetoui/Table');
26
26
  var Typography = require('@bigbinary/neetoui/Typography');
27
- var ramda = require('ramda');
28
27
  var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
29
28
  var reactQuery = require('@tanstack/react-query');
30
29
  var reactUtils = require('@bigbinary/neeto-commons-frontend/react-utils');
@@ -37,6 +36,7 @@ var jsxRuntime = require('react/jsx-runtime');
37
36
  var MoreDropdown = require('@bigbinary/neeto-molecules/MoreDropdown');
38
37
  var Tooltip = require('@bigbinary/neetoui/Tooltip');
39
38
  var formik = require('formik');
39
+ var Label = require('@bigbinary/neetoui/Label');
40
40
  var NeetoHeader = require('@bigbinary/neeto-molecules/Header');
41
41
  var HelpPopover = require('@bigbinary/neeto-molecules/HelpPopover');
42
42
 
@@ -97,14 +97,14 @@ var QUERY_KEYS = {
97
97
  };
98
98
 
99
99
  var _excluded = ["ownerId", "ownerType"];
100
- 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; }
101
- function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
100
+ function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
101
+ function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
102
102
  var ACCESS_CONTROL_CONFIGURATION_INVITATIONS$1 = QUERY_KEYS.ACCESS_CONTROL_CONFIGURATION_INVITATIONS;
103
103
  var useListInvitations = function useListInvitations(_ref, options) {
104
104
  var ownerId = _ref.ownerId,
105
105
  ownerType = _ref.ownerType,
106
106
  otherParams = _objectWithoutProperties(_ref, _excluded);
107
- return reactQuery.useQuery(_objectSpread$3({
107
+ return reactQuery.useQuery(_objectSpread$5({
108
108
  queryKey: [ACCESS_CONTROL_CONFIGURATION_INVITATIONS$1, ownerType, ownerId, otherParams],
109
109
  queryFn: function queryFn() {
110
110
  return invitationsApi.list(otherParams);
@@ -121,7 +121,7 @@ var useBulkCreateInvitations = function useBulkCreateInvitations(_ref2, options)
121
121
  configurationId: configurationId,
122
122
  payload: payload
123
123
  });
124
- }, _objectSpread$3({
124
+ }, _objectSpread$5({
125
125
  keysToInvalidate: [[ACCESS_CONTROL_CONFIGURATION_INVITATIONS$1, ownerType, ownerId]]
126
126
  }, options));
127
127
  };
@@ -134,7 +134,7 @@ var useBulkDestroyInvitations = function useBulkDestroyInvitations(_ref3, option
134
134
  configurationId: configurationId,
135
135
  payload: payload
136
136
  });
137
- }, _objectSpread$3({
137
+ }, _objectSpread$5({
138
138
  keysToInvalidate: [[ACCESS_CONTROL_CONFIGURATION_INVITATIONS$1, ownerType, ownerId]]
139
139
  }, options));
140
140
  };
@@ -257,6 +257,8 @@ var renderColumnData = function renderColumnData(_ref2) {
257
257
  }), extraColumnsData);
258
258
  };
259
259
 
260
+ 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; }
261
+ function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
260
262
  var Invitations$1 = function Invitations(_ref) {
261
263
  var _selectedEmails$;
262
264
  var _ref$extraColumnsData = _ref.extraColumnsData,
@@ -270,6 +272,8 @@ var Invitations$1 = function Invitations(_ref) {
270
272
  onClose = _ref.onClose,
271
273
  _ref$hideAddEmailsFor = _ref.hideAddEmailsForm,
272
274
  hideAddEmailsForm = _ref$hideAddEmailsFor === void 0 ? false : _ref$hideAddEmailsFor,
275
+ _ref$inviteButtonProp = _ref.inviteButtonProps,
276
+ inviteButtonProps = _ref$inviteButtonProp === void 0 ? {} : _ref$inviteButtonProp,
273
277
  _ref$onDestroyInvitat = _ref.onDestroyInvitationsSuccess,
274
278
  onDestroyInvitationsSuccess = _ref$onDestroyInvitat === void 0 ? neetoCist.noop : _ref$onDestroyInvitat;
275
279
  var _useState = react.useState([]),
@@ -342,8 +346,11 @@ var Invitations$1 = function Invitations(_ref) {
342
346
  children: t("neetoAccessControl.titles.invitations")
343
347
  })
344
348
  }), /*#__PURE__*/jsxRuntime.jsxs(Pane.Body, {
345
- className: "pt-2",
346
- children: [!hideAddEmailsForm && /*#__PURE__*/jsxRuntime.jsx(AddEmails, {
349
+ className: "space-y-4 pt-2",
350
+ children: [neetoCist.isNotEmpty(inviteButtonProps) && /*#__PURE__*/jsxRuntime.jsx("div", {
351
+ className: "flex w-full justify-end",
352
+ children: /*#__PURE__*/jsxRuntime.jsx(Button$1, _objectSpread$4({}, inviteButtonProps))
353
+ }), !hideAddEmailsForm && /*#__PURE__*/jsxRuntime.jsx(AddEmails, {
347
354
  configurationId: configurationId,
348
355
  ownerId: ownerId,
349
356
  ownerType: ownerType
@@ -454,8 +461,8 @@ var configurationsApi = {
454
461
  update: update
455
462
  };
456
463
 
457
- 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; }
458
- function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
464
+ 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; }
465
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
459
466
  var ACCESS_CONTROL_CONFIGURATION = QUERY_KEYS.ACCESS_CONTROL_CONFIGURATION,
460
467
  ACCESS_CONTROL_CONFIGURATION_INVITATIONS = QUERY_KEYS.ACCESS_CONTROL_CONFIGURATION_INVITATIONS;
461
468
  var useShowConfiguration = function useShowConfiguration(_ref) {
@@ -482,7 +489,7 @@ var useUpdateConfiguration = function useUpdateConfiguration(_ref2, options) {
482
489
  ownerType: ownerType,
483
490
  payload: payload
484
491
  });
485
- }, _objectSpread$2({
492
+ }, _objectSpread$3({
486
493
  keysToInvalidate: [[ACCESS_CONTROL_CONFIGURATION, ownerType, ownerId], [ACCESS_CONTROL_CONFIGURATION_INVITATIONS, ownerType, ownerId]]
487
494
  }, options));
488
495
  };
@@ -494,27 +501,6 @@ var AUTH = {
494
501
  SESSION: "session",
495
502
  INVITED: "invited"
496
503
  };
497
- var AUTH_OPTIONS = [{
498
- label: i18next.t("neetoAccessControl.auth.no"),
499
- value: AUTH.NO,
500
- "data-cy": "access-control-public-access-radio-input"
501
- }, {
502
- label: i18next.t("neetoAccessControl.auth.basic"),
503
- value: AUTH.BASIC,
504
- "data-cy": "access-control-password-protected-radio-input"
505
- }, {
506
- label: i18next.t("neetoAccessControl.auth.invited"),
507
- value: AUTH.INVITED,
508
- "data-cy": "access-control-only-invited-people-radio-input"
509
- }, {
510
- label: i18next.t("neetoAccessControl.auth.email"),
511
- value: AUTH.EMAIL,
512
- "data-cy": "access-control-secure-by-email-patterns-radio-input"
513
- }, {
514
- label: i18next.t("neetoAccessControl.auth.session"),
515
- value: AUTH.SESSION,
516
- "data-cy": "access-control-logged-in-members-only-radio-input"
517
- }];
518
504
  var CONFIGURATION_VALIDATION_SCHEMA = yup__namespace.object({
519
505
  auth: yup__namespace.string().required(i18next.t("neetoAccessControl.inputs.validation.authRequired")),
520
506
  password: yup__namespace.string().nullable().when("auth", {
@@ -532,6 +518,8 @@ var DEFAULT_CONFIGURATION_VALUES = {
532
518
  allowedKeywords: [""]
533
519
  };
534
520
 
521
+ 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; }
522
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
535
523
  var buildConfigurationInitialValues = function buildConfigurationInitialValues(configuration) {
536
524
  if (configuration.auth === AUTH.NO) {
537
525
  return DEFAULT_CONFIGURATION_VALUES;
@@ -579,6 +567,46 @@ var renderLabelWithViewInvitation = function renderLabelWithViewInvitation(_ref2
579
567
  }
580
568
  });
581
569
  };
570
+ var getAuthOptions = function getAuthOptions(_ref3) {
571
+ var translationContext = _ref3.translationContext,
572
+ transProps = _ref3.transProps;
573
+ return [{
574
+ label: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread$2({
575
+ context: translationContext,
576
+ i18nKey: "neetoAccessControl.auth.no"
577
+ }, transProps[AUTH.NO])),
578
+ value: AUTH.NO,
579
+ "data-cy": "access-control-public-access-radio-input"
580
+ }, {
581
+ label: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread$2({
582
+ context: translationContext,
583
+ i18nKey: "neetoAccessControl.auth.basic"
584
+ }, transProps[AUTH.BASIC])),
585
+ value: AUTH.BASIC,
586
+ "data-cy": "access-control-password-protected-radio-input"
587
+ }, {
588
+ label: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread$2({
589
+ context: translationContext,
590
+ i18nKey: "neetoAccessControl.auth.invited"
591
+ }, transProps[AUTH.INVITED])),
592
+ value: AUTH.INVITED,
593
+ "data-cy": "access-control-only-invited-people-radio-input"
594
+ }, {
595
+ label: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread$2({
596
+ context: translationContext,
597
+ i18nKey: "neetoAccessControl.auth.email"
598
+ }, transProps[AUTH.EMAIL])),
599
+ value: AUTH.EMAIL,
600
+ "data-cy": "access-control-secure-by-email-patterns-radio-input"
601
+ }, {
602
+ label: /*#__PURE__*/jsxRuntime.jsx(reactI18next.Trans, _objectSpread$2({
603
+ context: translationContext,
604
+ i18nKey: "neetoAccessControl.auth.session"
605
+ }, transProps[AUTH.SESSION])),
606
+ value: AUTH.SESSION,
607
+ "data-cy": "access-control-logged-in-members-only-radio-input"
608
+ }];
609
+ };
582
610
 
583
611
  var AllowedKeywords = reactUtils.withT(function (_ref) {
584
612
  var t = _ref.t,
@@ -671,11 +699,20 @@ var Configuration = function Configuration(_ref) {
671
699
  hideAddEmailsFromInvitationPane = _ref$hideAddEmailsFro === void 0 ? false : _ref$hideAddEmailsFro,
672
700
  _ref$onDestroyInvitat = _ref.onDestroyInvitationsSuccess,
673
701
  onDestroyInvitationsSuccess = _ref$onDestroyInvitat === void 0 ? neetoCist.noop : _ref$onDestroyInvitat,
674
- children = _ref.children;
702
+ _ref$inviteButtonProp = _ref.inviteButtonProps,
703
+ inviteButtonProps = _ref$inviteButtonProp === void 0 ? {} : _ref$inviteButtonProp,
704
+ _ref$additionalFields = _ref.additionalFieldsInitialValues,
705
+ additionalFieldsInitialValues = _ref$additionalFields === void 0 ? {} : _ref$additionalFields,
706
+ children = _ref.children,
707
+ fieldsWrapper = _ref.fieldsWrapper,
708
+ translationContext = _ref.translationContext,
709
+ _ref$transProps = _ref.transProps,
710
+ transProps = _ref$transProps === void 0 ? {} : _ref$transProps;
675
711
  var _useState = react.useState(false),
676
712
  _useState2 = _slicedToArray(_useState, 2),
677
- showInviationsPane = _useState2[0],
678
- setShowInviationsPane = _useState2[1];
713
+ showInvitationsPane = _useState2[0],
714
+ setShowInvitationsPane = _useState2[1];
715
+ var FieldsWrapper = fieldsWrapper || react.Fragment;
679
716
  var _useTranslation = reactI18next.useTranslation(),
680
717
  t = _useTranslation.t;
681
718
  var _useShowConfiguration = useShowConfiguration({
@@ -686,7 +723,7 @@ var Configuration = function Configuration(_ref) {
686
723
  configuration = _useShowConfiguration2 === void 0 ? {} : _useShowConfiguration2,
687
724
  isLoading = _useShowConfiguration.isLoading,
688
725
  isFetching = _useShowConfiguration.isFetching;
689
- var configurationInitialValues = buildConfigurationInitialValues(configuration);
726
+ var configurationInitialValues = ramda.mergeLeft(buildConfigurationInitialValues(configuration), additionalFieldsInitialValues);
690
727
  var _useUpdateConfigurati = useUpdateConfiguration({
691
728
  ownerId: ownerId,
692
729
  ownerType: ownerType
@@ -704,7 +741,7 @@ var Configuration = function Configuration(_ref) {
704
741
  updateConfiguration = _useUpdateConfigurati.mutate;
705
742
  var handleSubmit = function handleSubmit(values, _ref2) {
706
743
  var setSubmitting = _ref2.setSubmitting;
707
- var payload = buildPayload(values);
744
+ var payload = ramda.mergeLeft(buildPayload(values), ramda.pick(ramda.keys(additionalFieldsInitialValues), values));
708
745
  updateConfiguration(payload, {
709
746
  onSettled: function onSettled() {
710
747
  return setSubmitting(false);
@@ -712,7 +749,7 @@ var Configuration = function Configuration(_ref) {
712
749
  });
713
750
  };
714
751
  var handleShowInvitations = onConfigurationChangedToInviteOnly === neetoCist.noop ? function () {
715
- return setShowInviationsPane(true);
752
+ return setShowInvitationsPane(true);
716
753
  } : onConfigurationChangedToInviteOnly;
717
754
  return /*#__PURE__*/jsxRuntime.jsxs(Container, {
718
755
  children: [/*#__PURE__*/jsxRuntime.jsx(Header, {
@@ -734,44 +771,46 @@ var Configuration = function Configuration(_ref) {
734
771
  children: function children(_ref3) {
735
772
  var values = _ref3.values;
736
773
  return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
737
- children: [/*#__PURE__*/jsxRuntime.jsx(Label, {
738
- className: "neeto-ui-text-base",
739
- children: t("neetoAccessControl.inputs.labels.visibility")
740
- }), /*#__PURE__*/jsxRuntime.jsx(Radio, {
741
- stacked: true,
742
- name: "auth",
743
- children: AUTH_OPTIONS.map(function (props) {
744
- return /*#__PURE__*/react.createElement(Radio.Item, _objectSpread(_objectSpread({}, props), {}, {
745
- key: props.value,
746
- className: classNames({
747
- "items-start": (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === props.value && (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === AUTH.INVITED
748
- }),
749
- label: (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === props.value && (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === AUTH.INVITED ? renderLabelWithViewInvitation({
750
- onViewInvites: function onViewInvites() {
751
- return setShowInviationsPane(true);
752
- }
753
- }) : props.label,
754
- labelProps: {
774
+ children: [/*#__PURE__*/jsxRuntime.jsxs(FieldsWrapper, {
775
+ children: [/*#__PURE__*/jsxRuntime.jsx(Radio, {
776
+ stacked: true,
777
+ name: "auth",
778
+ children: getAuthOptions({
779
+ translationContext: translationContext,
780
+ transProps: transProps
781
+ }).map(function (props) {
782
+ return /*#__PURE__*/react.createElement(Radio.Item, _objectSpread(_objectSpread({}, props), {}, {
783
+ key: props.value,
755
784
  className: classNames({
756
- "flex flex-col items-start justify-start": (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === props.value && (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === AUTH.INVITED
757
- })
758
- }
759
- }));
760
- })
761
- }), values.auth === AUTH.BASIC && /*#__PURE__*/jsxRuntime.jsx("div", {
762
- className: "space-y-4 pb-2",
763
- children: /*#__PURE__*/jsxRuntime.jsx(Input, {
764
- autoFocus: true,
765
- required: true,
766
- unlimitedChars: true,
767
- className: "w-7/12",
768
- label: t("neetoAccessControl.inputs.labels.password"),
769
- name: "password",
770
- placeholder: t("neetoAccessControl.inputs.placeholders.enterPassword")
771
- })
772
- }), values.auth === AUTH.EMAIL && /*#__PURE__*/jsxRuntime.jsx(AllowedKeywords, {
773
- label: t("neetoAccessControl.inputs.labels.keywords"),
774
- name: "allowedKeywords"
785
+ "items-start": (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === props.value && (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === AUTH.INVITED
786
+ }),
787
+ label: (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === props.value && (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === AUTH.INVITED ? renderLabelWithViewInvitation({
788
+ onViewInvites: function onViewInvites() {
789
+ return setShowInvitationsPane(true);
790
+ }
791
+ }) : props.label,
792
+ labelProps: {
793
+ className: classNames({
794
+ "flex flex-col items-start justify-start": (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === props.value && (configuration === null || configuration === void 0 ? void 0 : configuration.auth) === AUTH.INVITED
795
+ })
796
+ }
797
+ }));
798
+ })
799
+ }), values.auth === AUTH.BASIC && /*#__PURE__*/jsxRuntime.jsx("div", {
800
+ className: "space-y-4 pb-2",
801
+ children: /*#__PURE__*/jsxRuntime.jsx(Input, {
802
+ autoFocus: true,
803
+ required: true,
804
+ unlimitedChars: true,
805
+ className: "w-7/12",
806
+ label: t("neetoAccessControl.inputs.labels.password"),
807
+ name: "password",
808
+ placeholder: t("neetoAccessControl.inputs.placeholders.enterPassword")
809
+ })
810
+ }), values.auth === AUTH.EMAIL && /*#__PURE__*/jsxRuntime.jsx(AllowedKeywords, {
811
+ label: t("neetoAccessControl.inputs.labels.keywords"),
812
+ name: "allowedKeywords"
813
+ })]
775
814
  }), /*#__PURE__*/jsxRuntime.jsx(ActionBlock, {
776
815
  cancelButtonProps: {
777
816
  onClick: handleCancel
@@ -783,15 +822,16 @@ var Configuration = function Configuration(_ref) {
783
822
  });
784
823
  }
785
824
  }), /*#__PURE__*/jsxRuntime.jsx(Invitations$1, {
825
+ inviteButtonProps: inviteButtonProps,
786
826
  onDestroyInvitationsSuccess: onDestroyInvitationsSuccess,
787
827
  ownerId: ownerId,
788
828
  ownerType: ownerType,
789
829
  configurationId: configuration.id,
790
830
  extraColumnsData: invitationsTableExtraColumnsData,
791
831
  hideAddEmailsForm: hideAddEmailsFromInvitationPane,
792
- isOpen: showInviationsPane && !isFetching,
832
+ isOpen: showInvitationsPane && !isFetching,
793
833
  onClose: function onClose() {
794
- return setShowInviationsPane(false);
834
+ return setShowInvitationsPane(false);
795
835
  }
796
836
  }), children]
797
837
  })]