@itilite/iui-user-management 0.3.7 → 0.3.9
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 +31 -63
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +31 -63
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { IUIAsyncSelect, IUIBox, IUILabel, IUIFileUpload, IUICheckboxButton, IUIPhone, IUISelect, IUIDatePicker, IUIInput, IUIDivider, IUIGrid, IUITypography, IUIRadio, IUIButton, IUIModal, IUIAccordion, IUIAccordionSummary, IUIAccordionDetails, IUIIconButton, IUICard, IUIBackdrop, IUICircularProgress, IUIBreadCrumb, IUIDropzone, IUIStepper, IUIFormControlLabel, IUICheckBox, IUIPrimaryRadio, IUITable, IUISkeleton, IUIProfileBox, IUIFormGroup, IUIDropdownButton } from '@itilite/iuistyles';
|
|
2
2
|
import React, { useState, useEffect, useRef, Fragment as Fragment$1 } from 'react';
|
|
3
3
|
import { configs, services, utilUrls } from '@itilite/utils';
|
|
4
|
-
import axios from 'axios';
|
|
5
4
|
import AddIcon$1 from '@material-ui/icons/Add';
|
|
6
5
|
import DeleteIcon from '@material-ui/icons/Delete';
|
|
6
|
+
import axios from 'axios';
|
|
7
7
|
import { useDispatch, useSelector, Provider } from 'react-redux';
|
|
8
8
|
import { combineReducers, createStore, applyMiddleware } from 'redux';
|
|
9
9
|
import thunk from 'redux-thunk';
|
|
@@ -158,52 +158,24 @@ function _catch(body, recover) {
|
|
|
158
158
|
|
|
159
159
|
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"};
|
|
160
160
|
|
|
161
|
-
function
|
|
162
|
-
var
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
if (Array.isArray(mix)) {
|
|
170
|
-
for (k = 0; k < mix.length; k++) {
|
|
171
|
-
if (mix[k]) {
|
|
172
|
-
if (y = toVal(mix[k])) {
|
|
173
|
-
str && (str += ' ');
|
|
174
|
-
str += y;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
} else {
|
|
179
|
-
for (k in mix) {
|
|
180
|
-
if (mix[k]) {
|
|
181
|
-
str && (str += ' ');
|
|
182
|
-
str += k;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
161
|
+
function r(e) {
|
|
162
|
+
var t,
|
|
163
|
+
f,
|
|
164
|
+
n = "";
|
|
165
|
+
if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) {
|
|
166
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
167
|
+
} else for (t in e) {
|
|
168
|
+
e[t] && (n && (n += " "), n += t);
|
|
186
169
|
}
|
|
187
|
-
|
|
188
|
-
return str;
|
|
170
|
+
return n;
|
|
189
171
|
}
|
|
190
172
|
|
|
191
173
|
function clsx() {
|
|
192
|
-
var
|
|
193
|
-
|
|
194
|
-
x,
|
|
195
|
-
str = '';
|
|
196
|
-
|
|
197
|
-
while (i < arguments.length) {
|
|
198
|
-
if (tmp = arguments[i++]) {
|
|
199
|
-
if (x = toVal(tmp)) {
|
|
200
|
-
str && (str += ' ');
|
|
201
|
-
str += x;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
174
|
+
for (var e, t, f = 0, n = ""; f < arguments.length;) {
|
|
175
|
+
(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
204
176
|
}
|
|
205
177
|
|
|
206
|
-
return
|
|
178
|
+
return n;
|
|
207
179
|
}
|
|
208
180
|
|
|
209
181
|
var GetInputType = React.forwardRef(function (props, ref) {
|
|
@@ -430,7 +402,7 @@ var userAddEditUrl = {
|
|
|
430
402
|
return "api/v1/onboarding/user-sign-up-info/" + userId + "?company_id=" + IUILocalStorageService.getCompanyId();
|
|
431
403
|
},
|
|
432
404
|
airlineList: function airlineList() {
|
|
433
|
-
return "
|
|
405
|
+
return "api/v1/paginated/airline/";
|
|
434
406
|
},
|
|
435
407
|
rejectUserVerification: function rejectUserVerification(userId) {
|
|
436
408
|
return "api/v1/onboarding/user-signup-reject/" + userId;
|
|
@@ -495,7 +467,6 @@ var userPanelUrl = {
|
|
|
495
467
|
}
|
|
496
468
|
};
|
|
497
469
|
|
|
498
|
-
var IUILocalStorageService$1 = services.IUILocalStorageService;
|
|
499
470
|
var api = configs.api;
|
|
500
471
|
var NAoptionConfig = {
|
|
501
472
|
option: {
|
|
@@ -740,13 +711,10 @@ var airlineOptionsfn = function airlineOptionsfn(search, loadedOptions, _ref6) {
|
|
|
740
711
|
try {
|
|
741
712
|
return Promise.resolve(_catch(function () {
|
|
742
713
|
var url = userAddEditUrl.airlineList() + ("?page=" + page + "&search=" + search);
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
headers: {
|
|
746
|
-
Authorization: 'Bearer ' + token
|
|
747
|
-
}
|
|
714
|
+
return Promise.resolve(api.get(url).then(function (res) {
|
|
715
|
+
return res.data;
|
|
748
716
|
})).then(function (response) {
|
|
749
|
-
return Promise.resolve(response.
|
|
717
|
+
return Promise.resolve(response.results.map(function (item) {
|
|
750
718
|
return {
|
|
751
719
|
value: item.id,
|
|
752
720
|
label: item.name
|
|
@@ -815,12 +783,12 @@ var SET_STATIC_FIELDS_VISIBILITY = 'SET_STATIC_FIELDS_VISIBILITY';
|
|
|
815
783
|
var SET_PAYMENT_DETAILS = 'SET_PAYMENT_DETAILS';
|
|
816
784
|
|
|
817
785
|
var env$1 = configs.env;
|
|
818
|
-
var IUILocalStorageService$
|
|
786
|
+
var IUILocalStorageService$1 = services.IUILocalStorageService;
|
|
819
787
|
var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
820
788
|
var _payload$employeeInfo, _payload$employeeInfo2, _payload$employeeInfo3, _payload$employeeInfo4, _payload$employeeInfo5, _payload$employeeInfo6, _payload$employeeInfo7, _payload$employeeInfo8, _payload$employeeInfo9, _payload$employeeInfo10;
|
|
821
789
|
|
|
822
790
|
var res = {
|
|
823
|
-
company_id: +IUILocalStorageService$
|
|
791
|
+
company_id: +IUILocalStorageService$1.getCompanyId(),
|
|
824
792
|
first_name: payload.personalInfoInput.first_name,
|
|
825
793
|
last_name: payload.personalInfoInput.last_name,
|
|
826
794
|
email: payload.personalInfoInput.email,
|
|
@@ -1198,7 +1166,7 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
1198
1166
|
|
|
1199
1167
|
var api$1 = configs.api;
|
|
1200
1168
|
var IUIToastMessageService = services.IUIToastMessageService,
|
|
1201
|
-
IUILocalStorageService$
|
|
1169
|
+
IUILocalStorageService$2 = services.IUILocalStorageService;
|
|
1202
1170
|
var showLoader = function showLoader() {
|
|
1203
1171
|
return {
|
|
1204
1172
|
type: SHOW_LOADER
|
|
@@ -1569,7 +1537,7 @@ var deletePaymentCard = function deletePaymentCard(payload) {
|
|
|
1569
1537
|
dispatch(showLoader());
|
|
1570
1538
|
axios["delete"](userAddEditUrl.deletePaymentCard(payload.pmId, payload.vendorId), {
|
|
1571
1539
|
headers: {
|
|
1572
|
-
Authorization: 'Bearer ' + IUILocalStorageService$
|
|
1540
|
+
Authorization: 'Bearer ' + IUILocalStorageService$2.getAccessToken()
|
|
1573
1541
|
}
|
|
1574
1542
|
}).then(function (res) {
|
|
1575
1543
|
if (res.data.status) {
|
|
@@ -1602,7 +1570,7 @@ var setDefaultPaymentCard = function setDefaultPaymentCard(payload) {
|
|
|
1602
1570
|
dispatch(showLoader());
|
|
1603
1571
|
axios.put(userAddEditUrl.setDefaultCard(), payload, {
|
|
1604
1572
|
headers: {
|
|
1605
|
-
Authorization: 'Bearer ' + IUILocalStorageService$
|
|
1573
|
+
Authorization: 'Bearer ' + IUILocalStorageService$2.getAccessToken()
|
|
1606
1574
|
}
|
|
1607
1575
|
}).then(function (res) {
|
|
1608
1576
|
if (res.data.status) {
|
|
@@ -1936,7 +1904,7 @@ var SET_VERIFICATION_ERROR = 'SET_VERIFICATION_ERROR';
|
|
|
1936
1904
|
var api$4 = configs.api,
|
|
1937
1905
|
env$2 = configs.env;
|
|
1938
1906
|
var common = utilUrls.common;
|
|
1939
|
-
var IUILocalStorageService$
|
|
1907
|
+
var IUILocalStorageService$3 = services.IUILocalStorageService;
|
|
1940
1908
|
var setTokenResponse = function setTokenResponse(payload) {
|
|
1941
1909
|
return {
|
|
1942
1910
|
type: VERIFY_ACCESS_TOKEN,
|
|
@@ -1958,7 +1926,7 @@ var verifyAccessToken = function verifyAccessToken(roleCanAccess) {
|
|
|
1958
1926
|
return new Promise(function (resolve, reject) {
|
|
1959
1927
|
dispatch(setVerificationError(false));
|
|
1960
1928
|
api$4.post(common.verifyToken(), {
|
|
1961
|
-
client_id: +IUILocalStorageService$
|
|
1929
|
+
client_id: +IUILocalStorageService$3.getClientId() || null,
|
|
1962
1930
|
product: env$2.isExpense() ? 'expense' : 'travel'
|
|
1963
1931
|
}).then(function (res) {
|
|
1964
1932
|
if (res.data.status === true) {
|
|
@@ -1969,14 +1937,14 @@ var verifyAccessToken = function verifyAccessToken(roleCanAccess) {
|
|
|
1969
1937
|
}
|
|
1970
1938
|
|
|
1971
1939
|
if (env$2.isProfilePage()) {
|
|
1972
|
-
IUILocalStorageService$
|
|
1940
|
+
IUILocalStorageService$3.setCompanyId(res.data.company);
|
|
1973
1941
|
dispatch(setTokenResponse(res.data));
|
|
1974
1942
|
dispatch(setVerificationError(false));
|
|
1975
1943
|
|
|
1976
1944
|
if (env$2.isExpense()) {
|
|
1977
|
-
IUILocalStorageService$
|
|
1945
|
+
IUILocalStorageService$3.setRole('submitter');
|
|
1978
1946
|
} else {
|
|
1979
|
-
IUILocalStorageService$
|
|
1947
|
+
IUILocalStorageService$3.setRole('traveler');
|
|
1980
1948
|
}
|
|
1981
1949
|
|
|
1982
1950
|
resolve();
|
|
@@ -1984,8 +1952,8 @@ var verifyAccessToken = function verifyAccessToken(roleCanAccess) {
|
|
|
1984
1952
|
} else {
|
|
1985
1953
|
for (var index = 0; index < res.data.applicable_role.length; index++) {
|
|
1986
1954
|
if (roleCanAccess.includes(res.data.applicable_role[index])) {
|
|
1987
|
-
IUILocalStorageService$
|
|
1988
|
-
IUILocalStorageService$
|
|
1955
|
+
IUILocalStorageService$3.setCompanyId(res.data.company);
|
|
1956
|
+
IUILocalStorageService$3.setRole(res.data.applicable_role[index]);
|
|
1989
1957
|
dispatch(setTokenResponse(res.data));
|
|
1990
1958
|
dispatch(setVerificationError(false));
|
|
1991
1959
|
resolve();
|
|
@@ -2102,7 +2070,7 @@ var editCustomFieldLabel = function editCustomFieldLabel(payload) {
|
|
|
2102
2070
|
};
|
|
2103
2071
|
};
|
|
2104
2072
|
|
|
2105
|
-
var IUILocalStorageService$
|
|
2073
|
+
var IUILocalStorageService$4 = services.IUILocalStorageService;
|
|
2106
2074
|
var env$3 = configs.env;
|
|
2107
2075
|
|
|
2108
2076
|
var CreditCard = function CreditCard(_ref) {
|
|
@@ -2170,7 +2138,7 @@ var CreditCard = function CreditCard(_ref) {
|
|
|
2170
2138
|
var AddCard = function AddCard(_ref2) {
|
|
2171
2139
|
var pg = _ref2.pg;
|
|
2172
2140
|
|
|
2173
|
-
var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$
|
|
2141
|
+
var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$4.getAccessToken() + "/1/" + pg.entity_id + "/0/" + pg.vendor_id + "/1");
|
|
2174
2142
|
|
|
2175
2143
|
var handleAddCard = function handleAddCard() {
|
|
2176
2144
|
window.location.assign(_url);
|