@bigbinary/neeto-team-members-frontend 2.5.17 → 2.5.19

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/dist/index.cjs.js CHANGED
@@ -5540,7 +5540,8 @@ var helpers$1 = {
5540
5540
  selectedMembersCount: "{{count}} {{metaName}} selected of",
5541
5541
  singleProductInvitation: "{{- emails, boldList}} will be invited to <strong>{{product}}</strong> with a role of <strong>{{role}}</strong>.",
5542
5542
  themeSelector: "Theme selector",
5543
- visitToKnowMoreAboutPermissions: "Visit to know more about permissions"
5543
+ visitToKnowMoreAboutPermissions: "Visit to know more about permissions",
5544
+ whyIsItDisabled: "Why is it disabled?"
5544
5545
  };
5545
5546
  var labels = {
5546
5547
  neeto_: "neeto{{product}}"
@@ -5568,8 +5569,7 @@ var tooltips$1 = {
5568
5569
  noPermissionToEditRoles: "Please ask the admin to permit you to edit roles.",
5569
5570
  noPermissionToRemoveRoles: "Please ask the admin to permit you to remove roles.",
5570
5571
  goBackToChangeRole: "Please go back to change the role.",
5571
- hostAppisRequired: "This neeto product is required to continue.",
5572
- whyEmailsAreNotEditable: "Why can't the owner change another user's email?"
5572
+ hostAppisRequired: "This neeto product is required to continue."
5573
5573
  };
5574
5574
  var validations$1 = {
5575
5575
  enterRoleName: "Please enter a valid role name.",
@@ -5631,9 +5631,13 @@ var common = {
5631
5631
  edit_: "Modifier le {{what}}",
5632
5632
  email_one: "E-mail",
5633
5633
  email_other: "E-mails",
5634
+ invited: "Invité",
5635
+ inviteStatus: "Statut d'invitation",
5634
5636
  manage_: "Gérer {{what}}",
5635
5637
  name: "Nom",
5636
5638
  notFound_: "Il n'y a pas de {{what}} à afficher",
5639
+ notInvited: "Non invité",
5640
+ pending: "En attente",
5637
5641
  permission_one: "Autorisation",
5638
5642
  permission_other: "Autorisations",
5639
5643
  role_one: "Rôle",
@@ -5656,7 +5660,8 @@ var helpers = {
5656
5660
  singleProductInvitation_one: "{{- emails, boldList}} sera invité à <strong>{{product}}</strong> avec un rôle de <strong>{{role}}</strong>.",
5657
5661
  singleProductInvitation_other: "{{- emails, boldList}} seront invités à <strong>{{product}}</strong> avec un rôle de <strong>{{role}}</strong>.",
5658
5662
  themeSelector: "Sélecteur de thème",
5659
- visitToKnowMoreAboutPermissions: "Visitez pour en savoir plus sur les autorisations"
5663
+ visitToKnowMoreAboutPermissions: "Visitez pour en savoir plus sur les autorisations",
5664
+ whyIsItDisabled: "Pourquoi est-ce désactivé?"
5660
5665
  };
5661
5666
  var metaNames = {
5662
5667
  member_one: "Membre",
@@ -5679,8 +5684,7 @@ var tooltips = {
5679
5684
  noPermissionToEditRoles: "Veuillez demander à l'administrateur de vous autoriser à modifier les rôles.",
5680
5685
  noPermissionToRemoveRoles: "Veuillez demander à l'administrateur de vous autoriser à supprimer des rôles.",
5681
5686
  goBackToChangeRole: "Veuillez revenir en arrière pour modifier le rôle.",
5682
- hostAppisRequired: "Ce produit neeto est nécessaire pour continuer.",
5683
- whyEmailsAreNotEditable: "Pourquoi le propriétaire ne peut-il pas modifier l'adresse e-mail d'un autre utilisateur?"
5687
+ hostAppisRequired: "Ce produit neeto est nécessaire pour continuer."
5684
5688
  };
5685
5689
  var validations = {
5686
5690
  enterRoleName: "Veuillez entrer le nom du rôle",
@@ -10560,6 +10564,18 @@ const DEFAULT_SELECTED_ROWS = {
10560
10564
  keys: []
10561
10565
  };
10562
10566
  const DEFAULT_NEETO_FILTERS_COLUMNS = [{
10567
+ key: "email",
10568
+ node: "email",
10569
+ label: instance.t("common.email", SINGULAR),
10570
+ type: "multi_option",
10571
+ values: []
10572
+ }, {
10573
+ key: "name",
10574
+ node: "first_name,last_name",
10575
+ label: instance.t("common.name"),
10576
+ type: "text",
10577
+ values: ""
10578
+ }, {
10563
10579
  key: "role",
10564
10580
  node: "organization_role.name",
10565
10581
  model: "OrganizationRole",
@@ -11393,9 +11409,28 @@ const getMetaName = ramda.curry((metaName, count) => {
11393
11409
  });
11394
11410
  const clearSelectedMembers = (previousCategory, currentCategory) => pure.notEquals(previousCategory, currentCategory) && pure.notEquals(currentCategory, "ALL");
11395
11411
  const buildFilterColumns = _ref10 => {
11396
- let _ref10$organizationRo = _ref10.organizationRoles,
11397
- organizationRoles = _ref10$organizationRo === void 0 ? [] : _ref10$organizationRo;
11398
- return ramda.assocPath([0, "values"], organizationRoles.map(pure.toLabelAndValue), DEFAULT_NEETO_FILTERS_COLUMNS);
11412
+ let _ref10$options = _ref10.options,
11413
+ _ref10$options$emails = _ref10$options.emails,
11414
+ emails = _ref10$options$emails === void 0 ? [] : _ref10$options$emails,
11415
+ _ref10$options$organi = _ref10$options.organizationRoles,
11416
+ organizationRoles = _ref10$options$organi === void 0 ? [] : _ref10$options$organi,
11417
+ _ref10$emailConfig = _ref10.emailConfig,
11418
+ setSearchTerm = _ref10$emailConfig.setSearchTerm,
11419
+ isLoading = _ref10$emailConfig.isLoading;
11420
+ const columnValues = {
11421
+ email: emails.map(pure.toLabelAndValue),
11422
+ role: organizationRoles.map(pure.toLabelAndValue)
11423
+ };
11424
+ return DEFAULT_NEETO_FILTERS_COLUMNS.map(column => {
11425
+ const values = columnValues[column.key];
11426
+ if (column.key === "role") return ramda.assoc("values", values, column);
11427
+ const emailConfig = {
11428
+ values,
11429
+ isLoading,
11430
+ onInputChange: setSearchTerm
11431
+ };
11432
+ return ramda.mergeLeft(emailConfig, column);
11433
+ });
11399
11434
  };
11400
11435
  const getValidCategory = function (category) {
11401
11436
  let defaultCategory = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : MEMBER_FILTER.ACTIVE.value;
@@ -11721,27 +11756,6 @@ const Confirmation = () => {
11721
11756
  }));
11722
11757
  };
11723
11758
 
11724
- const LabelWithIcon = _ref => {
11725
- let _ref$label = _ref.label,
11726
- label = _ref$label === void 0 ? "" : _ref$label,
11727
- _ref$tooltipProps = _ref.tooltipProps,
11728
- tooltipProps = _ref$tooltipProps === void 0 ? {
11729
- content: ""
11730
- } : _ref$tooltipProps,
11731
- _ref$iconProps = _ref.iconProps,
11732
- iconProps = _ref$iconProps === void 0 ? {
11733
- onClick: pure.noop
11734
- } : _ref$iconProps;
11735
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
11736
- className: "ntm-members-radio-group__label"
11737
- }, label), /*#__PURE__*/React__default["default"].createElement(neetoui.Tooltip, _extends({
11738
- position: "right"
11739
- }, tooltipProps), /*#__PURE__*/React__default["default"].createElement("span", null, /*#__PURE__*/React__default["default"].createElement(neetoIcons.Info, _extends({
11740
- className: "ntm-members-radio-group__icon",
11741
- size: 16
11742
- }, iconProps)))));
11743
- };
11744
-
11745
11759
  const MultipleEmailInput = _ref => {
11746
11760
  var _head;
11747
11761
  let _ref$emails = _ref.emails,
@@ -11757,15 +11771,17 @@ const MultipleEmailInput = _ref => {
11757
11771
  name: "emails",
11758
11772
  size: "medium",
11759
11773
  value: (_head = ramda.head(emails)) === null || _head === void 0 ? void 0 : _head.value,
11760
- label: /*#__PURE__*/React__default["default"].createElement(LabelWithIcon, {
11761
- label: instance.t("common.email", SINGULAR),
11762
- iconProps: {
11763
- onClick: () => window.open(OWNER_CANT_CHANGE_USER_EMAIL_KB_ARTICLE_URL, "_blank")
11764
- },
11765
- tooltipProps: {
11766
- content: instance.t("tooltips.whyEmailsAreNotEditable")
11767
- }
11768
- })
11774
+ label: /*#__PURE__*/React__default["default"].createElement("span", {
11775
+ className: "neeto-ui-w-full neeto-ui-flex neeto-ui-justify-between"
11776
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
11777
+ component: "span",
11778
+ style: "body2"
11779
+ }, instance.t("common.email", SINGULAR)), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
11780
+ href: OWNER_CANT_CHANGE_USER_EMAIL_KB_ARTICLE_URL,
11781
+ label: instance.t("helpers.whyIsItDisabled"),
11782
+ style: "link",
11783
+ target: "_blank"
11784
+ }))
11769
11785
  }) : /*#__PURE__*/React__default["default"].createElement(formik$1.MultiEmailInput, {
11770
11786
  counter: COUNTER_PROPS,
11771
11787
  "data-cy": "ntm-manage-member-email-input",
@@ -11778,6 +11794,27 @@ const MultipleEmailInput = _ref => {
11778
11794
  }));
