@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 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'));
8
7
  var AddIcon$1 = _interopDefault(require('@material-ui/icons/Add'));
9
8
  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,52 +161,24 @@ 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 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
- }
164
+ function r(e) {
165
+ var t,
166
+ f,
167
+ n = "";
168
+ 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++) {
169
+ e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
170
+ } else for (t in e) {
171
+ e[t] && (n && (n += " "), n += t);
189
172
  }
190
-
191
- return str;
173
+ return n;
192
174
  }
193
175
 
194
176
  function clsx() {
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
- }
177
+ for (var e, t, f = 0, n = ""; f < arguments.length;) {
178
+ (e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
207
179
  }
208
180
 
209
- return str;
181
+ return n;
210
182
  }
211
183
 
212
184
  var GetInputType = React__default.forwardRef(function (props, ref) {
@@ -433,7 +405,7 @@ var userAddEditUrl = {
433
405
  return "api/v1/onboarding/user-sign-up-info/" + userId + "?company_id=" + IUILocalStorageService.getCompanyId();
434
406
  },
435
407
  airlineList: function airlineList() {
436
- return "https://serviceearth.iltech.in/api/v1/paginated/airline/";
408
+ return "api/v1/paginated/airline/";
437
409
  },
438
410
  rejectUserVerification: function rejectUserVerification(userId) {
439
411
  return "api/v1/onboarding/user-signup-reject/" + userId;
@@ -498,7 +470,6 @@ var userPanelUrl = {
498
470
  }
499
471
  };
500
472
 
501
- var IUILocalStorageService$1 = utils.services.IUILocalStorageService;
502
473
  var api = utils.configs.api;
503
474
  var NAoptionConfig = {
504
475
  option: {
@@ -743,13 +714,10 @@ var airlineOptionsfn = function airlineOptionsfn(search, loadedOptions, _ref6) {
743
714
  try {
744
715
  return Promise.resolve(_catch(function () {
745
716
  var url = userAddEditUrl.airlineList() + ("?page=" + page + "&search=" + search);
746
- var token = IUILocalStorageService$1.getAccessToken();
747
- return Promise.resolve(axios.get(url, {
748
- headers: {
749
- Authorization: 'Bearer ' + token
750
- }
717
+ return Promise.resolve(api.get(url).then(function (res) {
718
+ return res.data;
751
719
  })).then(function (response) {
752
- return Promise.resolve(response.data.results.map(function (item) {
720
+ return Promise.resolve(response.results.map(function (item) {
753
721
  return {
754
722
  value: item.id,
755
723
  label: item.name
@@ -818,12 +786,12 @@ var SET_STATIC_FIELDS_VISIBILITY = 'SET_STATIC_FIELDS_VISIBILITY';
818
786
  var SET_PAYMENT_DETAILS = 'SET_PAYMENT_DETAILS';
819
787
 
820
788
  var env$1 = utils.configs.env;
821
- var IUILocalStorageService$2 = utils.services.IUILocalStorageService;
789
+ var IUILocalStorageService$1 = utils.services.IUILocalStorageService;
822
790
  var formatCreateUserPayload = function formatCreateUserPayload(payload) {
823
791
  var _payload$employeeInfo, _payload$employeeInfo2, _payload$employeeInfo3, _payload$employeeInfo4, _payload$employeeInfo5, _payload$employeeInfo6, _payload$employeeInfo7, _payload$employeeInfo8, _payload$employeeInfo9, _payload$employeeInfo10;
824
792
 
825
793
  var res = {
826
- company_id: +IUILocalStorageService$2.getCompanyId(),
794
+ company_id: +IUILocalStorageService$1.getCompanyId(),
827
795
  first_name: payload.personalInfoInput.first_name,
828
796
  last_name: payload.personalInfoInput.last_name,
829
797
  email: payload.personalInfoInput.email,
@@ -1201,7 +1169,7 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
1201
1169
 
1202
1170
  var api$1 = utils.configs.api;
1203
1171
  var IUIToastMessageService = utils.services.IUIToastMessageService,
1204
- IUILocalStorageService$3 = utils.services.IUILocalStorageService;
1172
+ IUILocalStorageService$2 = utils.services.IUILocalStorageService;
1205
1173
  var showLoader = function showLoader() {
1206
1174
  return {
1207
1175
  type: SHOW_LOADER
@@ -1572,7 +1540,7 @@ var deletePaymentCard = function deletePaymentCard(payload) {
1572
1540
  dispatch(showLoader());
1573
1541
  axios["delete"](userAddEditUrl.deletePaymentCard(payload.pmId, payload.vendorId), {
1574
1542
  headers: {
1575
- Authorization: 'Bearer ' + IUILocalStorageService$3.getAccessToken()
1543
+ Authorization: 'Bearer ' + IUILocalStorageService$2.getAccessToken()
1576
1544
  }
1577
1545
  }).then(function (res) {
1578
1546
  if (res.data.status) {
@@ -1605,7 +1573,7 @@ var setDefaultPaymentCard = function setDefaultPaymentCard(payload) {
1605
1573
  dispatch(showLoader());
1606
1574
  axios.put(userAddEditUrl.setDefaultCard(), payload, {
1607
1575
  headers: {
1608
- Authorization: 'Bearer ' + IUILocalStorageService$3.getAccessToken()
1576
+ Authorization: 'Bearer ' + IUILocalStorageService$2.getAccessToken()
1609
1577
  }
1610
1578
  }).then(function (res) {
1611
1579
  if (res.data.status) {
@@ -1939,7 +1907,7 @@ var SET_VERIFICATION_ERROR = 'SET_VERIFICATION_ERROR';
1939
1907
  var api$4 = utils.configs.api,
1940
1908
  env$2 = utils.configs.env;
1941
1909
  var common = utils.utilUrls.common;
1942
- var IUILocalStorageService$4 = utils.services.IUILocalStorageService;
1910
+ var IUILocalStorageService$3 = utils.services.IUILocalStorageService;
1943
1911
  var setTokenResponse = function setTokenResponse(payload) {
1944
1912
  return {
1945
1913
  type: VERIFY_ACCESS_TOKEN,
@@ -1961,7 +1929,7 @@ var verifyAccessToken = function verifyAccessToken(roleCanAccess) {
1961
1929
  return new Promise(function (resolve, reject) {
1962
1930
  dispatch(setVerificationError(false));
1963
1931
  api$4.post(common.verifyToken(), {
1964
- client_id: +IUILocalStorageService$4.getClientId() || null,
1932
+ client_id: +IUILocalStorageService$3.getClientId() || null,
1965
1933
  product: env$2.isExpense() ? 'expense' : 'travel'
1966
1934
  }).then(function (res) {
1967
1935
  if (res.data.status === true) {
@@ -1972,14 +1940,14 @@ var verifyAccessToken = function verifyAccessToken(roleCanAccess) {
1972
1940
  }
1973
1941
 
1974
1942
  if (env$2.isProfilePage()) {
1975
- IUILocalStorageService$4.setCompanyId(res.data.company);
1943
+ IUILocalStorageService$3.setCompanyId(res.data.company);
1976
1944
  dispatch(setTokenResponse(res.data));
1977
1945
  dispatch(setVerificationError(false));
1978
1946
 
1979
1947
  if (env$2.isExpense()) {
1980
- IUILocalStorageService$4.setRole('submitter');
1948
+ IUILocalStorageService$3.setRole('submitter');
1981
1949
  } else {
1982
- IUILocalStorageService$4.setRole('traveler');
1950
+ IUILocalStorageService$3.setRole('traveler');
1983
1951
  }
1984
1952
 
1985
1953
  resolve();
@@ -1987,8 +1955,8 @@ var verifyAccessToken = function verifyAccessToken(roleCanAccess) {
1987
1955
  } else {
1988
1956
  for (var index = 0; index < res.data.applicable_role.length; index++) {
1989
1957
  if (roleCanAccess.includes(res.data.applicable_role[index])) {
1990
- IUILocalStorageService$4.setCompanyId(res.data.company);
1991
- IUILocalStorageService$4.setRole(res.data.applicable_role[index]);
1958
+ IUILocalStorageService$3.setCompanyId(res.data.company);
1959
+ IUILocalStorageService$3.setRole(res.data.applicable_role[index]);
1992
1960
  dispatch(setTokenResponse(res.data));
1993
1961
  dispatch(setVerificationError(false));
1994
1962
  resolve();
@@ -2105,7 +2073,7 @@ var editCustomFieldLabel = function editCustomFieldLabel(payload) {
2105
2073
  };
2106
2074
  };
2107
2075
 
2108
- var IUILocalStorageService$5 = utils.services.IUILocalStorageService;
2076
+ var IUILocalStorageService$4 = utils.services.IUILocalStorageService;
2109
2077
  var env$3 = utils.configs.env;
2110
2078
 
2111
2079
  var CreditCard = function CreditCard(_ref) {
@@ -2173,7 +2141,7 @@ var CreditCard = function CreditCard(_ref) {
2173
2141
  var AddCard = function AddCard(_ref2) {
2174
2142
  var pg = _ref2.pg;
2175
2143
 
2176
- var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$5.getAccessToken() + "/1/" + pg.entity_id + "/0/" + pg.vendor_id + "/1");
2144
+ var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$4.getAccessToken() + "/1/" + pg.entity_id + "/0/" + pg.vendor_id + "/1");
2177
2145
 
2178
2146
  var handleAddCard = function handleAddCard() {
2179
2147
  window.location.assign(_url);