@itilite/iui-user-management 1.4.895 → 1.4.941

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.css CHANGED
@@ -357,6 +357,11 @@
357
357
  opacity: 1 !important;
358
358
  margin: 0 !important;
359
359
  }
360
+ ._3MVKj {
361
+ opacity: 0.6;
362
+ filter: grayscale(1);
363
+ }
364
+
360
365
  ._2d_OH {
361
366
  margin-bottom: 24px;
362
367
  }
package/dist/index.js CHANGED
@@ -413,6 +413,9 @@ var userAddEditUrl = {
413
413
  setDefaultCard: function setDefaultCard(pmId, vendorId) {
414
414
  return env.getPaymentUrl() + "/api/v1/card/default";
415
415
  },
416
+ disablePaymentCard: function disablePaymentCard() {
417
+ return env.getPaymentUrl() + "/api/v1/card/status";
418
+ },
416
419
  verifyUserInfo: function verifyUserInfo(userId) {
417
420
  return "api/v1/onboarding/user-sign-up-info/" + userId + "?company_id=" + IUILocalStorageService.getCompanyId();
418
421
  },
@@ -829,7 +832,7 @@ var UserRole = function UserRole(_ref) {
829
832
 
830
833
  var styles$1 = {"defaultLabel":"_smjc4","card":"_3_S9J","cardNumber":"_36E9M","cardDigit":"_2pm-T","expiryDate":"_2tBnF","cardImage":"_3QvZh","visa":"_1IpBm","mastercard":"_2x6IX","amex":"_2a38S","discover":"_2vksl","diners":"_2kQRs","jcb":"_2bO1f","unionpay":"_2_jfu","is_nothing":"_1Lrzs","addCard":"_3711U","cardDeleteBtn":"_7Da2t","cardLabel":"_PQTex","defaultBtn":"_1_ArA","cursonPointer":"_1L115","sectionWrapper":"_VpUCK","margin":"_1Fs_D","minGridWidth":"_1hl-Z","firstRowMargin":"_1WZZj","firstChildMargin":"_IT_O_","paddingTop":"_Mhnl7","dividerColor":"_3ltFd"};
831
834
 
832
- var classes = {"sectionHeader":"_2d_OH","myCardsSection":"_3MNHj","companyCardsSection":"_34lN6","disabledNotice":"_1yV0j","cardsGrid":"_1oHGu","card":"_3ZTQc","moreIcon":"_3utA0","personal":"_duePd","corporate":"_3O33a","company":"_180_L","cardHeader":"_1eF61","cardTitleSection":"_2c40W","cardMaskedNumber":"_2Vlhq","cardName":"_bp-Mt","cardType":"_3l4HZ","menuButton":"_3TTEn","lockIcon":"_1S27X","cardDetails":"_IP2rg","cardNumber":"_7FOPe","cardExpiry":"_CI_p2","cardCvv":"_3Gzqu","cardUnhide":"_ivgBf","cardFooter":"_1WgPL","brandLogo":"_EV0l8","addCardButton":"_1oaCc","plusIcon":"_w9L5L"};
835
+ var classes = {"disabledCard":"_3MVKj","sectionHeader":"_2d_OH","myCardsSection":"_3MNHj","companyCardsSection":"_34lN6","disabledNotice":"_1yV0j","cardsGrid":"_1oHGu","card":"_3ZTQc","moreIcon":"_3utA0","personal":"_duePd","corporate":"_3O33a","company":"_180_L","cardHeader":"_1eF61","cardTitleSection":"_2c40W","cardMaskedNumber":"_2Vlhq","cardName":"_bp-Mt","cardType":"_3l4HZ","menuButton":"_3TTEn","lockIcon":"_1S27X","cardDetails":"_IP2rg","cardNumber":"_7FOPe","cardExpiry":"_CI_p2","cardCvv":"_3Gzqu","cardUnhide":"_ivgBf","cardFooter":"_1WgPL","brandLogo":"_EV0l8","addCardButton":"_1oaCc","plusIcon":"_w9L5L"};
833
836
 
834
837
  var SHOW_LOADER = 'SHOW_LOADER';
835
838
  var STOP_LOADER = 'STOP_LOADER';
@@ -1838,13 +1841,13 @@ var setDefaultPaymentCard = function setDefaultPaymentCard(payload) {
1838
1841
  });
1839
1842
  dispatch(setPaymentDetails(_paymentDetails));
1840
1843
  } else {
1841
- var _res$data3;
1842
- IUIToastMessageService$1.warningNotify((res === null || res === void 0 ? void 0 : (_res$data3 = res.data) === null || _res$data3 === void 0 ? void 0 : _res$data3.message) || 'Opps, Something went wrong.');
1844
+ var _res$data4;
1845
+ IUIToastMessageService$1.warningNotify((res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.message) || 'Opps, Something went wrong.');
1843
1846
  reject(res);
1844
1847
  }
