@itilite/iui-user-management 1.5.0-beta-3 → 1.5.0-beta-4
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 +26 -5
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +27 -6
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -423,6 +423,9 @@ var userAddEditUrl = {
|
|
|
423
423
|
setDefaultCard: function setDefaultCard(pmId, vendorId) {
|
|
424
424
|
return env.getPaymentUrl() + "/api/v1/card/default";
|
|
425
425
|
},
|
|
426
|
+
personalCardEligibility: function personalCardEligibility() {
|
|
427
|
+
return env.getPaymentUrl() + "/api/v1/card/clients/" + IUILocalStorageService.getClientId() + "/personal/eligibility?app_type=1";
|
|
428
|
+
},
|
|
426
429
|
disablePaymentCard: function disablePaymentCard() {
|
|
427
430
|
return env.getPaymentUrl() + "/api/v1/card/status";
|
|
428
431
|
},
|
|
@@ -2664,7 +2667,8 @@ var Visa = function Visa(props) {
|
|
|
2664
2667
|
};
|
|
2665
2668
|
|
|
2666
2669
|
var IUILocalStorageService$3 = utils.services.IUILocalStorageService;
|
|
2667
|
-
var env$3 = utils.configs.env
|
|
2670
|
+
var env$3 = utils.configs.env,
|
|
2671
|
+
paymentApi$1 = utils.configs.paymentApi;
|
|
2668
2672
|
var CardsManagement = function CardsManagement(_ref) {
|
|
2669
2673
|
var _selectedCard$metadat, _pg$gateway;
|
|
2670
2674
|
var _ref$paymentDetails = _ref.paymentDetails,
|
|
@@ -2685,6 +2689,23 @@ var CardsManagement = function CardsManagement(_ref) {
|
|
|
2685
2689
|
var _useState2 = React.useState(null),
|
|
2686
2690
|
selectedCard = _useState2[0],
|
|
2687
2691
|
setSelectedCard = _useState2[1];
|
|
2692
|
+
var _useState3 = React.useState(false),
|
|
2693
|
+
allowPersonalCardAdd = _useState3[0],
|
|
2694
|
+
setAllowPersonalCardAdd = _useState3[1];
|
|
2695
|
+
React.useEffect(function () {
|
|
2696
|
+
var isActive = true;
|
|
2697
|
+
paymentApi$1.get(userAddEditUrl.personalCardEligibility()).then(function (res) {
|
|
2698
|
+
if (isActive) {
|
|
2699
|
+
var _res$data, _res$data$data;
|
|
2700
|
+
setAllowPersonalCardAdd((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : (_res$data$data = _res$data.data) === null || _res$data$data === void 0 ? void 0 : _res$data$data.allow_personal_card_add) === true);
|
|
2701
|
+
}
|
|
2702
|
+
})["catch"](function () {
|
|
2703
|
+
if (isActive) setAllowPersonalCardAdd(false);
|
|
2704
|
+
});
|
|
2705
|
+
return function () {
|
|
2706
|
+
isActive = false;
|
|
2707
|
+
};
|
|
2708
|
+
}, []);
|
|
2688
2709
|
var handleMenuClick = function handleMenuClick(event, card) {
|
|
2689
2710
|
setAnchorEl(event.currentTarget);
|
|
2690
2711
|
setSelectedCard(card);
|
|
@@ -2902,7 +2923,7 @@ var CardsManagement = function CardsManagement(_ref) {
|
|
|
2902
2923
|
return renderCard(card);
|
|
2903
2924
|
}) : null, corporateCards.length !== 0 ? corporateCards === null || corporateCards === void 0 ? void 0 : corporateCards.map(function (card) {
|
|
2904
2925
|
return renderCard(card);
|
|
2905
|
-
}) : null),
|
|
2926
|
+
}) : null), (!cards || cardsCount < 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 && allowPersonalCardAdd && /*#__PURE__*/React__default.createElement("button", {
|
|
2906
2927
|
className: classes.addCardButton,
|
|
2907
2928
|
onClick: function onClick() {
|
|
2908
2929
|
sendLog({
|
|
@@ -3607,7 +3628,7 @@ var personalInfo = [{
|
|
|
3607
3628
|
readOnly: false,
|
|
3608
3629
|
placeholder: 'Enter first and middle name',
|
|
3609
3630
|
validation: {
|
|
3610
|
-
regexOnChange:
|
|
3631
|
+
regexOnChange: /^(?!.* {2}).*$/,
|
|
3611
3632
|
regexOnBlur: [{
|
|
3612
3633
|
regex: /^[a-zA-Z ]*$/,
|
|
3613
3634
|
message: 'Only alphabets are allowed.'
|
|
@@ -3629,7 +3650,7 @@ var personalInfo = [{
|
|
|
3629
3650
|
readOnly: false,
|
|
3630
3651
|
placeholder: 'Enter last name',
|
|
3631
3652
|
validation: {
|
|
3632
|
-
regexOnChange:
|
|
3653
|
+
regexOnChange: /^(?!.* {2}).*$/,
|
|
3633
3654
|
regexOnBlur: [{
|
|
3634
3655
|
regex: /^[a-zA-Z ]*$/,
|
|
3635
3656
|
message: 'Only alphabets are allowed.'
|
|
@@ -3672,7 +3693,7 @@ var personalInfo = [{
|
|
|
3672
3693
|
visibility: true,
|
|
3673
3694
|
readOnly: false,
|
|
3674
3695
|
validation: {
|
|
3675
|
-
regexOnChange:
|
|
3696
|
+
regexOnChange: /^\d*$/,
|
|
3676
3697
|
regexOnBlur: null,
|
|
3677
3698
|
maxLimit: '',
|
|
3678
3699
|
minLimit: '',
|