@itilite/iui-user-management 0.0.18 → 0.0.20
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 +1 -1
- package/dist/index.js +18 -113
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +18 -113
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -2
package/dist/index.modern.js
CHANGED
|
@@ -219,9 +219,6 @@ var userAddEditUrl = {
|
|
|
219
219
|
},
|
|
220
220
|
verifyUserInfo: function verifyUserInfo(userId) {
|
|
221
221
|
return "api/v1/onboarding/user-sign-up-info/" + userId + "?company_id=" + IUILocalStorageService.getCompanyId();
|
|
222
|
-
},
|
|
223
|
-
rejectUserVerification: function rejectUserVerification(userId) {
|
|
224
|
-
return "api/v1/onboarding/user-signup-reject/" + userId;
|
|
225
222
|
}
|
|
226
223
|
};
|
|
227
224
|
var userListUrl = {
|
|
@@ -323,51 +320,6 @@ var commonLoadOptions = function commonLoadOptions(search, loadedOptions, _ref)
|
|
|
323
320
|
return Promise.reject(e);
|
|
324
321
|
}
|
|
325
322
|
};
|
|
326
|
-
var commonLoadOptionsUM = function commonLoadOptionsUM(search, loadedOptions, _ref2) {
|
|
327
|
-
var page = _ref2.page,
|
|
328
|
-
tabelName = _ref2.tabelName,
|
|
329
|
-
placeholder = _ref2.placeholder,
|
|
330
|
-
defaultData = _ref2.defaultData;
|
|
331
|
-
|
|
332
|
-
try {
|
|
333
|
-
return Promise.resolve(_catch(function () {
|
|
334
|
-
var url = userAddEditUrl.dropdownList() + ("?page=" + page + "&table_name=" + tabelName + "&search=" + search);
|
|
335
|
-
return Promise.resolve(api.get(url).then(function (res) {
|
|
336
|
-
return res.data;
|
|
337
|
-
})).then(function (response) {
|
|
338
|
-
var arrList = response.results.filter(function (item) {
|
|
339
|
-
return item.name !== defaultData;
|
|
340
|
-
});
|
|
341
|
-
var mappedValue = arrList.map(function (item) {
|
|
342
|
-
return {
|
|
343
|
-
value: item.id,
|
|
344
|
-
label: item.name
|
|
345
|
-
};
|
|
346
|
-
});
|
|
347
|
-
return {
|
|
348
|
-
options: mappedValue,
|
|
349
|
-
hasMore: !!response.next,
|
|
350
|
-
additional: {
|
|
351
|
-
page: page + 1,
|
|
352
|
-
tabelName: tabelName
|
|
353
|
-
}
|
|
354
|
-
};
|
|
355
|
-
});
|
|
356
|
-
}, function () {
|
|
357
|
-
return {
|
|
358
|
-
options: [],
|
|
359
|
-
hasMore: false,
|
|
360
|
-
additional: {
|
|
361
|
-
page: 1,
|
|
362
|
-
tabelName: tabelName,
|
|
363
|
-
placeholder: placeholder
|
|
364
|
-
}
|
|
365
|
-
};
|
|
366
|
-
}));
|
|
367
|
-
} catch (e) {
|
|
368
|
-
return Promise.reject(e);
|
|
369
|
-
}
|
|
370
|
-
};
|
|
371
323
|
var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _ref3) {
|
|
372
324
|
var page = _ref3.page;
|
|
373
325
|
|
|
@@ -1789,12 +1741,12 @@ var addTravelApproverField = function addTravelApproverField() {
|
|
|
1789
1741
|
return new Promise(function (resolve, reject) {
|
|
1790
1742
|
var _travelApprovers = getState().userAddEdit.renderFields.travelApprovers;
|
|
1791
1743
|
var sNo = _travelApprovers.length + 1;
|
|
1792
|
-
var label = "Travel
|
|
1744
|
+
var label = "Travel person " + sNo;
|
|
1793
1745
|
|
|
1794
1746
|
_travelApprovers.forEach(function (approver) {
|
|
1795
1747
|
if (approver.label === label) {
|
|
1796
1748
|
sNo++;
|
|
1797
|
-
label = "Travel
|
|
1749
|
+
label = "Travel person " + sNo;
|
|
1798
1750
|
}
|
|
1799
1751
|
});
|
|
1800
1752
|
|
|
@@ -1833,12 +1785,12 @@ var addExpenseApproverField = function addExpenseApproverField() {
|
|
|
1833
1785
|
return new Promise(function (resolve, reject) {
|
|
1834
1786
|
var _expenseApprovers = getState().userAddEdit.renderFields.expenseApprovers;
|
|
1835
1787
|
var sNo = _expenseApprovers.length + 1;
|
|
1836
|
-
var label = "Expense
|
|
1788
|
+
var label = "Expense person " + sNo;
|
|
1837
1789
|
|
|
1838
1790
|
_expenseApprovers.forEach(function (approver) {
|
|
1839
1791
|
if (approver.label === label) {
|
|
1840
1792
|
sNo++;
|
|
1841
|
-
label = "Expense
|
|
1793
|
+
label = "Expense person " + sNo;
|
|
1842
1794
|
}
|
|
1843
1795
|
});
|
|
1844
1796
|
|
|
@@ -2135,33 +2087,6 @@ var verifyUserInfo = function verifyUserInfo(userId) {
|
|
|
2135
2087
|
});
|
|
2136
2088
|
};
|
|
2137
2089
|
};
|
|
2138
|
-
var rejectUserVerification = function rejectUserVerification(userId) {
|
|
2139
|
-
return function (dispatch) {
|
|
2140
|
-
return new Promise(function (resolve, reject) {
|
|
2141
|
-
api$1.get(userAddEditUrl.rejectUserVerification(userId)).then(function (res) {
|
|
2142
|
-
console.log(res);
|
|
2143
|
-
|
|
2144
|
-
if (res.data.status === true) {
|
|
2145
|
-
var _res$data5;
|
|
2146
|
-
|
|
2147
|
-
IUIToastMessageService.sNotify((res === null || res === void 0 ? void 0 : (_res$data5 = res.data) === null || _res$data5 === void 0 ? void 0 : _res$data5.message) || 'User rejected successfully.');
|
|
2148
|
-
resolve(res.data);
|
|
2149
|
-
} else {
|
|
2150
|
-
var _res$data6;
|
|
2151
|
-
|
|
2152
|
-
IUIToastMessageService.warningNotify((res === null || res === void 0 ? void 0 : (_res$data6 = res.data) === null || _res$data6 === void 0 ? void 0 : _res$data6.message) || 'Opps, Unable to reject user.');
|
|
2153
|
-
reject(res);
|
|
2154
|
-
}
|
|
2155
|
-
})["catch"](function (err) {
|
|
2156
|
-
var _err$response10, _err$response10$data;
|
|
2157
|
-
|
|
2158
|
-
console.log(err);
|
|
2159
|
-
IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$response10 = err.response) === null || _err$response10 === void 0 ? void 0 : (_err$response10$data = _err$response10.data) === null || _err$response10$data === void 0 ? void 0 : _err$response10$data.message) || 'Opps, Unable to reject user.');
|
|
2160
|
-
reject(err);
|
|
2161
|
-
});
|
|
2162
|
-
});
|
|
2163
|
-
};
|
|
2164
|
-
};
|
|
2165
2090
|
|
|
2166
2091
|
var SHOW_LOADER$1 = 'SHOW_LOADER';
|
|
2167
2092
|
var STOP_LOADER$1 = 'STOP_LOADER';
|
|
@@ -2846,13 +2771,13 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2846
2771
|
var rgx = null;
|
|
2847
2772
|
|
|
2848
2773
|
if (type === 'travel') {
|
|
2849
|
-
rgx = /^(travel
|
|
2774
|
+
rgx = /^(travel person)( )[0-9]*$/i;
|
|
2850
2775
|
} else {
|
|
2851
|
-
rgx = /^(expense
|
|
2776
|
+
rgx = /^(expense person)( )[0-9]*$/i;
|
|
2852
2777
|
}
|
|
2853
2778
|
|
|
2854
|
-
if (editedLabel.approvers[i].label.match(rgx) && editedLabel.approvers[i].label.toLowerCase() !== type.toLowerCase() + "
|
|
2855
|
-
_errMsg[editedLabel.approvers[i].indexAt] = "Can't update '" + (type === 'travel' ? 'Travel' : 'Expense') + "
|
|
2779
|
+
if (editedLabel.approvers[i].label.match(rgx) && editedLabel.approvers[i].label.toLowerCase() !== type.toLowerCase() + " person " + (editedLabel.approvers[i].indexAt + 1)) {
|
|
2780
|
+
_errMsg[editedLabel.approvers[i].indexAt] = "Can't update '" + (type === 'travel' ? 'Travel' : 'Expense') + " person " + (editedLabel.approvers[i].indexAt + 1) + "' to '" + editedLabel.approvers[i].label + "'";
|
|
2856
2781
|
|
|
2857
2782
|
if (!hasError) {
|
|
2858
2783
|
hasError = true;
|
|
@@ -2967,10 +2892,10 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2967
2892
|
return null;
|
|
2968
2893
|
}
|
|
2969
2894
|
|
|
2970
|
-
if (p.label.toLowerCase() === type + "
|
|
2895
|
+
if (p.label.toLowerCase() === type + " person " + (i + 1)) {
|
|
2971
2896
|
p.secondaryLabel = '';
|
|
2972
2897
|
} else {
|
|
2973
|
-
p.secondaryLabel = type + "
|
|
2898
|
+
p.secondaryLabel = type + " person " + (i + 1);
|
|
2974
2899
|
}
|
|
2975
2900
|
|
|
2976
2901
|
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
@@ -3086,7 +3011,7 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
3086
3011
|
className: styles.fieldMargin
|
|
3087
3012
|
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
3088
3013
|
defaultValue: p.label,
|
|
3089
|
-
label: (type === 'travel' ? 'Travel' : 'Expense') + "
|
|
3014
|
+
label: (type === 'travel' ? 'Travel' : 'Expense') + " person " + (i + 1),
|
|
3090
3015
|
className: styles.inputWidth,
|
|
3091
3016
|
id: type + '_' + p.sequence,
|
|
3092
3017
|
name: type + '_' + p.sequence,
|
|
@@ -5455,7 +5380,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5455
5380
|
userTagType: userTagType
|
|
5456
5381
|
};
|
|
5457
5382
|
|
|
5458
|
-
if (verifyUserId
|
|
5383
|
+
if (verifyUserId) {
|
|
5459
5384
|
payload.verifyUserId = verifyUserId;
|
|
5460
5385
|
}
|
|
5461
5386
|
|
|
@@ -5775,10 +5700,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5775
5700
|
window.location.href = config.routes.profile.redirectUrl.cancel;
|
|
5776
5701
|
}
|
|
5777
5702
|
}
|
|
5778
|
-
} else if (verifyUserId
|
|
5703
|
+
} else if (verifyUserId) {
|
|
5779
5704
|
var _config$routes4, _config$routes4$signu, _config$routes4$signu2;
|
|
5780
5705
|
|
|
5781
|
-
(config === null || config === void 0 ? void 0 : (_config$routes4 = config.routes) === null || _config$routes4 === void 0 ? void 0 : (_config$routes4$signu = _config$routes4.signupRequest) === null || _config$routes4$signu === void 0 ? void 0 : (_config$routes4$signu2 = _config$routes4$signu.list) === null || _config$routes4$signu2 === void 0 ? void 0 : _config$routes4$signu2.path) &&
|
|
5706
|
+
(config === null || config === void 0 ? void 0 : (_config$routes4 = config.routes) === null || _config$routes4 === void 0 ? void 0 : (_config$routes4$signu = _config$routes4.signupRequest) === null || _config$routes4$signu === void 0 ? void 0 : (_config$routes4$signu2 = _config$routes4$signu.list) === null || _config$routes4$signu2 === void 0 ? void 0 : _config$routes4$signu2.path) && history.push(config.routes.signupRequest.list.path);
|
|
5782
5707
|
} else {
|
|
5783
5708
|
var _config$routes5, _config$routes5$users, _config$routes5$users2;
|
|
5784
5709
|
|
|
@@ -5803,7 +5728,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5803
5728
|
};
|
|
5804
5729
|
|
|
5805
5730
|
var getUserInfoForVerification = function getUserInfoForVerification() {
|
|
5806
|
-
if (verifyUserId
|
|
5731
|
+
if (verifyUserId) {
|
|
5807
5732
|
dispatch(showLoader());
|
|
5808
5733
|
dispatch(verifyUserInfo(verifyUserId)).then(function (res) {
|
|
5809
5734
|
console.log(res);
|
|
@@ -5906,19 +5831,6 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5906
5831
|
}
|
|
5907
5832
|
};
|
|
5908
5833
|
|
|
5909
|
-
var handleSignUpRequestRejection = function handleSignUpRequestRejection() {
|
|
5910
|
-
if (verifyUserId && isILadmin) {
|
|
5911
|
-
dispatch(showLoader());
|
|
5912
|
-
dispatch(rejectUserVerification(verifyUserId)).then(function (res) {
|
|
5913
|
-
setTimeout(function () {
|
|
5914
|
-
window.location.assign(config.routes.signupRequest.list.path);
|
|
5915
|
-
}, 1500);
|
|
5916
|
-
})["finally"](function () {
|
|
5917
|
-
dispatch(stopLoader());
|
|
5918
|
-
});
|
|
5919
|
-
}
|
|
5920
|
-
};
|
|
5921
|
-
|
|
5922
5834
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
5923
5835
|
component: "div",
|
|
5924
5836
|
className: styles.UUIUserManagementAddEdit
|
|
@@ -5935,7 +5847,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5935
5847
|
className: styles.breadcrumb
|
|
5936
5848
|
}, /*#__PURE__*/React.createElement(IUIBreadCrumb, {
|
|
5937
5849
|
breadCrumbs: [{
|
|
5938
|
-
href: verifyUserId
|
|
5850
|
+
href: verifyUserId ? config.routes.signupRequest.list.path : config.routes.users.list.path,
|
|
5939
5851
|
label: 'Users',
|
|
5940
5852
|
hasLink: true
|
|
5941
5853
|
}]
|
|
@@ -5970,14 +5882,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5970
5882
|
type: "contained",
|
|
5971
5883
|
onClick: formSubmitHandler,
|
|
5972
5884
|
disabled: isPageLoading || productAccess.travel === false && productAccess.expense === false || !!doesFormHasError()
|
|
5973
|
-
})),
|
|
5974
|
-
component: "div",
|
|
5975
|
-
className: clsx(styles.buttonSingle, styles.buttonLeft)
|
|
5976
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
5977
|
-
buttonText: "Reject",
|
|
5978
|
-
type: "outlined",
|
|
5979
|
-
onClick: handleSignUpRequestRejection
|
|
5980
|
-
})) : null))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
5885
|
+
}))))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
5981
5886
|
component: "div",
|
|
5982
5887
|
marginTop: "8rem",
|
|
5983
5888
|
flexDirection: "column"
|
|
@@ -8853,7 +8758,7 @@ function MoveUserDialog(_ref) {
|
|
|
8853
8758
|
name: name,
|
|
8854
8759
|
isMove: isMove,
|
|
8855
8760
|
customSelectHandler: customSelectHandler,
|
|
8856
|
-
loadOption:
|
|
8761
|
+
loadOption: commonLoadOptions,
|
|
8857
8762
|
isError: isError,
|
|
8858
8763
|
errorMsg: "Please select " + (name === null || name === void 0 ? void 0 : name.toLowerCase()) + ".",
|
|
8859
8764
|
placeHolderCheck: name !== undefined && name === ''
|