@itilite/iui-user-management 0.4.57 → 0.4.59

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.js CHANGED
@@ -4943,6 +4943,7 @@ var ErrorMessages = {
4943
4943
  passport_expiry_date: 'Please enter passport expiry date.',
4944
4944
  passport_photo: 'Please attach passport photo.',
4945
4945
  travel_docs: 'Please attach travel docs.',
4946
+ products: 'Please select atleast one product access.',
4946
4947
  only_cards_products: 'Select at least one additional product if opting for cards.',
4947
4948
  none_products: 'Select at least one product. If opting for cards, please choose at least one additional product.'
4948
4949
  };
@@ -5076,8 +5077,6 @@ var UserAddEdit = function UserAddEdit(props) {
5076
5077
  isCardsDetailsRendered = _useSelector.isCardsDetailsRendered,
5077
5078
  isCardsAdmin = _useSelector.isCardsAdmin,
5078
5079
  cardsDetails = _useSelector.cardsDetails;
5079
- console.log("isCardsAdmin", isCardsAdmin);
5080
- console.log("cardsDetails", cardsDetails);
5081
5080
  var _useSelector2 = reactRedux.useSelector(function (state) {
5082
5081
  return state.common;
5083
5082
  }),
@@ -5086,7 +5085,6 @@ var UserAddEdit = function UserAddEdit(props) {
5086
5085
  hasVerificationError = _useSelector2.hasVerificationError,
5087
5086
  isILadmin = _useSelector2.isILadmin,
5088
5087
  companyName = _useSelector2.companyName;
5089
- console.log("id", id);
5090
5088
  var history = reactRouterDom.useHistory();
5091
5089
  var location = reactRouterDom.useLocation();
5092
5090
  var _useState = React.useState({
@@ -5125,7 +5123,7 @@ var UserAddEdit = function UserAddEdit(props) {
5125
5123
  if (_errorArray2.indexOf('products') === -1) {
5126
5124
  _errorArray2.push('products');
5127
5125
  }
5128
- _errorMsgs2.products = ErrorMessages.none_products;
5126
+ _errorMsgs2.products = ErrorMessages.products;
5129
5127
  setErrorArray(_errorArray2);
5130
5128
  setErrorMsgs(_errorMsgs2);
5131
5129
  var _el = document.getElementById('products');
@@ -5542,7 +5540,8 @@ var UserAddEdit = function UserAddEdit(props) {
5542
5540
  travel_docs: '',
5543
5541
  products: '',
5544
5542
  userTagType: '',
5545
- profile_pic: ''
5543
+ profile_pic: '',
5544
+ cards_admin: ''
5546
5545
  }),
5547
5546
  errorMsgs = _useState28[0],
5548
5547
  setErrorMsgs = _useState28[1];
@@ -6005,11 +6004,15 @@ var UserAddEdit = function UserAddEdit(props) {
6005
6004
  React.useEffect(function () {
6006
6005
  if (isTokenVerified === true) {
6007
6006
  dispatch(fetchRenderFileds());
6008
- editUserId ? fetchEditUserCardsDetails(editUserId) : fetchLoggedUserCardsDetails();
6009
6007
  }
6010
6008
  }, [isTokenVerified]);
6011
6009
  React.useEffect(function () {
6012
6010
  if (isRendered === true) {
6011
+ renderFields === null || renderFields === void 0 ? void 0 : renderFields.products.forEach(function (prod) {
6012
+ if ((prod === null || prod === void 0 ? void 0 : prod.name) === 'cards') {
6013
+ editUserId ? fetchEditUserCardsDetails(editUserId) : fetchLoggedUserCardsDetails();
6014
+ }
6015
+ });
6013
6016
  setPersonalInfoInput(_extends({}, personalInfoInput, {
6014
6017
  country_code: countryCode
6015
6018
  }));
@@ -6386,6 +6389,10 @@ var UserAddEdit = function UserAddEdit(props) {
6386
6389
  var allMandatoryFields = ['first_name', 'last_name', 'email'];
6387
6390
  if (cardsErrorMsg) {
6388
6391
  _isError = true;
6392
+ _errorMsgs.cards_admin = "You are not authorized person to make someone admin";
6393
+ } else {
6394
+ _isError = false;
6395
+ _errorMsgs.cards_admin = '';
6389
6396
  }
6390
6397
  allMandatoryFields.forEach(function (key, index) {
6391
6398
  if (personalInfoInput[key] === '') {
@@ -6941,7 +6948,7 @@ var UserAddEdit = function UserAddEdit(props) {
6941
6948
  md: 4
6942
6949
  }, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
6943
6950
  label: "Product access",
6944
- description: isProfile ? '' : 'Please select a product. Cards are available along with at least one additional product.',
6951
+ description: isProfile ? '' : 'Select at least one product',
6945
6952
  headerType: true,
6946
6953
  required: true
6947
6954
  })), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {