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

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.1 @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.14
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",
@@ -11263,6 +11278,14 @@ const getDefaultAlertMessage = _ref4 => {
11263
11278
  }
11264
11279
  });
11265
11280
  };
11281
+ const renderInvitedStatus = inviteStatus => {
11282
+ const statuses = {
11283
+ not_invited: instance.t("common.notInvited"),
11284
+ pending: instance.t("common.pending"),
11285
+ confirmed: instance.t("common.invited")
11286
+ };
11287
+ return statuses[inviteStatus];
11288
+ };
11266
11289
  const getDefaultColumns = displayStatusTag => [{
11267
11290
  dataIndex: "name",
11268
11291
  key: "name",
@@ -11279,6 +11302,12 @@ const getDefaultColumns = displayStatusTag => [{
11279
11302
  key: "organization_role",
11280
11303
  sorter: true,
11281
11304
  title: instance.t("common.role", SINGULAR)
11305
+ }, {
11306
+ dataIndex: "inviteStatus",
11307
+ key: "invite_status",
11308
+ sorter: true,
11309
+ title: instance.t("common.inviteStatus"),
11310
+ render: inviteStatus => renderInvitedStatus(inviteStatus)
11282
11311
  }];
11283
11312
  const getActionColumn = (handleUpdateRole, handleUpdateStatus, permissions) => ({
11284
11313
  dataIndex: "actions",
@@ -11412,11 +11441,17 @@ const AppList = _ref => {
11412
11441
  const selectedEmail = ramda.pluck("value", emails);
11413
11442
  React.useEffect(() => {
11414
11443
  if (savedStateRef.current.isAppListEnabled !== isAppListEnabled) {
11415
- appRoles.forEach((_, index) => {
11444
+ appRoles.forEach((appRole, index) => {
11445
+ var _globalProps$appName;
11446
+ if ((appRole === null || appRole === void 0 ? void 0 : appRole.appName) === ((_globalProps$appName = initializers.globalProps.appName) === null || _globalProps$appName === void 0 ? void 0 : _globalProps$appName.substring(5))) {
11447
+ setFieldValue(`appRoles[${index}].isEnabled`, true);
11448
+ return;
11449
+ }
11416
11450
  setFieldValue(`appRoles[${index}].isEnabled`, isAppListEnabled);
11417
11451
  });
11418
11452
  }
11419
11453
  savedStateRef.current.isAppListEnabled = isAppListEnabled;
11454
+ // eslint-disable-next-line react-hooks/exhaustive-deps
11420
11455
  }, [isAppListEnabled]);
11421
11456
  const buildRoleOptions = roles => roles.map(role => pure.toLabelAndValue(role.name));
11422
11457
  return /*#__PURE__*/React__default["default"].createElement("div", {
@@ -11440,10 +11475,10 @@ const AppList = _ref => {
11440
11475
  })), /*#__PURE__*/React__default["default"].createElement("div", {
11441
11476
  className: "neeto-ui-w-full"
11442
11477
  }, appRoles.map((_ref2, index) => {
11443
- var _globalProps$appName;
11478
+ var _globalProps$appName2;
11444
11479
  let appName = _ref2.appName,
11445
11480
  isEnabled = _ref2.isEnabled;
11446
- const isCurrentApp = appName === ((_globalProps$appName = initializers.globalProps.appName) === null || _globalProps$appName === void 0 ? void 0 : _globalProps$appName.substring(5));
11481
+ const isCurrentApp = appName === ((_globalProps$appName2 = initializers.globalProps.appName) === null || _globalProps$appName2 === void 0 ? void 0 : _globalProps$appName2.substring(5));
11447
11482
  const isAppRoleSelectionChecked = isCurrentApp || isEnabled && isAppListEnabled;
11448
11483
  return /*#__PURE__*/React__default["default"].createElement("div", {
11449
11484
  className: "ntm-manage-members__app-roles",
@@ -12178,6 +12213,11 @@ const TeamMembers = _ref => {
12178
12213
  isFiltersPaneOpen = _useState4[0],
12179
12214
  setIsFiltersPaneOpen = _useState4[1];
12180
12215
  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);
12216
+ React.useEffect(() => {
12217
+ if (!localStorage.getItem("NTM_MEMBERS_TABLE_HIDDEN_COLUMNS")) {
12218
+ localStorage.setItem("NTM_MEMBERS_TABLE_HIDDEN_COLUMNS", JSON.stringify(["inviteStatus"]));
12219
+ }
12220
+ }, []);
12181
12221
  const _useFilters = useFilters({
12182
12222
  config
12183
12223
  }),