@itilite/iui-user-management 0.2.0 → 0.2.1
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 +120 -22
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +120 -22
- package/dist/index.modern.js.map +1 -1
- package/package.json +1 -1
package/dist/index.modern.js
CHANGED
|
@@ -402,6 +402,9 @@ var userAddEditUrl = {
|
|
|
402
402
|
},
|
|
403
403
|
airlineList: function airlineList() {
|
|
404
404
|
return "https://serviceearth.iltech.in/api/v1/paginated/airline/";
|
|
405
|
+
},
|
|
406
|
+
rejectUserVerification: function rejectUserVerification(userId) {
|
|
407
|
+
return "api/v1/onboarding/user-signup-reject/" + userId;
|
|
405
408
|
}
|
|
406
409
|
};
|
|
407
410
|
var userListUrl = {
|
|
@@ -1217,6 +1220,51 @@ var commonLoadOptions = function commonLoadOptions(search, loadedOptions, _ref)
|
|
|
1217
1220
|
return Promise.reject(e);
|
|
1218
1221
|
}
|
|
1219
1222
|
};
|
|
1223
|
+
var commonLoadOptionsUM = function commonLoadOptionsUM(search, loadedOptions, _ref2) {
|
|
1224
|
+
var page = _ref2.page,
|
|
1225
|
+
tabelName = _ref2.tabelName,
|
|
1226
|
+
placeholder = _ref2.placeholder,
|
|
1227
|
+
defaultData = _ref2.defaultData;
|
|
1228
|
+
|
|
1229
|
+
try {
|
|
1230
|
+
return Promise.resolve(_catch(function () {
|
|
1231
|
+
var url = userAddEditUrl.dropdownList() + ("?page=" + page + "&table_name=" + tabelName + "&search=" + search);
|
|
1232
|
+
return Promise.resolve(api.get(url).then(function (res) {
|
|
1233
|
+
return res.data;
|
|
1234
|
+
})).then(function (response) {
|
|
1235
|
+
var arrList = response.results.filter(function (item) {
|
|
1236
|
+
return item.name !== defaultData;
|
|
1237
|
+
});
|
|
1238
|
+
var mappedValue = arrList.map(function (item) {
|
|
1239
|
+
return {
|
|
1240
|
+
value: item.id,
|
|
1241
|
+
label: item.name
|
|
1242
|
+
};
|
|
1243
|
+
});
|
|
1244
|
+
return {
|
|
1245
|
+
options: mappedValue,
|
|
1246
|
+
hasMore: !!response.next,
|
|
1247
|
+
additional: {
|
|
1248
|
+
page: page + 1,
|
|
1249
|
+
tabelName: tabelName
|
|
1250
|
+
}
|
|
1251
|
+
};
|
|
1252
|
+
});
|
|
1253
|
+
}, function () {
|
|
1254
|
+
return {
|
|
1255
|
+
options: [],
|
|
1256
|
+
hasMore: false,
|
|
1257
|
+
additional: {
|
|
1258
|
+
page: 1,
|
|
1259
|
+
tabelName: tabelName,
|
|
1260
|
+
placeholder: placeholder
|
|
1261
|
+
}
|
|
1262
|
+
};
|
|
1263
|
+
}));
|
|
1264
|
+
} catch (e) {
|
|
1265
|
+
return Promise.reject(e);
|
|
1266
|
+
}
|
|
1267
|
+
};
|
|
1220
1268
|
var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _ref3) {
|
|
1221
1269
|
var page = _ref3.page;
|
|
1222
1270
|
|
|
@@ -1921,12 +1969,12 @@ var addTravelApproverField = function addTravelApproverField() {
|
|
|
1921
1969
|
return new Promise(function (resolve, reject) {
|
|
1922
1970
|
var _travelApprovers = getState().userAddEdit.renderFields.travelApprovers;
|
|
1923
1971
|
var sNo = _travelApprovers.length + 1;
|
|
1924
|
-
var label = "Travel
|
|
1972
|
+
var label = "Travel approver " + sNo;
|
|
1925
1973
|
|
|
1926
1974
|
_travelApprovers.forEach(function (approver) {
|
|
1927
1975
|
if (approver.label === label) {
|
|
1928
1976
|
sNo++;
|
|
1929
|
-
label = "Travel
|
|
1977
|
+
label = "Travel approver " + sNo;
|
|
1930
1978
|
}
|
|
1931
1979
|
});
|
|
1932
1980
|
|
|
@@ -1965,12 +2013,12 @@ var addExpenseApproverField = function addExpenseApproverField() {
|
|
|
1965
2013
|
return new Promise(function (resolve, reject) {
|
|
1966
2014
|
var _expenseApprovers = getState().userAddEdit.renderFields.expenseApprovers;
|
|
1967
2015
|
var sNo = _expenseApprovers.length + 1;
|
|
1968
|
-
var label = "Expense
|
|
2016
|
+
var label = "Expense approver " + sNo;
|
|
1969
2017
|
|
|
1970
2018
|
_expenseApprovers.forEach(function (approver) {
|
|
1971
2019
|
if (approver.label === label) {
|
|
1972
2020
|
sNo++;
|
|
1973
|
-
label = "Expense
|
|
2021
|
+
label = "Expense approver " + sNo;
|
|
1974
2022
|
}
|
|
1975
2023
|
});
|
|
1976
2024
|
|
|
@@ -2282,6 +2330,33 @@ var submitAddModalData = function submitAddModalData(tableName, data) {
|
|
|
2282
2330
|
});
|
|
2283
2331
|
};
|
|
2284
2332
|
};
|
|
2333
|
+
var rejectUserVerification = function rejectUserVerification(userId) {
|
|
2334
|
+
return function (dispatch) {
|
|
2335
|
+
return new Promise(function (resolve, reject) {
|
|
2336
|
+
api$1.get(userAddEditUrl.rejectUserVerification(userId)).then(function (res) {
|
|
2337
|
+
console.log(res);
|
|
2338
|
+
|
|
2339
|
+
if (res.data.status === true) {
|
|
2340
|
+
var _res$data5;
|
|
2341
|
+
|
|
2342
|
+
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.');
|
|
2343
|
+
resolve(res.data);
|
|
2344
|
+
} else {
|
|
2345
|
+
var _res$data6;
|
|
2346
|
+
|
|
2347
|
+
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.');
|
|
2348
|
+
reject(res);
|
|
2349
|
+
}
|
|
2350
|
+
})["catch"](function (err) {
|
|
2351
|
+
var _err$response11, _err$response11$data;
|
|
2352
|
+
|
|
2353
|
+
console.log(err);
|
|
2354
|
+
IUIToastMessageService.warningNotify((err === null || err === void 0 ? void 0 : (_err$response11 = err.response) === null || _err$response11 === void 0 ? void 0 : (_err$response11$data = _err$response11.data) === null || _err$response11$data === void 0 ? void 0 : _err$response11$data.message) || 'Opps, Unable to reject user.');
|
|
2355
|
+
reject(err);
|
|
2356
|
+
});
|
|
2357
|
+
});
|
|
2358
|
+
};
|
|
2359
|
+
};
|
|
2285
2360
|
|
|
2286
2361
|
var SHOW_LOADER$1 = 'SHOW_LOADER';
|
|
2287
2362
|
var STOP_LOADER$1 = 'STOP_LOADER';
|
|
@@ -2749,8 +2824,10 @@ var CreditCard = function CreditCard(_ref) {
|
|
|
2749
2824
|
var AddCard = function AddCard(_ref2) {
|
|
2750
2825
|
var pg = _ref2.pg;
|
|
2751
2826
|
|
|
2827
|
+
var _url = env$3.getPaymentUrl() + ("/api/v1/auth/" + IUILocalStorageService$5.getAccessToken() + "/1/" + pg.entity_id + "/0/" + pg.vendor_id + "/1");
|
|
2828
|
+
|
|
2752
2829
|
var handleAddCard = function handleAddCard() {
|
|
2753
|
-
window.location.assign(
|
|
2830
|
+
window.location.assign(_url);
|
|
2754
2831
|
};
|
|
2755
2832
|
|
|
2756
2833
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -2951,13 +3028,13 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
2951
3028
|
var rgx = null;
|
|
2952
3029
|
|
|
2953
3030
|
if (type === 'travel') {
|
|
2954
|
-
rgx = /^(travel
|
|
3031
|
+
rgx = /^(travel approver)( )[0-9]*$/i;
|
|
2955
3032
|
} else {
|
|
2956
|
-
rgx = /^(expense
|
|
3033
|
+
rgx = /^(expense approver)( )[0-9]*$/i;
|
|
2957
3034
|
}
|
|
2958
3035
|
|
|
2959
|
-
if (editedLabel.approvers[i].label.match(rgx) && editedLabel.approvers[i].label.toLowerCase() !== type.toLowerCase() + "
|
|
2960
|
-
_errMsg[editedLabel.approvers[i].indexAt] = "Can't update '" + (type === 'travel' ? 'Travel' : 'Expense') + "
|
|
3036
|
+
if (editedLabel.approvers[i].label.match(rgx) && editedLabel.approvers[i].label.toLowerCase() !== type.toLowerCase() + " approver " + (editedLabel.approvers[i].indexAt + 1)) {
|
|
3037
|
+
_errMsg[editedLabel.approvers[i].indexAt] = "Can't update '" + (type === 'travel' ? 'Travel' : 'Expense') + " approver " + (editedLabel.approvers[i].indexAt + 1) + "' to '" + editedLabel.approvers[i].label + "'";
|
|
2961
3038
|
|
|
2962
3039
|
if (!hasError) {
|
|
2963
3040
|
hasError = true;
|
|
@@ -3072,10 +3149,10 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
3072
3149
|
return null;
|
|
3073
3150
|
}
|
|
3074
3151
|
|
|
3075
|
-
if (p.label.toLowerCase() === type + "
|
|
3152
|
+
if (p.label.toLowerCase() === type + " approver " + (i + 1)) {
|
|
3076
3153
|
p.secondaryLabel = '';
|
|
3077
3154
|
} else {
|
|
3078
|
-
p.secondaryLabel = type + "
|
|
3155
|
+
p.secondaryLabel = type + " approver " + (i + 1);
|
|
3079
3156
|
}
|
|
3080
3157
|
|
|
3081
3158
|
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
@@ -3191,7 +3268,7 @@ var TravelExpenseFields = function TravelExpenseFields(props) {
|
|
|
3191
3268
|
className: styles.fieldMargin
|
|
3192
3269
|
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
3193
3270
|
defaultValue: p.label,
|
|
3194
|
-
label: (type === 'travel' ? 'Travel' : 'Expense') + "
|
|
3271
|
+
label: (type === 'travel' ? 'Travel' : 'Expense') + " approver " + (i + 1),
|
|
3195
3272
|
className: styles.inputWidth,
|
|
3196
3273
|
id: type + '_' + p.sequence,
|
|
3197
3274
|
name: type + '_' + p.sequence,
|
|
@@ -5877,7 +5954,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
5877
5954
|
userTagType: userTagType
|
|
5878
5955
|
};
|
|
5879
5956
|
|
|
5880
|
-
if (verifyUserId) {
|
|
5957
|
+
if (verifyUserId && isILadmin) {
|
|
5881
5958
|
payload.verifyUserId = verifyUserId;
|
|
5882
5959
|
}
|
|
5883
5960
|
|
|
@@ -6197,10 +6274,10 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6197
6274
|
window.location.href = config.routes.profile.redirectUrl.cancel;
|
|
6198
6275
|
}
|
|
6199
6276
|
}
|
|
6200
|
-
} else if (verifyUserId) {
|
|
6277
|
+
} else if (verifyUserId && isILadmin) {
|
|
6201
6278
|
var _config$routes4, _config$routes4$signu, _config$routes4$signu2;
|
|
6202
6279
|
|
|
6203
|
-
(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) &&
|
|
6280
|
+
(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) && window.location.assign(config.routes.signupRequest.list.path);
|
|
6204
6281
|
} else {
|
|
6205
6282
|
var _config$routes5, _config$routes5$users, _config$routes5$users2;
|
|
6206
6283
|
|
|
@@ -6225,7 +6302,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6225
6302
|
};
|
|
6226
6303
|
|
|
6227
6304
|
var getUserInfoForVerification = function getUserInfoForVerification() {
|
|
6228
|
-
if (verifyUserId) {
|
|
6305
|
+
if (verifyUserId && isILadmin) {
|
|
6229
6306
|
dispatch(showLoader());
|
|
6230
6307
|
dispatch(verifyUserInfo(verifyUserId)).then(function (res) {
|
|
6231
6308
|
setPersonalInfoInput(function (prevState) {
|
|
@@ -6327,6 +6404,19 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6327
6404
|
}
|
|
6328
6405
|
};
|
|
6329
6406
|
|
|
6407
|
+
var handleSignUpRequestRejection = function handleSignUpRequestRejection() {
|
|
6408
|
+
if (verifyUserId && isILadmin) {
|
|
6409
|
+
dispatch(showLoader());
|
|
6410
|
+
dispatch(rejectUserVerification(verifyUserId)).then(function (res) {
|
|
6411
|
+
setTimeout(function () {
|
|
6412
|
+
window.location.assign(config.routes.signupRequest.list.path);
|
|
6413
|
+
}, 1500);
|
|
6414
|
+
})["finally"](function () {
|
|
6415
|
+
dispatch(stopLoader());
|
|
6416
|
+
});
|
|
6417
|
+
}
|
|
6418
|
+
};
|
|
6419
|
+
|
|
6330
6420
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
6331
6421
|
component: "div",
|
|
6332
6422
|
className: styles.UUIUserManagementAddEdit
|
|
@@ -6343,7 +6433,7 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6343
6433
|
className: styles.breadcrumb
|
|
6344
6434
|
}, /*#__PURE__*/React.createElement(IUIBreadCrumb, {
|
|
6345
6435
|
breadCrumbs: [{
|
|
6346
|
-
href: verifyUserId ? config.routes.signupRequest.list.path : config.routes.users.list.path,
|
|
6436
|
+
href: verifyUserId && isILadmin ? config.routes.signupRequest.list.path : config.routes.users.list.path,
|
|
6347
6437
|
label: 'Users',
|
|
6348
6438
|
hasLink: true
|
|
6349
6439
|
}]
|
|
@@ -6378,7 +6468,14 @@ var UserAddEdit = function UserAddEdit(props) {
|
|
|
6378
6468
|
type: "contained",
|
|
6379
6469
|
onClick: formSubmitHandler,
|
|
6380
6470
|
disabled: isPageLoading || productAccess.travel === false && productAccess.expense === false || !!doesFormHasError()
|
|
6381
|
-
}))
|
|
6471
|
+
})), verifyUserId && isILadmin ? /*#__PURE__*/React.createElement(IUIBox, {
|
|
6472
|
+
component: "div",
|
|
6473
|
+
className: clsx(styles.buttonSingle, styles.buttonLeft)
|
|
6474
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
6475
|
+
buttonText: "Reject",
|
|
6476
|
+
type: "outlined",
|
|
6477
|
+
onClick: handleSignUpRequestRejection
|
|
6478
|
+
})) : null))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
6382
6479
|
component: "div",
|
|
6383
6480
|
marginTop: "8rem",
|
|
6384
6481
|
flexDirection: "column"
|
|
@@ -9220,7 +9317,7 @@ function MoveUserDialog(_ref) {
|
|
|
9220
9317
|
name: name,
|
|
9221
9318
|
isMove: isMove,
|
|
9222
9319
|
customSelectHandler: customSelectHandler,
|
|
9223
|
-
loadOption:
|
|
9320
|
+
loadOption: commonLoadOptionsUM,
|
|
9224
9321
|
isError: isError,
|
|
9225
9322
|
errorMsg: "Please select " + (name === null || name === void 0 ? void 0 : name.toLowerCase()) + ".",
|
|
9226
9323
|
placeHolderCheck: name !== undefined && name === ''
|
|
@@ -9533,9 +9630,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9533
9630
|
var handleEditPanel = function handleEditPanel(data) {
|
|
9534
9631
|
if (dataList) {
|
|
9535
9632
|
var payload = {
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9633
|
+
rows: [{
|
|
9634
|
+
id: dialogData.data.id,
|
|
9635
|
+
name: dataList
|
|
9636
|
+
}]
|
|
9539
9637
|
};
|
|
9540
9638
|
var message = title + " updated successfully.";
|
|
9541
9639
|
handleApiCall(editRecord, payload, message, 'edit');
|