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