@itilite/iui-user-management 0.4.52 → 0.4.53
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.css +4 -0
- package/dist/index.js +615 -225
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +615 -225
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -35,6 +35,37 @@ function _extends() {
|
|
|
35
35
|
};
|
|
36
36
|
return _extends.apply(this, arguments);
|
|
37
37
|
}
|
|
38
|
+
function _unsupportedIterableToArray(o, minLen) {
|
|
39
|
+
if (!o) return;
|
|
40
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
41
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
42
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
43
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
44
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
45
|
+
}
|
|
46
|
+
function _arrayLikeToArray(arr, len) {
|
|
47
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
48
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
49
|
+
return arr2;
|
|
50
|
+
}
|
|
51
|
+
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
52
|
+
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
53
|
+
if (it) return (it = it.call(o)).next.bind(it);
|
|
54
|
+
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
55
|
+
if (it) o = it;
|
|
56
|
+
var i = 0;
|
|
57
|
+
return function () {
|
|
58
|
+
if (i >= o.length) return {
|
|
59
|
+
done: true
|
|
60
|
+
};
|
|
61
|
+
return {
|
|
62
|
+
done: false,
|
|
63
|
+
value: o[i++]
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
68
|
+
}
|
|
38
69
|
|
|
39
70
|
var _Pact = /*#__PURE__*/function () {
|
|
40
71
|
function _Pact() {}
|
|
@@ -392,6 +423,12 @@ var userAddEditUrl = {
|
|
|
392
423
|
},
|
|
393
424
|
undoRejectUserVerification: function undoRejectUserVerification(userId) {
|
|
394
425
|
return "api/v1/onboarding/user-signup-reject/" + userId + "?action=undo";
|
|
426
|
+
},
|
|
427
|
+
cardsEditUserDetails: function cardsEditUserDetails(userId) {
|
|
428
|
+
return env.getCardsapiURL() + "/card/authorization/user/" + userId;
|
|
429
|
+
},
|
|
430
|
+
cardsAddUsersDetails: function cardsAddUsersDetails() {
|
|
431
|
+
return env.getCardsapiURL() + "/card/authorization/company/" + IUILocalStorageService.getCompanyId() + "/roles";
|
|
395
432
|
}
|
|
396
433
|
};
|
|
397
434
|
var userListUrl = {
|
|
@@ -750,7 +787,6 @@ var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions
|
|
|
750
787
|
data: item
|
|
751
788
|
};
|
|
752
789
|
});
|
|
753
|
-
console.log(response.next);
|
|
754
790
|
return {
|
|
755
791
|
options: mappedValue,
|
|
756
792
|
hasMore: !!response.next,
|
|
@@ -795,6 +831,7 @@ var styles$1 = {"card":"_3_S9J","cardNumber":"_36E9M","cardDigit":"_2pm-T","expi
|
|
|
795
831
|
var SHOW_LOADER = 'SHOW_LOADER';
|
|
796
832
|
var STOP_LOADER = 'STOP_LOADER';
|
|
797
833
|
var SET_RENDER_FIELDS = 'SET_RENDER_FIELDS';
|
|
834
|
+
var SET_CARDS_DETAILS = 'SET_CARDS_DETAILS';
|
|
798
835
|
var SET_CUSTOM_FIELD = 'SET_CUSTOM_FIELD';
|
|
799
836
|
var SET_TRAVEL_APPROVER_FIELD = 'SET_TRAVEL_APPROVER_FIELD';
|
|
800
837
|
var SET_EXPENSE_APPROVER_FIELD = 'SET_EXPENSE_APPROVER_FIELD';
|
|
@@ -839,9 +876,15 @@ var formatCreateUserPayload = function formatCreateUserPayload(payload) {
|
|
|
839
876
|
if (payload.productAccess.expense) {
|
|
840
877
|
product.expense = payload.expenseRole || null;
|
|
841
878
|
}
|
|
879
|
+
if (payload.productAccess.cards) {
|
|
880
|
+
var splitRole = payload.cardsRole.split(":");
|
|
881
|
+
var cardsUsmRole = splitRole[2];
|
|
882
|
+
product.cards = cardsUsmRole || null;
|
|
883
|
+
}
|
|
842
884
|
return product;
|
|
843
885
|
}(),
|
|
844
|
-
approvers: {}
|
|
886
|
+
approvers: {},
|
|
887
|
+
requested_user_is_admin: payload.isCardsAdmin
|
|
845
888
|
};
|
|
846
889
|
var userTags = [];
|
|
847
890
|
for (var key in payload.userTagType) {
|
|
@@ -933,13 +976,20 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
933
976
|
var res = {
|
|
934
977
|
fields: {
|
|
935
978
|
user_personal_info: {},
|
|
936
|
-
employee_info: {}
|
|
979
|
+
employee_info: {},
|
|
980
|
+
requested_user_is_admin: payload.isCardsAdmin
|
|
937
981
|
}
|
|
938
982
|
};
|
|
939
983
|
if (!env$1.isProfilePage()) {
|
|
940
984
|
res.fields.product = function () {
|
|
941
|
-
if (payload.productAccess.travel && payload.productAccess.expense) {
|
|
985
|
+
if (payload.productAccess.travel && payload.productAccess.expense && payload.productAccess.cards) {
|
|
986
|
+
return 'expense+travel+cards';
|
|
987
|
+
} else if (payload.productAccess.travel && payload.productAccess.expense) {
|
|
942
988
|
return 'expense+travel';
|
|
989
|
+
} else if (payload.productAccess.expense && payload.productAccess.cards) {
|
|
990
|
+
return 'expense+cards';
|
|
991
|
+
} else if (payload.productAccess.travel && payload.productAccess.cards) {
|
|
992
|
+
return 'travel+cards';
|
|
943
993
|
} else if (payload.productAccess.travel) {
|
|
944
994
|
return 'travel';
|
|
945
995
|
} else {
|
|
@@ -954,6 +1004,11 @@ var formatUpdateUserPayload = function formatUpdateUserPayload(payload, inputCha
|
|
|
954
1004
|
if (payload.productAccess.expense) {
|
|
955
1005
|
roles.expense = payload.expenseRole;
|
|
956
1006
|
}
|
|
1007
|
+
if (payload.productAccess.cards) {
|
|
1008
|
+
var splitRole = payload.cardsRole.split(":");
|
|
1009
|
+
var cardsUsmRole = splitRole[2];
|
|
1010
|
+
roles.cards = cardsUsmRole;
|
|
1011
|
+
}
|
|
957
1012
|
return roles;
|
|
958
1013
|
}();
|
|
959
1014
|
res.fields.custom_attributes = payload.customFieldsInput;
|
|
@@ -1292,6 +1347,12 @@ var setRenderFields = function setRenderFields(payload) {
|
|
|
1292
1347
|
payload: payload
|
|
1293
1348
|
};
|
|
1294
1349
|
};
|
|
1350
|
+
var setCardsDetails = function setCardsDetails(payload) {
|
|
1351
|
+
return {
|
|
1352
|
+
type: SET_CARDS_DETAILS,
|
|
1353
|
+
payload: payload
|
|
1354
|
+
};
|
|
1355
|
+
};
|
|
1295
1356
|
var setCustomField = function setCustomField(payload) {
|
|
1296
1357
|
return {
|
|
1297
1358
|
type: SET_CUSTOM_FIELD,
|
|
@@ -1363,7 +1424,7 @@ var fetchCountryCodes = function fetchCountryCodes() {
|
|
|
1363
1424
|
return new Promise(function (resolve, reject) {
|
|
1364
1425
|
api$2.get(userAddEditUrl.countryCode()).then(function (res) {
|
|
1365
1426
|
dispatch(setCountryCodes(res.data.country_code_details));
|
|
1366
|
-
resolve(
|
|
1427
|
+
resolve(res.data.country_code_details);
|
|
1367
1428
|
})["catch"](function (err) {
|
|
1368
1429
|
reject(err);
|
|
1369
1430
|
})["finally"](function () {});
|
|
@@ -1517,7 +1578,6 @@ var createUser = function createUser(payload) {
|
|
|
1517
1578
|
return new Promise(function (resolve, reject) {
|
|
1518
1579
|
api$2.post(userAddEditUrl.createUser(), formatCreateUserPayload(payload)).then(function (res) {
|
|
1519
1580
|
if (res.data.status === true) {
|
|
1520
|
-
IUIToastMessageService$1.sNotify(res.data.message);
|
|
1521
1581
|
resolve(res.data);
|
|
1522
1582
|
} else {
|
|
1523
1583
|
if (res.data.errors && typeof res.data.errors === 'object') {
|
|
@@ -1668,7 +1728,6 @@ var updateUser = function updateUser(payload, userId, inputChangeLog) {
|
|
|
1668
1728
|
return new Promise(function (resolve, reject) {
|
|
1669
1729
|
api$2.put(userAddEditUrl.editUser(userId), formatUpdateUserPayload(payload, inputChangeLog)).then(function (res) {
|
|
1670
1730
|
if (res.data.status === true) {
|
|
1671
|
-
IUIToastMessageService$1.sNotify(res.data.message);
|
|
1672
1731
|
resolve(res.data);
|
|
1673
1732
|
} else {
|
|
1674
1733
|
if (!Object.keys(res.data.errors).length) {
|
|
@@ -3194,6 +3253,12 @@ var products = [{
|
|
|
3194
3253
|
name: 'expense',
|
|
3195
3254
|
type: 'checkbox',
|
|
3196
3255
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3256
|
+
}, {
|
|
3257
|
+
id: 3,
|
|
3258
|
+
label: 'Cards',
|
|
3259
|
+
name: 'cards',
|
|
3260
|
+
type: 'checkbox',
|
|
3261
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3197
3262
|
}];
|
|
3198
3263
|
var dropdownList = {
|
|
3199
3264
|
gender: [{
|
|
@@ -3364,6 +3429,34 @@ var expenseConstants = {
|
|
|
3364
3429
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3365
3430
|
}]
|
|
3366
3431
|
};
|
|
3432
|
+
var cardsConstants = {
|
|
3433
|
+
heading: 'Card specific information',
|
|
3434
|
+
roleHeading: 'Card role',
|
|
3435
|
+
roleDescription: 'Roles allow users to only access relevant features and functionalities',
|
|
3436
|
+
roles: [{
|
|
3437
|
+
id: 1,
|
|
3438
|
+
label: 'Card holder',
|
|
3439
|
+
description: 'Can own and use cards that are issued to them',
|
|
3440
|
+
value: '',
|
|
3441
|
+
name: '',
|
|
3442
|
+
type: 'radio',
|
|
3443
|
+
isAssigned: false,
|
|
3444
|
+
fullWidth: false,
|
|
3445
|
+
visibility: true,
|
|
3446
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3447
|
+
}, {
|
|
3448
|
+
id: 2,
|
|
3449
|
+
label: 'Card admin',
|
|
3450
|
+
description: 'Can issue cards to others and can manage all cards and transactions across the company.',
|
|
3451
|
+
value: '',
|
|
3452
|
+
name: '',
|
|
3453
|
+
type: 'radio',
|
|
3454
|
+
isAssigned: false,
|
|
3455
|
+
fullWidth: false,
|
|
3456
|
+
visibility: true,
|
|
3457
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3458
|
+
}]
|
|
3459
|
+
};
|
|
3367
3460
|
var passportInfo = [{
|
|
3368
3461
|
id: 1,
|
|
3369
3462
|
label: 'Passport issuing country',
|
|
@@ -3593,6 +3686,12 @@ var initialState = {
|
|
|
3593
3686
|
travelConstants: travelConstants,
|
|
3594
3687
|
expenseConstants: expenseConstants
|
|
3595
3688
|
},
|
|
3689
|
+
isCardsDetailsRendered: false,
|
|
3690
|
+
isCardsAdmin: false,
|
|
3691
|
+
cardsDetails: {
|
|
3692
|
+
cardsRoles: cardsConstants.roles,
|
|
3693
|
+
cardsConstants: cardsConstants
|
|
3694
|
+
},
|
|
3596
3695
|
dropdownList: dropdownList,
|
|
3597
3696
|
maxTravelApprovers: 10,
|
|
3598
3697
|
maxExpenseApprovers: 10,
|
|
@@ -3759,11 +3858,37 @@ var reducer = function reducer(state, action) {
|
|
|
3759
3858
|
isRendered: true
|
|
3760
3859
|
});
|
|
3761
3860
|
}
|
|
3861
|
+
case SET_CARDS_DETAILS:
|
|
3862
|
+
{
|
|
3863
|
+
var _action$payload8, _action$payload8$role, _action$payload9;
|
|
3864
|
+
var cardsDetails = _extends({}, state.cardsDetails);
|
|
3865
|
+
if (action !== null && action !== void 0 && (_action$payload8 = action.payload) !== null && _action$payload8 !== void 0 && (_action$payload8$role = _action$payload8.roles) !== null && _action$payload8$role !== void 0 && _action$payload8$role.length) {
|
|
3866
|
+
cardsDetails.cardsRoles = action.payload.roles.map(function (role) {
|
|
3867
|
+
return {
|
|
3868
|
+
id: role.id,
|
|
3869
|
+
label: role.name,
|
|
3870
|
+
description: role.description,
|
|
3871
|
+
value: role.value,
|
|
3872
|
+
isAssigned: role.is_assigned,
|
|
3873
|
+
name: role.value,
|
|
3874
|
+
type: 'radio',
|
|
3875
|
+
fullWidth: false,
|
|
3876
|
+
visibility: true,
|
|
3877
|
+
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3878
|
+
};
|
|
3879
|
+
});
|
|
3880
|
+
}
|
|
3881
|
+
return _extends({}, state, {
|
|
3882
|
+
cardsDetails: cardsDetails,
|
|
3883
|
+
isCardsDetailsRendered: true,
|
|
3884
|
+
isCardsAdmin: action === null || action === void 0 ? void 0 : (_action$payload9 = action.payload) === null || _action$payload9 === void 0 ? void 0 : _action$payload9.requested_user_is_admin
|
|
3885
|
+
});
|
|
3886
|
+
}
|
|
3762
3887
|
case SET_STATIC_FIELDS_VISIBILITY:
|
|
3763
3888
|
{
|
|
3764
3889
|
var _personalInfo = state.renderFields.personalInfo.map(function (input) {
|
|
3765
|
-
var _action$
|
|
3766
|
-
if (action !== null && action !== void 0 && action.payload && Object.hasOwnProperty.call(action.payload, input.name) && action !== null && action !== void 0 && (_action$
|
|
3890
|
+
var _action$payload10;
|
|
3891
|
+
if (action !== null && action !== void 0 && action.payload && Object.hasOwnProperty.call(action.payload, input.name) && action !== null && action !== void 0 && (_action$payload10 = action.payload) !== null && _action$payload10 !== void 0 && _action$payload10[input.name]) {
|
|
3767
3892
|
if (Object.hasOwnProperty.call(action.payload[input.name], 'readOnly')) {
|
|
3768
3893
|
input.readOnly = action.payload[input.name].readOnly;
|
|
3769
3894
|
}
|
|
@@ -4816,7 +4941,8 @@ var ErrorMessages = {
|
|
|
4816
4941
|
passport_expiry_date: 'Please enter passport expiry date.',
|
|
4817
4942
|
passport_photo: 'Please attach passport photo.',
|
|
4818
4943
|
travel_docs: 'Please attach travel docs.',
|
|
4819
|
-
|
|
4944
|
+
only_cards_products: 'Select at least one additional product if opting for cards.',
|
|
4945
|
+
none_products: 'Select at least one product. If opting for cards, please choose at least one additional product.'
|
|
4820
4946
|
};
|
|
4821
4947
|
|
|
4822
4948
|
function AddPanelDialog(_ref) {
|
|
@@ -4866,7 +4992,56 @@ function AddPanelDialog(_ref) {
|
|
|
4866
4992
|
})));
|
|
4867
4993
|
}
|
|
4868
4994
|
|
|
4869
|
-
var
|
|
4995
|
+
var CardsField = function CardsField(props) {
|
|
4996
|
+
var cardsConstants = props.cardsConstants,
|
|
4997
|
+
_props$onRoleChange = props.onRoleChange,
|
|
4998
|
+
onRoleChange = _props$onRoleChange === void 0 ? function () {} : _props$onRoleChange,
|
|
4999
|
+
_props$roleValue = props.roleValue,
|
|
5000
|
+
roleValue = _props$roleValue === void 0 ? '' : _props$roleValue,
|
|
5001
|
+
_props$isProfile = props.isProfile,
|
|
5002
|
+
isProfile = _props$isProfile === void 0 ? false : _props$isProfile,
|
|
5003
|
+
_props$roles = props.roles,
|
|
5004
|
+
roles = _props$roles === void 0 ? [] : _props$roles;
|
|
5005
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
5006
|
+
container: true,
|
|
5007
|
+
className: (styles.headingPadding)
|
|
5008
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
5009
|
+
variant: "h3",
|
|
5010
|
+
className: clsx(styles.heading, styles.headingMedium)
|
|
5011
|
+
}, cardsConstants.heading)), /*#__PURE__*/React__default.createElement(iuistyles.IUIDivider, {
|
|
5012
|
+
className: styles.dividerColor
|
|
5013
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
5014
|
+
container: true,
|
|
5015
|
+
className: clsx(styles.product_info, styles.sectionWrapper)
|
|
5016
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
5017
|
+
item: true,
|
|
5018
|
+
sm: 12,
|
|
5019
|
+
md: 4
|
|
5020
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
5021
|
+
label: cardsConstants.roleHeading,
|
|
5022
|
+
headerType: true,
|
|
5023
|
+
description: cardsConstants.roleDescription
|
|
5024
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
5025
|
+
item: true,
|
|
5026
|
+
sm: 12,
|
|
5027
|
+
md: 8,
|
|
5028
|
+
lg: 8,
|
|
5029
|
+
xl: 6
|
|
5030
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
5031
|
+
container: true,
|
|
5032
|
+
className: styles.formFieldsWrapper
|
|
5033
|
+
}, isProfile ? /*#__PURE__*/React__default.createElement(UserRole, {
|
|
5034
|
+
list: roles,
|
|
5035
|
+
value: roleValue
|
|
5036
|
+
}) : /*#__PURE__*/React__default.createElement(iuistyles.IUIRadio, {
|
|
5037
|
+
list: roles,
|
|
5038
|
+
value: roleValue,
|
|
5039
|
+
onValueChange: onRoleChange
|
|
5040
|
+
})))));
|
|
5041
|
+
};
|
|
5042
|
+
|
|
5043
|
+
var IUIToastMessageService$4 = utils.services.IUIToastMessageService,
|
|
5044
|
+
IUILocalStorageService$5 = utils.services.IUILocalStorageService;
|
|
4870
5045
|
var env$4 = utils.configs.env;
|
|
4871
5046
|
var UserAddEdit = function UserAddEdit(props) {
|
|
4872
5047
|
var isEditMode = props.isEditMode,
|
|
@@ -4874,6 +5049,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4874
5049
|
config = props.config,
|
|
4875
5050
|
_props$isProfile = props.isProfile,
|
|
4876
5051
|
isProfile = _props$isProfile === void 0 ? false : _props$isProfile;
|
|
5052
|
+
console.log("isProfile", isProfile);
|
|
5053
|
+
console.log("isEditMode", isEditMode);
|
|
4877
5054
|
env$4.init(config, isProfile);
|
|
4878
5055
|
var queryParams = new URLSearchParams(window.location.search);
|
|
4879
5056
|
var verifyUserId = Number(queryParams.get(config.routes.users.add.queryParamKeys.verifyUserId));
|
|
@@ -4893,7 +5070,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4893
5070
|
isRendered = _useSelector.isRendered,
|
|
4894
5071
|
maxTravelApprovers = _useSelector.maxTravelApprovers,
|
|
4895
5072
|
maxExpenseApprovers = _useSelector.maxExpenseApprovers,
|
|
4896
|
-
maxMembershipInput = _useSelector.maxMembershipInput
|
|
5073
|
+
maxMembershipInput = _useSelector.maxMembershipInput,
|
|
5074
|
+
isCardsDetailsRendered = _useSelector.isCardsDetailsRendered,
|
|
5075
|
+
isCardsAdmin = _useSelector.isCardsAdmin,
|
|
5076
|
+
cardsDetails = _useSelector.cardsDetails;
|
|
5077
|
+
console.log("isCardsAdmin", isCardsAdmin);
|
|
5078
|
+
console.log("cardsDetails", cardsDetails);
|
|
4897
5079
|
var _useSelector2 = reactRedux.useSelector(function (state) {
|
|
4898
5080
|
return state.common;
|
|
4899
5081
|
}),
|
|
@@ -4902,11 +5084,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4902
5084
|
hasVerificationError = _useSelector2.hasVerificationError,
|
|
4903
5085
|
isILadmin = _useSelector2.isILadmin,
|
|
4904
5086
|
companyName = _useSelector2.companyName;
|
|
5087
|
+
console.log("id", id);
|
|
4905
5088
|
var history = reactRouterDom.useHistory();
|
|
4906
5089
|
var location = reactRouterDom.useLocation();
|
|
4907
5090
|
var _useState = React.useState({
|
|
4908
5091
|
travel: false,
|
|
4909
|
-
expense: false
|
|
5092
|
+
expense: false,
|
|
5093
|
+
cards: false
|
|
4910
5094
|
}),
|
|
4911
5095
|
productAccess = _useState[0],
|
|
4912
5096
|
setProductAccess = _useState[1];
|
|
@@ -4917,13 +5101,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4917
5101
|
errorMsgs.products = '';
|
|
4918
5102
|
var _productAccess = _extends({}, productAccess);
|
|
4919
5103
|
_productAccess[value] = !_productAccess[value];
|
|
4920
|
-
if (_productAccess.travel === false && _productAccess.expense === false) {
|
|
5104
|
+
if (_productAccess.travel === false && _productAccess.expense === false && _productAccess.cards === true) {
|
|
4921
5105
|
var _errorArray = [].concat(errorArray);
|
|
4922
5106
|
var _errorMsgs = _extends({}, errorMsgs);
|
|
4923
5107
|
if (_errorArray.indexOf('products') === -1) {
|
|
4924
5108
|
_errorArray.push('products');
|
|
4925
5109
|
}
|
|
4926
|
-
_errorMsgs.products = ErrorMessages.
|
|
5110
|
+
_errorMsgs.products = ErrorMessages.only_cards_products;
|
|
4927
5111
|
setErrorArray(_errorArray);
|
|
4928
5112
|
setErrorMsgs(_errorMsgs);
|
|
4929
5113
|
var el = document.getElementById('products');
|
|
@@ -4933,13 +5117,192 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4933
5117
|
block: 'center'
|
|
4934
5118
|
});
|
|
4935
5119
|
}
|
|
5120
|
+
} else if (_productAccess.travel === false && _productAccess.expense === false && _productAccess.cards === false) {
|
|
5121
|
+
var _errorArray2 = [].concat(errorArray);
|
|
5122
|
+
var _errorMsgs2 = _extends({}, errorMsgs);
|
|
5123
|
+
if (_errorArray2.indexOf('products') === -1) {
|
|
5124
|
+
_errorArray2.push('products');
|
|
5125
|
+
}
|
|
5126
|
+
_errorMsgs2.products = ErrorMessages.none_products;
|
|
5127
|
+
setErrorArray(_errorArray2);
|
|
5128
|
+
setErrorMsgs(_errorMsgs2);
|
|
5129
|
+
var _el = document.getElementById('products');
|
|
5130
|
+
if (_el) {
|
|
5131
|
+
_el.scrollIntoView({
|
|
5132
|
+
behavior: 'smooth',
|
|
5133
|
+
block: 'center'
|
|
5134
|
+
});
|
|
5135
|
+
}
|
|
4936
5136
|
} else {
|
|
4937
5137
|
setErrorArray(errorArray);
|
|
4938
5138
|
setErrorMsgs(errorMsgs);
|
|
4939
5139
|
}
|
|
4940
5140
|
setProductAccess(_productAccess);
|
|
4941
5141
|
};
|
|
4942
|
-
var _useState2 = React.useState(
|
|
5142
|
+
var _useState2 = React.useState(''),
|
|
5143
|
+
newCountryCode = _useState2[0],
|
|
5144
|
+
setNewCountryCode = _useState2[1];
|
|
5145
|
+
var _useState3 = React.useState(),
|
|
5146
|
+
countryDialCode = _useState3[0],
|
|
5147
|
+
setCountryDialCode = _useState3[1];
|
|
5148
|
+
var _useState4 = React.useState([]),
|
|
5149
|
+
countryContactCode = _useState4[0],
|
|
5150
|
+
setCountryContactCode = _useState4[1];
|
|
5151
|
+
var updateUserApiCall = function updateUserApiCall(payload, inputChangeLog) {
|
|
5152
|
+
dispatch(updateUser(payload, isProfile ? id : editUserId, inputChangeLog)).then(function (res) {
|
|
5153
|
+
if (isProfile) {
|
|
5154
|
+
var _config$routes, _config$routes$profil, _config$routes$profil2;
|
|
5155
|
+
(config === null || config === void 0 ? void 0 : (_config$routes = config.routes) === null || _config$routes === void 0 ? void 0 : (_config$routes$profil = _config$routes.profile) === null || _config$routes$profil === void 0 ? void 0 : (_config$routes$profil2 = _config$routes$profil.redirectUrl) === null || _config$routes$profil2 === void 0 ? void 0 : _config$routes$profil2.submit) && history.push(config.routes.profile.redirectUrl.submit);
|
|
5156
|
+
} else {
|
|
5157
|
+
var _config$routes2, _config$routes2$users, _config$routes2$users2;
|
|
5158
|
+
(config === null || config === void 0 ? void 0 : (_config$routes2 = config.routes) === null || _config$routes2 === void 0 ? void 0 : (_config$routes2$users = _config$routes2.users) === null || _config$routes2$users === void 0 ? void 0 : (_config$routes2$users2 = _config$routes2$users.list) === null || _config$routes2$users2 === void 0 ? void 0 : _config$routes2$users2.path) && history.push(config.routes.users.list.path);
|
|
5159
|
+
}
|
|
5160
|
+
setFilesForDelete([]);
|
|
5161
|
+
setProfilePicDelete([]);
|
|
5162
|
+
})["catch"](function (err) {
|
|
5163
|
+
if (typeof err === 'object') {
|
|
5164
|
+
if (err.country_code) {
|
|
5165
|
+
err.contact_number = err.country_code;
|
|
5166
|
+
}
|
|
5167
|
+
if (err.contact_country_code) {
|
|
5168
|
+
err.contact_number = err.contact_country_code;
|
|
5169
|
+
}
|
|
5170
|
+
if (err.passport) {
|
|
5171
|
+
err.passport_photo = _extends({}, err.passport);
|
|
5172
|
+
delete err.passport;
|
|
5173
|
+
}
|
|
5174
|
+
setErrorArray(Object.keys(err));
|
|
5175
|
+
setErrorMsgs(err);
|
|
5176
|
+
var _loop = function _loop() {
|
|
5177
|
+
if (Object.hasOwnProperty.call(err, key)) {
|
|
5178
|
+
if (err[key]) {
|
|
5179
|
+
if (key in passportInfoInput || key in travelPreferenceInfo || key in secureTravelInputInfo) {
|
|
5180
|
+
setAdditionalInfoFlag('open');
|
|
5181
|
+
}
|
|
5182
|
+
var el = document.getElementById(key === 'country_code' || key === 'contact_country_code' ? 'contact_number' : key);
|
|
5183
|
+
if (el) {
|
|
5184
|
+
setTimeout(function () {
|
|
5185
|
+
el.scrollIntoView({
|
|
5186
|
+
behavior: 'smooth',
|
|
5187
|
+
block: 'center'
|
|
5188
|
+
});
|
|
5189
|
+
}, 500);
|
|
5190
|
+
return 1;
|
|
5191
|
+
}
|
|
5192
|
+
}
|
|
5193
|
+
}
|
|
5194
|
+
};
|
|
5195
|
+
for (var key in err) {
|
|
5196
|
+
if (_loop()) break;
|
|
5197
|
+
}
|
|
5198
|
+
} else if (typeof err === 'string') {
|
|
5199
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
5200
|
+
} else {
|
|
5201
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5202
|
+
}
|
|
5203
|
+
})["finally"](function () {
|
|
5204
|
+
dispatch(stopLoader());
|
|
5205
|
+
});
|
|
5206
|
+
};
|
|
5207
|
+
var createUserApiCall = function createUserApiCall(payload) {
|
|
5208
|
+
dispatch(createUser(payload)).then(function (res) {
|
|
5209
|
+
var _config$routes3, _config$routes3$users, _config$routes3$users2;
|
|
5210
|
+
if (config !== null && config !== void 0 && (_config$routes3 = config.routes) !== null && _config$routes3 !== void 0 && (_config$routes3$users = _config$routes3.users) !== null && _config$routes3$users !== void 0 && (_config$routes3$users2 = _config$routes3$users.list) !== null && _config$routes3$users2 !== void 0 && _config$routes3$users2.path) {
|
|
5211
|
+
history.push({
|
|
5212
|
+
pathname: config.routes.users.list.path
|
|
5213
|
+
});
|
|
5214
|
+
}
|
|
5215
|
+
})["catch"](function (err) {
|
|
5216
|
+
if (typeof err === 'object') {
|
|
5217
|
+
if (err.country_code) {
|
|
5218
|
+
err.contact_number = err.country_code;
|
|
5219
|
+
}
|
|
5220
|
+
if (err.contact_country_code) {
|
|
5221
|
+
err.contact_number = err.contact_country_code;
|
|
5222
|
+
}
|
|
5223
|
+
if (err.passport) {
|
|
5224
|
+
err.passport_photo = _extends({}, err.passport);
|
|
5225
|
+
delete err.passport;
|
|
5226
|
+
}
|
|
5227
|
+
setErrorArray(Object.keys(err));
|
|
5228
|
+
setErrorMsgs(err);
|
|
5229
|
+
var _loop2 = function _loop2() {
|
|
5230
|
+
if (Object.hasOwnProperty.call(err, key)) {
|
|
5231
|
+
if (err[key]) {
|
|
5232
|
+
if (key in passportInfoInput || key in travelPreferenceInfo || key in secureTravelInputInfo) {
|
|
5233
|
+
setAdditionalInfoFlag('open');
|
|
5234
|
+
}
|
|
5235
|
+
var el = document.getElementById(key === 'country_code' || key === 'contact_country_code' ? 'contact_number' : key);
|
|
5236
|
+
if (el) {
|
|
5237
|
+
setTimeout(function () {
|
|
5238
|
+
el.scrollIntoView({
|
|
5239
|
+
behavior: 'smooth',
|
|
5240
|
+
block: 'center'
|
|
5241
|
+
});
|
|
5242
|
+
}, 500);
|
|
5243
|
+
return 1;
|
|
5244
|
+
}
|
|
5245
|
+
}
|
|
5246
|
+
}
|
|
5247
|
+
};
|
|
5248
|
+
for (var key in err) {
|
|
5249
|
+
if (_loop2()) break;
|
|
5250
|
+
}
|
|
5251
|
+
} else if (typeof err === 'string') {
|
|
5252
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
5253
|
+
} else {
|
|
5254
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
5255
|
+
}
|
|
5256
|
+
})["finally"](function () {
|
|
5257
|
+
dispatch(stopLoader());
|
|
5258
|
+
});
|
|
5259
|
+
};
|
|
5260
|
+
var fetchEditUserCardsDetails = function fetchEditUserCardsDetails(editUserId) {
|
|
5261
|
+
fetch(userAddEditUrl.cardsEditUserDetails(editUserId), {
|
|
5262
|
+
method: 'GET',
|
|
5263
|
+
headers: {
|
|
5264
|
+
'Content-Type': 'application/json',
|
|
5265
|
+
'authorization': "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
5266
|
+
}
|
|
5267
|
+
}).then(function (response) {
|
|
5268
|
+
return response.json();
|
|
5269
|
+
}).then(function (res) {
|
|
5270
|
+
dispatch(setCardsDetails(res));
|
|
5271
|
+
})["catch"](function (error) {
|
|
5272
|
+
console.log("errorrr", error);
|
|
5273
|
+
});
|
|
5274
|
+
};
|
|
5275
|
+
var fetchLoggedUserCardsDetails = function fetchLoggedUserCardsDetails() {
|
|
5276
|
+
fetch(userAddEditUrl.cardsAddUsersDetails(), {
|
|
5277
|
+
method: 'GET',
|
|
5278
|
+
headers: {
|
|
5279
|
+
'Content-Type': 'application/json',
|
|
5280
|
+
'authorization': "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
5281
|
+
}
|
|
5282
|
+
}).then(function (response) {
|
|
5283
|
+
return response.json();
|
|
5284
|
+
}).then(function (res) {
|
|
5285
|
+
dispatch(setCardsDetails(res));
|
|
5286
|
+
})["catch"](function (error) {
|
|
5287
|
+
console.log("errorrr", error);
|
|
5288
|
+
});
|
|
5289
|
+
};
|
|
5290
|
+
React.useEffect(function () {
|
|
5291
|
+
var countryObject = countryContactCode.find(function (t) {
|
|
5292
|
+
return t.dial_code === countryDialCode;
|
|
5293
|
+
});
|
|
5294
|
+
if (countryObject) {
|
|
5295
|
+
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
5296
|
+
country_code: countryObject.code
|
|
5297
|
+
}));
|
|
5298
|
+
}
|
|
5299
|
+
}, [countryDialCode]);
|
|
5300
|
+
React.useEffect(function () {
|
|
5301
|
+
var extractedNumber = newCountryCode.substring(1);
|
|
5302
|
+
var convertedNumber = parseInt(extractedNumber);
|
|
5303
|
+
setCountryDialCode(convertedNumber);
|
|
5304
|
+
}, [newCountryCode]);
|
|
5305
|
+
var _useState5 = React.useState({
|
|
4943
5306
|
first_name: '',
|
|
4944
5307
|
last_name: '',
|
|
4945
5308
|
email: '',
|
|
@@ -4950,9 +5313,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4950
5313
|
contact_country_code: '',
|
|
4951
5314
|
profile_pic: []
|
|
4952
5315
|
}),
|
|
4953
|
-
personalInfoInput =
|
|
4954
|
-
setPersonalInfoInput =
|
|
4955
|
-
var
|
|
5316
|
+
personalInfoInput = _useState5[0],
|
|
5317
|
+
setPersonalInfoInput = _useState5[1];
|
|
5318
|
+
var _useState6 = React.useState({
|
|
4956
5319
|
emp_level: {
|
|
4957
5320
|
value: '',
|
|
4958
5321
|
label: 'Select employee level'
|
|
@@ -4985,9 +5348,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4985
5348
|
label: defaultCurrency
|
|
4986
5349
|
}
|
|
4987
5350
|
}),
|
|
4988
|
-
employeeInfoInput =
|
|
4989
|
-
setEmployeeInfoInput =
|
|
4990
|
-
var
|
|
5351
|
+
employeeInfoInput = _useState6[0],
|
|
5352
|
+
setEmployeeInfoInput = _useState6[1];
|
|
5353
|
+
var _useState7 = React.useState({
|
|
4991
5354
|
emp_level: 0,
|
|
4992
5355
|
entity: 0,
|
|
4993
5356
|
business_unit: 0,
|
|
@@ -4996,48 +5359,48 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4996
5359
|
manager_id: 0,
|
|
4997
5360
|
skip_manager_id: 0
|
|
4998
5361
|
}),
|
|
4999
|
-
cacheForAsyncDropdown =
|
|
5000
|
-
clearCacheForAsyncDropdown =
|
|
5001
|
-
var
|
|
5002
|
-
userTagType =
|
|
5003
|
-
setUserTagType =
|
|
5004
|
-
var
|
|
5005
|
-
scroll =
|
|
5006
|
-
setScroll =
|
|
5007
|
-
var
|
|
5008
|
-
customFieldsInput =
|
|
5009
|
-
setCustomFieldsInput =
|
|
5010
|
-
var
|
|
5011
|
-
travelRole =
|
|
5012
|
-
setTravelRole =
|
|
5013
|
-
var
|
|
5014
|
-
travelApproversInput =
|
|
5015
|
-
setTravelApproversInput =
|
|
5016
|
-
var
|
|
5362
|
+
cacheForAsyncDropdown = _useState7[0],
|
|
5363
|
+
clearCacheForAsyncDropdown = _useState7[1];
|
|
5364
|
+
var _useState8 = React.useState({}),
|
|
5365
|
+
userTagType = _useState8[0],
|
|
5366
|
+
setUserTagType = _useState8[1];
|
|
5367
|
+
var _useState9 = React.useState(false),
|
|
5368
|
+
scroll = _useState9[0],
|
|
5369
|
+
setScroll = _useState9[1];
|
|
5370
|
+
var _useState10 = React.useState({}),
|
|
5371
|
+
customFieldsInput = _useState10[0],
|
|
5372
|
+
setCustomFieldsInput = _useState10[1];
|
|
5373
|
+
var _useState11 = React.useState('traveler'),
|
|
5374
|
+
travelRole = _useState11[0],
|
|
5375
|
+
setTravelRole = _useState11[1];
|
|
5376
|
+
var _useState12 = React.useState({}),
|
|
5377
|
+
travelApproversInput = _useState12[0],
|
|
5378
|
+
setTravelApproversInput = _useState12[1];
|
|
5379
|
+
var _useState13 = React.useState({
|
|
5017
5380
|
value: '',
|
|
5018
5381
|
label: 'Select approver'
|
|
5019
5382
|
}),
|
|
5020
|
-
travelFYI =
|
|
5021
|
-
setTravelFYI =
|
|
5022
|
-
var
|
|
5023
|
-
membershipInfoInput =
|
|
5024
|
-
setMembershipInfoInput =
|
|
5025
|
-
var
|
|
5026
|
-
removedMembershipInfoInput =
|
|
5027
|
-
setRemovedMembershipInfoInput =
|
|
5028
|
-
var
|
|
5383
|
+
travelFYI = _useState13[0],
|
|
5384
|
+
setTravelFYI = _useState13[1];
|
|
5385
|
+
var _useState14 = React.useState([]),
|
|
5386
|
+
membershipInfoInput = _useState14[0],
|
|
5387
|
+
setMembershipInfoInput = _useState14[1];
|
|
5388
|
+
var _useState15 = React.useState([]),
|
|
5389
|
+
removedMembershipInfoInput = _useState15[0],
|
|
5390
|
+
setRemovedMembershipInfoInput = _useState15[1];
|
|
5391
|
+
var _useState16 = React.useState({
|
|
5029
5392
|
flight_seat_preference: '',
|
|
5030
5393
|
meal_preference: ''
|
|
5031
5394
|
}),
|
|
5032
|
-
travelPreferenceInfo =
|
|
5033
|
-
settravelPreferenceInfo =
|
|
5034
|
-
var
|
|
5395
|
+
travelPreferenceInfo = _useState16[0],
|
|
5396
|
+
settravelPreferenceInfo = _useState16[1];
|
|
5397
|
+
var _useState17 = React.useState({
|
|
5035
5398
|
trusted_traveller: '',
|
|
5036
5399
|
redress_number: ''
|
|
5037
5400
|
}),
|
|
5038
|
-
secureTravelInputInfo =
|
|
5039
|
-
setSecureTravelInputInfo =
|
|
5040
|
-
var
|
|
5401
|
+
secureTravelInputInfo = _useState17[0],
|
|
5402
|
+
setSecureTravelInputInfo = _useState17[1];
|
|
5403
|
+
var _useState18 = React.useState({
|
|
5041
5404
|
passport_issue_country: {
|
|
5042
5405
|
value: '',
|
|
5043
5406
|
label: 'Select country'
|
|
@@ -5052,39 +5415,94 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5052
5415
|
passport_photo: [],
|
|
5053
5416
|
travel_docs: []
|
|
5054
5417
|
}),
|
|
5055
|
-
passportInfoInput =
|
|
5056
|
-
setPassportInfoInput =
|
|
5057
|
-
var
|
|
5058
|
-
filesForDelete =
|
|
5059
|
-
setFilesForDelete =
|
|
5060
|
-
var
|
|
5061
|
-
profilePicDelete =
|
|
5062
|
-
setProfilePicDelete =
|
|
5063
|
-
var
|
|
5064
|
-
isAdditionalInfoExpanded =
|
|
5065
|
-
setAdditionalInfoFlag =
|
|
5066
|
-
var
|
|
5067
|
-
expenseRole =
|
|
5068
|
-
setExpenseRole =
|
|
5069
|
-
var
|
|
5070
|
-
expenseApproversInput =
|
|
5071
|
-
setExpenseApproversInput =
|
|
5072
|
-
var
|
|
5418
|
+
passportInfoInput = _useState18[0],
|
|
5419
|
+
setPassportInfoInput = _useState18[1];
|
|
5420
|
+
var _useState19 = React.useState([]),
|
|
5421
|
+
filesForDelete = _useState19[0],
|
|
5422
|
+
setFilesForDelete = _useState19[1];
|
|
5423
|
+
var _useState20 = React.useState([]),
|
|
5424
|
+
profilePicDelete = _useState20[0],
|
|
5425
|
+
setProfilePicDelete = _useState20[1];
|
|
5426
|
+
var _useState21 = React.useState(config.env.isTravelProduct && isProfile ? 'open' : ''),
|
|
5427
|
+
isAdditionalInfoExpanded = _useState21[0],
|
|
5428
|
+
setAdditionalInfoFlag = _useState21[1];
|
|
5429
|
+
var _useState22 = React.useState('submitter'),
|
|
5430
|
+
expenseRole = _useState22[0],
|
|
5431
|
+
setExpenseRole = _useState22[1];
|
|
5432
|
+
var _useState23 = React.useState({}),
|
|
5433
|
+
expenseApproversInput = _useState23[0],
|
|
5434
|
+
setExpenseApproversInput = _useState23[1];
|
|
5435
|
+
var _useState24 = React.useState({
|
|
5073
5436
|
value: '',
|
|
5074
5437
|
label: 'Select approver'
|
|
5075
5438
|
}),
|
|
5076
|
-
expenseFYI =
|
|
5077
|
-
setExpenseFYI =
|
|
5439
|
+
expenseFYI = _useState24[0],
|
|
5440
|
+
setExpenseFYI = _useState24[1];
|
|
5441
|
+
var _useState25 = React.useState(''),
|
|
5442
|
+
cardsRole = _useState25[0],
|
|
5443
|
+
setCardsRole = _useState25[1];
|
|
5444
|
+
var _useState26 = React.useState(false),
|
|
5445
|
+
cardsErrorMsg = _useState26[0],
|
|
5446
|
+
setCardsErrorMsg = _useState26[1];
|
|
5447
|
+
console.log("cardsRole123", cardsRole);
|
|
5448
|
+
console.log("cardsErrorMsg", cardsErrorMsg);
|
|
5449
|
+
React.useEffect(function () {
|
|
5450
|
+
if (isCardsAdmin === false && cardsRole.includes("card_admin")) {
|
|
5451
|
+
setCardsErrorMsg(true);
|
|
5452
|
+
IUIToastMessageService$4.warningNotify("You are not authorized person to make someone admin");
|
|
5453
|
+
} else {
|
|
5454
|
+
setCardsErrorMsg(false);
|
|
5455
|
+
}
|
|
5456
|
+
}, [cardsRole]);
|
|
5457
|
+
React.useEffect(function () {
|
|
5458
|
+
if (productAccess.cards === false) {
|
|
5459
|
+
setCardsRole('');
|
|
5460
|
+
} else {
|
|
5461
|
+
for (var _iterator = _createForOfIteratorHelperLoose(cardsDetails.cardsRoles), _step; !(_step = _iterator()).done;) {
|
|
5462
|
+
var role = _step.value;
|
|
5463
|
+
var splitRoleval = role.value.split(":");
|
|
5464
|
+
var defaultRole = splitRoleval[2];
|
|
5465
|
+
if (defaultRole === 'card_holder') {
|
|
5466
|
+
setCardsRole(role.value);
|
|
5467
|
+
break;
|
|
5468
|
+
}
|
|
5469
|
+
}
|
|
5470
|
+
}
|
|
5471
|
+
}, [productAccess.cards]);
|
|
5472
|
+
React.useEffect(function () {
|
|
5473
|
+
if (isCardsDetailsRendered) {
|
|
5474
|
+
var selectedRole = null;
|
|
5475
|
+
for (var _iterator2 = _createForOfIteratorHelperLoose(cardsDetails.cardsRoles), _step2; !(_step2 = _iterator2()).done;) {
|
|
5476
|
+
var _role = _step2.value;
|
|
5477
|
+
if (_role.isAssigned) {
|
|
5478
|
+
setCardsRole(_role.value);
|
|
5479
|
+
selectedRole = _role.value;
|
|
5480
|
+
break;
|
|
5481
|
+
}
|
|
5482
|
+
}
|
|
5483
|
+
if (selectedRole === null) {
|
|
5484
|
+
for (var _iterator3 = _createForOfIteratorHelperLoose(cardsDetails.cardsRoles), _step3; !(_step3 = _iterator3()).done;) {
|
|
5485
|
+
var role = _step3.value;
|
|
5486
|
+
var splitRoleval = role.value.split(":");
|
|
5487
|
+
var defaultRole = splitRoleval[2];
|
|
5488
|
+
if (defaultRole === 'card_holder') {
|
|
5489
|
+
setCardsRole(role.value);
|
|
5490
|
+
break;
|
|
5491
|
+
}
|
|
5492
|
+
}
|
|
5493
|
+
}
|
|
5494
|
+
}
|
|
5495
|
+
}, [isCardsDetailsRendered, cardsDetails]);
|
|
5078
5496
|
var asyncSelectRefs = React.useRef({
|
|
5079
5497
|
emp_level: React.useRef(null),
|
|
5080
5498
|
entity: React.useRef(null),
|
|
5081
5499
|
business_unit: React.useRef(null),
|
|
5082
5500
|
department: React.useRef(null)
|
|
5083
5501
|
});
|
|
5084
|
-
var
|
|
5085
|
-
errorArray =
|
|
5086
|
-
setErrorArray =
|
|
5087
|
-
var
|
|
5502
|
+
var _useState27 = React.useState([]),
|
|
5503
|
+
errorArray = _useState27[0],
|
|
5504
|
+
setErrorArray = _useState27[1];
|
|
5505
|
+
var _useState28 = React.useState({
|
|
5088
5506
|
first_name: '',
|
|
5089
5507
|
last_name: '',
|
|
5090
5508
|
email: '',
|
|
@@ -5114,9 +5532,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5114
5532
|
userTagType: '',
|
|
5115
5533
|
profile_pic: ''
|
|
5116
5534
|
}),
|
|
5117
|
-
errorMsgs =
|
|
5118
|
-
setErrorMsgs =
|
|
5119
|
-
var
|
|
5535
|
+
errorMsgs = _useState28[0],
|
|
5536
|
+
setErrorMsgs = _useState28[1];
|
|
5537
|
+
var _useState29 = React.useState({
|
|
5120
5538
|
first_name: false,
|
|
5121
5539
|
last_name: false,
|
|
5122
5540
|
email: false,
|
|
@@ -5143,14 +5561,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5143
5561
|
userTagType: false,
|
|
5144
5562
|
profile_pic: false
|
|
5145
5563
|
}),
|
|
5146
|
-
inputChangeLog =
|
|
5147
|
-
updateInputChangeLog =
|
|
5148
|
-
var
|
|
5149
|
-
uploadedFiles =
|
|
5150
|
-
setUploadedFiles =
|
|
5151
|
-
var
|
|
5152
|
-
maxLengthForModal =
|
|
5153
|
-
setMaxLengthForModal =
|
|
5564
|
+
inputChangeLog = _useState29[0],
|
|
5565
|
+
updateInputChangeLog = _useState29[1];
|
|
5566
|
+
var _useState30 = React.useState([]),
|
|
5567
|
+
uploadedFiles = _useState30[0],
|
|
5568
|
+
setUploadedFiles = _useState30[1];
|
|
5569
|
+
var _useState31 = React.useState(70),
|
|
5570
|
+
maxLengthForModal = _useState31[0],
|
|
5571
|
+
setMaxLengthForModal = _useState31[1];
|
|
5154
5572
|
var defaultAddModalData = {
|
|
5155
5573
|
isOpen: false,
|
|
5156
5574
|
isError: false,
|
|
@@ -5166,9 +5584,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5166
5584
|
maxLength: maxLengthForModal,
|
|
5167
5585
|
minLength: 0
|
|
5168
5586
|
};
|
|
5169
|
-
var
|
|
5170
|
-
addModalData =
|
|
5171
|
-
setAddModalData =
|
|
5587
|
+
var _useState32 = React.useState(defaultAddModalData),
|
|
5588
|
+
addModalData = _useState32[0],
|
|
5589
|
+
setAddModalData = _useState32[1];
|
|
5172
5590
|
var onAddModalClose = function onAddModalClose() {
|
|
5173
5591
|
setAddModalData(_extends({}, defaultAddModalData));
|
|
5174
5592
|
};
|
|
@@ -5345,7 +5763,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5345
5763
|
_value = args._value,
|
|
5346
5764
|
_isError = args._isError,
|
|
5347
5765
|
_errorMsg = args._errorMsg;
|
|
5348
|
-
console.log(_name, _value);
|
|
5349
5766
|
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5350
5767
|
updateError(_name, _isError, _errorMsg);
|
|
5351
5768
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
@@ -5379,7 +5796,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5379
5796
|
var _extends12;
|
|
5380
5797
|
var _name = _ref3._name,
|
|
5381
5798
|
_value = _ref3._value;
|
|
5382
|
-
console.log(_name, _value, 'travel');
|
|
5383
5799
|
setTravelApproversInput(_extends({}, travelApproversInput, (_extends12 = {}, _extends12[_name] = _value, _extends12)));
|
|
5384
5800
|
};
|
|
5385
5801
|
var onExpenseApproversInputChange = function onExpenseApproversInputChange(_ref4) {
|
|
@@ -5577,6 +5993,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5577
5993
|
React.useEffect(function () {
|
|
5578
5994
|
if (isTokenVerified === true) {
|
|
5579
5995
|
dispatch(fetchRenderFileds());
|
|
5996
|
+
editUserId ? fetchEditUserCardsDetails(editUserId) : fetchLoggedUserCardsDetails();
|
|
5580
5997
|
}
|
|
5581
5998
|
}, [isTokenVerified]);
|
|
5582
5999
|
React.useEffect(function () {
|
|
@@ -5591,6 +6008,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5591
6008
|
}
|
|
5592
6009
|
}));
|
|
5593
6010
|
dispatch(fetchCountryCodes()).then(function (_res) {
|
|
6011
|
+
setCountryContactCode(_res);
|
|
5594
6012
|
if (isEditMode) {
|
|
5595
6013
|
if (!isProfile && !editUserId) return false;
|
|
5596
6014
|
dispatch(setStaticFieldsVisibility({
|
|
@@ -5701,7 +6119,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5701
6119
|
var products = res.user_product.split('+');
|
|
5702
6120
|
setProductAccess({
|
|
5703
6121
|
travel: products.includes('travel'),
|
|
5704
|
-
expense: products.includes('expense')
|
|
6122
|
+
expense: products.includes('expense'),
|
|
6123
|
+
cards: products.includes('cards')
|
|
5705
6124
|
});
|
|
5706
6125
|
if (products.includes('travel')) {
|
|
5707
6126
|
var _res$travel_info, _res$travel_info2, _res$travel_info3, _res$travel_info4, _res$travel_info5, _res$travel_info6;
|
|
@@ -5912,13 +6331,15 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5912
6331
|
IUIToastMessageService$4.warningNotify(checkAnyError);
|
|
5913
6332
|
return Promise.resolve();
|
|
5914
6333
|
}
|
|
5915
|
-
console.log(employeeInfoInput, 'data');
|
|
5916
6334
|
if (employeeInfoInput.manager_id.value !== '') {
|
|
5917
6335
|
employeeInfoInput.manager_id = employeeInfoInput.manager.value;
|
|
5918
6336
|
}
|
|
5919
6337
|
if (employeeInfoInput.skip_manager_id.value !== '') {
|
|
5920
6338
|
employeeInfoInput.skip_manager_id = employeeInfoInput.skip_manager.value;
|
|
5921
6339
|
}
|
|
6340
|
+
var cardsPayload = {
|
|
6341
|
+
"roles": [cardsRole]
|
|
6342
|
+
};
|
|
5922
6343
|
var payload = {
|
|
5923
6344
|
personalInfoInput: personalInfoInput,
|
|
5924
6345
|
employeeInfoInput: employeeInfoInput,
|
|
@@ -5937,7 +6358,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5937
6358
|
uploadedFiles: uploadedFiles,
|
|
5938
6359
|
filesForDelete: filesForDelete,
|
|
5939
6360
|
profilePicDelete: profilePicDelete,
|
|
5940
|
-
userTagType: userTagType
|
|
6361
|
+
userTagType: userTagType,
|
|
6362
|
+
cardsRole: cardsRole,
|
|
6363
|
+
isCardsAdmin: isCardsAdmin
|
|
5941
6364
|
};
|
|
5942
6365
|
if (verifyUserId) {
|
|
5943
6366
|
payload.verifyUserId = verifyUserId;
|
|
@@ -5949,6 +6372,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5949
6372
|
employeeInfo = optionalFields.employee_info,
|
|
5950
6373
|
userTravelInfo = optionalFields.user_travel_info;
|
|
5951
6374
|
var allMandatoryFields = ['first_name', 'last_name', 'email'];
|
|
6375
|
+
if (cardsErrorMsg) {
|
|
6376
|
+
_isError = true;
|
|
6377
|
+
}
|
|
5952
6378
|
allMandatoryFields.forEach(function (key, index) {
|
|
5953
6379
|
if (personalInfoInput[key] === '') {
|
|
5954
6380
|
_isError = true;
|
|
@@ -5976,11 +6402,8 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5976
6402
|
}
|
|
5977
6403
|
}
|
|
5978
6404
|
for (var _key in employeeInfo) {
|
|
5979
|
-
console.log('key', _key);
|
|
5980
6405
|
if (Object.hasOwnProperty.call(employeeInfo, _key)) {
|
|
5981
|
-
|
|
5982
|
-
console.log('employeeInfo0000', (_employeeInfoInput$_k = employeeInfoInput[_key]) === null || _employeeInfoInput$_k === void 0 ? void 0 : _employeeInfoInput$_k.value, 'sajkdhjasj');
|
|
5983
|
-
if (employeeInfo[_key] === false && employeeInfoInput[_key] !== undefined && (typeof employeeInfoInput[_key] === 'string' && !employeeInfoInput[_key] || typeof employeeInfoInput[_key] === 'object' && !employeeInfoInput[_key].value || !employeeInfoInput[_key].value) === '' && fieldsVisibility.employee_info[_key] !== 2) {
|
|
6406
|
+
if (employeeInfo[_key] === false && employeeInfoInput[_key] !== undefined && (typeof employeeInfoInput[_key] === 'string' && !employeeInfoInput[_key] || typeof employeeInfoInput[_key] === 'object' && !employeeInfoInput[_key].value) && fieldsVisibility.employee_info[_key] !== 2) {
|
|
5984
6407
|
_isError = true;
|
|
5985
6408
|
if (_errorArray.indexOf(_key) === -1) _errorArray.push(_key);
|
|
5986
6409
|
_errorMsgs[_key] = ErrorMessages[_key];
|
|
@@ -6066,7 +6489,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6066
6489
|
if (_isError) {
|
|
6067
6490
|
setErrorArray(_errorArray);
|
|
6068
6491
|
setErrorMsgs(_errorMsgs);
|
|
6069
|
-
var
|
|
6492
|
+
var _loop3 = function _loop3() {
|
|
6070
6493
|
if (Object.hasOwnProperty.call(_errorMsgs, _key3)) {
|
|
6071
6494
|
if (_errorMsgs[_key3]) {
|
|
6072
6495
|
if (_key3 in passportInfoInput || _key3 in travelPreferenceInfo || _key3 in secureTravelInputInfo) {
|
|
@@ -6086,115 +6509,57 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6086
6509
|
}
|
|
6087
6510
|
};
|
|
6088
6511
|
for (var _key3 in _errorMsgs) {
|
|
6089
|
-
if (
|
|
6512
|
+
if (_loop3()) break;
|
|
6090
6513
|
}
|
|
6091
6514
|
}
|
|
6515
|
+
var cardApiflag = false;
|
|
6516
|
+
if (productAccess.cards === false) {
|
|
6517
|
+
cardApiflag = false;
|
|
6518
|
+
} else {
|
|
6519
|
+
cardApiflag = true;
|
|
6520
|
+
}
|
|
6092
6521
|
if (!_isError) {
|
|
6093
6522
|
if (isEditMode && editUserId || isProfile) {
|
|
6094
6523
|
dispatch(showLoader());
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
}
|
|
6103
|
-
setFilesForDelete([]);
|
|
6104
|
-
setProfilePicDelete([]);
|
|
6105
|
-
})["catch"](function (err) {
|
|
6106
|
-
if (typeof err === 'object') {
|
|
6107
|
-
if (err.country_code) {
|
|
6108
|
-
err.contact_number = err.country_code;
|
|
6109
|
-
}
|
|
6110
|
-
if (err.contact_country_code) {
|
|
6111
|
-
err.contact_number = err.contact_country_code;
|
|
6112
|
-
}
|
|
6113
|
-
if (err.passport) {
|
|
6114
|
-
err.passport_photo = _extends({}, err.passport);
|
|
6115
|
-
delete err.passport;
|
|
6524
|
+
if (cardApiflag) {
|
|
6525
|
+
fetch(userAddEditUrl.cardsEditUserDetails(editUserId), {
|
|
6526
|
+
method: 'POST',
|
|
6527
|
+
body: JSON.stringify(cardsPayload),
|
|
6528
|
+
headers: {
|
|
6529
|
+
'Content-Type': 'application/json',
|
|
6530
|
+
'authorization': "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
6116
6531
|
}
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
|
|
6127
|
-
setTimeout(function () {
|
|
6128
|
-
el.scrollIntoView({
|
|
6129
|
-
behavior: 'smooth',
|
|
6130
|
-
block: 'center'
|
|
6131
|
-
});
|
|
6132
|
-
}, 500);
|
|
6133
|
-
return 1;
|
|
6134
|
-
}
|
|
6135
|
-
}
|
|
6136
|
-
}
|
|
6137
|
-
};
|
|
6138
|
-
for (var _key4 in err) {
|
|
6139
|
-
if (_loop2()) break;
|
|
6140
|
-
}
|
|
6141
|
-
} else if (typeof err === 'string') {
|
|
6142
|
-
IUIToastMessageService$4.warningNotify(err);
|
|
6143
|
-
} else {
|
|
6144
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6145
|
-
}
|
|
6146
|
-
})["finally"](function () {
|
|
6147
|
-
dispatch(stopLoader());
|
|
6148
|
-
});
|
|
6532
|
+
}).then(function (response) {
|
|
6533
|
+
return response.json();
|
|
6534
|
+
}).then(function (res) {
|
|
6535
|
+
updateUserApiCall(payload, inputChangeLog);
|
|
6536
|
+
})["catch"](function (error) {
|
|
6537
|
+
console.log("errorrr", error);
|
|
6538
|
+
});
|
|
6539
|
+
} else {
|
|
6540
|
+
updateUserApiCall(payload, inputChangeLog);
|
|
6541
|
+
}
|
|
6149
6542
|
} else {
|
|
6150
6543
|
dispatch(showLoader());
|
|
6151
|
-
dispatch(
|
|
6152
|
-
|
|
6153
|
-
(
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
if (err.contact_country_code) {
|
|
6160
|
-
err.contact_number = err.contact_country_code;
|
|
6161
|
-
}
|
|
6162
|
-
if (err.passport) {
|
|
6163
|
-
err.passport_photo = _extends({}, err.passport);
|
|
6164
|
-
delete err.passport;
|
|
6165
|
-
}
|
|
6166
|
-
setErrorArray(Object.keys(err));
|
|
6167
|
-
setErrorMsgs(err);
|
|
6168
|
-
var _loop3 = function _loop3() {
|
|
6169
|
-
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
6170
|
-
if (err[_key5]) {
|
|
6171
|
-
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
6172
|
-
setAdditionalInfoFlag('open');
|
|
6173
|
-
}
|
|
6174
|
-
var el = document.getElementById(_key5 === 'country_code' || _key5 === 'contact_country_code' ? 'contact_number' : _key5);
|
|
6175
|
-
if (el) {
|
|
6176
|
-
setTimeout(function () {
|
|
6177
|
-
el.scrollIntoView({
|
|
6178
|
-
behavior: 'smooth',
|
|
6179
|
-
block: 'center'
|
|
6180
|
-
});
|
|
6181
|
-
}, 500);
|
|
6182
|
-
return 1;
|
|
6183
|
-
}
|
|
6184
|
-
}
|
|
6185
|
-
}
|
|
6186
|
-
};
|
|
6187
|
-
for (var _key5 in err) {
|
|
6188
|
-
if (_loop3()) break;
|
|
6544
|
+
dispatch(showLoader());
|
|
6545
|
+
if (cardApiflag === true) {
|
|
6546
|
+
fetch(userAddEditUrl.cardsEditUserDetails(isEditMode ? editUserId : id), {
|
|
6547
|
+
method: 'POST',
|
|
6548
|
+
body: JSON.stringify(cardsPayload),
|
|
6549
|
+
headers: {
|
|
6550
|
+
'Content-Type': 'application/json',
|
|
6551
|
+
'authorization': "Bearer " + IUILocalStorageService$5.getAccessToken()
|
|
6189
6552
|
}
|
|
6190
|
-
}
|
|
6191
|
-
|
|
6192
|
-
}
|
|
6193
|
-
|
|
6194
|
-
}
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
}
|
|
6553
|
+
}).then(function (response) {
|
|
6554
|
+
return response.json();
|
|
6555
|
+
}).then(function (res) {
|
|
6556
|
+
createUserApiCall(payload);
|
|
6557
|
+
})["catch"](function (error) {
|
|
6558
|
+
console.log("errorrr", error);
|
|
6559
|
+
});
|
|
6560
|
+
} else {
|
|
6561
|
+
createUserApiCall(payload);
|
|
6562
|
+
}
|
|
6198
6563
|
}
|
|
6199
6564
|
}
|
|
6200
6565
|
return Promise.resolve();
|
|
@@ -6233,17 +6598,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6233
6598
|
if (verifyUserId) {
|
|
6234
6599
|
dispatch(showLoader());
|
|
6235
6600
|
dispatch(verifyUserInfo(verifyUserId)).then(function (res) {
|
|
6601
|
+
setNewCountryCode(res === null || res === void 0 ? void 0 : res.country_contact_code);
|
|
6236
6602
|
setPersonalInfoInput(function (prevState) {
|
|
6237
6603
|
return _extends({}, prevState, {
|
|
6238
|
-
first_name: res.
|
|
6239
|
-
last_name: res.
|
|
6604
|
+
first_name: res.first_name,
|
|
6605
|
+
last_name: res.last_name,
|
|
6240
6606
|
email: res.email,
|
|
6241
|
-
contact_number: res.
|
|
6242
|
-
dob: function () {
|
|
6243
|
-
var dt = new Date(res.dob);
|
|
6244
|
-
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
6245
|
-
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
6246
|
-
}(),
|
|
6607
|
+
contact_number: res === null || res === void 0 ? void 0 : res.contact_number,
|
|
6247
6608
|
gender: function () {
|
|
6248
6609
|
if (res.gender === 'male') return 'Male';else if (res.gender === 'female') return 'Female';else if (res.gender === 'others') return 'Others';else return '';
|
|
6249
6610
|
}()
|
|
@@ -6516,7 +6877,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6516
6877
|
md: 4
|
|
6517
6878
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
6518
6879
|
label: "Product access",
|
|
6519
|
-
description: isProfile ? '' : '
|
|
6880
|
+
description: isProfile ? '' : 'Please select a product. Cards are available along with at least one additional product.',
|
|
6520
6881
|
headerType: true,
|
|
6521
6882
|
required: true
|
|
6522
6883
|
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
@@ -6622,6 +6983,19 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6622
6983
|
isProfile: isProfile,
|
|
6623
6984
|
editUserId: editUserId,
|
|
6624
6985
|
roles: renderFields.expenseRoles
|
|
6986
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIDivider, {
|
|
6987
|
+
className: styles.dividerColor
|
|
6988
|
+
}), isCardsDetailsRendered && productAccess && productAccess.cards && /*#__PURE__*/React__default.createElement(CardsField, {
|
|
6989
|
+
cardsConstants: cardsDetails.cardsConstants,
|
|
6990
|
+
type: "cards",
|
|
6991
|
+
isProfile: isProfile,
|
|
6992
|
+
onRoleChange: function onRoleChange(_ref7) {
|
|
6993
|
+
var _value = _ref7._value;
|
|
6994
|
+
return setCardsRole(_value);
|
|
6995
|
+
},
|
|
6996
|
+
roleValue: cardsRole,
|
|
6997
|
+
roles: cardsDetails.cardsRoles,
|
|
6998
|
+
cardsAdmin: isCardsAdmin
|
|
6625
6999
|
}))) : /*#__PURE__*/React__default.createElement(VerificationError, {
|
|
6626
7000
|
config: config,
|
|
6627
7001
|
errMsg: hasVerificationError
|
|
@@ -8430,7 +8804,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8430
8804
|
cell: function cell(row) {
|
|
8431
8805
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8432
8806
|
component: "div"
|
|
8433
|
-
}, row.products.length > 0 ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8807
|
+
}, row.products.length > 0 ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, row.products[0].role !== "Card Holder" ? /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8434
8808
|
component: "div",
|
|
8435
8809
|
display: "flex"
|
|
8436
8810
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
@@ -8443,7 +8817,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8443
8817
|
style: {
|
|
8444
8818
|
whiteSpace: 'nowrap'
|
|
8445
8819
|
}
|
|
8446
|
-
}, "\xA0" + row.products[0].role)), row.products[1] && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8820
|
+
}, "\xA0" + row.products[0].role)) : "", row.products[1] && row.products[1].role !== "Card Holder" && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8447
8821
|
component: "div",
|
|
8448
8822
|
display: "flex"
|
|
8449
8823
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
@@ -8456,7 +8830,20 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8456
8830
|
style: {
|
|
8457
8831
|
whiteSpace: 'nowrap'
|
|
8458
8832
|
}
|
|
8459
|
-
}, "\xA0" + row.products[1].role))
|
|
8833
|
+
}, "\xA0" + row.products[1].role)), row.products[2] && row.products[2].role !== "Card Holder" && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8834
|
+
component: "div",
|
|
8835
|
+
display: "flex"
|
|
8836
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
8837
|
+
className: clsx(styles$5.rowText, styles$5.textTransform, styles$5.lightColor),
|
|
8838
|
+
style: {
|
|
8839
|
+
whiteSpace: 'nowrap'
|
|
8840
|
+
}
|
|
8841
|
+
}, row.products[2].name + ' / '), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
8842
|
+
className: clsx(styles$5.rowText, styles$5.textTransform),
|
|
8843
|
+
style: {
|
|
8844
|
+
whiteSpace: 'nowrap'
|
|
8845
|
+
}
|
|
8846
|
+
}, "\xA0" + row.products[2].role))) : '');
|
|
8460
8847
|
}
|
|
8461
8848
|
}, {
|
|
8462
8849
|
id: 'status',
|
|
@@ -8597,17 +8984,17 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8597
8984
|
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
8598
8985
|
};
|
|
8599
8986
|
var columns = [{
|
|
8600
|
-
id: '
|
|
8987
|
+
id: 'first_name',
|
|
8601
8988
|
label: 'Name',
|
|
8602
8989
|
minWidth: 250,
|
|
8603
8990
|
sortable: true,
|
|
8604
8991
|
cell: function cell(row) {
|
|
8605
8992
|
var _row$profile_pic2;
|
|
8606
8993
|
return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIProfileBox, {
|
|
8607
|
-
firstName: row.
|
|
8608
|
-
lastName: row.
|
|
8994
|
+
firstName: row.first_name,
|
|
8995
|
+
lastName: row.last_name,
|
|
8609
8996
|
isLetterAvatar: row.profile_pic && row.profile_pic.presigned_url ? false : true,
|
|
8610
|
-
primaryText: row.
|
|
8997
|
+
primaryText: row.first_name + ' ' + row.last_name,
|
|
8611
8998
|
secondaryText: row.email,
|
|
8612
8999
|
letterAvatarTextColor: "black",
|
|
8613
9000
|
letterAvatarBackgroundColor: "#d3d3d3",
|
|
@@ -8616,7 +9003,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8616
9003
|
}));
|
|
8617
9004
|
}
|
|
8618
9005
|
}, {
|
|
8619
|
-
id: '
|
|
9006
|
+
id: 'created_at',
|
|
8620
9007
|
label: 'Requested on',
|
|
8621
9008
|
minWidth: 100,
|
|
8622
9009
|
sortable: true,
|
|
@@ -8626,7 +9013,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8626
9013
|
width: 100
|
|
8627
9014
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
8628
9015
|
className: clsx(styles$5.rowText, styles$5.textTransform)
|
|
8629
|
-
}, formatDate(row.
|
|
9016
|
+
}, formatDate(row.created_at)));
|
|
8630
9017
|
}
|
|
8631
9018
|
}, {
|
|
8632
9019
|
id: 'actions',
|
|
@@ -8899,7 +9286,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8899
9286
|
var _React$useState11 = React__default.useState('asc'),
|
|
8900
9287
|
signup_order = _React$useState11[0],
|
|
8901
9288
|
setSignUpOrder = _React$useState11[1];
|
|
8902
|
-
var _React$useState12 = React__default.useState('
|
|
9289
|
+
var _React$useState12 = React__default.useState('first_name'),
|
|
8903
9290
|
signup_orderBy = _React$useState12[0],
|
|
8904
9291
|
setSignUpOrderBy = _React$useState12[1];
|
|
8905
9292
|
var _useState22 = React.useState(''),
|
|
@@ -8922,7 +9309,11 @@ var UserList = function UserList(_ref2) {
|
|
|
8922
9309
|
}),
|
|
8923
9310
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8924
9311
|
var redirectToNotifications = function redirectToNotifications() {
|
|
8925
|
-
|
|
9312
|
+
if (config.routes.notification) {
|
|
9313
|
+
history.push({
|
|
9314
|
+
pathname: config.routes.notification.path
|
|
9315
|
+
});
|
|
9316
|
+
}
|
|
8926
9317
|
};
|
|
8927
9318
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8928
9319
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
@@ -9544,7 +9935,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9544
9935
|
variant: "body2",
|
|
9545
9936
|
className: clsx(styles$5.description)
|
|
9546
9937
|
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in", ' ', /*#__PURE__*/React__default.createElement("span", {
|
|
9547
|
-
onClick:
|
|
9938
|
+
onClick: redirectToNotifications,
|
|
9548
9939
|
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9549
9940
|
}, "Notifications"))), /*#__PURE__*/React__default.createElement(SingupRequests, {
|
|
9550
9941
|
data: signupRequestListInfo,
|
|
@@ -10082,7 +10473,6 @@ function EditPanelDialog(_ref) {
|
|
|
10082
10473
|
}, [rowData]);
|
|
10083
10474
|
var history = reactRouterDom.useHistory();
|
|
10084
10475
|
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
10085
|
-
console.log(rowData);
|
|
10086
10476
|
history.push({
|
|
10087
10477
|
pathname: config.routes.users.add.path,
|
|
10088
10478
|
state: rowData
|