@itilite/iui-user-management 0.4.38 → 0.4.40
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 +114 -102
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +114 -102
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -5230,10 +5230,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5230
5230
|
_value = args._value,
|
|
5231
5231
|
_isError = args._isError,
|
|
5232
5232
|
_errorMsg = args._errorMsg;
|
|
5233
|
-
console.log({
|
|
5234
|
-
_name: _name,
|
|
5235
|
-
_value: _value
|
|
5236
|
-
});
|
|
5237
5233
|
setEmployeeInfoInput(_extends({}, employeeInfoInput, (_extends7 = {}, _extends7[_name] = _value, _extends7)));
|
|
5238
5234
|
updateError(_name, _isError, _errorMsg);
|
|
5239
5235
|
if (Object.hasOwnProperty.call(inputChangeLog, _name)) {
|
|
@@ -5520,6 +5516,20 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5520
5516
|
value: '',
|
|
5521
5517
|
label: 'Select employee level'
|
|
5522
5518
|
},
|
|
5519
|
+
manager: res.manager_info.manager !== '' ? {
|
|
5520
|
+
value: res.manager_info.manager,
|
|
5521
|
+
label: res.manager_info.manager
|
|
5522
|
+
} : {
|
|
5523
|
+
value: '',
|
|
5524
|
+
label: 'Select Manager'
|
|
5525
|
+
},
|
|
5526
|
+
skip_manager: res.manager_info.skip_manager !== '' ? {
|
|
5527
|
+
value: res.manager_info.skip_manager,
|
|
5528
|
+
label: res.manager_info.skip_manager
|
|
5529
|
+
} : {
|
|
5530
|
+
value: '',
|
|
5531
|
+
label: 'Select Manager'
|
|
5532
|
+
},
|
|
5523
5533
|
employee_id: res.employee_info.employee_id || '',
|
|
5524
5534
|
entity: res.employee_info.entity ? {
|
|
5525
5535
|
value: res.employee_info.entity.id,
|
|
@@ -5965,111 +5975,113 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5965
5975
|
}
|
|
5966
5976
|
}
|
|
5967
5977
|
}
|
|
5968
|
-
if (
|
|
5969
|
-
|
|
5970
|
-
|
|
5971
|
-
|
|
5972
|
-
|
|
5973
|
-
|
|
5974
|
-
|
|
5975
|
-
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
setFilesForDelete([]);
|
|
5979
|
-
setProfilePicDelete([]);
|
|
5980
|
-
})["catch"](function (err) {
|
|
5981
|
-
if (typeof err === 'object') {
|
|
5982
|
-
if (err.country_code) {
|
|
5983
|
-
err.contact_number = err.country_code;
|
|
5984
|
-
}
|
|
5985
|
-
if (err.contact_country_code) {
|
|
5986
|
-
err.contact_number = err.contact_country_code;
|
|
5987
|
-
}
|
|
5988
|
-
if (err.passport) {
|
|
5989
|
-
err.passport_photo = _extends({}, err.passport);
|
|
5990
|
-
delete err.passport;
|
|
5978
|
+
if (!_isError) {
|
|
5979
|
+
if (isEditMode && editUserId || isProfile) {
|
|
5980
|
+
dispatch(showLoader());
|
|
5981
|
+
dispatch(updateUser(payload, isProfile ? id : editUserId, inputChangeLog)).then(function (res) {
|
|
5982
|
+
if (isProfile) {
|
|
5983
|
+
var _config$routes, _config$routes$profil, _config$routes$profil2;
|
|
5984
|
+
(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);
|
|
5985
|
+
} else {
|
|
5986
|
+
var _config$routes2, _config$routes2$users, _config$routes2$users2;
|
|
5987
|
+
(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);
|
|
5991
5988
|
}
|
|
5992
|
-
|
|
5993
|
-
|
|
5994
|
-
|
|
5995
|
-
|
|
5996
|
-
|
|
5997
|
-
|
|
5998
|
-
|
|
5999
|
-
|
|
6000
|
-
|
|
6001
|
-
|
|
6002
|
-
|
|
6003
|
-
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
5989
|
+
setFilesForDelete([]);
|
|
5990
|
+
setProfilePicDelete([]);
|
|
5991
|
+
})["catch"](function (err) {
|
|
5992
|
+
if (typeof err === 'object') {
|
|
5993
|
+
if (err.country_code) {
|
|
5994
|
+
err.contact_number = err.country_code;
|
|
5995
|
+
}
|
|
5996
|
+
if (err.contact_country_code) {
|
|
5997
|
+
err.contact_number = err.contact_country_code;
|
|
5998
|
+
}
|
|
5999
|
+
if (err.passport) {
|
|
6000
|
+
err.passport_photo = _extends({}, err.passport);
|
|
6001
|
+
delete err.passport;
|
|
6002
|
+
}
|
|
6003
|
+
setErrorArray(Object.keys(err));
|
|
6004
|
+
setErrorMsgs(err);
|
|
6005
|
+
for (var _key4 in err) {
|
|
6006
|
+
if (Object.hasOwnProperty.call(err, _key4)) {
|
|
6007
|
+
if (err[_key4]) {
|
|
6008
|
+
var _ret2 = function () {
|
|
6009
|
+
if (_key4 in passportInfoInput || _key4 in travelPreferenceInfo || _key4 in secureTravelInputInfo) {
|
|
6010
|
+
setAdditionalInfoFlag('open');
|
|
6011
|
+
}
|
|
6012
|
+
var el = document.getElementById(_key4 === 'country_code' || _key4 === 'contact_country_code' ? 'contact_number' : _key4);
|
|
6013
|
+
if (el) {
|
|
6014
|
+
setTimeout(function () {
|
|
6015
|
+
el.scrollIntoView({
|
|
6016
|
+
behavior: 'smooth',
|
|
6017
|
+
block: 'center'
|
|
6018
|
+
});
|
|
6019
|
+
}, 500);
|
|
6020
|
+
return "break";
|
|
6021
|
+
}
|
|
6022
|
+
}();
|
|
6023
|
+
if (_ret2 === "break") break;
|
|
6024
|
+
}
|
|
6013
6025
|
}
|
|
6014
6026
|
}
|
|
6027
|
+
} else if (typeof err === 'string') {
|
|
6028
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
6029
|
+
} else {
|
|
6030
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6015
6031
|
}
|
|
6016
|
-
}
|
|
6017
|
-
|
|
6018
|
-
}
|
|
6019
|
-
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
err.
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6045
|
-
|
|
6046
|
-
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
return "break";
|
|
6059
|
-
}
|
|
6060
|
-
}();
|
|
6061
|
-
if (_ret3 === "break") break;
|
|
6032
|
+
})["finally"](function () {
|
|
6033
|
+
dispatch(stopLoader());
|
|
6034
|
+
});
|
|
6035
|
+
} else {
|
|
6036
|
+
dispatch(showLoader());
|
|
6037
|
+
dispatch(createUser(payload)).then(function (res) {
|
|
6038
|
+
var _config$routes3, _config$routes3$users, _config$routes3$users2;
|
|
6039
|
+
(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);
|
|
6040
|
+
})["catch"](function (err) {
|
|
6041
|
+
if (typeof err === 'object') {
|
|
6042
|
+
if (err.country_code) {
|
|
6043
|
+
err.contact_number = err.country_code;
|
|
6044
|
+
}
|
|
6045
|
+
if (err.contact_country_code) {
|
|
6046
|
+
err.contact_number = err.contact_country_code;
|
|
6047
|
+
}
|
|
6048
|
+
if (err.passport) {
|
|
6049
|
+
err.passport_photo = _extends({}, err.passport);
|
|
6050
|
+
delete err.passport;
|
|
6051
|
+
}
|
|
6052
|
+
setErrorArray(Object.keys(err));
|
|
6053
|
+
setErrorMsgs(err);
|
|
6054
|
+
for (var _key5 in err) {
|
|
6055
|
+
if (Object.hasOwnProperty.call(err, _key5)) {
|
|
6056
|
+
if (err[_key5]) {
|
|
6057
|
+
var _ret3 = function () {
|
|
6058
|
+
if (_key5 in passportInfoInput || _key5 in travelPreferenceInfo || _key5 in secureTravelInputInfo) {
|
|
6059
|
+
setAdditionalInfoFlag('open');
|
|
6060
|
+
}
|
|
6061
|
+
var el = document.getElementById(_key5 === 'country_code' || _key5 === 'contact_country_code' ? 'contact_number' : _key5);
|
|
6062
|
+
if (el) {
|
|
6063
|
+
setTimeout(function () {
|
|
6064
|
+
el.scrollIntoView({
|
|
6065
|
+
behavior: 'smooth',
|
|
6066
|
+
block: 'center'
|
|
6067
|
+
});
|
|
6068
|
+
}, 500);
|
|
6069
|
+
return "break";
|
|
6070
|
+
}
|
|
6071
|
+
}();
|
|
6072
|
+
if (_ret3 === "break") break;
|
|
6073
|
+
}
|
|
6062
6074
|
}
|
|
6063
6075
|
}
|
|
6076
|
+
} else if (typeof err === 'string') {
|
|
6077
|
+
IUIToastMessageService$4.warningNotify(err);
|
|
6078
|
+
} else {
|
|
6079
|
+
IUIToastMessageService$4.warningNotify('Opps, Something went wrong.');
|
|
6064
6080
|
}
|
|
6065
|
-
}
|
|
6066
|
-
|
|
6067
|
-
}
|
|
6068
|
-
|
|
6069
|
-
}
|
|
6070
|
-
})["finally"](function () {
|
|
6071
|
-
dispatch(stopLoader());
|
|
6072
|
-
});
|
|
6081
|
+
})["finally"](function () {
|
|
6082
|
+
dispatch(stopLoader());
|
|
6083
|
+
});
|
|
6084
|
+
}
|
|
6073
6085
|
}
|
|
6074
6086
|
return Promise.resolve();
|
|
6075
6087
|
} catch (e) {
|