@itilite/iui-user-management 1.4.766 → 1.4.771
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 +32 -40
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +32 -40
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2243,6 +2243,7 @@ var CardsManagement = function CardsManagement(_ref) {
|
|
|
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');
|
|
2246
2247
|
var dispatch = reactRedux.useDispatch();
|
|
2247
2248
|
var pg = paymentDetails.pg,
|
|
2248
2249
|
_paymentDetails$cards = paymentDetails.cards,
|
|
@@ -2418,7 +2419,7 @@ var CardsManagement = function CardsManagement(_ref) {
|
|
|
2418
2419
|
return renderCard(card);
|
|
2419
2420
|
}), corporateCards.map(function (card) {
|
|
2420
2421
|
return renderCard(card);
|
|
2421
|
-
})), (!cards || (cards === null || cards === void 0 ? void 0 : cards.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
|
|
2422
|
+
})), console.log(paymentMethod, 'paymentMethod in card section'), (!cards || (cards === null || cards === void 0 ? void 0 : cards.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", {
|
|
2422
2423
|
className: classes.addCardButton,
|
|
2423
2424
|
onClick: function onClick() {
|
|
2424
2425
|
return window.location.assign(_url);
|
|
@@ -2475,14 +2476,17 @@ var CardsManagement = function CardsManagement(_ref) {
|
|
|
2475
2476
|
|
|
2476
2477
|
var PaymentCards = function PaymentCards(_ref) {
|
|
2477
2478
|
var _paymentDetails$pg, _paymentDetails$pg2;
|
|
2478
|
-
var paymentDetails = _ref.paymentDetails
|
|
2479
|
-
|
|
2479
|
+
var paymentDetails = _ref.paymentDetails,
|
|
2480
|
+
paymentMethod = _ref.paymentMethod;
|
|
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)) {
|
|
2480
2482
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
2481
2483
|
}
|
|
2484
|
+
console.log(paymentMethod, 'paymentMethod in payment cards');
|
|
2482
2485
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIDivider, {
|
|
2483
2486
|
className: styles$1.dividerColor
|
|
2484
2487
|
}), /*#__PURE__*/React__default.createElement(CardsManagement, {
|
|
2485
|
-
paymentDetails: paymentDetails
|
|
2488
|
+
paymentDetails: paymentDetails,
|
|
2489
|
+
paymentMethod: paymentMethod
|
|
2486
2490
|
}));
|
|
2487
2491
|
};
|
|
2488
2492
|
|
|
@@ -6199,7 +6203,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6199
6203
|
method: 'GET',
|
|
6200
6204
|
headers: {
|
|
6201
6205
|
'Content-Type': 'application/json',
|
|
6202
|
-
|
|
6206
|
+
authorization: "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
6203
6207
|
}
|
|
6204
6208
|
}).then(function (response) {
|
|
6205
6209
|
return response.json();
|
|
@@ -6211,27 +6215,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6211
6215
|
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
6212
6216
|
}
|
|
6213
6217
|
})["catch"](function (error) {
|
|
6214
|
-
console.log(
|
|
6215
|
-
});
|
|
6216
|
-
};
|
|
6217
|
-
var fetchLoggedUserCardsDetails = function fetchLoggedUserCardsDetails() {
|
|
6218
|
-
fetch(userAddEditUrl.cardsAddUsersDetails(), {
|
|
6219
|
-
method: 'GET',
|
|
6220
|
-
headers: {
|
|
6221
|
-
'Content-Type': 'application/json',
|
|
6222
|
-
'authorization': "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
6223
|
-
}
|
|
6224
|
-
}).then(function (response) {
|
|
6225
|
-
return response.json();
|
|
6226
|
-
}).then(function (res) {
|
|
6227
|
-
var _res$roles2;
|
|
6228
|
-
if (res !== null && res !== void 0 && (_res$roles2 = res.roles) !== null && _res$roles2 !== void 0 && _res$roles2.length) {
|
|
6229
|
-
dispatch(setCardsDetails(res));
|
|
6230
|
-
} else {
|
|
6231
|
-
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
6232
|
-
}
|
|
6233
|
-
})["catch"](function (error) {
|
|
6234
|
-
console.log("errorrr", error);
|
|
6218
|
+
console.log('errorrr', error);
|
|
6235
6219
|
});
|
|
6236
6220
|
};
|
|
6237
6221
|
React.useEffect(function () {
|
|
@@ -6411,13 +6395,20 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6411
6395
|
}
|
|
6412
6396
|
} else if (isCardsDetailsRendered && isProfile && productAccess.card) {
|
|
6413
6397
|
var targetRole = isCardsAdmin ? 'card-admin' : 'card-holder';
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6398
|
+
var _selectedRole = cardsDetails.cardsRoles.find(function (role) {
|
|
6399
|
+
return role.isAssigned;
|
|
6400
|
+
});
|
|
6401
|
+
if (_selectedRole) {
|
|
6402
|
+
setCardsRole(_selectedRole.value);
|
|
6403
|
+
} else {
|
|
6404
|
+
for (var _iterator = _createForOfIteratorHelperLoose(cardsDetails.cardsRoles), _step; !(_step = _iterator()).done;) {
|
|
6405
|
+
var role = _step.value;
|
|
6406
|
+
var splitRoleVal = role.value.split(':');
|
|
6407
|
+
var profileRole = splitRoleVal[2];
|
|
6408
|
+
if (profileRole === targetRole) {
|
|
6409
|
+
setCardsRole(role.value);
|
|
6410
|
+
break;
|
|
6411
|
+
}
|
|
6421
6412
|
}
|
|
6422
6413
|
}
|
|
6423
6414
|
}
|
|
@@ -6928,7 +6919,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6928
6919
|
if (isRendered === true) {
|
|
6929
6920
|
renderFields === null || renderFields === void 0 ? void 0 : renderFields.products.forEach(function (prod) {
|
|
6930
6921
|
if ((prod === null || prod === void 0 ? void 0 : prod.name) === 'card') {
|
|
6931
|
-
|
|
6922
|
+
fetchEditUserCardsDetails(isProfile ? id : editUserId);
|
|
6932
6923
|
}
|
|
6933
6924
|
});
|
|
6934
6925
|
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
@@ -7271,7 +7262,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7271
7262
|
employeeInfoInput.skip_manager_id = employeeInfoInput.skip_manager.value;
|
|
7272
7263
|
}
|
|
7273
7264
|
var cardsPayload = {
|
|
7274
|
-
|
|
7265
|
+
roles: [cardsRole]
|
|
7275
7266
|
};
|
|
7276
7267
|
var payload = {
|
|
7277
7268
|
personalInfoInput: personalInfoInput,
|
|
@@ -7457,7 +7448,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7457
7448
|
body: JSON.stringify(cardsPayload),
|
|
7458
7449
|
headers: {
|
|
7459
7450
|
'Content-Type': 'application/json',
|
|
7460
|
-
|
|
7451
|
+
authorization: "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
7461
7452
|
}
|
|
7462
7453
|
}).then(function (response) {
|
|
7463
7454
|
if (response.status === 200) {
|
|
@@ -7466,7 +7457,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7466
7457
|
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
7467
7458
|
}
|
|
7468
7459
|
})["catch"](function (error) {
|
|
7469
|
-
console.log(
|
|
7460
|
+
console.log('errorrr', error);
|
|
7470
7461
|
})["finally"](function () {
|
|
7471
7462
|
dispatch(stopLoader());
|
|
7472
7463
|
});
|
|
@@ -7484,14 +7475,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7484
7475
|
body: JSON.stringify(cardsPayload),
|
|
7485
7476
|
headers: {
|
|
7486
7477
|
'Content-Type': 'application/json',
|
|
7487
|
-
|
|
7478
|
+
authorization: "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
7488
7479
|
}
|
|
7489
7480
|
}).then(function (response) {
|
|
7490
7481
|
if (response.status !== 200) {
|
|
7491
7482
|
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
7492
7483
|
}
|
|
7493
7484
|
})["catch"](function (error) {
|
|
7494
|
-
console.log(
|
|
7485
|
+
console.log('errorrr', error);
|
|
7495
7486
|
});
|
|
7496
7487
|
}
|
|
7497
7488
|
(config === null || config === void 0 ? void 0 : (_config$routes4 = config.routes) === null || _config$routes4 === void 0 ? void 0 : (_config$routes4$users = _config$routes4.users) === null || _config$routes4$users === void 0 ? void 0 : (_config$routes4$users2 = _config$routes4$users.list) === null || _config$routes4$users2 === void 0 ? void 0 : _config$routes4$users2.path) && history.push(config.routes.users.list.path);
|
|
@@ -7946,7 +7937,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
7946
7937
|
maxApprovers: maxExpenseApprovers,
|
|
7947
7938
|
isProfile: isProfile,
|
|
7948
7939
|
editUserId: editUserId,
|
|
7949
|
-
roles: renderFields.expenseRoles
|
|
7940
|
+
roles: renderFields.expenseRoles,
|
|
7941
|
+
paymentMethod: paymentMethod
|
|
7950
7942
|
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIDivider, {
|
|
7951
7943
|
className: styles.dividerColor
|
|
7952
7944
|
}), isCardsDetailsRendered && productAccess && productAccess.card && /*#__PURE__*/React__default.createElement(CardsField, {
|