@itilite/iui-user-management 0.4.219 → 0.4.221
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 +0 -4
- package/dist/index.js +123 -144
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +123 -144
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -5344,10 +5344,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5344
5344
|
_value = args._value,
|
|
5345
5345
|
_isError = args._isError,
|
|
5346
5346
|
_errorMsg = args._errorMsg;
|
|
5347
|
-
console.log(
|
|
5348
|
-
_name: _name,
|
|
5349
|
-
_value: _value
|
|
5350
|
-
});
|
|
5347
|
+
console.log(_name, _value);
|
|
5351
5348
|
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5352
5349
|
updateError(_name, _isError, _errorMsg);
|
|
5353
5350
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
@@ -5605,6 +5602,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5605
5602
|
userId: isProfile ? id : editUserId
|
|
5606
5603
|
})).then(function (res) {
|
|
5607
5604
|
var _res$user_tags, _res$custom_attribute;
|
|
5605
|
+
console.log('response is', res);
|
|
5608
5606
|
var profilePic = [];
|
|
5609
5607
|
if (res && res.profile_pic) {
|
|
5610
5608
|
profilePic = [{
|
|
@@ -5900,6 +5898,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5900
5898
|
IUIToastMessageService$4.warningNotify(checkAnyError);
|
|
5901
5899
|
return Promise.resolve();
|
|
5902
5900
|
}
|
|
5901
|
+
console.log(employeeInfoInput, 'data');
|
|
5903
5902
|
var payload = {
|
|
5904
5903
|
personalInfoInput: personalInfoInput,
|
|
5905
5904
|
employeeInfoInput: employeeInfoInput,
|
|
@@ -6067,115 +6066,116 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6067
6066
|
var _ret = _loop();
|
|
6068
6067
|
if (_ret === "break") break;
|
|
6069
6068
|
}
|
|
6070
|
-
return Promise.resolve();
|
|
6071
6069
|
}
|
|
6072
|
-
if (
|
|
6073
|
-
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
setFilesForDelete([]);
|
|
6083
|
-
setProfilePicDelete([]);
|
|
6084
|
-
})["catch"](function (err) {
|
|
6085
|
-
if (typeof err === 'object') {
|
|
6086
|
-
if (err.country_code) {
|
|
6087
|
-
err.contact_number = err.country_code;
|
|
6088
|
-
}
|
|
6089
|
-
if (err.contact_country_code) {
|
|
6090
|
-
err.contact_number = err.contact_country_code;
|
|
6091
|
-
}
|
|
6092
|
-
if (err.passport) {
|
|
6093
|
-
err.passport_photo = _extends({}, err.passport);
|
|
6094
|
-
delete err.passport;
|
|
6070
|
+
if (!_isError) {
|
|
6071
|
+
if (isEditMode && editUserId || isProfile) {
|
|
6072
|
+
dispatch(showLoader());
|
|
6073
|
+
dispatch(updateUser(payload, isProfile ? id : editUserId, inputChangeLog)).then(function (res) {
|
|
6074
|
+
if (isProfile) {
|
|
6075
|
+
var _config$routes, _config$routes$profil, _config$routes$profil2;
|
|
6076
|
+
(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);
|
|
6077
|
+
} else {
|
|
6078
|
+
var _config$routes2, _config$routes2$users, _config$routes2$users2;
|
|
6079
|
+
(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);
|
|
6095
6080
|
}
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6081
|
+
setFilesForDelete([]);
|
|
6082
|
+
setProfilePicDelete([]);
|
|
6083
|
+
})["catch"](function (err) {
|
|
6084
|
+
if (typeof err === 'object') {
|
|
6085
|
+
if (err.country_code) {
|
|
6086
|
+
err.contact_number = err.country_code;
|
|
6087
|
+
}
|
|
6088
|
+
if (err.contact_country_code) {
|
|
6089
|
+
err.contact_number = err.contact_country_code;
|
|
6090
|
+
}
|
|
6091
|
+
if (err.passport) {
|
|
6092
|
+
err.passport_photo = _extends({}, err.passport);
|
|
6093
|
+
delete err.passport;
|
|
6094
|
+
}
|
|
6095
|
+
setErrorArray(Object.keys(err));
|
|
6096
|
+
setErrorMsgs(err);
|
|
6097
|
+
var _loop2 = function _loop2() {
|
|
6098
|
+
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
6099
|
+
if (err[_key4]) {
|
|
6100
|
+
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
6101
|
+
setAdditionalInfoFlag('open');
|
|
6102
|
+
}
|
|
6103
|
+
var el = document.getElementById(_key4 === 'country_code' || _key4 === 'contact_country_code' ? 'contact_number' : _key4);
|
|
6104
|
+
if (el) {
|
|
6105
|
+
setTimeout(function () {
|
|
6106
|
+
el.scrollIntoView({
|
|
6107
|
+
behavior: 'smooth',
|
|
6108
|
+
block: 'center'
|
|
6109
|
+
});
|
|
6110
|
+
}, 500);
|
|
6111
|
+
return "break";
|
|
6112
|
+
}
|
|
6113
6113
|
}
|
|
6114
6114
|
}
|
|
6115
|
+
};
|
|
6116
|
+
for (var _key4 in err) {
|
|
6117
|
+
var _ret2 = _loop2();
|
|
6118
|
+
if (_ret2 === "break") break;
|
|
6115
6119
|
}
|
|
6116
|
-
}
|
|
6117
|
-
|
|
6118
|
-
|
|
6119
|
-
|
|
6120
|
-
}
|
|
6121
|
-
} else if (typeof err === 'string') {
|
|
6122
|
-
IUIToastMessageService$4.warningNotify(err);
|
|
6123
|
-
} else {
|
|
6124
|
-
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6125
|
-
}
|
|
6126
|
-
})["finally"](function () {
|
|
6127
|
-
dispatch(stopLoader());
|
|
6128
|
-
});
|
|
6129
|
-
} else {
|
|
6130
|
-
dispatch(showLoader());
|
|
6131
|
-
dispatch(createUser(payload)).then(function (res) {
|
|
6132
|
-
var _config$routes3, _config$routes3$users, _config$routes3$users2;
|
|
6133
|
-
(config === null || config === void 0 ? void 0 : (_config$routes3 = config.routes) === null || _config$routes3 === void 0 ? void 0 : (_config$routes3$users = _config$routes3.users) === null || _config$routes3$users === void 0 ? void 0 : (_config$routes3$users2 = _config$routes3$users.list) === null || _config$routes3$users2 === void 0 ? void 0 : _config$routes3$users2.path) && history.push(config.routes.users.list.path);
|
|
6134
|
-
})["catch"](function (err) {
|
|
6135
|
-
if (typeof err === 'object') {
|
|
6136
|
-
if (err.country_code) {
|
|
6137
|
-
err.contact_number = err.country_code;
|
|
6138
|
-
}
|
|
6139
|
-
if (err.contact_country_code) {
|
|
6140
|
-
err.contact_number = err.contact_country_code;
|
|
6141
|
-
}
|
|
6142
|
-
if (err.passport) {
|
|
6143
|
-
err.passport_photo = _extends({}, err.passport);
|
|
6144
|
-
delete err.passport;
|
|
6120
|
+
} else if (typeof err === 'string') {
|
|
6121
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
6122
|
+
} else {
|
|
6123
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6145
6124
|
}
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6125
|
+
})["finally"](function () {
|
|
6126
|
+
dispatch(stopLoader());
|
|
6127
|
+
});
|
|
6128
|
+
} else {
|
|
6129
|
+
dispatch(showLoader());
|
|
6130
|
+
dispatch(createUser(payload)).then(function (res) {
|
|
6131
|
+
var _config$routes3, _config$routes3$users, _config$routes3$users2;
|
|
6132
|
+
(config === null || config === void 0 ? void 0 : (_config$routes3 = config.routes) === null || _config$routes3 === void 0 ? void 0 : (_config$routes3$users = _config$routes3.users) === null || _config$routes3$users === void 0 ? void 0 : (_config$routes3$users2 = _config$routes3$users.list) === null || _config$routes3$users2 === void 0 ? void 0 : _config$routes3$users2.path) && history.push(config.routes.users.list.path);
|
|
6133
|
+
})["catch"](function (err) {
|
|
6134
|
+
if (typeof err === 'object') {
|
|
6135
|
+
if (err.country_code) {
|
|
6136
|
+
err.contact_number = err.country_code;
|
|
6137
|
+
}
|
|
6138
|
+
if (err.contact_country_code) {
|
|
6139
|
+
err.contact_number = err.contact_country_code;
|
|
6140
|
+
}
|
|
6141
|
+
if (err.passport) {
|
|
6142
|
+
err.passport_photo = _extends({}, err.passport);
|
|
6143
|
+
delete err.passport;
|
|
6144
|
+
}
|
|
6145
|
+
setErrorArray(Object.keys(err));
|
|
6146
|
+
setErrorMsgs(err);
|
|
6147
|
+
var _loop3 = function _loop3() {
|
|
6148
|
+
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
6149
|
+
if (err[_key5]) {
|
|
6150
|
+
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
6151
|
+
setAdditionalInfoFlag('open');
|
|
6152
|
+
}
|
|
6153
|
+
var el = document.getElementById(_key5 === 'country_code' || _key5 === 'contact_country_code' ? 'contact_number' : _key5);
|
|
6154
|
+
if (el) {
|
|
6155
|
+
setTimeout(function () {
|
|
6156
|
+
el.scrollIntoView({
|
|
6157
|
+
behavior: 'smooth',
|
|
6158
|
+
block: 'center'
|
|
6159
|
+
});
|
|
6160
|
+
}, 500);
|
|
6161
|
+
return "break";
|
|
6162
|
+
}
|
|
6163
6163
|
}
|
|
6164
6164
|
}
|
|
6165
|
+
};
|
|
6166
|
+
for (var _key5 in err) {
|
|
6167
|
+
var _ret3 = _loop3();
|
|
6168
|
+
if (_ret3 === "break") break;
|
|
6165
6169
|
}
|
|
6166
|
-
}
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
+
} else if (typeof err === 'string') {
|
|
6171
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
6172
|
+
} else {
|
|
6173
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6170
6174
|
}
|
|
6171
|
-
}
|
|
6172
|
-
|
|
6173
|
-
}
|
|
6174
|
-
|
|
6175
|
-
}
|
|
6176
|
-
})["finally"](function () {
|
|
6177
|
-
dispatch(stopLoader());
|
|
6178
|
-
});
|
|
6175
|
+
})["finally"](function () {
|
|
6176
|
+
dispatch(stopLoader());
|
|
6177
|
+
});
|
|
6178
|
+
}
|
|
6179
6179
|
}
|
|
6180
6180
|
return Promise.resolve();
|
|
6181
6181
|
} catch (e) {
|
|
@@ -6215,15 +6215,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6215
6215
|
dispatch(verifyUserInfo(verifyUserId)).then(function (res) {
|
|
6216
6216
|
setPersonalInfoInput(function (prevState) {
|
|
6217
6217
|
return _extends({}, prevState, {
|
|
6218
|
-
first_name: res.
|
|
6219
|
-
last_name: res.
|
|
6218
|
+
first_name: res.first_name,
|
|
6219
|
+
last_name: res.last_name,
|
|
6220
6220
|
email: res.email,
|
|
6221
6221
|
contact_number: res.phone,
|
|
6222
|
-
dob: function () {
|
|
6223
|
-
var dt = new Date(res.dob);
|
|
6224
|
-
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
|
|
6225
|
-
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
6226
|
-
}(),
|
|
6227
6222
|
gender: function () {
|
|
6228
6223
|
if (res.gender === 'male') return 'Male';else if (res.gender === 'female') return 'Female';else if (res.gender === 'others') return 'Others';else return '';
|
|
6229
6224
|
}()
|
|
@@ -6386,6 +6381,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6386
6381
|
if (!p.visibility) {
|
|
6387
6382
|
return null;
|
|
6388
6383
|
}
|
|
6384
|
+
if (p.name === 'profile_pic' && config.env.isExpenseProduct) {
|
|
6385
|
+
return null;
|
|
6386
|
+
}
|
|
6389
6387
|
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
6390
6388
|
item: true,
|
|
6391
6389
|
sm: 12,
|
|
@@ -8511,6 +8509,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8511
8509
|
endIcon: null,
|
|
8512
8510
|
outlinedBtn: false,
|
|
8513
8511
|
className: "threedotMenuBtn",
|
|
8512
|
+
MoreHorizIcon: true,
|
|
8514
8513
|
placement: "bottom-end"
|
|
8515
8514
|
}));
|
|
8516
8515
|
},
|
|
@@ -8573,17 +8572,17 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8573
8572
|
return dt.getDate() + " " + months[dt.getMonth()] + " " + dt.getFullYear();
|
|
8574
8573
|
};
|
|
8575
8574
|
var columns = [{
|
|
8576
|
-
id: '
|
|
8575
|
+
id: 'first_name',
|
|
8577
8576
|
label: 'Name',
|
|
8578
8577
|
minWidth: 250,
|
|
8579
8578
|
sortable: true,
|
|
8580
8579
|
cell: function cell(row) {
|
|
8581
8580
|
var _row$profile_pic2;
|
|
8582
8581
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIProfileBox, {
|
|
8583
|
-
firstName: row.
|
|
8584
|
-
lastName: row.
|
|
8582
|
+
firstName: row.first_name,
|
|
8583
|
+
lastName: row.last_name,
|
|
8585
8584
|
isLetterAvatar: row.profile_pic && row.profile_pic.presigned_url ? false : true,
|
|
8586
|
-
primaryText: row.
|
|
8585
|
+
primaryText: row.first_name + ' ' + row.last_name,
|
|
8587
8586
|
secondaryText: row.email,
|
|
8588
8587
|
letterAvatarTextColor: "black",
|
|
8589
8588
|
letterAvatarBackgroundColor: "#d3d3d3",
|
|
@@ -8592,7 +8591,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8592
8591
|
}));
|
|
8593
8592
|
}
|
|
8594
8593
|
}, {
|
|
8595
|
-
id: '
|
|
8594
|
+
id: 'created_at',
|
|
8596
8595
|
label: 'Requested on',
|
|
8597
8596
|
minWidth: 100,
|
|
8598
8597
|
sortable: true,
|
|
@@ -8602,7 +8601,7 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8602
8601
|
width: 100
|
|
8603
8602
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8604
8603
|
className: clsx(styles$5.rowText, styles$5.textTransform)
|
|
8605
|
-
}, formatDate(row.
|
|
8604
|
+
}, formatDate(row.created_at)));
|
|
8606
8605
|
}
|
|
8607
8606
|
}, {
|
|
8608
8607
|
id: 'actions',
|
|
@@ -8875,7 +8874,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8875
8874
|
var _React$useState11 = React.useState('asc'),
|
|
8876
8875
|
signup_order = _React$useState11[0],
|
|
8877
8876
|
setSignUpOrder = _React$useState11[1];
|
|
8878
|
-
var _React$useState12 = React.useState('
|
|
8877
|
+
var _React$useState12 = React.useState('first_name'),
|
|
8879
8878
|
signup_orderBy = _React$useState12[0],
|
|
8880
8879
|
setSignUpOrderBy = _React$useState12[1];
|
|
8881
8880
|
var _useState22 = useState(''),
|
|
@@ -8909,31 +8908,14 @@ var UserList = function UserList(_ref2) {
|
|
|
8909
8908
|
var _SelectedUsersNotApprover = [].concat(selectedUsersNotApprover);
|
|
8910
8909
|
var _SelectedUsersApprover = [].concat(selectedUsersApprover);
|
|
8911
8910
|
var _selected = Object.values(selected).flat();
|
|
8912
|
-
|
|
8913
|
-
|
|
8914
|
-
var tempArray1 = [];
|
|
8915
|
-
var tempArray2 = [];
|
|
8916
|
-
_SelectedUsersNotApprover.map(function (item) {
|
|
8917
|
-
if (temp1[item.id] !== item) {
|
|
8918
|
-
temp1[item.id] = item;
|
|
8919
|
-
}
|
|
8911
|
+
_SelectedUsersNotApprover = _SelectedUsersNotApprover.filter(function (item) {
|
|
8912
|
+
return _selected.includes(item.id.toString());
|
|
8920
8913
|
});
|
|
8921
|
-
_SelectedUsersApprover.
|
|
8922
|
-
|
|
8923
|
-
temp2[item.id] = item;
|
|
8924
|
-
}
|
|
8914
|
+
_SelectedUsersApprover = _SelectedUsersApprover.filter(function (item) {
|
|
8915
|
+
return _selected.includes(item.id.toString());
|
|
8925
8916
|
});
|
|
8926
|
-
|
|
8927
|
-
|
|
8928
|
-
if (_selected[i] == temp1[_selected[i]].id) {
|
|
8929
|
-
tempArray1.push(temp1[_selected[i]]);
|
|
8930
|
-
}
|
|
8931
|
-
} else if (temp2[_selected[i]].id != undefined) {
|
|
8932
|
-
if (_selected[i] == temp2[_selected[i]].id) tempArray2.push(temp2[_selected[i]]);
|
|
8933
|
-
}
|
|
8934
|
-
}
|
|
8935
|
-
setSelectedUsersNotApprover(tempArray1);
|
|
8936
|
-
setSelectedUsersApprover(tempArray2);
|
|
8917
|
+
setSelectedUsersNotApprover(_SelectedUsersNotApprover);
|
|
8918
|
+
setSelectedUsersApprover(_SelectedUsersApprover);
|
|
8937
8919
|
setIsBulkDeactivateModalOpen(true);
|
|
8938
8920
|
} else {
|
|
8939
8921
|
setOpenDeActivateModalFlag(true);
|
|
@@ -9691,10 +9673,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9691
9673
|
}));
|
|
9692
9674
|
})), selectedUsersNotApprover !== null && selectedUsersNotApprover !== void 0 && selectedUsersNotApprover.length ? /*#__PURE__*/React.createElement(IUIBox, null, /*#__PURE__*/React.createElement("hr", {
|
|
9693
9675
|
style: {
|
|
9694
|
-
borderColor: '#E5E9ED'
|
|
9695
|
-
borderLeft: 'none',
|
|
9696
|
-
borderTop: 'none',
|
|
9697
|
-
borderRight: 'none'
|
|
9676
|
+
borderColor: '#E5E9ED'
|
|
9698
9677
|
}
|
|
9699
9678
|
}), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9700
9679
|
className: "iui__my-15"
|