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