@itilite/iui-user-management 0.3.13 → 0.3.14
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 +62 -28
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +62 -28
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
- package/dist/style.css.map +0 -1
package/dist/index.js
CHANGED
|
@@ -4,9 +4,9 @@ var iuistyles = require('@itilite/iuistyles');
|
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var React__default = _interopDefault(React);
|
|
6
6
|
var utils = require('@itilite/utils');
|
|
7
|
+
var axios = _interopDefault(require('axios'));
|
|
7
8
|
var AddIcon$1 = _interopDefault(require('@material-ui/icons/Add'));
|
|
8
9
|
var DeleteIcon = _interopDefault(require('@material-ui/icons/Delete'));
|
|
9
|
-
var axios = _interopDefault(require('axios'));
|
|
10
10
|
var reactRedux = require('react-redux');
|
|
11
11
|
var redux = require('redux');
|
|
12
12
|
var thunk = _interopDefault(require('redux-thunk'));
|
|
@@ -161,24 +161,52 @@ function _catch(body, recover) {
|
|
|
161
161
|
|
|
162
162
|
var styles = {"UUIUserManagementAddEdit":"_3n-WG","pageHeader":"_3qWcA","buttonWrapper":"_1IP9P","scrolled":"_m8f96","headingButtonWrapper":"_w9z7b","headingButtonWrapperProfile":"_12Wd9","hintText":"_ySdbZ","heading":"_2Y1Aw","headingLarge":"_2K1NF","headingMedium":"_RUuAz","headingSmall":"_23Dye","additionalInfoContainer":"_1Suhw","additionalInfoTitle":"_56iJF","titleContainer":"_H5nfl","expandIconAlign":"_3F4i0","detailsContainer":"_2G0LW","formWrapper":"_2fPRc","sectionWrapper":"_37Gqp","margin":"_2Sdl7","minGridWidth":"_2D7iu","firstRowMargin":"_1BozG","firstChildMargin":"_2C3Mb","paddingTop":"_DBPjV","backGrdColorOnHover":"_5oE6H","fieldMargin":"_RCWjq","productContainerGap":"_tuCbi","containerWidth":"_1oWos","productItemBroder":"_T0Hcd","headingPadding":"_2MFfQ","emptyFieldContainer":"_3VWtw","emptyFieldDescription":"_2jC5u","rowGap":"_1NJFY","formTitle":"_GAKk2","formDescription":"_3TZ6Z","themeLink":"_eJ_1B","dashedLine":"_3ZOs1","dividerColor":"_2pxEJ","errorTextCls":"_27eth","backdrop":"_Pm0Au","inputWidth":"_ajB82"};
|
|
163
163
|
|
|
164
|
-
function
|
|
165
|
-
var
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
164
|
+
function toVal(mix) {
|
|
165
|
+
var k,
|
|
166
|
+
y,
|
|
167
|
+
str = '';
|
|
168
|
+
|
|
169
|
+
if (typeof mix === 'string' || typeof mix === 'number') {
|
|
170
|
+
str += mix;
|
|
171
|
+
} else if (typeof mix === 'object') {
|
|
172
|
+
if (Array.isArray(mix)) {
|
|
173
|
+
for (k = 0; k < mix.length; k++) {
|
|
174
|
+
if (mix[k]) {
|
|
175
|
+
if (y = toVal(mix[k])) {
|
|
176
|
+
str && (str += ' ');
|
|
177
|
+
str += y;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
} else {
|
|
182
|
+
for (k in mix) {
|
|
183
|
+
if (mix[k]) {
|
|
184
|
+
str && (str += ' ');
|
|
185
|
+
str += k;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
172
189
|
}
|
|
173
|
-
|
|
190
|
+
|
|
191
|
+
return str;
|
|
174
192
|
}
|
|
175
193
|
|
|
176
194
|
function clsx() {
|
|
177
|
-
|
|
178
|
-
|
|
195
|
+
var i = 0,
|
|
196
|
+
tmp,
|
|
197
|
+
x,
|
|
198
|
+
str = '';
|
|
199
|
+
|
|
200
|
+
while (i < arguments.length) {
|
|
201
|
+
if (tmp = arguments[i++]) {
|
|
202
|
+
if (x = toVal(tmp)) {
|
|
203
|
+
str && (str += ' ');
|
|
204
|
+
str += x;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
179
207
|
}
|
|
180
208
|
|
|
181
|
-
return
|
|
209
|
+
return str;
|
|
182
210
|
}
|
|
183
211
|
|
|
184
212
|
var GetInputType = React__default.forwardRef(function (props, ref) {
|
|
@@ -470,6 +498,7 @@ var userPanelUrl = {
|
|
|
470
498
|
}
|
|
471
499
|
};
|
|
472
500
|
|
|
501
|
+
var IUILocalStorageService$1 = utils.services.IUILocalStorageService;
|
|
473
502
|
var api = utils.configs.api;
|
|
474
503
|
var NAoptionConfig = {
|
|
475
504
|
option: {
|
|
@@ -714,7 +743,12 @@ var airlineOptionsfn = function airlineOptionsfn(search, loadedOptions, _ref6) {
|
|
|
714
743
|
try {
|
|
715
744
|
return Promise.resolve(_catch(function () {
|
|
716
745
|
var url = userAddEditUrl.airlineList() + ("?page=" + page + "&search=" + search);
|
|
717
|
-
|
|
746
|
+
var token = IUILocalStorageService$1.getAccessToken();
|
|
747
|
+
return Promise.resolve(axios.get(url, {
|
|
748
|
+
headers: {
|
|
749
|
+
Authorization: 'Bearer ' + token
|
|
750
|
+
}
|
|
751
|
+
}).then(function (res) {
|
|
718
752
|
return res.data;
|
|
719
753
|
})).then(function (response) {
|
|
720
754
|
return Promise.resolve(response.results.map(function (item) {
|
|
@@ -786,12 +820,12 @@ var SET_STATIC_FIELDS_VISIBILITY = 'SET_STATIC_FIELDS_VISIBILITY';
|
|
|
786
820
|
var SET_PAYMENT_DETAILS = 'SET_PAYMENT_DETAILS';
|
|
787
821
|
|
|
788
822
|
var env$1 = utils.configs.env;
|
|
789
|
-
var IUILocalStorageService$
|
|
823
|
+
var IUILocalStorageService$2 = utils.services.IUILocalStorageService;
|
|
790
824
|
var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
791
825
|
var _payload$employeeInfo, _payload$employeeInfo2, _payload$employeeInfo3, _payload$employeeInfo4, _payload$employeeInfo5, _payload$employeeInfo6, _payload$employeeInfo7, _payload$employeeInfo8, _payload$employeeInfo9, _payload$employeeInfo10;
|
|
792
826
|
|
|
793
827
|
var res = {
|
|
794
|
-
company_id: +IUILocalStorageService$
|
|
828
|
+
company_id: +IUILocalStorageService$2.getCompanyId(),
|
|
795
829
|
first_name: payload.personalInfoInput.first_name,
|
|
796
830
|
last_name: payload.personalInfoInput.last_name,
|
|
797
831
|
email: payload.personalInfoInput.email,
|
|
@@ -1169,7 +1203,7 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1169
1203
|
|
|
1170
1204
|
var api$1 = utils.configs.api;
|
|
1171
1205
|
var IUIToastMessageService = utils.services.IUIToastMessageService,
|
|
1172
|
-
IUILocalStorageService$
|
|
1206
|
+
IUILocalStorageService$3 = utils.services.IUILocalStorageService;
|
|
1173
1207
|
var showLoader = function showLoader() {
|
|
1174
1208
|
return {
|
|
1175
1209
|
type: SHOW_LOADER
|
|
@@ -1540,7 +1574,7 @@ var deletePaymentCard = function deletePaymentCard(payload) {
|
|
|
1540
1574
|
dispatch(showLoader());
|
|
1541
1575
|
axios["delete"](userAddEditUrl.deletePaymentCard(payload.pmId, payload.vendorId), {
|
|
1542
1576
|
headers: {
|
|
1543
|
-
Authorization: 'Bearer ' + IUILocalStorageService$
|
|
1577
|
+
Authorization: 'Bearer ' + IUILocalStorageService$3.getAccessToken()
|
|
1544
1578
|
}
|
|
1545
1579
|
}).then(function (res) {
|
|
1546
1580
|
if (res.data.status) {
|
|
@@ -1573,7 +1607,7 @@ var setDefaultPaymentCard = function setDefaultPaymentCard(payload) {
|
|
|
1573
1607
|
dispatch(showLoader());
|
|
1574
1608
|
axios.put(userAddEditUrl.setDefaultCard(), payload, {
|
|
1575
1609
|
headers: {
|
|
1576
|
-
Authorization: 'Bearer ' + IUILocalStorageService$
|
|
1610
|
+
Authorization: 'Bearer ' + IUILocalStorageService$3.getAccessToken()
|
|
1577
1611
|
}
|
|
1578
1612
|
}).then(function (res) {
|
|
1579
1613
|
if (res.data.status) {
|
|
@@ -1908,7 +1942,7 @@ var SET_VERIFICATION_ERROR = 'SET_VERIFICATION_ERROR';
|
|
|
1908
1942
|
var api$4 = utils.configs.api,
|
|
1909
1943
|
env$2 = utils.configs.env;
|
|
1910
1944
|
var common = utils.utilUrls.common;
|
|
1911
|
-
var IUILocalStorageService$
|
|
1945
|
+
var IUILocalStorageService$4 = utils.services.IUILocalStorageService;
|
|
1912
1946
|
var setTokenResponse = function setTokenResponse(payload) {
|
|
1913
1947
|
return {
|
|
1914
1948
|
type: VERIFY_ACCESS_TOKEN,
|
|
@@ -1930,7 +1964,7 @@ var verifyAccessToken = function verifyAccessToken(roleCanAccess) {
|
|
|
1930
1964
|
return new Promise(function (resolve, reject) {
|
|
1931
1965
|
dispatch(setVerificationError(false));
|
|
1932
1966
|
api$4.post(common.verifyToken(), {
|
|
1933
|
-
client_id: +IUILocalStorageService$
|
|
1967
|
+
client_id: +IUILocalStorageService$4.getClientId() || null,
|
|
1934
1968
|
product: env$2.isExpense() ? 'expense' : 'travel'
|
|
1935
1969
|
}).then(function (res) {
|
|
1936
1970
|
if (res.data.status === true) {
|
|
@@ -1941,14 +1975,14 @@ var verifyAccessToken = function verifyAccessToken(roleCanAccess) {
|
|
|
1941
1975
|
}
|
|
1942
1976
|
|
|
1943
1977
|
if (env$2.isProfilePage()) {
|
|
1944
|
-
IUILocalStorageService$
|
|
1978
|
+
IUILocalStorageService$4.setCompanyId(res.data.company);
|
|
1945
1979
|
dispatch(setTokenResponse(res.data));
|
|
1946
1980
|
dispatch(setVerificationError(false));
|
|
1947
1981
|
|
|
1948
1982
|
if (env$2.isExpense()) {
|
|
1949
|
-
IUILocalStorageService$
|
|
1983
|
+
IUILocalStorageService$4.setRole('submitter');
|
|
1950
1984
|
} else {
|
|
1951
|
-
IUILocalStorageService$
|
|
1985
|
+
IUILocalStorageService$4.setRole('traveler');
|
|
1952
1986
|
}
|
|
1953
1987
|
|
|
1954
1988
|
resolve();
|
|
@@ -1956,8 +1990,8 @@ var verifyAccessToken = function verifyAccessToken(roleCanAccess) {
|
|
|
1956
1990
|
} else {
|
|
1957
1991
|
for (var index = 0; index < res.data.applicable_role.length; index++) {
|
|
1958
1992
|
if (roleCanAccess.includes(res.data.applicable_role[index])) {
|
|
1959
|
-
IUILocalStorageService$
|
|
1960
|
-
IUILocalStorageService$
|
|
1993
|
+
IUILocalStorageService$4.setCompanyId(res.data.company);
|
|
1994
|
+
IUILocalStorageService$4.setRole(res.data.applicable_role[index]);
|
|
1961
1995
|
dispatch(setTokenResponse(res.data));
|
|
1962
1996
|
dispatch(setVerificationError(false));
|
|
1963
1997
|
resolve();
|
|
@@ -2112,7 +2146,7 @@ var editCustomFieldLabel = function editCustomFieldLabel(payload) {
|
|
|
2112
2146
|
};
|
|
2113
2147
|
};
|
|
2114
2148
|
|
|
2115
|
-
var IUILocalStorageService$
|
|
2149
|
+
var IUILocalStorageService$5 = utils.services.IUILocalStorageService;
|
|
2116
2150
|
var env$3 = utils.configs.env;
|
|
2117
2151
|
|
|
2118
2152
|
var CreditCard = function CreditCard(_ref) {
|
|
@@ -2180,7 +2214,7 @@ var CreditCard = function CreditCard(_ref) {
|
|
|
2180
2214
|
var AddCard = function AddCard(_ref2) {
|
|
2181
2215
|
var pg = _ref2.pg;
|
|
2182
2216
|
|
|
2183
|
-
var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$
|
|
2217
|
+
var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$5.getAccessToken() + "/1/" + pg.entity_id + "/0/" + pg.vendor_id + "/1");
|
|
2184
2218
|
|
|
2185
2219
|
var handleAddCard = function handleAddCard() {
|
|
2186
2220
|
window.location.assign(_url);
|