@itilite/iui-user-management 1.4.7711 → 1.4.7721

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.
@@ -2235,12 +2235,11 @@ var editCustomFieldLabel = function editCustomFieldLabel(payload) {
2235
2235
  var IUILocalStorageService$4 = services.IUILocalStorageService;
2236
2236
  var env$3 = configs.env;
2237
2237
  var CardsManagement = function CardsManagement(_ref) {
2238
- var _pg$gateway, _pg$gateway2;
2238
+ var _pg$gateway;
2239
2239
  var _ref$paymentDetails = _ref.paymentDetails,
2240
2240
  paymentDetails = _ref$paymentDetails === void 0 ? {} : _ref$paymentDetails,
2241
2241
  _ref$paymentMethod = _ref.paymentMethod,
2242
2242
  paymentMethod = _ref$paymentMethod === void 0 ? null : _ref$paymentMethod;
2243
- console.log(paymentMethod, 'paymentMethod in CardsManagement');
2244
2243
  var dispatch = useDispatch();
2245
2244
  var pg = paymentDetails.pg,
2246
2245
  _paymentDetails$cards = paymentDetails.cards,
@@ -2374,15 +2373,16 @@ var CardsManagement = function CardsManagement(_ref) {
2374
2373
  className: classes.brandLogo
2375
2374
  })));
2376
2375
  };
2377
- var personalCards = cards.filter(function (card) {
2376
+ var personalCards = cards === null || cards === void 0 ? void 0 : cards.filter(function (card) {
2378
2377
  return card.category === 'Personal';
2379
2378
  });
2380
- var corporateCards = cards.filter(function (card) {
2379
+ var corporateCards = cards === null || cards === void 0 ? void 0 : cards.filter(function (card) {
2381
2380
  return card.category === 'Corporate';
2382
2381
  });
2383
- var companyCards = cards.filter(function (card) {
2382
+ var companyCards = cards === null || cards === void 0 ? void 0 : cards.filter(function (card) {
2384
2383
  return card.category === 'Company';
2385
2384
  });
2385
+ var cardsCount = (personalCards === null || personalCards === void 0 ? void 0 : personalCards.length) + (corporateCards === null || corporateCards === void 0 ? void 0 : corporateCards.length);
2386
2386
  var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$4.getAccessToken() + "/1/" + pg.entity_id + "/0/" + pg.vendor_id + "/1");
2387
2387
  return /*#__PURE__*/React.createElement("div", {
2388
2388
  style: {
@@ -2416,7 +2416,7 @@ var CardsManagement = function CardsManagement(_ref) {
2416
2416
  return renderCard(card);
2417
2417
  }), corporateCards.map(function (card) {
2418
2418
  return renderCard(card);
2419
- })), console.log(paymentMethod, 'paymentMethod in card section', !cards, (cards === null || cards === void 0 ? void 0 : cards.length) < 10, pg, (pg === null || pg === void 0 ? void 0 : (_pg$gateway = pg.gateway) === null || _pg$gateway === void 0 ? void 0 : _pg$gateway.toLowerCase()) === 'stripe', (pg === null || pg === void 0 ? void 0 : pg.save_card_enable) === 1, paymentMethod === 1), (!cards || (cards === null || cards === void 0 ? void 0 : cards.length) < 10) && (pg === null || pg === void 0 ? void 0 : (_pg$gateway2 = pg.gateway) === null || _pg$gateway2 === void 0 ? void 0 : _pg$gateway2.toLowerCase()) === 'stripe' && (pg === null || pg === void 0 ? void 0 : pg.save_card_enable) === 1 && paymentMethod === 1 && /*#__PURE__*/React.createElement("button", {
2419
+ })), (!cards || (cardsCount === null || cardsCount === void 0 ? void 0 : cardsCount.length) < 10) && (pg === null || pg === void 0 ? void 0 : (_pg$gateway = pg.gateway) === null || _pg$gateway === void 0 ? void 0 : _pg$gateway.toLowerCase()) === 'stripe' && (pg === null || pg === void 0 ? void 0 : pg.save_card_enable) === 1 && paymentMethod === 1 && /*#__PURE__*/React.createElement("button", {
2420
2420
  className: classes.addCardButton,
2421
2421
  onClick: function onClick() {
2422
2422
  return window.location.assign(_url);
@@ -2478,7 +2478,6 @@ var PaymentCards = function PaymentCards(_ref) {
2478
2478
  if (!paymentDetails || Object.keys(paymentDetails).length === 0 || (!paymentDetails.cards || paymentDetails.cards.length === 0) && ((paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$pg = paymentDetails.pg) === null || _paymentDetails$pg === void 0 ? void 0 : _paymentDetails$pg.gateway.toLowerCase()) !== 'stripe' || (paymentDetails === null || paymentDetails === void 0 ? void 0 : (_paymentDetails$pg2 = paymentDetails.pg) === null || _paymentDetails$pg2 === void 0 ? void 0 : _paymentDetails$pg2.save_card_enable) !== 1 || paymentMethod !== 1)) {
2479
2479
  return /*#__PURE__*/React.createElement(React.Fragment, null);
2480
2480
  }
2481
- console.log(paymentMethod, 'paymentMethod in payment cards');
2482
2481
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIDivider, {
2483
2482
  className: styles$1.dividerColor
2484
2483
  }), /*#__PURE__*/React.createElement(CardsManagement, {