@itilite/iui-user-management 1.0.4 → 1.2.0
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 +7 -19
- package/dist/index.js +271 -144
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +274 -147
- package/dist/index.modern.js.map +1 -1
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -14,11 +14,11 @@ var moment = _interopDefault(require('moment'));
|
|
|
14
14
|
var reduxDevtoolsExtension = require('redux-devtools-extension');
|
|
15
15
|
var reactRouterDom = require('react-router-dom');
|
|
16
16
|
var styles$8 = require('@material-ui/core/styles');
|
|
17
|
+
var Tooltip = _interopDefault(require('@material-ui/core/Tooltip'));
|
|
17
18
|
var Switch = _interopDefault(require('@material-ui/core/Switch'));
|
|
18
19
|
var MoreHorizIcon = _interopDefault(require('@material-ui/icons/MoreHoriz'));
|
|
19
20
|
var Button = _interopDefault(require('@material-ui/core/Button'));
|
|
20
21
|
var core = require('@material-ui/core');
|
|
21
|
-
var useScrollPosition = require('@n8tb1t/use-scroll-position');
|
|
22
22
|
|
|
23
23
|
function _extends() {
|
|
24
24
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -449,10 +449,10 @@ var userPanelUrl = {
|
|
|
449
449
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?action=delete&table=" + tableName;
|
|
450
450
|
},
|
|
451
451
|
getUnit: function getUnit(tableName, length, sort) {
|
|
452
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&
|
|
452
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&ordering=" + sort;
|
|
453
453
|
},
|
|
454
454
|
getPaginationUnit: function getPaginationUnit(tableName, length, page, sort) {
|
|
455
|
-
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&page=" + page + "&
|
|
455
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&page=" + page + "&ordering=" + sort;
|
|
456
456
|
},
|
|
457
457
|
moveUnit: function moveUnit() {
|
|
458
458
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
@@ -1254,7 +1254,6 @@ var fetchRenderFileds = function fetchRenderFileds() {
|
|
|
1254
1254
|
var _res$data;
|
|
1255
1255
|
IUIToastMessageService$1.warningNotify((res === null || res === void 0 ? void 0 : (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.message) || 'Opps, Something went wrong.');
|
|
1256
1256
|
dispatch(stopLoader());
|
|
1257
|
-
reject();
|
|
1258
1257
|
}
|
|
1259
1258
|
})["catch"](function (err) {
|
|
1260
1259
|
reject(err);
|
|
@@ -1426,11 +1425,9 @@ var createUser = function createUser(payload) {
|
|
|
1426
1425
|
} else {
|
|
1427
1426
|
if (res.data.errors && typeof res.data.errors === 'object') {
|
|
1428
1427
|
reject(res.data.errors);
|
|
1429
|
-
return;
|
|
1430
1428
|
} else if (!Object.keys(res.data.errors).length) {
|
|
1431
1429
|
IUIToastMessageService$1.warningNotify(res.data.message);
|
|
1432
1430
|
}
|
|
1433
|
-
reject();
|
|
1434
1431
|
}
|
|
1435
1432
|
})["catch"](function (err) {
|
|
1436
1433
|
var _err$response6;
|
|
@@ -1546,6 +1543,48 @@ var undoneSignUpRejection = function undoneSignUpRejection(userId) {
|
|
|
1546
1543
|
});
|
|
1547
1544
|
};
|
|
1548
1545
|
};
|
|
1546
|
+
var resetPasswordForUser = function resetPasswordForUser(data) {
|
|
1547
|
+
return function (dispatch) {
|
|
1548
|
+
return new Promise(function (resolve, reject) {
|
|
1549
|
+
api$2.post("" + userAddEditUrl.resetPasswordForUserApi(), {
|
|
1550
|
+
email: data.email
|
|
1551
|
+
}).then(function (res) {
|
|
1552
|
+
IUIToastMessageService$1.sNotify("The link to reset the password has been sent to the user's email address. Check your \"junk mail\" or \"spam\" folders in case it's not received.");
|
|
1553
|
+
resolve();
|
|
1554
|
+
})["catch"](function (err) {
|
|
1555
|
+
var _err$response9, _err$response9$data;
|
|
1556
|
+
if (!(err !== null && err !== void 0 && (_err$response9 = err.response) !== null && _err$response9 !== void 0 && (_err$response9$data = _err$response9.data) !== null && _err$response9$data !== void 0 && _err$response9$data.status)) {
|
|
1557
|
+
var _err$response10, _err$response10$data, _err$response10$data$;
|
|
1558
|
+
IUIToastMessageService$1.errNotify(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$ = _err$response10$data.message) === null || _err$response10$data$ === void 0 ? void 0 : _err$response10$data$.email[0]);
|
|
1559
|
+
reject(err);
|
|
1560
|
+
return;
|
|
1561
|
+
}
|
|
1562
|
+
reject(err);
|
|
1563
|
+
});
|
|
1564
|
+
});
|
|
1565
|
+
};
|
|
1566
|
+
};
|
|
1567
|
+
var resendInviteForUser = function resendInviteForUser(data) {
|
|
1568
|
+
return function (dispatch) {
|
|
1569
|
+
return new Promise(function (resolve, reject) {
|
|
1570
|
+
api$2.post(userAddEditUrl.resendInviteForUserApi(), {
|
|
1571
|
+
user_ids: data
|
|
1572
|
+
}).then(function (res) {
|
|
1573
|
+
IUIToastMessageService$1.sNotify(res.data.message);
|
|
1574
|
+
resolve();
|
|
1575
|
+
})["catch"](function (err) {
|
|
1576
|
+
var _err$response11, _err$response11$data;
|
|
1577
|
+
if (!(err !== null && err !== void 0 && (_err$response11 = err.response) !== null && _err$response11 !== void 0 && (_err$response11$data = _err$response11.data) !== null && _err$response11$data !== void 0 && _err$response11$data.status)) {
|
|
1578
|
+
var _err$response12, _err$response12$data, _err$response12$data$;
|
|
1579
|
+
IUIToastMessageService$1.errNotify(err === null || err === void 0 ? void 0 : (_err$response12 = err.response) === null || _err$response12 === void 0 ? void 0 : (_err$response12$data = _err$response12.data) === null || _err$response12$data === void 0 ? void 0 : (_err$response12$data$ = _err$response12$data.message) === null || _err$response12$data$ === void 0 ? void 0 : _err$response12$data$.email[0]);
|
|
1580
|
+
reject(err);
|
|
1581
|
+
return;
|
|
1582
|
+
}
|
|
1583
|
+
reject(err);
|
|
1584
|
+
});
|
|
1585
|
+
});
|
|
1586
|
+
};
|
|
1587
|
+
};
|
|
1549
1588
|
var updateUser = function updateUser(payload, userId, inputChangeLog) {
|
|
1550
1589
|
return function (dispatch) {
|
|
1551
1590
|
return new Promise(function (resolve, reject) {
|
|
@@ -6702,7 +6741,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6702
6741
|
};
|
|
6703
6742
|
};
|
|
6704
6743
|
|
|
6705
|
-
var styles$5 = {"UUIUserManagementList":"_3WNHx","
|
|
6744
|
+
var styles$5 = {"UUIUserManagementList":"_3WNHx","pageHeader":"_1WLpc","buttonWrapper":"_2egTG","headingWrapper":"_1He01","headingSignUpWrapper":"_Q8vqd","heading":"_1uPaO","headingLarge":"_2FsLd","headingMedium":"_nGXA9","headingSmall":"_2rpwF","description":"_25vb9","headerText":"_1Ny9J","letterImage":"_2hr3R","tablewrapper":"_1-RPw","rowText":"_1LXyO","textTransform":"_3kFQS","lightColor":"_3Ghgw","avatarClassName":"_2qO_X","tooltipText":"_151u_","tooltip":"_-LQNH","importModalBodyContainer":"_25xUk","dividerColor":"_2HZv9","w100":"_3vGmU","downloadTemplateContainer":"_3-Xu_","downloadTemplateDescContainer":"_tLw43","labelContainer":"_7TYUZ","downlTempHeader":"__CZpe","downlTempDescription":"_19jEe","downloadTemplateButton":"_1qXtq","fileUploaderContainer":"_1YVz2","colGap":"_3vnY5","deActivateModalContainer":"_28H9H","backdrop":"_1ky1x","errorText":"_26_if","user_list_page_tabs":"_xWE7K","TabLabelCount":"_13pXn"};
|
|
6706
6745
|
|
|
6707
6746
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6708
6747
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -8125,6 +8164,10 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8125
8164
|
selected = props.selected,
|
|
8126
8165
|
_props$handleSingleCh = props.handleSingleCheckBoxClick,
|
|
8127
8166
|
handleSingleCheckBoxClick = _props$handleSingleCh === void 0 ? function () {} : _props$handleSingleCh,
|
|
8167
|
+
_props$onResetPasswor = props.onResetPasswordHandler,
|
|
8168
|
+
onResetPasswordHandler = _props$onResetPasswor === void 0 ? function () {} : _props$onResetPasswor,
|
|
8169
|
+
_props$toggleInviteMo = props.toggleInviteModal,
|
|
8170
|
+
toggleInviteModal = _props$toggleInviteMo === void 0 ? function () {} : _props$toggleInviteMo,
|
|
8128
8171
|
orderBy = props.orderBy,
|
|
8129
8172
|
order = props.order,
|
|
8130
8173
|
_props$onRequestSort = props.onRequestSort,
|
|
@@ -8142,6 +8185,21 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8142
8185
|
searchValue = props.searchValue,
|
|
8143
8186
|
_props$isILadmin = props.isILadmin,
|
|
8144
8187
|
isILadmin = _props$isILadmin === void 0 ? false : _props$isILadmin;
|
|
8188
|
+
var useStyles = styles$8.makeStyles(function (theme) {
|
|
8189
|
+
return {
|
|
8190
|
+
tooltip: {
|
|
8191
|
+
background: '#1F2937',
|
|
8192
|
+
fontSize: '14px',
|
|
8193
|
+
color: '#ffffff',
|
|
8194
|
+
padding: '12px 16px',
|
|
8195
|
+
borderRadius: '6px'
|
|
8196
|
+
},
|
|
8197
|
+
arrow: {
|
|
8198
|
+
color: '#1F2937'
|
|
8199
|
+
}
|
|
8200
|
+
};
|
|
8201
|
+
});
|
|
8202
|
+
var classes = useStyles();
|
|
8145
8203
|
var columns = [{
|
|
8146
8204
|
id: 'first_name',
|
|
8147
8205
|
label: 'Name',
|
|
@@ -8161,6 +8219,27 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8161
8219
|
profilePath: row === null || row === void 0 ? void 0 : (_row$profile_pic = row.profile_pic) === null || _row$profile_pic === void 0 ? void 0 : _row$profile_pic.presigned_url
|
|
8162
8220
|
}));
|
|
8163
8221
|
}
|
|
8222
|
+
}, {
|
|
8223
|
+
id: 'first_name',
|
|
8224
|
+
label: '',
|
|
8225
|
+
minWidth: 60,
|
|
8226
|
+
sortable: false,
|
|
8227
|
+
cell: function cell(row) {
|
|
8228
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8229
|
+
component: "div",
|
|
8230
|
+
width: 60
|
|
8231
|
+
}, row && row.has_visited === 0 ? /*#__PURE__*/React__default.createElement(Tooltip, {
|
|
8232
|
+
title: "This user hasn't logged on to the platform yet",
|
|
8233
|
+
arrow: true,
|
|
8234
|
+
classes: {
|
|
8235
|
+
arrow: classes.arrow,
|
|
8236
|
+
tooltip: classes.tooltip
|
|
8237
|
+
},
|
|
8238
|
+
placement: "top-start"
|
|
8239
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
8240
|
+
className: clsx(styles$5.tooltipText)
|
|
8241
|
+
}, "Invited")) : null);
|
|
8242
|
+
}
|
|
8164
8243
|
}, {
|
|
8165
8244
|
id: 'emp_info__department__name',
|
|
8166
8245
|
label: 'Department',
|
|
@@ -8248,6 +8327,21 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8248
8327
|
return onEditHandler(row.id);
|
|
8249
8328
|
}
|
|
8250
8329
|
}];
|
|
8330
|
+
if (row && row.has_visited && row.is_active) {
|
|
8331
|
+
options.push({
|
|
8332
|
+
label: 'Reset password',
|
|
8333
|
+
handler: function handler() {
|
|
8334
|
+
return onResetPasswordHandler(row.email);
|
|
8335
|
+
}
|
|
8336
|
+
});
|
|
8337
|
+
} else if (row && row.is_active) {
|
|
8338
|
+
options.push({
|
|
8339
|
+
label: 'Resend invite',
|
|
8340
|
+
handler: function handler() {
|
|
8341
|
+
return toggleInviteModal(row.id, 'single');
|
|
8342
|
+
}
|
|
8343
|
+
});
|
|
8344
|
+
}
|
|
8251
8345
|
if (isILadmin) {
|
|
8252
8346
|
options.push({
|
|
8253
8347
|
label: 'Make primary admin',
|
|
@@ -8300,8 +8394,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8300
8394
|
isDataFetching: isDataFetching,
|
|
8301
8395
|
disableRowCheckbox: disableRowCheckbox,
|
|
8302
8396
|
searchBoxWidth: "400px",
|
|
8303
|
-
searchValue: searchValue
|
|
8304
|
-
hideTopPagination: false
|
|
8397
|
+
searchValue: searchValue
|
|
8305
8398
|
});
|
|
8306
8399
|
};
|
|
8307
8400
|
var SingupRequests = function SingupRequests(props) {
|
|
@@ -8416,6 +8509,22 @@ var SingupRequests = function SingupRequests(props) {
|
|
|
8416
8509
|
});
|
|
8417
8510
|
};
|
|
8418
8511
|
|
|
8512
|
+
function InviteInfoIcon() {
|
|
8513
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8514
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8515
|
+
width: "20",
|
|
8516
|
+
height: "20",
|
|
8517
|
+
fill: "none",
|
|
8518
|
+
viewBox: "0 0 20 20"
|
|
8519
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8520
|
+
fill: "#CA8A04",
|
|
8521
|
+
d: "M11 5a1 1 0 11-2 0 1 1 0 012 0zM8 8a1 1 0 000 2h1v3H8a1 1 0 100 2h4a1 1 0 100-2h-1V9a1 1 0 00-1-1H8z"
|
|
8522
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8523
|
+
fill: "#CA8A04",
|
|
8524
|
+
d: "M0 10c0 5.522 4.477 10 10 10s10-4.478 10-10c0-5.523-4.477-10-10-10S0 4.477 0 10zm10-8a8 8 0 110 16 8 8 0 010-16z"
|
|
8525
|
+
}));
|
|
8526
|
+
}
|
|
8527
|
+
|
|
8419
8528
|
var IUIToastMessageService$7 = utils.services.IUIToastMessageService;
|
|
8420
8529
|
var env$7 = utils.configs.env;
|
|
8421
8530
|
var UndoButton = function UndoButton(_ref) {
|
|
@@ -8458,7 +8567,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8458
8567
|
var _React$useState = React__default.useState(1),
|
|
8459
8568
|
page = _React$useState[0],
|
|
8460
8569
|
setPage = _React$useState[1];
|
|
8461
|
-
var _useState = React.useState(
|
|
8570
|
+
var _useState = React.useState(5),
|
|
8462
8571
|
rowsPerPage = _useState[0],
|
|
8463
8572
|
setRowsPerPage = _useState[1];
|
|
8464
8573
|
var _React$useState2 = React__default.useState({}),
|
|
@@ -8504,56 +8613,39 @@ var UserList = function UserList(_ref2) {
|
|
|
8504
8613
|
var _useState10 = React.useState(false),
|
|
8505
8614
|
isApiFetching = _useState10[0],
|
|
8506
8615
|
setisApiFetching = _useState10[1];
|
|
8507
|
-
var
|
|
8508
|
-
|
|
8509
|
-
|
|
8510
|
-
useScrollPosition.useScrollPosition(function (_ref3) {
|
|
8511
|
-
var prevPos = _ref3.prevPos,
|
|
8512
|
-
currPos = _ref3.currPos;
|
|
8513
|
-
if (prevPos.y - currPos.y > 0) {
|
|
8514
|
-
if (currPos.y <= -275) {
|
|
8515
|
-
setOverlayMenu(true);
|
|
8516
|
-
}
|
|
8517
|
-
} else {
|
|
8518
|
-
if (currPos.y > -295) {
|
|
8519
|
-
setOverlayMenu(false);
|
|
8520
|
-
}
|
|
8521
|
-
}
|
|
8522
|
-
}, [overlayMenu]);
|
|
8523
|
-
var scrollTo = function scrollTo(id) {
|
|
8524
|
-
var el = document.getElementById(id);
|
|
8525
|
-
window.scrollTo({
|
|
8526
|
-
top: el.offsetTop,
|
|
8527
|
-
behavior: 'smooth'
|
|
8528
|
-
});
|
|
8529
|
-
};
|
|
8530
|
-
var _React$useState6 = React__default.useState(1),
|
|
8531
|
-
signup_page = _React$useState6[0],
|
|
8532
|
-
setSignUpPage = _React$useState6[1];
|
|
8533
|
-
var _useState11 = React.useState(5),
|
|
8534
|
-
signup_rowsPerPage = _useState11[0],
|
|
8535
|
-
setSignUpRowsPerPage = _useState11[1];
|
|
8536
|
-
var _React$useState7 = React__default.useState('asc'),
|
|
8537
|
-
signup_order = _React$useState7[0],
|
|
8538
|
-
setSignUpOrder = _React$useState7[1];
|
|
8539
|
-
var _React$useState8 = React__default.useState('fname'),
|
|
8540
|
-
signup_orderBy = _React$useState8[0],
|
|
8541
|
-
setSignUpOrderBy = _React$useState8[1];
|
|
8616
|
+
var _useState11 = React.useState(false),
|
|
8617
|
+
showInviteModal = _useState11[0],
|
|
8618
|
+
setToggleInviteModal = _useState11[1];
|
|
8542
8619
|
var _useState12 = React.useState(''),
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
var
|
|
8546
|
-
|
|
8547
|
-
|
|
8548
|
-
var
|
|
8549
|
-
|
|
8550
|
-
|
|
8620
|
+
userIds = _useState12[0],
|
|
8621
|
+
setUserIds = _useState12[1];
|
|
8622
|
+
var _React$useState5 = React__default.useState(1),
|
|
8623
|
+
signup_page = _React$useState5[0],
|
|
8624
|
+
setSignUpPage = _React$useState5[1];
|
|
8625
|
+
var _useState13 = React.useState(5),
|
|
8626
|
+
signup_rowsPerPage = _useState13[0],
|
|
8627
|
+
setSignUpRowsPerPage = _useState13[1];
|
|
8628
|
+
var _React$useState6 = React__default.useState('asc'),
|
|
8629
|
+
signup_order = _React$useState6[0],
|
|
8630
|
+
setSignUpOrder = _React$useState6[1];
|
|
8631
|
+
var _React$useState7 = React__default.useState('fname'),
|
|
8632
|
+
signup_orderBy = _React$useState7[0],
|
|
8633
|
+
setSignUpOrderBy = _React$useState7[1];
|
|
8634
|
+
var _useState14 = React.useState(''),
|
|
8635
|
+
signup_searchValue = _useState14[0],
|
|
8636
|
+
set_signup_SearchValue = _useState14[1];
|
|
8551
8637
|
var _useState15 = React.useState(false),
|
|
8552
|
-
|
|
8553
|
-
|
|
8638
|
+
isSignUpSortingChange = _useState15[0],
|
|
8639
|
+
setSignUpSortingChange = _useState15[1];
|
|
8554
8640
|
var _useState16 = React.useState(false),
|
|
8555
|
-
|
|
8556
|
-
|
|
8641
|
+
isSignUpSearchingChange = _useState16[0],
|
|
8642
|
+
setSignUpSearchingChange = _useState16[1];
|
|
8643
|
+
var _useState17 = React.useState(false),
|
|
8644
|
+
isSignUpSortingChangeTemp = _useState17[0],
|
|
8645
|
+
setSignUpSortingChangeTemp = _useState17[1];
|
|
8646
|
+
var _useState18 = React.useState(false),
|
|
8647
|
+
isSignUpSearchingChangeTemp = _useState18[0],
|
|
8648
|
+
setSignUpSearchingChangeTemp = _useState18[1];
|
|
8557
8649
|
var _useSelector3 = reactRedux.useSelector(function (state) {
|
|
8558
8650
|
return state.userList;
|
|
8559
8651
|
}),
|
|
@@ -8595,7 +8687,8 @@ var UserList = function UserList(_ref2) {
|
|
|
8595
8687
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
8596
8688
|
length: signup_rowsPerPage,
|
|
8597
8689
|
page: signup_page,
|
|
8598
|
-
search: signup_searchValue.trim()
|
|
8690
|
+
search: signup_searchValue.trim(),
|
|
8691
|
+
pagename: 'company'
|
|
8599
8692
|
})).then(function () {
|
|
8600
8693
|
return dispatch(stopDataFetchingStatus());
|
|
8601
8694
|
});
|
|
@@ -8700,6 +8793,37 @@ var UserList = function UserList(_ref2) {
|
|
|
8700
8793
|
setOpenImportUsersModal(false);
|
|
8701
8794
|
handleImportPagenavigation(jobId);
|
|
8702
8795
|
};
|
|
8796
|
+
var onResetPasswordHandler = function onResetPasswordHandler(email) {
|
|
8797
|
+
dispatch(resetPasswordForUser({
|
|
8798
|
+
email: email
|
|
8799
|
+
}));
|
|
8800
|
+
};
|
|
8801
|
+
var toggleInviteModal = function toggleInviteModal(ids, type) {
|
|
8802
|
+
console.log(type);
|
|
8803
|
+
if (!type && (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined)) {
|
|
8804
|
+
IUIToastMessageService$7.warningNotify('Select at least one user to invite.');
|
|
8805
|
+
return false;
|
|
8806
|
+
}
|
|
8807
|
+
setUserIds(ids);
|
|
8808
|
+
setToggleInviteModal(!showInviteModal);
|
|
8809
|
+
};
|
|
8810
|
+
var onResendInviteHandler = function onResendInviteHandler() {
|
|
8811
|
+
var userIdArr = [];
|
|
8812
|
+
if (userIds && !isNaN(userIds)) {
|
|
8813
|
+
userIdArr = [userIds];
|
|
8814
|
+
} else if (Object.keys(selected).length) {
|
|
8815
|
+
Object.values(selected).map(function (val, i) {
|
|
8816
|
+
if (val.length) {
|
|
8817
|
+
val.map(function (idx, i) {
|
|
8818
|
+
userIdArr.push(idx);
|
|
8819
|
+
});
|
|
8820
|
+
}
|
|
8821
|
+
});
|
|
8822
|
+
}
|
|
8823
|
+
setUserIds('');
|
|
8824
|
+
dispatch(resendInviteForUser(userIdArr));
|
|
8825
|
+
setToggleInviteModal(!showInviteModal);
|
|
8826
|
+
};
|
|
8703
8827
|
var handleExportUsers = function handleExportUsers() {
|
|
8704
8828
|
try {
|
|
8705
8829
|
setDownlStatus(true);
|
|
@@ -8739,6 +8863,9 @@ var UserList = function UserList(_ref2) {
|
|
|
8739
8863
|
}, {
|
|
8740
8864
|
label: 'Bulk action history',
|
|
8741
8865
|
handler: handleBulkActionHistoryClick
|
|
8866
|
+
}, {
|
|
8867
|
+
label: 'Resend invite',
|
|
8868
|
+
handler: toggleInviteModal
|
|
8742
8869
|
}];
|
|
8743
8870
|
React.useEffect(function () {
|
|
8744
8871
|
var roleCanAccess = ['travel_itilite_admin', 'travel_admin', 'expense_itilite_admin', 'expense_admin'];
|
|
@@ -8763,7 +8890,6 @@ var UserList = function UserList(_ref2) {
|
|
|
8763
8890
|
dispatch(fetchUsersList(url)).then(function () {
|
|
8764
8891
|
setSearchingChange(false);
|
|
8765
8892
|
setisApiFetching(false);
|
|
8766
|
-
scrollTo('table-root');
|
|
8767
8893
|
});
|
|
8768
8894
|
}, 1000);
|
|
8769
8895
|
return function () {
|
|
@@ -8777,7 +8903,8 @@ var UserList = function UserList(_ref2) {
|
|
|
8777
8903
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
8778
8904
|
length: signup_rowsPerPage,
|
|
8779
8905
|
page: signup_page,
|
|
8780
|
-
search: signup_searchValue.trim()
|
|
8906
|
+
search: signup_searchValue.trim(),
|
|
8907
|
+
pagename: 'company'
|
|
8781
8908
|
})).then(function () {
|
|
8782
8909
|
setSignUpSearchingChange(false);
|
|
8783
8910
|
setisApiFetching(false);
|
|
@@ -8789,7 +8916,6 @@ var UserList = function UserList(_ref2) {
|
|
|
8789
8916
|
}
|
|
8790
8917
|
if (isSortingChange) {
|
|
8791
8918
|
setisApiFetching(true);
|
|
8792
|
-
scrollTo('table-root');
|
|
8793
8919
|
dispatch(fetchUsersList(url)).then(function () {
|
|
8794
8920
|
setisApiFetching(false);
|
|
8795
8921
|
setSortingChange(false);
|
|
@@ -8804,7 +8930,8 @@ var UserList = function UserList(_ref2) {
|
|
|
8804
8930
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
8805
8931
|
length: signup_rowsPerPage,
|
|
8806
8932
|
page: signup_page,
|
|
8807
|
-
search: signup_searchValue.trim()
|
|
8933
|
+
search: signup_searchValue.trim(),
|
|
8934
|
+
pagename: 'company'
|
|
8808
8935
|
})).then(function () {
|
|
8809
8936
|
setisApiFetching(false);
|
|
8810
8937
|
setSignUpSortingChange(false);
|
|
@@ -8820,7 +8947,8 @@ var UserList = function UserList(_ref2) {
|
|
|
8820
8947
|
ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
|
|
8821
8948
|
length: signup_rowsPerPage,
|
|
8822
8949
|
page: signup_page,
|
|
8823
|
-
search: signup_searchValue.trim()
|
|
8950
|
+
search: signup_searchValue.trim(),
|
|
8951
|
+
pagename: 'company'
|
|
8824
8952
|
})).then(function () {
|
|
8825
8953
|
return dispatch(stopDataFetchingStatus());
|
|
8826
8954
|
});
|
|
@@ -8828,89 +8956,15 @@ var UserList = function UserList(_ref2) {
|
|
|
8828
8956
|
}
|
|
8829
8957
|
}
|
|
8830
8958
|
}, [isTokenVerified, isSearchingChangeTemp, isSortingChangeTemp, isSignUpSearchingChangeTemp, isSignUpSortingChangeTemp]);
|
|
8831
|
-
var topRightButtons = function topRightButtons() {
|
|
8832
|
-
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8833
|
-
component: "div",
|
|
8834
|
-
className: styles$5.buttonWrapper,
|
|
8835
|
-
display: "flex",
|
|
8836
|
-
justifyContent: "space-between",
|
|
8837
|
-
alignItems: "center",
|
|
8838
|
-
alignSelf: "flex-start"
|
|
8839
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8840
|
-
component: "div",
|
|
8841
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
8842
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
8843
|
-
buttonText: "Export all users",
|
|
8844
|
-
type: "outlined",
|
|
8845
|
-
startIcon: /*#__PURE__*/React__default.createElement(BulkDownloadIcon, {
|
|
8846
|
-
width: "22",
|
|
8847
|
-
height: "22"
|
|
8848
|
-
}),
|
|
8849
|
-
onClick: handleExportUsers
|
|
8850
|
-
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8851
|
-
component: "div",
|
|
8852
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
8853
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIDropdownButton, {
|
|
8854
|
-
buttonText: "Bulk actions",
|
|
8855
|
-
type: "outlined",
|
|
8856
|
-
menuListInfo: BulkUploadInfo
|
|
8857
|
-
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8858
|
-
component: "div",
|
|
8859
|
-
className: "pageHeader--button-single button-right"
|
|
8860
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
8861
|
-
buttonText: "Add user",
|
|
8862
|
-
type: "contained",
|
|
8863
|
-
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
8864
|
-
width: "9",
|
|
8865
|
-
height: "9",
|
|
8866
|
-
color: "white"
|
|
8867
|
-
}),
|
|
8868
|
-
onClick: handleAddPageNavigation
|
|
8869
|
-
})));
|
|
8870
|
-
};
|
|
8871
8959
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8872
8960
|
component: "div",
|
|
8873
8961
|
className: styles$5.UUIUserManagementList
|
|
8874
|
-
},
|
|
8875
|
-
className: styles$5.scrollOverlayMenu
|
|
8876
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8877
|
-
component: "div",
|
|
8878
|
-
className: clsx(styles$5.pageHeader)
|
|
8879
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8880
|
-
component: "div",
|
|
8881
|
-
display: "flex",
|
|
8882
|
-
justifyContent: "space-between",
|
|
8883
|
-
alignItems: "center",
|
|
8884
|
-
flexWrap: "wrap",
|
|
8885
|
-
style: {
|
|
8886
|
-
gap: '1rem'
|
|
8887
|
-
}
|
|
8888
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8889
|
-
component: "div",
|
|
8890
|
-
display: "flex",
|
|
8891
|
-
flexDirection: "column",
|
|
8892
|
-
style: {
|
|
8893
|
-
gap: '0.5rem'
|
|
8894
|
-
}
|
|
8895
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUISearch, {
|
|
8896
|
-
placeholder: "Search by name, email & department",
|
|
8897
|
-
value: searchValue,
|
|
8898
|
-
onChangeHandler: function onChangeHandler(e) {
|
|
8899
|
-
return onSearchHandler(e.target.value);
|
|
8900
|
-
},
|
|
8901
|
-
className: styles$5.overlaysearch
|
|
8902
|
-
})), topRightButtons()), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8903
|
-
component: "div",
|
|
8904
|
-
display: "flex",
|
|
8905
|
-
justifyContent: "space-between",
|
|
8906
|
-
alignItems: "center"
|
|
8907
|
-
}))) : '', !hasVerificationError ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBackdrop, {
|
|
8962
|
+
}, !hasVerificationError ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBackdrop, {
|
|
8908
8963
|
open: isFileDownloading || isApiFetching,
|
|
8909
8964
|
className: styles$5.backdrop
|
|
8910
8965
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUICircularProgress, {
|
|
8911
8966
|
color: "inherit"
|
|
8912
8967
|
})), isDataFetching ? /*#__PURE__*/React__default.createElement(SkeletonLoader, null) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8913
|
-
id: "table-root",
|
|
8914
8968
|
component: "div",
|
|
8915
8969
|
className: clsx(styles$5.pageHeader)
|
|
8916
8970
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
@@ -8935,7 +8989,44 @@ var UserList = function UserList(_ref2) {
|
|
|
8935
8989
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
8936
8990
|
variant: "h3",
|
|
8937
8991
|
className: clsx(styles$5.heading, styles$5.headingLarge)
|
|
8938
|
-
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))),
|
|
8992
|
+
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8993
|
+
component: "div",
|
|
8994
|
+
className: styles$5.buttonWrapper,
|
|
8995
|
+
display: "flex",
|
|
8996
|
+
justifyContent: "space-between",
|
|
8997
|
+
alignItems: "center",
|
|
8998
|
+
alignSelf: "flex-start"
|
|
8999
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9000
|
+
component: "div",
|
|
9001
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9002
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9003
|
+
buttonText: "Export all users",
|
|
9004
|
+
type: "outlined",
|
|
9005
|
+
startIcon: /*#__PURE__*/React__default.createElement(BulkDownloadIcon, {
|
|
9006
|
+
width: "22",
|
|
9007
|
+
height: "22"
|
|
9008
|
+
}),
|
|
9009
|
+
onClick: handleExportUsers
|
|
9010
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9011
|
+
component: "div",
|
|
9012
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9013
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIDropdownButton, {
|
|
9014
|
+
buttonText: "Bulk actions",
|
|
9015
|
+
type: "outlined",
|
|
9016
|
+
menuListInfo: BulkUploadInfo
|
|
9017
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9018
|
+
component: "div",
|
|
9019
|
+
className: "pageHeader--button-single button-right"
|
|
9020
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9021
|
+
buttonText: "Add user",
|
|
9022
|
+
type: "contained",
|
|
9023
|
+
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
9024
|
+
width: "9",
|
|
9025
|
+
height: "9",
|
|
9026
|
+
color: "white"
|
|
9027
|
+
}),
|
|
9028
|
+
onClick: handleAddPageNavigation
|
|
9029
|
+
})))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8939
9030
|
component: "div",
|
|
8940
9031
|
display: "flex",
|
|
8941
9032
|
justifyContent: "space-between",
|
|
@@ -8980,7 +9071,9 @@ var UserList = function UserList(_ref2) {
|
|
|
8980
9071
|
disableRowCheckbox: deactivatedUsers,
|
|
8981
9072
|
searchValue: searchValue,
|
|
8982
9073
|
isILadmin: isILadmin,
|
|
8983
|
-
onPrimaryAdminHandler: onPrimaryAdminHandler
|
|
9074
|
+
onPrimaryAdminHandler: onPrimaryAdminHandler,
|
|
9075
|
+
onResetPasswordHandler: onResetPasswordHandler,
|
|
9076
|
+
toggleInviteModal: toggleInviteModal
|
|
8984
9077
|
}))
|
|
8985
9078
|
}, {
|
|
8986
9079
|
label: /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, null, "Sign-up requests", ' ', /*#__PURE__*/React__default.createElement(TabLabelCount, {
|
|
@@ -9053,7 +9146,41 @@ var UserList = function UserList(_ref2) {
|
|
|
9053
9146
|
className: styles$5.headerText
|
|
9054
9147
|
}, 'Are you sure you want to deactivate ' + Object.values(selected).flat().length.toString() + (Object.values(selected).flat().length === 1 ? ' user ?' : ' users ?')), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9055
9148
|
className: styles$5.description
|
|
9056
|
-
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React__default.createElement(
|
|
9149
|
+
}, "The", ' ', Object.values(selected).flat().length === 1 ? ' user ' : ' users ', "won\u2019t be able to access itilite platform"))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9150
|
+
isOpen: showInviteModal,
|
|
9151
|
+
closeHandler: toggleInviteModal,
|
|
9152
|
+
cancelLabel: "Cancel",
|
|
9153
|
+
headerText: "Resend Invites?",
|
|
9154
|
+
submitLabel: "Send",
|
|
9155
|
+
submitHandler: function submitHandler() {
|
|
9156
|
+
return onResendInviteHandler();
|
|
9157
|
+
},
|
|
9158
|
+
width: "400px",
|
|
9159
|
+
modalBodyStyle: {
|
|
9160
|
+
padding: '0px'
|
|
9161
|
+
},
|
|
9162
|
+
footerStyle: {
|
|
9163
|
+
justifyContent: 'center'
|
|
9164
|
+
}
|
|
9165
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9166
|
+
style: {
|
|
9167
|
+
display: 'flex',
|
|
9168
|
+
padding: '16px',
|
|
9169
|
+
margin: '8px 24px',
|
|
9170
|
+
border: '1px solid #FDE047',
|
|
9171
|
+
background: '#FEFCE8',
|
|
9172
|
+
borderRadius: '5px'
|
|
9173
|
+
}
|
|
9174
|
+
}, /*#__PURE__*/React__default.createElement("div", {
|
|
9175
|
+
style: {
|
|
9176
|
+
marginRight: '5px'
|
|
9177
|
+
}
|
|
9178
|
+
}, /*#__PURE__*/React__default.createElement(InviteInfoIcon, null)), /*#__PURE__*/React__default.createElement("div", {
|
|
9179
|
+
style: {
|
|
9180
|
+
fontSize: '14px',
|
|
9181
|
+
color: '#374151'
|
|
9182
|
+
}
|
|
9183
|
+
}, "This invitation will be sent to users who have not logged into the platform."))), /*#__PURE__*/React__default.createElement(BulkUploadModal, {
|
|
9057
9184
|
isOpenImportUsersModal: isOpenImportUsersModal,
|
|
9058
9185
|
closeImportUsersModal: closeImportUsersModal,
|
|
9059
9186
|
closeImportModal: closeImportModal
|
|
@@ -9062,8 +9189,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9062
9189
|
errMsg: hasVerificationError
|
|
9063
9190
|
}));
|
|
9064
9191
|
};
|
|
9065
|
-
var TabLabelCount = function TabLabelCount(
|
|
9066
|
-
var count =
|
|
9192
|
+
var TabLabelCount = function TabLabelCount(_ref3) {
|
|
9193
|
+
var count = _ref3.count;
|
|
9067
9194
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9068
9195
|
className: styles$5.TabLabelCount
|
|
9069
9196
|
}, " ", count, " ");
|
|
@@ -9169,7 +9296,7 @@ function Listview(_ref) {
|
|
|
9169
9296
|
id: 'no_of_users',
|
|
9170
9297
|
label: 'Number of users',
|
|
9171
9298
|
width: '45%',
|
|
9172
|
-
sortable:
|
|
9299
|
+
sortable: false,
|
|
9173
9300
|
cell: function cell(row) {
|
|
9174
9301
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9175
9302
|
component: "div"
|