11779
11795
  };
11780
11796
 
11797
+ const LabelWithIcon = _ref => {
11798
+ let _ref$label = _ref.label,
11799
+ label = _ref$label === void 0 ? "" : _ref$label,
11800
+ _ref$tooltipProps = _ref.tooltipProps,
11801
+ tooltipProps = _ref$tooltipProps === void 0 ? {
11802
+ content: ""
11803
+ } : _ref$tooltipProps,
11804
+ _ref$iconProps = _ref.iconProps,
11805
+ iconProps = _ref$iconProps === void 0 ? {
11806
+ onClick: pure.noop
11807
+ } : _ref$iconProps;
11808
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
11809
+ className: "ntm-members-radio-group__label"
11810
+ }, label), /*#__PURE__*/React__default["default"].createElement(neetoui.Tooltip, _extends({
11811
+ position: "right"
11812
+ }, tooltipProps), /*#__PURE__*/React__default["default"].createElement("span", null, /*#__PURE__*/React__default["default"].createElement(neetoIcons.Info, _extends({
11813
+ className: "ntm-members-radio-group__icon",
11814
+ size: 16
11815
+ }, iconProps)))));
11816
+ };
11817
+
11781
11818
  const RolesRadioGroup = _ref => {
11782
11819
  let _ref$role = _ref.role,
11783
11820
  role = _ref$role === void 0 ? "" : _ref$role,
@@ -12066,25 +12103,40 @@ function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) {
12066
12103
  const useFilters = _ref => {
12067
12104
  var _config$filterColumns, _config$defaultFilter;
12068
12105
  let config = _ref.config;
12106
+ const _useState = React.useState(""),
12107
+ _useState2 = _slicedToArray(_useState, 2),
12108
+ emailSearchTerm = _useState2[0],
12109
+ setEmailSearchTerm = _useState2[1];
12069
12110
  const metaName = getMetaName((config === null || config === void 0 ? void 0 : config.metaName) || "member");
12070
12111
  const defaultNeetoFilters = Ze((_config$filterColumns = config === null || config === void 0 ? void 0 : config.filterColumns) !== null && _config$filterColumns !== void 0 ? _config$filterColumns : DEFAULT_NEETO_FILTERS_COLUMNS);
12071
- const _useState = React.useState(_objectSpread$2(_objectSpread$2(_objectSpread$2({}, DEFAULT_FILTER_VALUES), config === null || config === void 0 ? void 0 : config.defaultFilterValues), {}, {
12112
+ const _useState3 = React.useState(_objectSpread$2(_objectSpread$2(_objectSpread$2({}, DEFAULT_FILTER_VALUES), config === null || config === void 0 ? void 0 : config.defaultFilterValues), {}, {
12072
12113
  neetoFilters: defaultNeetoFilters,
12073
12114
  category: getValidCategory(URL_CATEGORY_FILTER_VALUE, config === null || config === void 0 ? void 0 : (_config$defaultFilter = config.defaultFilterValues) === null || _config$defaultFilter === void 0 ? void 0 : _config$defaultFilter.category)
12074
12115
  })),
12075
- _useState2 = _slicedToArray(_useState, 2),
12076
- filters = _useState2[0],
12077
- setFilters = _useState2[1];
12116
+ _useState4 = _slicedToArray(_useState3, 2),
12117
+ filters = _useState4[0],
12118
+ setFilters = _useState4[1];
12078
12119
  const debouncedSearch = reactUtils.useDebounce(filters.search, 750);
12120
+ const debouncedEmailSearchTerm = reactUtils.useDebounce(emailSearchTerm, 750);
12079
12121
  const shouldFetchFilterOptions = ramda.isNil(config === null || config === void 0 ? void 0 : config.filterColumns);
12080
12122
  const _useFetchFilterOption = useFetchFilterOptions({
12123
+ params: {
12124
+ emailSearchTerm: debouncedEmailSearchTerm
12125
+ },
12081
12126
  options: {
12082
12127
  enabled: shouldFetchFilterOptions
12083
12128
  }
12084
12129
  }),
12085
12130
  _useFetchFilterOption2 = _useFetchFilterOption.data,
12086
- filterOptions = _useFetchFilterOption2 === void 0 ? {} : _useFetchFilterOption2;
12087
- const filterColumns = shouldFetchFilterOptions ? buildFilterColumns(filterOptions) : config === null || config === void 0 ? void 0 : config.filterColumns;
12131
+ filterOptions = _useFetchFilterOption2 === void 0 ? {} : _useFetchFilterOption2,
12132
+ isFilterOptionsLoading = _useFetchFilterOption.isLoading;
12133
+ const filterColumns = shouldFetchFilterOptions ? buildFilterColumns({
12134
+ options: filterOptions,
12135
+ emailConfig: {
12136
+ setSearchTerm: setEmailSearchTerm,
12137
+ isLoading: isFilterOptionsLoading
12138
+ }
12139
+ }) : config === null || config === void 0 ? void 0 : config.filterColumns;
12088
12140
  const searchProps = {
12089
12141
  "data-cy": "ntm-search-members-input",
12090
12142
  onChange: _ref2 => {