1845
1848
  })["catch"](function (err) {
1846
- var _err$response15, _err$response15$data;
1847
- IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response15 = err.response) === null || _err$response15 === void 0 ? void 0 : (_err$response15$data = _err$response15.data) === null || _err$response15$data === void 0 ? void 0 : _err$response15$data.message) || 'Opps, Something went wrong.');
1849
+ var _err$response16, _err$response16$data;
1850
+ IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response16 = err.response) === null || _err$response16 === void 0 ? void 0 : (_err$response16$data = _err$response16.data) === null || _err$response16$data === void 0 ? void 0 : _err$response16$data.message) || 'Opps, Something went wrong.');
1848
1851
  reject(err);
1849
1852
  })["finally"](function () {
1850
1853
  dispatch(stopLoader());
@@ -1859,16 +1862,16 @@ var verifyUserInfo = function verifyUserInfo(userId) {
1859
1862
  if (res.data.status === 200) {
1860
1863
  resolve(res.data.result);
1861
1864
  } else {
1862
- var _res$data4;
1863
- IUIToastMessageService$1.warningNotify((res === null || res === void 0 ? void 0 : (_res$data4 = res.data) === null || _res$data4 === void 0 ? void 0 : _res$data4.message) || 'Opps, Unable to fetch user info.');
1865
+ var _res$data5;
1866
+ IUIToastMessageService$1.warningNotify((res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.message) || 'Opps, Unable to fetch user info.');
1864
1867
  setTimeout(function () {
1865
1868
  window.history.back();
1866
1869
  }, 1000);
1867
1870
  reject(res);
1868
1871
  }
1869
1872
  })["catch"](function (err) {
1870
- var _err$response16, _err$response16$data;
1871
- IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response16 = err.response) === null || _err$response16 === void 0 ? void 0 : (_err$response16$data = _err$response16.data) === null || _err$response16$data === void 0 ? void 0 : _err$response16$data.message) || 'Opps, Unable to fetch user info.');
1873
+ var _err$response17, _err$response17$data;
1874
+ IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response17 = err.response) === null || _err$response17 === void 0 ? void 0 : (_err$response17$data = _err$response17.data) === null || _err$response17$data === void 0 ? void 0 : _err$response17$data.message) || 'Opps, Unable to fetch user info.');
1872
1875
  setTimeout(function () {
1873
1876
  window.history.back();
1874
1877
  }, 1000);
@@ -1883,8 +1886,8 @@ var submitAddModalData = function submitAddModalData(tableName, data) {
1883
1886
  api$2.post(tableName === 'department' ? departmentUrl.departmentUrl() : userAddEditUrl.dropdownList() + ("?action=add&table=" + tableName), data).then(function (res) {
1884
1887
  resolve(res);
1885
1888
  })["catch"](function (err) {
1886
- var _err$response17, _err$response17$data;
1887
- IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response17 = err.response) === null || _err$response17 === void 0 ? void 0 : (_err$response17$data = _err$response17.data) === null || _err$response17$data === void 0 ? void 0 : _err$response17$data.message) || 'Opps, Something went wrong.');
1889
+ var _err$response18, _err$response18$data;
1890
+ IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response18 = err.response) === null || _err$response18 === void 0 ? void 0 : (_err$response18$data = _err$response18.data) === null || _err$response18$data === void 0 ? void 0 : _err$response18$data.message) || 'Opps, Something went wrong.');
1888
1891
  dispatch(stopLoader());
