@itilite/iui-user-management 0.4.504 → 0.4.601
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +268 -185
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +268 -185
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -146,11 +146,17 @@ function r(e) {
|
|
|
146
146
|
var t,
|
|
147
147
|
f,
|
|
148
148
|
n = "";
|
|
149
|
-
if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++)
|
|
149
|
+
if ("string" == typeof e || "number" == typeof e) n += e;else if ("object" == typeof e) if (Array.isArray(e)) for (t = 0; t < e.length; t++) {
|
|
150
|
+
e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
|
|
151
|
+
} else for (t in e) {
|
|
152
|
+
e[t] && (n && (n += " "), n += t);
|
|
153
|
+
}
|
|
150
154
|
return n;
|
|
151
155
|
}
|
|
152
156
|
function clsx() {
|
|
153
|
-
for (var e, t, f = 0, n = ""; f < arguments.length;)
|
|
157
|
+
for (var e, t, f = 0, n = ""; f < arguments.length;) {
|
|
158
|
+
(e = arguments[f++]) && (t = r(e)) && (n && (n += " "), n += t);
|
|
159
|
+
}
|
|
154
160
|
return n;
|
|
155
161
|
}
|
|
156
162
|
|
|
@@ -3155,6 +3161,31 @@ var workInfo = [{
|
|
|
3155
3161
|
minLength: 0
|
|
3156
3162
|
},
|
|
3157
3163
|
disableText: 'Please get in touch with your administrator to change this value.'
|
|
3164
|
+
}, {
|
|
3165
|
+
id: 7,
|
|
3166
|
+
label: 'Manager',
|
|
3167
|
+
name: 'manager',
|
|
3168
|
+
required: false,
|
|
3169
|
+
type: 'async_select',
|
|
3170
|
+
fullWidth: false,
|
|
3171
|
+
visibility: true,
|
|
3172
|
+
readOnly: false,
|
|
3173
|
+
placeholder: 'Select manager',
|
|
3174
|
+
tabelName: 'manager',
|
|
3175
|
+
product: 'travel',
|
|
3176
|
+
loadOption: approversOptions
|
|
3177
|
+
}, {
|
|
3178
|
+
id: 8,
|
|
3179
|
+
label: 'Skip manager',
|
|
3180
|
+
name: 'skip_manager',
|
|
3181
|
+
required: false,
|
|
3182
|
+
type: 'async_select',
|
|
3183
|
+
fullWidth: false,
|
|
3184
|
+
visibility: true,
|
|
3185
|
+
readOnly: false,
|
|
3186
|
+
placeholder: 'Select manager',
|
|
3187
|
+
product: 'travel',
|
|
3188
|
+
loadOption: approversOptions
|
|
3158
3189
|
}, {
|
|
3159
3190
|
id: 9,
|
|
3160
3191
|
label: 'Base location',
|
|
@@ -4988,6 +5019,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
4988
5019
|
},
|
|
4989
5020
|
designation: '',
|
|
4990
5021
|
base_location: '',
|
|
5022
|
+
manager_id: {
|
|
5023
|
+
value: '',
|
|
5024
|
+
label: 'Select Manager'
|
|
5025
|
+
},
|
|
5026
|
+
skip_manager_id: {
|
|
5027
|
+
value: '',
|
|
5028
|
+
label: 'Select Manager'
|
|
5029
|
+
},
|
|
4991
5030
|
currency: {
|
|
4992
5031
|
value: defaultCurrency,
|
|
4993
5032
|
label: defaultCurrency
|
|
@@ -5000,7 +5039,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5000
5039
|
entity: 0,
|
|
5001
5040
|
business_unit: 0,
|
|
5002
5041
|
department: 0,
|
|
5003
|
-
currency: 0
|
|
5042
|
+
currency: 0,
|
|
5043
|
+
manager_id: 0,
|
|
5044
|
+
skip_manager_id: 0
|
|
5004
5045
|
}),
|
|
5005
5046
|
cacheForAsyncDropdown = _useState4[0],
|
|
5006
5047
|
clearCacheForAsyncDropdown = _useState4[1];
|
|
@@ -5264,7 +5305,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5264
5305
|
};
|
|
5265
5306
|
var onPersonalInfoChange = function onPersonalInfoChange(args) {
|
|
5266
5307
|
try {
|
|
5267
|
-
var
|
|
5308
|
+
var _temp6 = function _temp6() {
|
|
5268
5309
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
5269
5310
|
var _extends6;
|
|
5270
5311
|
updateInputChangeLog(_extends({}, inputChangeLog, (_extends6 = {}, _extends6[_name] = true, _extends6)));
|
|
@@ -5278,7 +5319,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5278
5319
|
_errorMsg = _args$_errorMsg === void 0 ? '' : _args$_errorMsg,
|
|
5279
5320
|
_args$_obj = args._obj,
|
|
5280
5321
|
_obj = _args$_obj === void 0 ? {} : _args$_obj;
|
|
5281
|
-
var
|
|
5322
|
+
var _temp7 = function () {
|
|
5282
5323
|
if (_name === 'contact_number') {
|
|
5283
5324
|
setPersonalInfoInput(_extends({}, personalInfoInput, {
|
|
5284
5325
|
contact_number: _value.trim(),
|
|
@@ -5289,14 +5330,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5289
5330
|
updateError('country_code', _isError, _errorMsg);
|
|
5290
5331
|
updateError('contact_country_code', _isError, _errorMsg);
|
|
5291
5332
|
} else {
|
|
5292
|
-
var
|
|
5333
|
+
var _temp8 = function _temp8() {
|
|
5293
5334
|
var _extends7;
|
|
5294
5335
|
setPersonalInfoInput(_extends({}, personalInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5295
5336
|
updateError(_name, _isError, _errorMsg);
|
|
5296
5337
|
};
|
|
5297
|
-
var
|
|
5338
|
+
var _temp9 = function () {
|
|
5298
5339
|
if (_name === 'profile_pic') {
|
|
5299
|
-
var
|
|
5340
|
+
var _temp10 = function () {
|
|
5300
5341
|
if (_obj.isUpload) {
|
|
5301
5342
|
return Promise.resolve(uploadDocs(_value, _name)).then(function (docsData) {
|
|
5302
5343
|
_value = _value.map(function (_val) {
|
|
@@ -5327,13 +5368,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5327
5368
|
setProfilePicDelete([].concat(profilePicDelete, _deletedFiles));
|
|
5328
5369
|
}
|
|
5329
5370
|
}();
|
|
5330
|
-
if (
|
|
5371
|
+
if (_temp10 && _temp10.then) return _temp10.then(function () {});
|
|
5331
5372
|
}
|
|
5332
5373
|
}();
|
|
5333
|
-
return
|
|
5374
|
+
return _temp9 && _temp9.then ? _temp9.then(_temp8) : _temp8(_temp9);
|
|
5334
5375
|
}
|
|
5335
5376
|
}();
|
|
5336
|
-
return Promise.resolve(
|
|
5377
|
+
return Promise.resolve(_temp7 && _temp7.then ? _temp7.then(_temp6) : _temp6(_temp7));
|
|
5337
5378
|
} catch (e) {
|
|
5338
5379
|
return Promise.reject(e);
|
|
5339
5380
|
}
|
|
@@ -5344,10 +5385,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5344
5385
|
_value = args._value,
|
|
5345
5386
|
_isError = args._isError,
|
|
5346
5387
|
_errorMsg = args._errorMsg;
|
|
5347
|
-
console.log(
|
|
5348
|
-
_name: _name,
|
|
5349
|
-
_value: _value
|
|
5350
|
-
});
|
|
5388
|
+
console.log(_name, _value);
|
|
5351
5389
|
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends8 = {}, _extends8[_name] = _value, _extends8)));
|
|
5352
5390
|
updateError(_name, _isError, _errorMsg);
|
|
5353
5391
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
@@ -5449,7 +5487,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5449
5487
|
};
|
|
5450
5488
|
var onPassportInfoInputChange = function onPassportInfoInputChange(args) {
|
|
5451
5489
|
try {
|
|
5452
|
-
var
|
|
5490
|
+
var _temp14 = function _temp14() {
|
|
5453
5491
|
var _extends18;
|
|
5454
5492
|
setPassportInfoInput(_extends({}, passportInfoInput, (_extends18 = {}, _extends18[_name] = _value, _extends18)));
|
|
5455
5493
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
@@ -5492,9 +5530,9 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5492
5530
|
}
|
|
5493
5531
|
return Promise.resolve();
|
|
5494
5532
|
}
|
|
5495
|
-
var
|
|
5533
|
+
var _temp15 = function () {
|
|
5496
5534
|
if (_name === 'passport_photo' || _name === 'travel_docs') {
|
|
5497
|
-
var
|
|
5535
|
+
var _temp16 = function () {
|
|
5498
5536
|
if (_obj.isUpload) {
|
|
5499
5537
|
var checkAlreadyUploadedFiles = uploadedFiles.filter(function (_file) {
|
|
5500
5538
|
if (_name === 'passport_photo') {
|
|
@@ -5538,10 +5576,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5538
5576
|
setFilesForDelete([].concat(filesForDelete, _deletedFiles));
|
|
5539
5577
|
}
|
|
5540
5578
|
}();
|
|
5541
|
-
if (
|
|
5579
|
+
if (_temp16 && _temp16.then) return _temp16.then(function () {});
|
|
5542
5580
|
}
|
|
5543
5581
|
}();
|
|
5544
|
-
return Promise.resolve(
|
|
5582
|
+
return Promise.resolve(_temp15 && _temp15.then ? _temp15.then(_temp14) : _temp14(_temp15));
|
|
5545
5583
|
} catch (e) {
|
|
5546
5584
|
return Promise.reject(e);
|
|
5547
5585
|
}
|
|
@@ -5635,6 +5673,20 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5635
5673
|
value: '',
|
|
5636
5674
|
label: 'Select employee level'
|
|
5637
5675
|
},
|
|
5676
|
+
manager_id: res.employee_info.manager ? {
|
|
5677
|
+
value: res.employee_info.manager,
|
|
5678
|
+
label: res.employee_info.manager
|
|
5679
|
+
} : {
|
|
5680
|
+
value: '',
|
|
5681
|
+
label: 'Select Manager'
|
|
5682
|
+
},
|
|
5683
|
+
skip_manager_id: res.employee_info.skip_manager ? {
|
|
5684
|
+
value: res.employee_info.skip_manager,
|
|
5685
|
+
label: res.employee_info.skip_manager
|
|
5686
|
+
} : {
|
|
5687
|
+
value: '',
|
|
5688
|
+
label: 'Select Manager'
|
|
5689
|
+
},
|
|
5638
5690
|
employee_id: res.employee_info.employee_id || '',
|
|
5639
5691
|
entity: res.employee_info.entity ? {
|
|
5640
5692
|
value: res.employee_info.entity.id,
|
|
@@ -5867,7 +5919,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5867
5919
|
}, [renderFields.expenseApprovers]);
|
|
5868
5920
|
var uploadDocs = function uploadDocs(docToUpload, type) {
|
|
5869
5921
|
try {
|
|
5870
|
-
var
|
|
5922
|
+
var _temp19 = function _temp19() {
|
|
5871
5923
|
setUploadedFiles([].concat(uploadedFiles, data));
|
|
5872
5924
|
dispatch(stopLoader());
|
|
5873
5925
|
return data;
|
|
@@ -5883,12 +5935,12 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5883
5935
|
userID: editUserId
|
|
5884
5936
|
});
|
|
5885
5937
|
});
|
|
5886
|
-
var
|
|
5938
|
+
var _temp20 = _forTo(docs, function (i) {
|
|
5887
5939
|
return Promise.resolve(dispatch(uploadSingleDocumnet(docs[i]))).then(function (res) {
|
|
5888
5940
|
data.push(res);
|
|
5889
5941
|
});
|
|
5890
5942
|
});
|
|
5891
|
-
return Promise.resolve(
|
|
5943
|
+
return Promise.resolve(_temp20 && _temp20.then ? _temp20.then(_temp19) : _temp19(_temp20));
|
|
5892
5944
|
} catch (e) {
|
|
5893
5945
|
return Promise.reject(e);
|
|
5894
5946
|
}
|
|
@@ -5900,6 +5952,13 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5900
5952
|
IUIToastMessageService$4.warningNotify(checkAnyError);
|
|
5901
5953
|
return Promise.resolve();
|
|
5902
5954
|
}
|
|
5955
|
+
console.log(employeeInfoInput, "data");
|
|
5956
|
+
if (employeeInfoInput.manager_id.value !== '') {
|
|
5957
|
+
employeeInfoInput.manager_id = employeeInfoInput.manager.value;
|
|
5958
|
+
}
|
|
5959
|
+
if (employeeInfoInput.skip_manager_id.value !== '') {
|
|
5960
|
+
employeeInfoInput.skip_manager_id = employeeInfoInput.skip_manager.value;
|
|
5961
|
+
}
|
|
5903
5962
|
var payload = {
|
|
5904
5963
|
personalInfoInput: personalInfoInput,
|
|
5905
5964
|
employeeInfoInput: employeeInfoInput,
|
|
@@ -6044,138 +6103,136 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6044
6103
|
if (_isError) {
|
|
6045
6104
|
setErrorArray(_errorArray);
|
|
6046
6105
|
setErrorMsgs(_errorMsgs);
|
|
6047
|
-
var
|
|
6106
|
+
for (var _key3 in _errorMsgs) {
|
|
6048
6107
|
if (Object.hasOwnProperty.call(_errorMsgs, _key3)) {
|
|
6049
6108
|
if (_errorMsgs[_key3]) {
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6109
|
+
var _ret = function () {
|
|
6110
|
+
if (_key3 in passportInfoInput || _key3 in travelPreferenceInfo || _key3 in secureTravelInputInfo) {
|
|
6111
|
+
setAdditionalInfoFlag('open');
|
|
6112
|
+
}
|
|
6113
|
+
var el = document.getElementById(_key3 === 'country_code' || _key3 === 'contact_country_code' ? 'contact_number' : _key3);
|
|
6114
|
+
if (el) {
|
|
6115
|
+
setTimeout(function () {
|
|
6116
|
+
el.scrollIntoView({
|
|
6117
|
+
behavior: 'smooth',
|
|
6118
|
+
block: 'center'
|
|
6119
|
+
});
|
|
6120
|
+
}, 500);
|
|
6121
|
+
return "break";
|
|
6122
|
+
}
|
|
6123
|
+
}();
|
|
6124
|
+
if (_ret === "break") break;
|
|
6063
6125
|
}
|
|
6064
6126
|
}
|
|
6065
|
-
};
|
|
6066
|
-
for (var _key3 in _errorMsgs) {
|
|
6067
|
-
var _ret = _loop();
|
|
6068
|
-
if (_ret === "break") break;
|
|
6069
6127
|
}
|
|
6070
|
-
return Promise.resolve();
|
|
6071
6128
|
}
|
|
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;
|
|
6129
|
+
if (!_isError) {
|
|
6130
|
+
if (isEditMode && editUserId || isProfile) {
|
|
6131
|
+
dispatch(showLoader());
|
|
6132
|
+
dispatch(updateUser(payload, isProfile ? id : editUserId, inputChangeLog)).then(function (res) {
|
|
6133
|
+
if (isProfile) {
|
|
6134
|
+
var _config$routes, _config$routes$profil, _config$routes$profil2;
|
|
6135
|
+
(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);
|
|
6136
|
+
} else {
|
|
6137
|
+
var _config$routes2, _config$routes2$users, _config$routes2$users2;
|
|
6138
|
+
(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
6139
|
}
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6100
|
-
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6140
|
+
setFilesForDelete([]);
|
|
6141
|
+
setProfilePicDelete([]);
|
|
6142
|
+
})["catch"](function (err) {
|
|
6143
|
+
if (typeof err === 'object') {
|
|
6144
|
+
if (err.country_code) {
|
|
6145
|
+
err.contact_number = err.country_code;
|
|
6146
|
+
}
|
|
6147
|
+
if (err.contact_country_code) {
|
|
6148
|
+
err.contact_number = err.contact_country_code;
|
|
6149
|
+
}
|
|
6150
|
+
if (err.passport) {
|
|
6151
|
+
err.passport_photo = _extends({}, err.passport);
|
|
6152
|
+
delete err.passport;
|
|
6153
|
+
}
|
|
6154
|
+
setErrorArray(Object.keys(err));
|
|
6155
|
+
setErrorMsgs(err);
|
|
6156
|
+
for (var _key4 in err) {
|
|
6157
|
+
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
6158
|
+
if (err[_key4]) {
|
|
6159
|
+
var _ret2 = function () {
|
|
6160
|
+
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
6161
|
+
setAdditionalInfoFlag('open');
|
|
6162
|
+
}
|
|
6163
|
+
var el = document.getElementById(_key4 === 'country_code' || _key4 === 'contact_country_code' ? 'contact_number' : _key4);
|
|
6164
|
+
if (el) {
|
|
6165
|
+
setTimeout(function () {
|
|
6166
|
+
el.scrollIntoView({
|
|
6167
|
+
behavior: 'smooth',
|
|
6168
|
+
block: 'center'
|
|
6169
|
+
});
|
|
6170
|
+
}, 500);
|
|
6171
|
+
return "break";
|
|
6172
|
+
}
|
|
6173
|
+
}();
|
|
6174
|
+
if (_ret2 === "break") break;
|
|
6113
6175
|
}
|
|
6114
6176
|
}
|
|
6115
6177
|
}
|
|
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;
|
|
6178
|
+
} else if (typeof err === 'string') {
|
|
6179
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
6180
|
+
} else {
|
|
6181
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6145
6182
|
}
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6149
|
-
|
|
6150
|
-
|
|
6151
|
-
|
|
6152
|
-
|
|
6153
|
-
|
|
6154
|
-
|
|
6155
|
-
|
|
6156
|
-
|
|
6157
|
-
|
|
6158
|
-
|
|
6159
|
-
|
|
6160
|
-
|
|
6161
|
-
|
|
6162
|
-
|
|
6183
|
+
})["finally"](function () {
|
|
6184
|
+
dispatch(stopLoader());
|
|
6185
|
+
});
|
|
6186
|
+
} else {
|
|
6187
|
+
dispatch(showLoader());
|
|
6188
|
+
dispatch(createUser(payload)).then(function (res) {
|
|
6189
|
+
var _config$routes3, _config$routes3$users, _config$routes3$users2;
|
|
6190
|
+
(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);
|
|
6191
|
+
})["catch"](function (err) {
|
|
6192
|
+
if (typeof err === 'object') {
|
|
6193
|
+
if (err.country_code) {
|
|
6194
|
+
err.contact_number = err.country_code;
|
|
6195
|
+
}
|
|
6196
|
+
if (err.contact_country_code) {
|
|
6197
|
+
err.contact_number = err.contact_country_code;
|
|
6198
|
+
}
|
|
6199
|
+
if (err.passport) {
|
|
6200
|
+
err.passport_photo = _extends({}, err.passport);
|
|
6201
|
+
delete err.passport;
|
|
6202
|
+
}
|
|
6203
|
+
setErrorArray(Object.keys(err));
|
|
6204
|
+
setErrorMsgs(err);
|
|
6205
|
+
for (var _key5 in err) {
|
|
6206
|
+
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
6207
|
+
if (err[_key5]) {
|
|
6208
|
+
var _ret3 = function () {
|
|
6209
|
+
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
6210
|
+
setAdditionalInfoFlag('open');
|
|
6211
|
+
}
|
|
6212
|
+
var el = document.getElementById(_key5 === 'country_code' || _key5 === 'contact_country_code' ? 'contact_number' : _key5);
|
|
6213
|
+
if (el) {
|
|
6214
|
+
setTimeout(function () {
|
|
6215
|
+
el.scrollIntoView({
|
|
6216
|
+
behavior: 'smooth',
|
|
6217
|
+
block: 'center'
|
|
6218
|
+
});
|
|
6219
|
+
}, 500);
|
|
6220
|
+
return "break";
|
|
6221
|
+
}
|
|
6222
|
+
}();
|
|
6223
|
+
if (_ret3 === "break") break;
|
|
6163
6224
|
}
|
|
6164
6225
|
}
|
|
6165
6226
|
}
|
|
6166
|
-
}
|
|
6167
|
-
|
|
6168
|
-
|
|
6169
|
-
|
|
6227
|
+
} else if (typeof err === 'string') {
|
|
6228
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
6229
|
+
} else {
|
|
6230
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6170
6231
|
}
|
|
6171
|
-
}
|
|
6172
|
-
|
|
6173
|
-
}
|
|
6174
|
-
|
|
6175
|
-
}
|
|
6176
|
-
})["finally"](function () {
|
|
6177
|
-
dispatch(stopLoader());
|
|
6178
|
-
});
|
|
6232
|
+
})["finally"](function () {
|
|
6233
|
+
dispatch(stopLoader());
|
|
6234
|
+
});
|
|
6235
|
+
}
|
|
6179
6236
|
}
|
|
6180
6237
|
return Promise.resolve();
|
|
6181
6238
|
} catch (e) {
|
|
@@ -6959,7 +7016,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
6959
7016
|
file: doc
|
|
6960
7017
|
});
|
|
6961
7018
|
});
|
|
6962
|
-
var
|
|
7019
|
+
var _temp2 = _forTo(docs, function (i) {
|
|
6963
7020
|
return Promise.resolve(dispatch(uploadBulkUsersFile(docs[i]))).then(function (res) {
|
|
6964
7021
|
return Promise.resolve(dispatch(validateUploadedFile(res.user_file_name)).then(function (validatedRes) {
|
|
6965
7022
|
if (validatedRes.data.status) {
|
|
@@ -6999,7 +7056,7 @@ var BulkUploadModal = function BulkUploadModal(props) {
|
|
|
6999
7056
|
})).then(function () {});
|
|
7000
7057
|
});
|
|
7001
7058
|
});
|
|
7002
|
-
return Promise.resolve(
|
|
7059
|
+
return Promise.resolve(_temp2 && _temp2.then ? _temp2.then(function () {}) : void 0);
|
|
7003
7060
|
} catch (e) {
|
|
7004
7061
|
return Promise.reject(e);
|
|
7005
7062
|
}
|
|
@@ -8514,6 +8571,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8514
8571
|
endIcon: null,
|
|
8515
8572
|
outlinedBtn: false,
|
|
8516
8573
|
className: "threedotMenuBtn",
|
|
8574
|
+
MoreHorizIcon: true,
|
|
8517
8575
|
placement: "bottom-end"
|
|
8518
8576
|
}));
|
|
8519
8577
|
},
|
|
@@ -8741,8 +8799,10 @@ var UndoButton = function UndoButton(_ref) {
|
|
|
8741
8799
|
};
|
|
8742
8800
|
var UserList = function UserList(_ref2) {
|
|
8743
8801
|
var config = _ref2.config,
|
|
8744
|
-
isProfile = _ref2.isProfile
|
|
8745
|
-
|
|
8802
|
+
isProfile = _ref2.isProfile,
|
|
8803
|
+
_ref2$tabVal = _ref2.tabVal,
|
|
8804
|
+
tabVal = _ref2$tabVal === void 0 ? 'current' : _ref2$tabVal;
|
|
8805
|
+
env$7.init(config, isProfile, tabVal);
|
|
8746
8806
|
var history = useHistory();
|
|
8747
8807
|
var _useSelector = useSelector(function (state) {
|
|
8748
8808
|
return state.userList;
|
|
@@ -8752,15 +8812,18 @@ var UserList = function UserList(_ref2) {
|
|
|
8752
8812
|
deactivatedUsers = _useSelector.deactivatedUsers,
|
|
8753
8813
|
tabValue = _useSelector.tabValue;
|
|
8754
8814
|
var newSelecteds = userListInfo.results;
|
|
8755
|
-
var _React$useState = React.useState(
|
|
8756
|
-
|
|
8757
|
-
|
|
8758
|
-
var _React$useState2 = React.useState(
|
|
8759
|
-
|
|
8760
|
-
|
|
8761
|
-
var _React$useState3 = React.useState(
|
|
8762
|
-
|
|
8763
|
-
|
|
8815
|
+
var _React$useState = React.useState(0),
|
|
8816
|
+
activeTab = _React$useState[0],
|
|
8817
|
+
setActiveTab = _React$useState[1];
|
|
8818
|
+
var _React$useState2 = React.useState(''),
|
|
8819
|
+
deactivateUser = _React$useState2[0],
|
|
8820
|
+
setDeactivateUser = _React$useState2[1];
|
|
8821
|
+
var _React$useState3 = React.useState(null),
|
|
8822
|
+
defaultId = _React$useState3[0],
|
|
8823
|
+
setDefaultId = _React$useState3[1];
|
|
8824
|
+
var _React$useState4 = React.useState(1),
|
|
8825
|
+
page = _React$useState4[0],
|
|
8826
|
+
setPage = _React$useState4[1];
|
|
8764
8827
|
var _useState = useState([]),
|
|
8765
8828
|
selectedUsersNotApprover = _useState[0],
|
|
8766
8829
|
setSelectedUsersNotApprover = _useState[1];
|
|
@@ -8770,24 +8833,24 @@ var UserList = function UserList(_ref2) {
|
|
|
8770
8833
|
var _useState3 = useState(false),
|
|
8771
8834
|
isBulkDeactivateModalOpen = _useState3[0],
|
|
8772
8835
|
setIsBulkDeactivateModalOpen = _useState3[1];
|
|
8773
|
-
var _React$
|
|
8774
|
-
user = _React$
|
|
8775
|
-
setUser = _React$
|
|
8836
|
+
var _React$useState5 = React.useState(''),
|
|
8837
|
+
user = _React$useState5[0],
|
|
8838
|
+
setUser = _React$useState5[1];
|
|
8776
8839
|
var _useState4 = useState(10),
|
|
8777
8840
|
rowsPerPage = _useState4[0],
|
|
8778
8841
|
setRowsPerPage = _useState4[1];
|
|
8779
|
-
var _React$
|
|
8780
|
-
selected = _React$
|
|
8781
|
-
setSelected = _React$
|
|
8782
|
-
var _React$
|
|
8783
|
-
order = _React$
|
|
8784
|
-
setOrder = _React$
|
|
8785
|
-
var _React$
|
|
8786
|
-
deactivateSingle = _React$
|
|
8787
|
-
setDeactivateSingle = _React$
|
|
8788
|
-
var _React$
|
|
8789
|
-
orderBy = _React$
|
|
8790
|
-
setOrderBy = _React$
|
|
8842
|
+
var _React$useState6 = React.useState({}),
|
|
8843
|
+
selected = _React$useState6[0],
|
|
8844
|
+
setSelected = _React$useState6[1];
|
|
8845
|
+
var _React$useState7 = React.useState('asc'),
|
|
8846
|
+
order = _React$useState7[0],
|
|
8847
|
+
setOrder = _React$useState7[1];
|
|
8848
|
+
var _React$useState8 = React.useState(false),
|
|
8849
|
+
deactivateSingle = _React$useState8[0],
|
|
8850
|
+
setDeactivateSingle = _React$useState8[1];
|
|
8851
|
+
var _React$useState9 = React.useState('first_name'),
|
|
8852
|
+
orderBy = _React$useState9[0],
|
|
8853
|
+
setOrderBy = _React$useState9[1];
|
|
8791
8854
|
var _useState5 = useState(''),
|
|
8792
8855
|
searchValue = _useState5[0],
|
|
8793
8856
|
setSearchValue = _useState5[1];
|
|
@@ -8837,9 +8900,9 @@ var UserList = function UserList(_ref2) {
|
|
|
8837
8900
|
var _useState17 = useState(''),
|
|
8838
8901
|
userIds = _useState17[0],
|
|
8839
8902
|
setUserIds = _useState17[1];
|
|
8840
|
-
var _React$
|
|
8841
|
-
overlayMenu = _React$
|
|
8842
|
-
setOverlayMenu = _React$
|
|
8903
|
+
var _React$useState10 = React.useState(false),
|
|
8904
|
+
overlayMenu = _React$useState10[0],
|
|
8905
|
+
setOverlayMenu = _React$useState10[1];
|
|
8843
8906
|
var _useState18 = useState(''),
|
|
8844
8907
|
userFirstName = _useState18[0],
|
|
8845
8908
|
setUserFirstName = _useState18[1];
|
|
@@ -8849,6 +8912,14 @@ var UserList = function UserList(_ref2) {
|
|
|
8849
8912
|
var _useState20 = useState(true),
|
|
8850
8913
|
isDisabledSubmitBtn = _useState20[0],
|
|
8851
8914
|
setIsDisabledSubmitBtn = _useState20[1];
|
|
8915
|
+
useEffect(function () {
|
|
8916
|
+
setActiveTab(tabValue);
|
|
8917
|
+
}, [tabValue]);
|
|
8918
|
+
useEffect(function () {
|
|
8919
|
+
if (tabVal === 'sign-up') {
|
|
8920
|
+
dispatch(updateTabValue(1));
|
|
8921
|
+
}
|
|
8922
|
+
}, []);
|
|
8852
8923
|
useScrollPosition(function (_ref3) {
|
|
8853
8924
|
var prevPos = _ref3.prevPos,
|
|
8854
8925
|
currPos = _ref3.currPos;
|
|
@@ -8869,18 +8940,18 @@ var UserList = function UserList(_ref2) {
|
|
|
8869
8940
|
behavior: 'smooth'
|
|
8870
8941
|
});
|
|
8871
8942
|
};
|
|
8872
|
-
var _React$
|
|
8873
|
-
signup_page = _React$
|
|
8874
|
-
setSignUpPage = _React$
|
|
8943
|
+
var _React$useState11 = React.useState(1),
|
|
8944
|
+
signup_page = _React$useState11[0],
|
|
8945
|
+
setSignUpPage = _React$useState11[1];
|
|
8875
8946
|
var _useState21 = useState(5),
|
|
8876
8947
|
signup_rowsPerPage = _useState21[0],
|
|
8877
8948
|
setSignUpRowsPerPage = _useState21[1];
|
|
8878
|
-
var _React$
|
|
8879
|
-
signup_order = _React$
|
|
8880
|
-
setSignUpOrder = _React$
|
|
8881
|
-
var _React$
|
|
8882
|
-
signup_orderBy = _React$
|
|
8883
|
-
setSignUpOrderBy = _React$
|
|
8949
|
+
var _React$useState12 = React.useState('asc'),
|
|
8950
|
+
signup_order = _React$useState12[0],
|
|
8951
|
+
setSignUpOrder = _React$useState12[1];
|
|
8952
|
+
var _React$useState13 = React.useState('fname'),
|
|
8953
|
+
signup_orderBy = _React$useState13[0],
|
|
8954
|
+
setSignUpOrderBy = _React$useState13[1];
|
|
8884
8955
|
var _useState22 = useState(''),
|
|
8885
8956
|
signup_searchValue = _useState22[0],
|
|
8886
8957
|
set_signup_SearchValue = _useState22[1];
|
|
@@ -9263,6 +9334,9 @@ var UserList = function UserList(_ref2) {
|
|
|
9263
9334
|
userId: userId
|
|
9264
9335
|
}));
|
|
9265
9336
|
};
|
|
9337
|
+
var knowMore = function knowMore() {
|
|
9338
|
+
window.open('https://itilite.notion.site/All-about-deactivating-users-77554de1fb494832ac7e344ca14277f0', '_blank');
|
|
9339
|
+
};
|
|
9266
9340
|
var dispatch = useDispatch();
|
|
9267
9341
|
useEffect(function () {
|
|
9268
9342
|
if (isTokenVerified === true) {
|
|
@@ -9459,7 +9533,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9459
9533
|
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9460
9534
|
className: styles$5.tablewrapper
|
|
9461
9535
|
}, /*#__PURE__*/React.createElement(IUITabs, {
|
|
9462
|
-
value:
|
|
9536
|
+
value: activeTab,
|
|
9463
9537
|
customTabHandler: function customTabHandler(value) {
|
|
9464
9538
|
return dispatch(updateTabValue(value));
|
|
9465
9539
|
},
|
|
@@ -9514,8 +9588,7 @@ var UserList = function UserList(_ref2) {
|
|
|
9514
9588
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
9515
9589
|
variant: "body2",
|
|
9516
9590
|
className: clsx(styles$5.description)
|
|
9517
|
-
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in", ' ', /*#__PURE__*/React.createElement(
|
|
9518
|
-
variant: "span",
|
|
9591
|
+
}, "Verify and add users to allow them to start using ITILITE. Set up preferences for receiving sign up request updates in", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9519
9592
|
onClick: config.routes.notification && redirectToNotifications,
|
|
9520
9593
|
className: clsx(config.routes.notification && 'iui__cursor-pointer iui__border--bottom_solid_black500-1')
|
|
9521
9594
|
}, "Notifications"))), /*#__PURE__*/React.createElement(SingupRequests, {
|
|
@@ -9573,7 +9646,12 @@ var UserList = function UserList(_ref2) {
|
|
|
9573
9646
|
}, /*#__PURE__*/React.createElement(InfoYellowIcon, {
|
|
9574
9647
|
width: "9",
|
|
9575
9648
|
height: "9"
|
|
9576
|
-
}), /*#__PURE__*/React.createElement(IUITypography,
|
|
9649
|
+
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9650
|
+
variant: "body2"
|
|
9651
|
+
}, /*#__PURE__*/React.createElement("b", null, deactivateUser), " is linked with following role. You can deactivate only once you transfer the role to another user. The changes will reflect subsequently.", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9652
|
+
onClick: knowMore,
|
|
9653
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9654
|
+
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9577
9655
|
className: "iui__mt-15"
|
|
9578
9656
|
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
9579
9657
|
isMove: true,
|
|
@@ -9639,7 +9717,12 @@ var UserList = function UserList(_ref2) {
|
|
|
9639
9717
|
}, /*#__PURE__*/React.createElement(RedWarningIcon, {
|
|
9640
9718
|
color: "#9A6700",
|
|
9641
9719
|
size: "14"
|
|
9642
|
-
}), /*#__PURE__*/React.createElement(IUITypography,
|
|
9720
|
+
}), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9721
|
+
variant: "body2"
|
|
9722
|
+
}, "Some users are linked with approval roles. Deactivating these users will result in missing roles and approvers. Deactivate these users individually and transfer their roles to avoid missing roles. The changes will reflect subsequently.", ' ', /*#__PURE__*/React.createElement("span", {
|
|
9723
|
+
onClick: knowMore,
|
|
9724
|
+
className: "iui__cursor-pointer iui__border--bottom_solid_black500-1"
|
|
9725
|
+
}, "Know more"))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9643
9726
|
className: "iui__my-15"
|
|
9644
9727
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9645
9728
|
className: "iui__font--para-large iui__font--weight-medium"
|