@itilite/iui-user-management 1.4.964-beta.11 → 1.4.964-beta.13
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 +43 -61
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +43 -61
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1382,9 +1382,9 @@ var updateActiveStatus = function updateActiveStatus(activateVal, id, roleTransf
|
|
|
1382
1382
|
};
|
|
1383
1383
|
};
|
|
1384
1384
|
|
|
1385
|
-
var api$2 = utils.configs.api
|
|
1386
|
-
|
|
1387
|
-
|
|
1385
|
+
var api$2 = utils.configs.api,
|
|
1386
|
+
paymentApi = utils.configs.paymentApi;
|
|
1387
|
+
var IUIToastMessageService$1 = utils.services.IUIToastMessageService;
|
|
1388
1388
|
var showLoader = function showLoader() {
|
|
1389
1389
|
return {
|
|
1390
1390
|
type: SHOW_LOADER
|
|
@@ -1823,11 +1823,7 @@ var deletePaymentCard = function deletePaymentCard(payload) {
|
|
|
1823
1823
|
return function (dispatch, getState) {
|
|
1824
1824
|
return new Promise(function (resolve, reject) {
|
|
1825
1825
|
dispatch(showLoader());
|
|
1826
|
-
|
|
1827
|
-
headers: {
|
|
1828
|
-
Authorization: 'Bearer ' + IUILocalStorageService$2.getAccessToken()
|
|
1829
|
-
}
|
|
1830
|
-
}).then(function (res) {
|
|
1826
|
+
paymentApi["delete"](userAddEditUrl.deletePaymentCard(payload.pmId, payload.vendorId)).then(function (res) {
|
|
1831
1827
|
if (res.data.status) {
|
|
1832
1828
|
resolve(res.data.result);
|
|
1833
1829
|
var _paymentDetails = getState().userAddEdit.paymentDetails;
|
|
@@ -1854,11 +1850,7 @@ var setDefaultPaymentCard = function setDefaultPaymentCard(payload) {
|
|
|
1854
1850
|
return function (dispatch, getState) {
|
|
1855
1851
|
return new Promise(function (resolve, reject) {
|
|
1856
1852
|
dispatch(showLoader());
|
|
1857
|
-
|
|
1858
|
-
headers: {
|
|
1859
|
-
Authorization: 'Bearer ' + IUILocalStorageService$2.getAccessToken()
|
|
1860
|
-
}
|
|
1861
|
-
}).then(function (res) {
|
|
1853
|
+
paymentApi.put(userAddEditUrl.setDefaultCard(), payload).then(function (res) {
|
|
1862
1854
|
if (res.data.status) {
|
|
1863
1855
|
resolve(res.data.result);
|
|
1864
1856
|
var _paymentDetails = getState().userAddEdit.paymentDetails;
|
|
@@ -2076,7 +2068,7 @@ var SET_VERIFICATION_ERROR = 'SET_VERIFICATION_ERROR';
|
|
|
2076
2068
|
var api$4 = utils.configs.api,
|
|
2077
2069
|
env$2 = utils.configs.env;
|
|
2078
2070
|
var common = utils.utilUrls.common;
|
|
2079
|
-
var IUILocalStorageService$
|
|
2071
|
+
var IUILocalStorageService$2 = utils.services.IUILocalStorageService;
|
|
2080
2072
|
var setTokenResponse = function setTokenResponse(payload) {
|
|
2081
2073
|
return {
|
|
2082
2074
|
type: VERIFY_ACCESS_TOKEN,
|
|
@@ -2097,7 +2089,7 @@ var verifyAccessToken = function verifyAccessToken(roleCanAccess) {
|
|
|
2097
2089
|
return new Promise(function (resolve, reject) {
|
|
2098
2090
|
dispatch(setVerificationError(false));
|
|
2099
2091
|
api$4.post(common.verifyToken(), {
|
|
2100
|
-
client_id: +IUILocalStorageService$
|
|
2092
|
+
client_id: +IUILocalStorageService$2.getClientId() || null,
|
|
2101
2093
|
product: env$2.isExpense() ? 'expense' : 'travel'
|
|
2102
2094
|
}).then(function (res) {
|
|
2103
2095
|
if (res.data.status === true) {
|
|
@@ -2107,21 +2099,21 @@ var verifyAccessToken = function verifyAccessToken(roleCanAccess) {
|
|
|
2107
2099
|
return;
|
|
2108
2100
|
}
|
|
2109
2101
|
if (env$2.isProfilePage()) {
|
|
2110
|
-
IUILocalStorageService$
|
|
2102
|
+
IUILocalStorageService$2.setCompanyId(res.data.company);
|
|
2111
2103
|
dispatch(setTokenResponse(res.data));
|
|
2112
2104
|
dispatch(setVerificationError(false));
|
|
2113
2105
|
if (env$2.isExpense()) {
|
|
2114
|
-
IUILocalStorageService$
|
|
2106
|
+
IUILocalStorageService$2.setRole('submitter');
|
|
2115
2107
|
} else {
|
|
2116
|
-
IUILocalStorageService$
|
|
2108
|
+
IUILocalStorageService$2.setRole('traveler');
|
|
2117
2109
|
}
|
|
2118
2110
|
resolve();
|
|
2119
2111
|
return;
|
|
2120
2112
|
} else {
|
|
2121
2113
|
for (var index = 0; index < res.data.applicable_role.length; index++) {
|
|
2122
2114
|
if (roleCanAccess.includes(res.data.applicable_role[index])) {
|
|
2123
|
-
IUILocalStorageService$
|
|
2124
|
-
IUILocalStorageService$
|
|
2115
|
+
IUILocalStorageService$2.setCompanyId(res.data.company);
|
|
2116
|
+
IUILocalStorageService$2.setRole(res.data.applicable_role[index]);
|
|
2125
2117
|
dispatch(setTokenResponse(res.data));
|
|
2126
2118
|
dispatch(setVerificationError(false));
|
|
2127
2119
|
resolve();
|
|
@@ -2677,7 +2669,7 @@ var CARDS_DISABLED = {
|
|
|
2677
2669
|
INVALID: '3'
|
|
2678
2670
|
};
|
|
2679
2671
|
|
|
2680
|
-
var IUILocalStorageService$
|
|
2672
|
+
var IUILocalStorageService$3 = utils.services.IUILocalStorageService;
|
|
2681
2673
|
var env$3 = utils.configs.env;
|
|
2682
2674
|
var CardsManagement = function CardsManagement(_ref) {
|
|
2683
2675
|
var _selectedCard$metadat, _pg$gateway;
|
|
@@ -2890,7 +2882,7 @@ var CardsManagement = function CardsManagement(_ref) {
|
|
|
2890
2882
|
className: classes.cardFooter
|
|
2891
2883
|
}, /*#__PURE__*/React__default.createElement("div", null), getBrandLogo(card === null || card === void 0 ? void 0 : (_card$card4 = card.card) === null || _card$card4 === void 0 ? void 0 : _card$card4.brand))));
|
|
2892
2884
|
};
|
|
2893
|
-
var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$
|
|
2885
|
+
var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$3.getAccessToken() + "/1/" + pg.entity_id + "/0/" + pg.vendor_id + "/1");
|
|
2894
2886
|
var showMenuButton = cardsCount === 1 || cardsCount > 1 && !+(selectedCard === null || selectedCard === void 0 ? void 0 : (_selectedCard$metadat = selectedCard.metadata) === null || _selectedCard$metadat === void 0 ? void 0 : _selectedCard$metadat.default_card);
|
|
2895
2887
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
2896
2888
|
style: {
|
|
@@ -6538,9 +6530,9 @@ var CardsField = function CardsField(props) {
|
|
|
6538
6530
|
}, editUserId ? "Only Card admin can change the Card role." : "Only Card admin can change card roles. By default this user will have Card Holder role.")))));
|
|
6539
6531
|
};
|
|
6540
6532
|
|
|
6541
|
-
var IUIToastMessageService$6 = utils.services.IUIToastMessageService
|
|
6542
|
-
|
|
6543
|
-
|
|
6533
|
+
var IUIToastMessageService$6 = utils.services.IUIToastMessageService;
|
|
6534
|
+
var cardsApi = utils.configs.cardsApi,
|
|
6535
|
+
env$4 = utils.configs.env;
|
|
6544
6536
|
var UserAddEdit = function UserAddEdit(props) {
|
|
6545
6537
|
var isEditMode = props.isEditMode,
|
|
6546
6538
|
editUserId = props.editUserId,
|
|
@@ -6755,14 +6747,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6755
6747
|
});
|
|
6756
6748
|
};
|
|
6757
6749
|
var fetchEditUserCardsDetails = function fetchEditUserCardsDetails(editUserId) {
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
headers: {
|
|
6761
|
-
'Content-Type': 'application/json',
|
|
6762
|
-
authorization: "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
6763
|
-
}
|
|
6764
|
-
}).then(function (response) {
|
|
6765
|
-
return response.json();
|
|
6750
|
+
cardsApi.get(userAddEditUrl.cardsEditUserDetails(editUserId)).then(function (response) {
|
|
6751
|
+
return response.data;
|
|
6766
6752
|
}).then(function (res) {
|
|
6767
6753
|
var _res$roles;
|
|
6768
6754
|
if (res !== null && res !== void 0 && (_res$roles = res.roles) !== null && _res$roles !== void 0 && _res$roles.length) {
|
|
@@ -6771,18 +6757,16 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6771
6757
|
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
6772
6758
|
}
|
|
6773
6759
|
})["catch"](function (error) {
|
|
6774
|
-
|
|
6760
|
+
if (error !== null && error !== void 0 && error.response) {
|
|
6761
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
6762
|
+
} else {
|
|
6763
|
+
console.log('errorrr', error);
|
|
6764
|
+
}
|
|
6775
6765
|
});
|
|
6776
6766
|
};
|
|
6777
6767
|
var fetchLoggedUserCardsDetails = function fetchLoggedUserCardsDetails() {
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
headers: {
|
|
6781
|
-
'Content-Type': 'application/json',
|
|
6782
|
-
authorization: "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
6783
|
-
}
|
|
6784
|
-
}).then(function (response) {
|
|
6785
|
-
return response.json();
|
|
6768
|
+
cardsApi.get(userAddEditUrl.cardsAddUsersDetails()).then(function (response) {
|
|
6769
|
+
return response.data;
|
|
6786
6770
|
}).then(function (res) {
|
|
6787
6771
|
var _res$roles2;
|
|
6788
6772
|
if (res !== null && res !== void 0 && (_res$roles2 = res.roles) !== null && _res$roles2 !== void 0 && _res$roles2.length) {
|
|
@@ -6791,7 +6775,11 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6791
6775
|
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
6792
6776
|
}
|
|
6793
6777
|
})["catch"](function (error) {
|
|
6794
|
-
|
|
6778
|
+
if (error !== null && error !== void 0 && error.response) {
|
|
6779
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
6780
|
+
} else {
|
|
6781
|
+
console.log('errorrr', error);
|
|
6782
|
+
}
|
|
6795
6783
|
});
|
|
6796
6784
|
};
|
|
6797
6785
|
React.useEffect(function () {
|
|
@@ -8030,21 +8018,18 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
8030
8018
|
if (isEditMode && editUserId || isProfile) {
|
|
8031
8019
|
dispatch(showLoader());
|
|
8032
8020
|
if (cardApiflag && !isProfile && editUserId !== (id === null || id === void 0 ? void 0 : id.toString())) {
|
|
8033
|
-
|
|
8034
|
-
method: 'POST',
|
|
8035
|
-
body: JSON.stringify(cardsPayload),
|
|
8036
|
-
headers: {
|
|
8037
|
-
'Content-Type': 'application/json',
|
|
8038
|
-
authorization: "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
8039
|
-
}
|
|
8040
|
-
}).then(function (response) {
|
|
8021
|
+
cardsApi.post(userAddEditUrl.cardsEditUserDetails(editUserId), cardsPayload).then(function (response) {
|
|
8041
8022
|
if (response.status === 200) {
|
|
8042
8023
|
updateUserApiCall(payload, inputChangeLog);
|
|
8043
8024
|
} else {
|
|
8044
8025
|
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
8045
8026
|
}
|
|
8046
8027
|
})["catch"](function (error) {
|
|
8047
|
-
|
|
8028
|
+
if (error !== null && error !== void 0 && error.response) {
|
|
8029
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
8030
|
+
} else {
|
|
8031
|
+
console.log('errorrr', error);
|
|
8032
|
+
}
|
|
8048
8033
|
})["finally"](function () {
|
|
8049
8034
|
dispatch(stopLoader());
|
|
8050
8035
|
});
|
|
@@ -8057,19 +8042,16 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
8057
8042
|
dispatch(createUser(payload)).then(function (res) {
|
|
8058
8043
|
var _config$routes4, _config$routes4$users, _config$routes4$users2;
|
|
8059
8044
|
if (res !== null && res !== void 0 && res.user_id) {
|
|
8060
|
-
|
|
8061
|
-
method: 'POST',
|
|
8062
|
-
body: JSON.stringify(cardsPayload),
|
|
8063
|
-
headers: {
|
|
8064
|
-
'Content-Type': 'application/json',
|
|
8065
|
-
authorization: "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
8066
|
-
}
|
|
8067
|
-
}).then(function (response) {
|
|
8045
|
+
cardsApi.post(userAddEditUrl.cardsEditUserDetails(res === null || res === void 0 ? void 0 : res.user_id), cardsPayload).then(function (response) {
|
|
8068
8046
|
if (response.status !== 200) {
|
|
8069
8047
|
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
8070
8048
|
}
|
|
8071
8049
|
})["catch"](function (error) {
|
|
8072
|
-
|
|
8050
|
+
if (error !== null && error !== void 0 && error.response) {
|
|
8051
|
+
IUIToastMessageService$6.warningNotify('Opps, Something went wrong.');
|
|
8052
|
+
} else {
|
|
8053
|
+
console.log('errorrr', error);
|
|
8054
|
+
}
|
|
8073
8055
|
});
|
|
8074
8056
|
}
|
|
8075
8057
|
(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);
|