1889
1892
  });
1890
1893
  });
@@ -1897,13 +1900,13 @@ var rejectUserVerification = function rejectUserVerification(userId) {
1897
1900
  if (res.data.status === true) {
1898
1901
  resolve(res.data);
1899
1902
  } else {
1900
- var _res$data5;
1901
- IUIToastMessageService$1.warningNotify((res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.message) || 'Opps, Unable to reject user.');
1903
+ var _res$data6;
1904
+ IUIToastMessageService$1.warningNotify((res === null || res === void 0 ? void 0 : (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.message) || 'Opps, Unable to reject user.');
1902
1905
  reject(res);
1903
1906
  }
1904
1907
  })["catch"](function (err) {
1905
- var _err$response18, _err$response18$data;
1906
- IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response18 = err.response) === null || _err$response18 === void 0 ? void 0 : (_err$response18$data = _err$response18.data) === null || _err$response18$data === void 0 ? void 0 : _err$response18$data.message) || 'Opps, Unable to reject user.');
1908
+ var _err$response19, _err$response19$data;
1909
+ IUIToastMessageService$1.warningNotify((err === null || err === void 0 ? void 0 : (_err$response19 = err.response) === null || _err$response19 === void 0 ? void 0 : (_err$response19$data = _err$response19.data) === null || _err$response19$data === void 0 ? void 0 : _err$response19$data.message) || 'Opps, Unable to reject user.');
1907
1910
  reject(err);
1908
1911
  });
1909
1912
  });
@@ -2789,14 +2792,16 @@ var CardsManagement = function CardsManagement(_ref) {
2789
2792
  });
2790
2793
  var cardsCount = (personalCards === null || personalCards === void 0 ? void 0 : personalCards.length) + (corporateCards === null || corporateCards === void 0 ? void 0 : corporateCards.length);
2791
2794
  var renderCard = function renderCard(card) {
2792
- var _card$metadata, _card$card, _card$card2, _card$card3, _card$card4;
2795
+ var _card$metadata, _card$metadata2, _clsx, _card$card, _card$card2, _card$card3, _card$card4;
2796
+ console.log('_paymentDetails2', card, cards);
2793
2797
  var isCompanyCard = (card === null || card === void 0 ? void 0 : card.category) === 'Company';
2794
2798
  var cardClass = getCardTypeClass(card === null || card === void 0 ? void 0 : card.category);
2795
2799
  var isDefaultCard = !!+(card === null || card === void 0 ? void 0 : (_card$metadata = card.metadata) === null || _card$metadata === void 0 ? void 0 : _card$metadata.default_card);
2800
+ var isDisabled = (card === null || card === void 0 ? void 0 : (_card$metadata2 = card.metadata) === null || _card$metadata2 === void 0 ? void 0 : _card$metadata2.is_enabled) === '0';
2796
2801
  var showMenuButton = cardsCount === 1 || cardsCount > 1 && !isDefaultCard;
2797
2802
  return /*#__PURE__*/React__default.createElement("div", {
2798
2803
  key: card.id,
2799
- className: clsx(classes.card, classes[cardClass])
2804
+ className: clsx(classes.card, classes[cardClass], (_clsx = {}, _clsx[classes.disabledCard] = isDisabled, _clsx))
2800
2805
  }, /*#__PURE__*/React__default.createElement("div", {
2801
2806
  className: classes.cardHeader
2802
2807
  }, /*#__PURE__*/React__default.createElement("div", {