@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.
package/dist/index.js CHANGED
@@ -2238,12 +2238,11 @@ var editCustomFieldLabel = function editCustomFieldLabel(payload) {
2238
2238
  var IUILocalStorageService$4 = utils.services.IUILocalStorageService;
2239
2239
  var env$3 = utils.configs.env;
2240
2240
  var CardsManagement = function CardsManagement(_ref) {
2241
- var _pg$gateway, _pg$gateway2;
2241
+ var _pg$gateway;
2242
2242
  var _ref$paymentDetails = _ref.paymentDetails,
2243
2243
  paymentDetails = _ref$paymentDetails === void 0 ? {} : _ref$paymentDetails,
2244
2244
  _ref$paymentMethod = _ref.paymentMethod,
2245
2245
  paymentMethod = _ref$paymentMethod === void 0 ? null : _ref$paymentMethod;
2246
- console.log(paymentMethod, 'paymentMethod in CardsManagement');
2247
2246
  var dispatch = reactRedux.useDispatch();
2248
2247
  var pg = paymentDetails.pg,
2249
2248
  _paymentDetails$cards = paymentDetails.cards,
@@ -2377,15 +2376,16 @@ var CardsManagement = function CardsManagement(_ref) {
2377
2376
  className: classes.brandLogo
2378
2377
  })));
2379
2378
  };
2380
- var personalCards = cards.filter(function (card) {
2379
+ var personalCards = cards === null || cards === void 0 ? void 0 : cards.filter(function (card) {
2381
2380
  return card.category === 'Personal';
2382
2381
  });
2383
- var corporateCards = cards.filter(function (card) {
2382
+ var corporateCards = cards === null || cards === void 0 ? void 0 : cards.filter(function (card) {
2384
2383
  return card.category === 'Corporate';
2385
2384
  });
2386
- var companyCards = cards.filter(function (card) {
2385
+ var companyCards = cards === null || cards === void 0 ? void 0 : cards.filter(function (card) {
2387
2386
  return card.category === 'Company';
2388
2387
  });
2388
+ var cardsCount = (personalCards === null || personalCards === void 0 ? void 0 : personalCards.length) + (corporateCards === null || corporateCards === void 0 ? void 0 : corporateCards.length);
2389
2389
  var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$4.getAccessToken() + "/1/" + pg.entity_id + "/0/" + pg.vendor_id + "/1");
2390
2390
  return /*#__PURE__*/React__default.createElement("div", {
2391
2391
  style: {
@@ -2419,7 +2419,7 @@ var CardsManagement = function CardsManagement(_ref) {
2419
2419
  return renderCard(card);
2420
2420
  }), corporateCards.map(function (card) {
2421
2421
  return renderCard(card);
2422
- })), 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__default.createElement("button", {
2422
+ })), (!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__default.createElement("button", {
2423
2423
  className: classes.addCardButton,
2424
2424
  onClick: function onClick() {
2425
2425
  return window.location.assign(_url);
@@ -2481,7 +2481,6 @@ var PaymentCards = function PaymentCards(_ref) {
2481
2481
  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)) {
2482
2482
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
2483
2483
  }
2484
- console.log(paymentMethod, 'paymentMethod in payment cards');
2485
2484
  return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIDivider, {
2486
2485
  className: styles$1.dividerColor
2487
2486
  }), /*#__PURE__*/React__default.createElement(CardsManagement, {