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