@bigbinary/neeto-team-members-frontend 2.5.16 → 2.5.18

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
@@ -12,13 +12,13 @@ functioning of the package. Install all the peer dependencies using the below
12
12
  command:
13
13
 
14
14
  ```zsh
15
- yarn add @bigbinary/neeto-commons-frontend@2.0.35 @bigbinary/neeto-icons@1.9.10 @bigbinary/neetoui@4.3.3 @honeybadger-io/js@5.1.1 @honeybadger-io/react@5.1.2 axios@1.3.3 classnames@2.3.2 formik@2.2.9 js-logger@1.6.1 ramda@0.28.0 react-helmet@6.1.0 react-query@3.39.3 react-router-dom@5.3.4 react-toastify@8.2.0 yup@1.0.0
15
+ yarn add @bigbinary/neeto-commons-frontend@2.0.36 @bigbinary/neeto-icons@1.9.11 @bigbinary/neetoui@4.3.3 @honeybadger-io/js@5.1.1 @honeybadger-io/react@5.1.3 axios@1.3.3 classnames@2.3.2 formik@2.2.9 js-logger@1.6.1 ramda@0.28.0 react-helmet@6.1.0 react-query@3.39.3 react-router-dom@5.3.4 react-toastify@8.2.0 yup@1.0.0
16
16
  ```
17
17
 
18
18
  2. Now install the latest **neetoTeamMembers** package using the below command:
19
19
 
20
20
  ```zsh
21
- yarn add @bigbinary/neeto-team-members-frontend@2.5.16
21
+ yarn add @bigbinary/neeto-team-members-frontend@2.5.17
22
22
  ```
23
23
 
24
24
  ## Usage
package/dist/index.cjs.js CHANGED
@@ -2519,14 +2519,24 @@ var Translator = function (_EventEmitter) {
2519
2519
  if (appendNamespaceToCIMode) {
2520
2520
  var nsSeparator = options.nsSeparator || this.options.nsSeparator;
2521
2521
  if (returnDetails) {
2522
- resolved.res = "".concat(namespace).concat(nsSeparator).concat(key);
2523
- return resolved;
2522
+ return {
2523
+ res: "".concat(namespace).concat(nsSeparator).concat(key),
2524
+ usedKey: key,
2525
+ exactUsedKey: key,
2526
+ usedLng: lng,
2527
+ usedNS: namespace
2528
+ };
2524
2529
  }
2525
2530
  return "".concat(namespace).concat(nsSeparator).concat(key);
2526
2531
  }
2527
2532
  if (returnDetails) {
2528
- resolved.res = key;
2529
- return resolved;
2533
+ return {
2534
+ res: key,
2535
+ usedKey: key,
2536
+ exactUsedKey: key,
2537
+ usedLng: lng,
2538
+ usedNS: namespace
2539
+ };
2530
2540
  }
2531
2541
  return key;
2532
2542
  }
@@ -3325,7 +3335,7 @@ var Interpolator = function () {
3325
3335
  if (typeof missingInterpolationHandler === 'function') {
3326
3336
  var temp = missingInterpolationHandler(str, match, options);
3327
3337
  value = typeof temp === 'string' ? temp : '';
3328
- } else if (options && options.hasOwnProperty(matchedVar)) {
3338
+ } else if (options && Object.prototype.hasOwnProperty.call(options, matchedVar)) {
3329
3339
  value = '';
3330
3340
  } else if (skipOnVariables) {
3331
3341
  value = match[0];
@@ -3474,34 +3484,34 @@ var Formatter = function () {
3474
3484
  this.logger = baseLogger.create('formatter');
3475
3485
  this.options = options;
3476
3486
  this.formats = {
3477
- number: createCachedFormatter(function (lng, options) {
3478
- var formatter = new Intl.NumberFormat(lng, options);
3487
+ number: createCachedFormatter(function (lng, opt) {
3488
+ var formatter = new Intl.NumberFormat(lng, _objectSpread$2$1({}, opt));
3479
3489
  return function (val) {
3480
3490
  return formatter.format(val);
3481
3491
  };
3482
3492
  }),
3483
- currency: createCachedFormatter(function (lng, options) {
3484
- var formatter = new Intl.NumberFormat(lng, _objectSpread$2$1(_objectSpread$2$1({}, options), {}, {
3493
+ currency: createCachedFormatter(function (lng, opt) {
3494
+ var formatter = new Intl.NumberFormat(lng, _objectSpread$2$1(_objectSpread$2$1({}, opt), {}, {
3485
3495
  style: 'currency'
3486
3496
  }));
3487
3497
  return function (val) {
3488
3498
  return formatter.format(val);
3489
3499
  };
3490
3500
  }),
3491
- datetime: createCachedFormatter(function (lng, options) {
3492
- var formatter = new Intl.DateTimeFormat(lng, _objectSpread$2$1({}, options));
3501
+ datetime: createCachedFormatter(function (lng, opt) {
3502
+ var formatter = new Intl.DateTimeFormat(lng, _objectSpread$2$1({}, opt));
3493
3503
  return function (val) {
3494
3504
  return formatter.format(val);
3495
3505
  };
3496
3506
  }),
3497
- relativetime: createCachedFormatter(function (lng, options) {
3498
- var formatter = new Intl.RelativeTimeFormat(lng, _objectSpread$2$1({}, options));
3507
+ relativetime: createCachedFormatter(function (lng, opt) {
3508
+ var formatter = new Intl.RelativeTimeFormat(lng, _objectSpread$2$1({}, opt));
3499
3509
  return function (val) {
3500
- return formatter.format(val, options.range || 'day');
3510
+ return formatter.format(val, opt.range || 'day');
3501
3511
  };
3502
3512
  }),
3503
- list: createCachedFormatter(function (lng, options) {
3504
- var formatter = new Intl.ListFormat(lng, _objectSpread$2$1({}, options));
3513
+ list: createCachedFormatter(function (lng, opt) {
3514
+ var formatter = new Intl.ListFormat(lng, _objectSpread$2$1({}, opt));
3505
3515
  return function (val) {
3506
3516
  return formatter.format(val);
3507
3517
  };
@@ -3530,8 +3540,9 @@ var Formatter = function () {
3530
3540
  }
3531
3541
  }, {
3532
3542
  key: "format",
3533
- value: function format(value, _format, lng, options) {
3543
+ value: function format(value, _format, lng) {
3534
3544
  var _this = this;
3545
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3535
3546
  var formats = _format.split(this.formatSeparator);
3536
3547
  var result = formats.reduce(function (mem, f) {
3537
3548
  var _parseFormatStr = parseFormatStr(f),
@@ -3660,8 +3671,8 @@ var Connector = function (_EventEmitter) {
3660
3671
  if (!loaded[l]) loaded[l] = {};
3661
3672
  var loadedKeys = q.loaded[l];
3662
3673
  if (loadedKeys.length) {
3663
- loadedKeys.forEach(function (ns) {
3664
- if (loaded[l][ns] === undefined) loaded[l][ns] = true;
3674
+ loadedKeys.forEach(function (n) {
3675
+ if (loaded[l][n] === undefined) loaded[l][n] = true;
3665
3676
  });
3666
3677
  }
3667
3678
  });
@@ -4315,7 +4326,7 @@ var I18n = function (_EventEmitter) {
4315
4326
  var _this7 = this;
4316
4327
  var deferred = defer();
4317
4328
  if (!this.options.ns) {
4318
- callback && callback();
4329
+ if (callback) callback();
4319
4330
  return Promise.resolve();
4320
4331
  }
4321
4332
  if (typeof ns === 'string') ns = [ns];
@@ -4580,7 +4591,7 @@ var localStorageAvailable = function localStorageAvailable() {
4580
4591
  }
4581
4592
  return hasLocalStorageSupport;
4582
4593
  };
4583
- var localStorage = {
4594
+ var localStorage$1 = {
4584
4595
  name: 'localStorage',
4585
4596
  lookup: function lookup(options) {
4586
4597
  var found;
@@ -4734,7 +4745,7 @@ var Browser = /*#__PURE__*/function () {
4734
4745
  this.i18nOptions = i18nOptions;
4735
4746
  this.addDetector(cookie$1);
4736
4747
  this.addDetector(querystring);
4737
- this.addDetector(localStorage);
4748
+ this.addDetector(localStorage$1);
4738
4749
  this.addDetector(sessionStorage);
4739
4750
  this.addDetector(navigator$1);
4740
4751
  this.addDetector(htmlTag);
@@ -5503,9 +5514,13 @@ var common$1 = {
5503
5514
  edit_: "Edit {{what}}",
5504
5515
  email_one: "Email",
5505
5516
  email_other: "Emails",
5517
+ invited: "Invited",
5518
+ inviteStatus: "Invite status",
5506
5519
  manage_: "Manage {{what}}",
5507
5520
  name: "Name",
5508
5521
  notFound_: "There are no {{what}} to show",
5522
+ notInvited: "Not invited",
5523
+ pending: "Pending",
5509
5524
  permission_one: "Permission",
5510
5525
  permission_other: "Permissions",
5511
5526
  role_one: "Role",
@@ -5525,7 +5540,8 @@ var helpers$1 = {
5525
5540
  selectedMembersCount: "{{count}} {{metaName}} selected of",
5526
5541
  singleProductInvitation: "{{- emails, boldList}} will be invited to <strong>{{product}}</strong> with a role of <strong>{{role}}</strong>.",
5527
5542
  themeSelector: "Theme selector",
5528
- visitToKnowMoreAboutPermissions: "Visit to know more about permissions"
5543
+ visitToKnowMoreAboutPermissions: "Visit to know more about permissions",
5544
+ whyIsItDisabled: "Why is it disabled?"
5529
5545
  };
5530
5546
  var labels = {
5531
5547
  neeto_: "neeto{{product}}"
@@ -5553,8 +5569,7 @@ var tooltips$1 = {
5553
5569
  noPermissionToEditRoles: "Please ask the admin to permit you to edit roles.",
5554
5570
  noPermissionToRemoveRoles: "Please ask the admin to permit you to remove roles.",
5555
5571
  goBackToChangeRole: "Please go back to change the role.",
5556
- hostAppisRequired: "This neeto product is required to continue.",
5557
- whyEmailsAreNotEditable: "Why can't the owner change another user's email?"
5572
+ hostAppisRequired: "This neeto product is required to continue."
5558
5573
  };
5559
5574
  var validations$1 = {
5560
5575
  enterRoleName: "Please enter a valid role name.",
@@ -5616,9 +5631,13 @@ var common = {
5616
5631
  edit_: "Modifier le {{what}}",
5617
5632
  email_one: "E-mail",
5618
5633
  email_other: "E-mails",
5634
+ invited: "Invité",
5635
+ inviteStatus: "Statut d'invitation",
5619
5636
  manage_: "Gérer {{what}}",
5620
5637
  name: "Nom",
5621
5638
  notFound_: "Il n'y a pas de {{what}} à afficher",
5639
+ notInvited: "Non invité",
5640
+ pending: "En attente",
5622
5641
  permission_one: "Autorisation",
5623
5642
  permission_other: "Autorisations",
5624
5643
  role_one: "Rôle",
@@ -5641,7 +5660,8 @@ var helpers = {
5641
5660
  singleProductInvitation_one: "{{- emails, boldList}} sera invité à <strong>{{product}}</strong> avec un rôle de <strong>{{role}}</strong>.",
5642
5661
  singleProductInvitation_other: "{{- emails, boldList}} seront invités à <strong>{{product}}</strong> avec un rôle de <strong>{{role}}</strong>.",
5643
5662
  themeSelector: "Sélecteur de thème",
5644
- 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é?"
5645
5665
  };
5646
5666
  var metaNames = {
5647
5667
  member_one: "Membre",
@@ -5664,8 +5684,7 @@ var tooltips = {
5664
5684
  noPermissionToEditRoles: "Veuillez demander à l'administrateur de vous autoriser à modifier les rôles.",
5665
5685
  noPermissionToRemoveRoles: "Veuillez demander à l'administrateur de vous autoriser à supprimer des rôles.",
5666
5686
  goBackToChangeRole: "Veuillez revenir en arrière pour modifier le rôle.",
5667
- hostAppisRequired: "Ce produit neeto est nécessaire pour continuer.",
5668
- 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."
5669
5688
  };
5670
5689
  var validations = {
5671
5690
  enterRoleName: "Veuillez entrer le nom du rôle",
@@ -11263,6 +11282,14 @@ const getDefaultAlertMessage = _ref4 => {
11263
11282
  }
11264
11283
  });
11265
11284
  };
11285
+ const renderInvitedStatus = inviteStatus => {
11286
+ const statuses = {
11287
+ not_invited: instance.t("common.notInvited"),
11288
+ pending: instance.t("common.pending"),
11289
+ confirmed: instance.t("common.invited")
11290
+ };
11291
+ return statuses[inviteStatus];
11292
+ };
11266
11293
  const getDefaultColumns = displayStatusTag => [{
11267
11294
  dataIndex: "name",
11268
11295
  key: "name",
@@ -11279,6 +11306,12 @@ const getDefaultColumns = displayStatusTag => [{
11279
11306
  key: "organization_role",
11280
11307
  sorter: true,
11281
11308
  title: instance.t("common.role", SINGULAR)
11309
+ }, {
11310
+ dataIndex: "inviteStatus",
11311
+ key: "invite_status",
11312
+ sorter: true,
11313
+ title: instance.t("common.inviteStatus"),
11314
+ render: inviteStatus => renderInvitedStatus(inviteStatus)
11282
11315
  }];
11283
11316
  const getActionColumn = (handleUpdateRole, handleUpdateStatus, permissions) => ({
11284
11317
  dataIndex: "actions",
@@ -11692,27 +11725,6 @@ const Confirmation = () => {
11692
11725
  }));
11693
11726
  };
11694
11727
 
11695
- const LabelWithIcon = _ref => {
11696
- let _ref$label = _ref.label,
11697
- label = _ref$label === void 0 ? "" : _ref$label,
11698
- _ref$tooltipProps = _ref.tooltipProps,
11699
- tooltipProps = _ref$tooltipProps === void 0 ? {
11700
- content: ""
11701
- } : _ref$tooltipProps,
11702
- _ref$iconProps = _ref.iconProps,
11703
- iconProps = _ref$iconProps === void 0 ? {
11704
- onClick: pure.noop
11705
- } : _ref$iconProps;
11706
- return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
11707
- className: "ntm-members-radio-group__label"
11708
- }, label), /*#__PURE__*/React__default["default"].createElement(neetoui.Tooltip, _extends({
11709
- position: "right"
11710
- }, tooltipProps), /*#__PURE__*/React__default["default"].createElement("span", null, /*#__PURE__*/React__default["default"].createElement(neetoIcons.Info, _extends({
11711
- className: "ntm-members-radio-group__icon",
11712
- size: 16
11713
- }, iconProps)))));
11714
- };
11715
-
11716
11728
  const MultipleEmailInput = _ref => {
11717
11729
  var _head;
11718
11730
  let _ref$emails = _ref.emails,
@@ -11728,15 +11740,17 @@ const MultipleEmailInput = _ref => {
11728
11740
  name: "emails",
11729
11741
  size: "medium",
11730
11742
  value: (_head = ramda.head(emails)) === null || _head === void 0 ? void 0 : _head.value,
11731
- label: /*#__PURE__*/React__default["default"].createElement(LabelWithIcon, {
11732
- label: instance.t("common.email", SINGULAR),
11733
- iconProps: {
11734
- onClick: () => window.open(OWNER_CANT_CHANGE_USER_EMAIL_KB_ARTICLE_URL, "_blank")
11735
- },
11736
- tooltipProps: {
11737
- content: instance.t("tooltips.whyEmailsAreNotEditable")
11738
- }
11739
- })
11743
+ label: /*#__PURE__*/React__default["default"].createElement("span", {
11744
+ className: "neeto-ui-w-full neeto-ui-flex neeto-ui-justify-between"
11745
+ }, /*#__PURE__*/React__default["default"].createElement(neetoui.Typography, {
11746
+ component: "span",
11747
+ style: "body2"
11748
+ }, instance.t("common.email", SINGULAR)), /*#__PURE__*/React__default["default"].createElement(neetoui.Button, {
11749
+ href: OWNER_CANT_CHANGE_USER_EMAIL_KB_ARTICLE_URL,
11750
+ label: instance.t("helpers.whyIsItDisabled"),
11751
+ style: "link",
11752
+ target: "_blank"
11753
+ }))
11740
11754
  }) : /*#__PURE__*/React__default["default"].createElement(formik$1.MultiEmailInput, {
11741
11755
  counter: COUNTER_PROPS,
11742
11756
  "data-cy": "ntm-manage-member-email-input",
@@ -11749,6 +11763,27 @@ const MultipleEmailInput = _ref => {
11749
11763
  }));
11750
11764
  };
11751
11765
 
11766
+ const LabelWithIcon = _ref => {
11767
+ let _ref$label = _ref.label,
11768
+ label = _ref$label === void 0 ? "" : _ref$label,
11769
+ _ref$tooltipProps = _ref.tooltipProps,
11770
+ tooltipProps = _ref$tooltipProps === void 0 ? {
11771
+ content: ""
11772
+ } : _ref$tooltipProps,
11773
+ _ref$iconProps = _ref.iconProps,
11774
+ iconProps = _ref$iconProps === void 0 ? {
11775
+ onClick: pure.noop
11776
+ } : _ref$iconProps;
11777
+ return /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("span", {
11778
+ className: "ntm-members-radio-group__label"
11779
+ }, label), /*#__PURE__*/React__default["default"].createElement(neetoui.Tooltip, _extends({
11780
+ position: "right"
11781
+ }, tooltipProps), /*#__PURE__*/React__default["default"].createElement("span", null, /*#__PURE__*/React__default["default"].createElement(neetoIcons.Info, _extends({
11782
+ className: "ntm-members-radio-group__icon",
11783
+ size: 16
11784
+ }, iconProps)))));
11785
+ };
11786
+
11752
11787
  const RolesRadioGroup = _ref => {
11753
11788
  let _ref$role = _ref.role,
11754
11789
  role = _ref$role === void 0 ? "" : _ref$role,
@@ -12184,6 +12219,11 @@ const TeamMembers = _ref => {
12184
12219
  isFiltersPaneOpen = _useState4[0],
12185
12220
  setIsFiltersPaneOpen = _useState4[1];
12186
12221
  const hasCreatePermission = (_config$permissions$c = config === null || config === void 0 ? void 0 : (_config$permissions = config.permissions) === null || _config$permissions === void 0 ? void 0 : _config$permissions.create) !== null && _config$permissions$c !== void 0 ? _config$permissions$c : hasPermission(MANAGE_MEMBER_PERMISSIONS);
12222
+ React.useEffect(() => {
12223
+ if (!localStorage.getItem("NTM_MEMBERS_TABLE_HIDDEN_COLUMNS")) {
12224
+ localStorage.setItem("NTM_MEMBERS_TABLE_HIDDEN_COLUMNS", JSON.stringify(["inviteStatus"]));
12225
+ }
12226
+ }, []);
12187
12227
  const _useFilters = useFilters({
12188
12228
  config
12189
12229
  }),