@itilite/iui-user-management 0.4.30 → 0.4.32
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 +79 -7
- package/dist/index.js +837 -466
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +839 -468
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -2
package/dist/index.modern.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IUIAsyncSelect, IUIBox, IUILabel, IUIFileUpload, IUICheckboxButton, IUIPhone, IUISelect, IUIDatePicker, IUIInput, IUIDivider, IUIGrid, IUITypography, IUIRadio, IUIButton, IUIModal,
|
|
1
|
+
import { IUIAsyncSelect, IUIBox, IUILabel, IUIFileUpload, IUICheckboxButton, IUIPhone, IUISelect, IUIDatePicker, IUIInput, IUIDivider, IUIGrid, IUITypography, IUIRadio, IUIButton, IUIModal, IUIAccordionMain, icons, IUIIconButton, IUICard, IUIBackdrop, IUICircularProgress, IUIBreadCrumb, IUIDropzone, IUIStepper, IUIFormControlLabel, IUICheckBox, IUIPrimaryRadio, IUITable, IUISkeleton, IUIProfileBox, IUIFormGroup, IUISearch, IUIDropdownButton, IUITabs } from '@itilite/iuistyles';
|
|
2
2
|
import React, { useState, useEffect, useRef, Fragment as Fragment$1 } from 'react';
|
|
3
3
|
import { configs, services, utilUrls } from '@itilite/utils';
|
|
4
4
|
import axios from 'axios';
|
|
@@ -15,7 +15,8 @@ import Tooltip from '@material-ui/core/Tooltip';
|
|
|
15
15
|
import Switch from '@material-ui/core/Switch';
|
|
16
16
|
import MoreHorizIcon from '@material-ui/icons/MoreHoriz';
|
|
17
17
|
import Button from '@material-ui/core/Button';
|
|
18
|
-
import { Popper, Grow, Paper, ClickAwayListener, MenuList, MenuItem, Typography } from '@material-ui/core';
|
|
18
|
+
import { Popper, Grow, Paper, ClickAwayListener, MenuList, MenuItem, Typography, Box } from '@material-ui/core';
|
|
19
|
+
import { useScrollPosition } from '@n8tb1t/use-scroll-position';
|
|
19
20
|
|
|
20
21
|
function _extends() {
|
|
21
22
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -455,6 +456,14 @@ var userPanelUrl = {
|
|
|
455
456
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
456
457
|
}
|
|
457
458
|
};
|
|
459
|
+
var departmentUrl = {
|
|
460
|
+
departmentUrl: function departmentUrl() {
|
|
461
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department";
|
|
462
|
+
},
|
|
463
|
+
getDepartmentHead: function getDepartmentHead(departmentId, page) {
|
|
464
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department/" + departmentId + "/users?page=" + page;
|
|
465
|
+
}
|
|
466
|
+
};
|
|
458
467
|
|
|
459
468
|
var api = configs.api;
|
|
460
469
|
var NAoptionConfig = {
|
|
@@ -683,6 +692,46 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
|
683
692
|
return Promise.reject(e);
|
|
684
693
|
}
|
|
685
694
|
};
|
|
695
|
+
var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions, _ref6) {
|
|
696
|
+
var page = _ref6.page,
|
|
697
|
+
departmentId = _ref6.departmentId;
|
|
698
|
+
try {
|
|
699
|
+
return Promise.resolve(_catch(function () {
|
|
700
|
+
return Promise.resolve(api.get(departmentUrl.getDepartmentHead(departmentId, page) + "&search=" + search).then(function (res) {
|
|
701
|
+
return res.data;
|
|
702
|
+
})).then(function (response) {
|
|
703
|
+
var mappedValue = response.results.map(function (item) {
|
|
704
|
+
return {
|
|
705
|
+
value: item.id,
|
|
706
|
+
label: item.first_name + ' ' + item.last_name,
|
|
707
|
+
type: 'detailed',
|
|
708
|
+
data: item
|
|
709
|
+
};
|
|
710
|
+
});
|
|
711
|
+
console.log(response.next);
|
|
712
|
+
return {
|
|
713
|
+
options: mappedValue,
|
|
714
|
+
hasMore: !!response.next,
|
|
715
|
+
additional: {
|
|
716
|
+
page: page + 1,
|
|
717
|
+
departmentId: departmentId
|
|
718
|
+
}
|
|
719
|
+
};
|
|
720
|
+
});
|
|
721
|
+
}, function () {
|
|
722
|
+
return {
|
|
723
|
+
options: [],
|
|
724
|
+
hasMore: false,
|
|
725
|
+
additional: {
|
|
726
|
+
page: 1,
|
|
727
|
+
departmentId: departmentId
|
|
728
|
+
}
|
|
729
|
+
};
|
|
730
|
+
}));
|
|
731
|
+
} catch (e) {
|
|
732
|
+
return Promise.reject(e);
|
|
733
|
+
}
|
|
734
|
+
};
|
|
686
735
|
|
|
687
736
|
var UserRole = function UserRole(_ref) {
|
|
688
737
|
var _ref$list = _ref.list,
|
|
@@ -1053,12 +1102,6 @@ var setSignUpRequestList = function setSignUpRequestList(payload) {
|
|
|
1053
1102
|
payload: payload
|
|
1054
1103
|
};
|
|
1055
1104
|
};
|
|
1056
|
-
var setUserActiveStatus = function setUserActiveStatus(payload) {
|
|
1057
|
-
return {
|
|
1058
|
-
type: SET_ACTIVE_STATUS,
|
|
1059
|
-
payload: payload
|
|
1060
|
-
};
|
|
1061
|
-
};
|
|
1062
1105
|
var setBulkDeactivatedUsers = function setBulkDeactivatedUsers(payload) {
|
|
1063
1106
|
return {
|
|
1064
1107
|
type: SET_BULK_DEACTIVATED_USERS,
|
|
@@ -1151,27 +1194,6 @@ var updateTabValue = function updateTabValue(tabId) {
|
|
|
1151
1194
|
payload: tabId
|
|
1152
1195
|
};
|
|
1153
1196
|
};
|
|
1154
|
-
var updateActiveStatus = function updateActiveStatus(activateVal, id) {
|
|
1155
|
-
return function (dispatch) {
|
|
1156
|
-
return new Promise(function (resolve, reject) {
|
|
1157
|
-
api$1.get(userListUrl.updateActiveStatus + 'user_id=' + id + '&activate=' + activateVal).then(function (res) {
|
|
1158
|
-
dispatch(setUserActiveStatus({
|
|
1159
|
-
is_active: activateVal !== 0,
|
|
1160
|
-
id: id
|
|
1161
|
-
}));
|
|
1162
|
-
IUIToastMessageService.sNotify(res.data.message);
|
|
1163
|
-
resolve(res);
|
|
1164
|
-
})["catch"](function (err) {
|
|
1165
|
-
if (!err.response.data.status) {
|
|
1166
|
-
IUIToastMessageService.warningNotify(err.response.data.message);
|
|
1167
|
-
reject(err);
|
|
1168
|
-
return;
|
|
1169
|
-
}
|
|
1170
|
-
reject(err);
|
|
1171
|
-
});
|
|
1172
|
-
});
|
|
1173
|
-
};
|
|
1174
|
-
};
|
|
1175
1197
|
|
|
1176
1198
|
var api$2 = configs.api;
|
|
1177
1199
|
var IUIToastMessageService$1 = services.IUIToastMessageService,
|
|
@@ -1754,6 +1776,7 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1754
1776
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1755
1777
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1756
1778
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1779
|
+
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1757
1780
|
|
|
1758
1781
|
var api$3 = configs.api;
|
|
1759
1782
|
var IUIToastMessageService$2 = services.IUIToastMessageService;
|
|
@@ -1803,14 +1826,14 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1803
1826
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1804
1827
|
return function (dispatch) {
|
|
1805
1828
|
return new Promise(function (resolve, reject) {
|
|
1806
|
-
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1829
|
+
api$3.post(tableName === 'department' ? departmentUrl.departmentUrl() : userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1807
1830
|
dispatch(getUserPanalData(getParam));
|
|
1808
1831
|
dispatch(closeDialog());
|
|
1809
1832
|
resolve(res);
|
|
1810
1833
|
})["catch"](function (err) {
|
|
1811
|
-
var _err$
|
|
1834
|
+
var _err$response3, _err$response3$data;
|
|
1812
1835
|
dispatch(userPanelStopLoader());
|
|
1813
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1836
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response3 = err.response) === null || _err$response3 === void 0 ? void 0 : (_err$response3$data = _err$response3.data) === null || _err$response3$data === void 0 ? void 0 : _err$response3$data.message) || 'Opps, Something went wrong.');
|
|
1814
1837
|
});
|
|
1815
1838
|
});
|
|
1816
1839
|
};
|
|
@@ -1824,25 +1847,37 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1824
1847
|
dispatch(userPanelStopLoader());
|
|
1825
1848
|
resolve();
|
|
1826
1849
|
})["catch"](function (err) {
|
|
1827
|
-
var _err$
|
|
1828
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1850
|
+
var _err$response4, _err$response4$data;
|
|
1851
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response4 = err.response) === null || _err$response4 === void 0 ? void 0 : (_err$response4$data = _err$response4.data) === null || _err$response4$data === void 0 ? void 0 : _err$response4$data.message) || 'Opps, Something went wrong.');
|
|
1829
1852
|
dispatch(userPanelStopLoader());
|
|
1830
1853
|
});
|
|
1831
1854
|
});
|
|
1832
1855
|
};
|
|
1833
1856
|
};
|
|
1834
|
-
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1857
|
+
var editRecord = function editRecord(tableName, data, getParam, optionalParams) {
|
|
1835
1858
|
return function (dispatch) {
|
|
1836
1859
|
return new Promise(function (resolve, reject) {
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1860
|
+
if (tableName === 'department') {
|
|
1861
|
+
api$3.put(departmentUrl.departmentUrl() + "/" + optionalParams, data).then(function (res) {
|
|
1862
|
+
dispatch(getUserPanalData(getParam));
|
|
1863
|
+
dispatch(closeDialog());
|
|
1864
|
+
resolve();
|
|
1865
|
+
})["catch"](function (err) {
|
|
1866
|
+
var _err$response5, _err$response5$data;
|
|
1867
|
+
dispatch(userPanelStopLoader());
|
|
1868
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response5 = err.response) === null || _err$response5 === void 0 ? void 0 : (_err$response5$data = _err$response5.data) === null || _err$response5$data === void 0 ? void 0 : _err$response5$data.message) || 'Opps, Something went wrong.');
|
|
1869
|
+
});
|
|
1870
|
+
} else {
|
|
1871
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1872
|
+
dispatch(getUserPanalData(getParam));
|
|
1873
|
+
dispatch(closeDialog());
|
|
1874
|
+
resolve();
|
|
1875
|
+
})["catch"](function (err) {
|
|
1876
|
+
var _err$response6, _err$response6$data;
|
|
1877
|
+
dispatch(userPanelStopLoader());
|
|
1878
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response6 = err.response) === null || _err$response6 === void 0 ? void 0 : (_err$response6$data = _err$response6.data) === null || _err$response6$data === void 0 ? void 0 : _err$response6$data.message) || 'Opps, Something went wrong.');
|
|
1879
|
+
});
|
|
1880
|
+
}
|
|
1846
1881
|
});
|
|
1847
1882
|
};
|
|
1848
1883
|
};
|
|
@@ -1854,8 +1889,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1854
1889
|
dispatch(closeDialog());
|
|
1855
1890
|
resolve(res);
|
|
1856
1891
|
})["catch"](function (err) {
|
|
1857
|
-
var _err$
|
|
1858
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1892
|
+
var _err$response7, _err$response7$data;
|
|
1893
|
+
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$response7 = err.response) === null || _err$response7 === void 0 ? void 0 : (_err$response7$data = _err$response7.data) === null || _err$response7$data === void 0 ? void 0 : _err$response7$data.message) || 'Opps, Something went wrong.');
|
|
1859
1894
|
});
|
|
1860
1895
|
});
|
|
1861
1896
|
};
|
|
@@ -3955,6 +3990,7 @@ var initialState$2 = {
|
|
|
3955
3990
|
previous: null,
|
|
3956
3991
|
results: []
|
|
3957
3992
|
},
|
|
3993
|
+
deptUsers: [],
|
|
3958
3994
|
loading: false
|
|
3959
3995
|
};
|
|
3960
3996
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4024,6 +4060,12 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4024
4060
|
loading: false
|
|
4025
4061
|
});
|
|
4026
4062
|
}
|
|
4063
|
+
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4064
|
+
{
|
|
4065
|
+
return _extends({}, state, {
|
|
4066
|
+
deptUsers: action.payload
|
|
4067
|
+
});
|
|
4068
|
+
}
|
|
4027
4069
|
default:
|
|
4028
4070
|
return state;
|
|
4029
4071
|
}
|
|
@@ -4221,49 +4263,8 @@ function withStore(Component) {
|
|
|
4221
4263
|
return WrappedComponent;
|
|
4222
4264
|
}
|
|
4223
4265
|
|
|
4224
|
-
var ExpandMoreIcon = function ExpandMoreIcon(props) {
|
|
4225
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
4226
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4227
|
-
width: props.width,
|
|
4228
|
-
height: props.height,
|
|
4229
|
-
fill: "none",
|
|
4230
|
-
viewBox: "0 0 12 7"
|
|
4231
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
4232
|
-
fill: "#6B7280",
|
|
4233
|
-
d: "M.293.294a1 1 0 011.414 0L6 4.587 10.293.294a1 1 0 111.414 1.414l-5 5a1 1 0 01-1.414 0l-5-5a1 1 0 010-1.414z"
|
|
4234
|
-
}));
|
|
4235
|
-
};
|
|
4236
|
-
|
|
4237
|
-
var ExpandLessIcon = function ExpandLessIcon(props) {
|
|
4238
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
4239
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4240
|
-
width: props.width,
|
|
4241
|
-
height: props.height,
|
|
4242
|
-
fill: "none",
|
|
4243
|
-
viewBox: "0 0 10 6"
|
|
4244
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
4245
|
-
fill: "#6B7280",
|
|
4246
|
-
d: "M.293.293a1 1 0 011.414 0L5 3.586 8.293.293a1 1 0 011.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
|
|
4247
|
-
}));
|
|
4248
|
-
};
|
|
4249
|
-
|
|
4250
|
-
var CrossIcon = function CrossIcon(props) {
|
|
4251
|
-
var _props$color = props.color,
|
|
4252
|
-
color = _props$color === void 0 ? '#6B7280' : _props$color;
|
|
4253
|
-
return /*#__PURE__*/React.createElement("svg", {
|
|
4254
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4255
|
-
width: props.width,
|
|
4256
|
-
height: props.height,
|
|
4257
|
-
fill: "none",
|
|
4258
|
-
viewBox: "0 0 14 14"
|
|
4259
|
-
}, /*#__PURE__*/React.createElement("path", {
|
|
4260
|
-
fill: color,
|
|
4261
|
-
d: "M.293.292a1 1 0 011.414 0L7 5.585 12.293.292a1 1 0 111.414 1.415L8.414 7l5.293 5.292a1 1 0 01-1.414 1.415L7 8.414l-5.293 5.293a1 1 0 01-1.414-1.415L5.586 7 .293 1.707a1 1 0 010-1.415z"
|
|
4262
|
-
}));
|
|
4263
|
-
};
|
|
4264
|
-
|
|
4265
4266
|
var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
4266
|
-
var
|
|
4267
|
+
var _clsx2;
|
|
4267
4268
|
var membershipInfoInput = _ref.membershipInfoInput,
|
|
4268
4269
|
onMemInfoInputChange = _ref.onMemInfoInputChange,
|
|
4269
4270
|
addMemInfoInput = _ref.addMemInfoInput,
|
|
@@ -4292,6 +4293,10 @@ var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
|
4292
4293
|
setAdditionalInfoFlag(defaultExpand ? panel : false);
|
|
4293
4294
|
};
|
|
4294
4295
|
};
|
|
4296
|
+
var ExpandMore = icons.ExpandMore,
|
|
4297
|
+
ExpandLess = icons.ExpandLess,
|
|
4298
|
+
Add = icons.Add,
|
|
4299
|
+
Cross = icons.Cross;
|
|
4295
4300
|
var _useSelector = useSelector(function (state) {
|
|
4296
4301
|
return state.userAddEdit.renderFields;
|
|
4297
4302
|
}),
|
|
@@ -4349,312 +4354,316 @@ var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
|
4349
4354
|
}
|
|
4350
4355
|
return null;
|
|
4351
4356
|
};
|
|
4352
|
-
|
|
4353
|
-
expanded: defaultExpand === 'open',
|
|
4354
|
-
onChange: handleChange('open'),
|
|
4355
|
-
className: styles.additionalInfoContainer
|
|
4356
|
-
}, /*#__PURE__*/React.createElement(IUIAccordionSummary, {
|
|
4357
|
-
expandIcon: defaultExpand ? /*#__PURE__*/React.createElement(ExpandLessIcon, {
|
|
4358
|
-
width: "12px",
|
|
4359
|
-
height: "7px"
|
|
4360
|
-
}) : /*#__PURE__*/React.createElement(ExpandMoreIcon, {
|
|
4361
|
-
width: "12px",
|
|
4362
|
-
height: "7px"
|
|
4363
|
-
}),
|
|
4364
|
-
"aria-controls": "panel1bh-content",
|
|
4365
|
-
id: "panel1bh-header",
|
|
4366
|
-
className: clsx(styles.additionalInfoTitle, (_clsx = {}, _clsx[styles.expandIconAlign] = defaultExpand === 'open', _clsx))
|
|
4367
|
-
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4368
|
-
container: true,
|
|
4369
|
-
className: clsx(styles.product_info, styles.sectionWrapper)
|
|
4370
|
-
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4371
|
-
item: true,
|
|
4372
|
-
sm: 12,
|
|
4373
|
-
md: 4,
|
|
4374
|
-
className: styles.titleContainer
|
|
4375
|
-
}, /*#__PURE__*/React.createElement(IUILabel, {
|
|
4376
|
-
label: "Additional information",
|
|
4377
|
-
headerType: true,
|
|
4378
|
-
description: "Passport, Membership, Travel preferences..."
|
|
4379
|
-
})))), /*#__PURE__*/React.createElement(IUIAccordionDetails, {
|
|
4380
|
-
className: styles.detailsContainer
|
|
4381
|
-
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4382
|
-
container: true,
|
|
4383
|
-
className: clsx(styles.work_info, styles.sectionWrapper)
|
|
4384
|
-
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4385
|
-
item: true,
|
|
4386
|
-
sm: 12,
|
|
4387
|
-
md: 4
|
|
4388
|
-
}, /*#__PURE__*/React.createElement(IUILabel, {
|
|
4389
|
-
label: "Passport information",
|
|
4390
|
-
headerType: true
|
|
4391
|
-
})), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4392
|
-
item: true,
|
|
4393
|
-
sm: 12,
|
|
4394
|
-
md: 8,
|
|
4395
|
-
lg: 8,
|
|
4396
|
-
xl: 6
|
|
4397
|
-
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4398
|
-
container: true,
|
|
4399
|
-
className: clsx(styles.formFieldsWrapper, styles.firstRowMargin)
|
|
4400
|
-
}, passportInfo.map(function (p, i) {
|
|
4401
|
-
var _clsx2;
|
|
4402
|
-
if (!p.visibility) {
|
|
4403
|
-
return null;
|
|
4404
|
-
}
|
|
4357
|
+
var getAccordianSummary = function getAccordianSummary() {
|
|
4405
4358
|
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4359
|
+
container: true,
|
|
4360
|
+
className: clsx(styles.product_info, styles.sectionWrapper)
|
|
4361
|
+
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4406
4362
|
item: true,
|
|
4407
4363
|
sm: 12,
|
|
4408
|
-
md:
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
dateFormat: dateFormat
|
|
4421
|
-
}));
|
|
4422
|
-
})))), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
4423
|
-
className: styles.dividerColor
|
|
4424
|
-
}), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4425
|
-
container: true,
|
|
4426
|
-
className: clsx(styles.personal_info, styles.sectionWrapper)
|
|
4427
|
-
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4428
|
-
item: true,
|
|
4429
|
-
sm: 12,
|
|
4430
|
-
md: 4
|
|
4431
|
-
}, /*#__PURE__*/React.createElement(IUILabel, {
|
|
4432
|
-
label: "Membership information",
|
|
4433
|
-
headerType: true,
|
|
4434
|
-
description: "You can add up to " + maxMembershipInput + " membership details"
|
|
4435
|
-
})), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4436
|
-
item: true,
|
|
4437
|
-
sm: 12,
|
|
4438
|
-
md: 8,
|
|
4439
|
-
lg: 8,
|
|
4440
|
-
xl: 6
|
|
4441
|
-
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4442
|
-
container: true,
|
|
4443
|
-
className: styles.formFieldsWrapper
|
|
4444
|
-
}, membershipInfoInput.length === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
4445
|
-
className: styles.emptyFieldContainer
|
|
4446
|
-
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
4447
|
-
className: styles.emptyFieldDescription
|
|
4448
|
-
}, "No membership details added yet"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
4449
|
-
className: clsx(styles.emptyFieldBtnContainer, styles.rowGap),
|
|
4450
|
-
display: "flex"
|
|
4451
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
4452
|
-
buttonText: "Add airline",
|
|
4453
|
-
type: "text",
|
|
4454
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4455
|
-
width: "10",
|
|
4456
|
-
height: "10",
|
|
4457
|
-
color: "#EC5D25"
|
|
4458
|
-
}),
|
|
4459
|
-
className: styles.paddingTop,
|
|
4460
|
-
onClick: function onClick(e) {
|
|
4461
|
-
return addMemInfoInput('flight');
|
|
4462
|
-
}
|
|
4463
|
-
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
4464
|
-
buttonText: "Add hotel",
|
|
4465
|
-
type: "text",
|
|
4466
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4467
|
-
width: "10",
|
|
4468
|
-
height: "10",
|
|
4469
|
-
color: "#EC5D25"
|
|
4470
|
-
}),
|
|
4471
|
-
className: styles.paddingTop,
|
|
4472
|
-
onClick: function onClick(e) {
|
|
4473
|
-
return addMemInfoInput('hotel');
|
|
4474
|
-
}
|
|
4475
|
-
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
4476
|
-
buttonText: "Add car rental",
|
|
4477
|
-
type: "text",
|
|
4478
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4479
|
-
width: "10",
|
|
4480
|
-
height: "10",
|
|
4481
|
-
color: "#EC5D25"
|
|
4482
|
-
}),
|
|
4483
|
-
className: styles.paddingTop,
|
|
4484
|
-
onClick: function onClick(e) {
|
|
4485
|
-
return addMemInfoInput('rental_car');
|
|
4486
|
-
}
|
|
4487
|
-
}))), membershipInfoInput.length > 0 && membershipInfoInput.map(function (val, index) {
|
|
4488
|
-
if (index >= maxMembershipInput) {
|
|
4489
|
-
return null;
|
|
4490
|
-
}
|
|
4491
|
-
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
4492
|
-
key: index.toString()
|
|
4364
|
+
md: 4,
|
|
4365
|
+
className: styles.titleContainer
|
|
4366
|
+
}, /*#__PURE__*/React.createElement(IUILabel, {
|
|
4367
|
+
label: "Additional information",
|
|
4368
|
+
headerType: true,
|
|
4369
|
+
description: "Passport, Membership, Travel preferences..."
|
|
4370
|
+
})));
|
|
4371
|
+
};
|
|
4372
|
+
var getAccordianDetails = function getAccordianDetails() {
|
|
4373
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4374
|
+
container: true,
|
|
4375
|
+
className: clsx(styles.work_info, styles.sectionWrapper)
|
|
4493
4376
|
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4494
4377
|
item: true,
|
|
4378
|
+
sm: 12,
|
|
4379
|
+
md: 4
|
|
4380
|
+
}, /*#__PURE__*/React.createElement(IUILabel, {
|
|
4381
|
+
label: "Passport information",
|
|
4382
|
+
headerType: true
|
|
4383
|
+
})), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4384
|
+
item: true,
|
|
4385
|
+
sm: 12,
|
|
4495
4386
|
md: 8,
|
|
4496
|
-
lg:
|
|
4387
|
+
lg: 8,
|
|
4497
4388
|
xl: 6
|
|
4498
|
-
}, /*#__PURE__*/React.createElement(
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4389
|
+
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4390
|
+
container: true,
|
|
4391
|
+
className: clsx(styles.formFieldsWrapper, styles.firstRowMargin)
|
|
4392
|
+
}, passportInfo.map(function (p, i) {
|
|
4393
|
+
var _clsx;
|
|
4394
|
+
if (!p.visibility) {
|
|
4395
|
+
return null;
|
|
4396
|
+
}
|
|
4397
|
+
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4398
|
+
item: true,
|
|
4399
|
+
sm: 12,
|
|
4400
|
+
md: 12,
|
|
4401
|
+
lg: p.type === 'datepicker' ? 2 : p.fullWidth ? 12 : 6,
|
|
4402
|
+
xl: p.type === 'datepicker' ? 2 : p.fullWidth ? 12 : 6,
|
|
4403
|
+
key: i,
|
|
4404
|
+
className: clsx(styles.margin, (_clsx = {}, _clsx[styles.minGridWidth] = p.type === 'datepicker', _clsx))
|
|
4405
|
+
}, /*#__PURE__*/React.createElement(GetInputType, {
|
|
4406
|
+
_p: p,
|
|
4407
|
+
inputState: passportInfoInput,
|
|
4408
|
+
onValueChange: onPassportInfoInputChange,
|
|
4409
|
+
dropdownList: dropdownList,
|
|
4410
|
+
errorArray: errorArray,
|
|
4411
|
+
errorMsg: errorMsgs[p.name],
|
|
4412
|
+
dateFormat: dateFormat
|
|
4413
|
+
}));
|
|
4414
|
+
})))), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
4415
|
+
className: styles.dividerColor
|
|
4416
|
+
}), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4417
|
+
container: true,
|
|
4418
|
+
className: clsx(styles.personal_info, styles.sectionWrapper)
|
|
4419
|
+
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4420
|
+
item: true,
|
|
4421
|
+
sm: 12,
|
|
4422
|
+
md: 4
|
|
4423
|
+
}, /*#__PURE__*/React.createElement(IUILabel, {
|
|
4424
|
+
label: "Membership information",
|
|
4425
|
+
headerType: true,
|
|
4426
|
+
description: "You can add up to " + maxMembershipInput + " membership details"
|
|
4502
4427
|
})), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4503
4428
|
item: true,
|
|
4429
|
+
sm: 12,
|
|
4504
4430
|
md: 8,
|
|
4505
|
-
lg:
|
|
4431
|
+
lg: 8,
|
|
4506
4432
|
xl: 6
|
|
4433
|
+
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4434
|
+
container: true,
|
|
4435
|
+
className: styles.formFieldsWrapper
|
|
4436
|
+
}, membershipInfoInput.length === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
4437
|
+
className: styles.emptyFieldContainer
|
|
4438
|
+
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
4439
|
+
className: styles.emptyFieldDescription
|
|
4440
|
+
}, "No membership details added yet"), /*#__PURE__*/React.createElement(IUIBox, {
|
|
4441
|
+
className: clsx(styles.emptyFieldBtnContainer, styles.rowGap),
|
|
4442
|
+
display: "flex"
|
|
4443
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
4444
|
+
buttonText: "Add airline",
|
|
4445
|
+
type: "text",
|
|
4446
|
+
startIcon: /*#__PURE__*/React.createElement(icons.Add, {
|
|
4447
|
+
width: "10",
|
|
4448
|
+
height: "10",
|
|
4449
|
+
color: "#EC5D25"
|
|
4450
|
+
}),
|
|
4451
|
+
className: styles.paddingTop,
|
|
4452
|
+
onClick: function onClick(e) {
|
|
4453
|
+
return addMemInfoInput('flight');
|
|
4454
|
+
}
|
|
4455
|
+
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
4456
|
+
buttonText: "Add hotel",
|
|
4457
|
+
type: "text",
|
|
4458
|
+
startIcon: /*#__PURE__*/React.createElement(icons.Add, {
|
|
4459
|
+
width: "10",
|
|
4460
|
+
height: "10",
|
|
4461
|
+
color: "#EC5D25"
|
|
4462
|
+
}),
|
|
4463
|
+
className: styles.paddingTop,
|
|
4464
|
+
onClick: function onClick(e) {
|
|
4465
|
+
return addMemInfoInput('hotel');
|
|
4466
|
+
}
|
|
4467
|
+
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
4468
|
+
buttonText: "Add car rental",
|
|
4469
|
+
type: "text",
|
|
4470
|
+
startIcon: /*#__PURE__*/React.createElement(icons.Add, {
|
|
4471
|
+
width: "10",
|
|
4472
|
+
height: "10",
|
|
4473
|
+
color: "#EC5D25"
|
|
4474
|
+
}),
|
|
4475
|
+
className: styles.paddingTop,
|
|
4476
|
+
onClick: function onClick(e) {
|
|
4477
|
+
return addMemInfoInput('rental_car');
|
|
4478
|
+
}
|
|
4479
|
+
}))), membershipInfoInput.length > 0 && membershipInfoInput.map(function (val, index) {
|
|
4480
|
+
if (index >= maxMembershipInput) {
|
|
4481
|
+
return null;
|
|
4482
|
+
}
|
|
4483
|
+
return /*#__PURE__*/React.createElement(React.Fragment, {
|
|
4484
|
+
key: index.toString()
|
|
4485
|
+
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4486
|
+
item: true,
|
|
4487
|
+
md: 8,
|
|
4488
|
+
lg: 6,
|
|
4489
|
+
xl: 6
|
|
4490
|
+
}, /*#__PURE__*/React.createElement(MembershipField, {
|
|
4491
|
+
val: val,
|
|
4492
|
+
index: index,
|
|
4493
|
+
key: index.toString()
|
|
4494
|
+
})), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4495
|
+
item: true,
|
|
4496
|
+
md: 8,
|
|
4497
|
+
lg: 6,
|
|
4498
|
+
xl: 6
|
|
4499
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
4500
|
+
component: "div",
|
|
4501
|
+
display: "flex"
|
|
4502
|
+
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
4503
|
+
label: "Membership number",
|
|
4504
|
+
placeholder: "Enter membership number",
|
|
4505
|
+
fullwidth: false,
|
|
4506
|
+
defaultValue: val.number,
|
|
4507
|
+
onValueChange: function onValueChange(_ref6) {
|
|
4508
|
+
var _value = _ref6._value;
|
|
4509
|
+
return onMemInfoInputChange(index, 'number', _value);
|
|
4510
|
+
}
|
|
4511
|
+
}), /*#__PURE__*/React.createElement(IUIIconButton, {
|
|
4512
|
+
style: {
|
|
4513
|
+
marginTop: '30px'
|
|
4514
|
+
},
|
|
4515
|
+
disableRipple: true,
|
|
4516
|
+
onClick: function onClick() {
|
|
4517
|
+
return handleRemoveMemFields(index);
|
|
4518
|
+
},
|
|
4519
|
+
className: styles.backGrdColorOnHover
|
|
4520
|
+
}, /*#__PURE__*/React.createElement(Cross, {
|
|
4521
|
+
width: "14",
|
|
4522
|
+
height: "14"
|
|
4523
|
+
})))));
|
|
4524
|
+
}), membershipInfoInput.length < maxMembershipInput && membershipInfoInput.length > 0 && /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4525
|
+
item: true,
|
|
4526
|
+
md: 8,
|
|
4527
|
+
lg: 8,
|
|
4528
|
+
xl: 8
|
|
4507
4529
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
4508
|
-
|
|
4530
|
+
className: clsx(styles.emptyFieldBtnContainer, styles.rowGap),
|
|
4509
4531
|
display: "flex"
|
|
4510
|
-
}, /*#__PURE__*/React.createElement(
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4532
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
4533
|
+
buttonText: "Add airline",
|
|
4534
|
+
type: "text",
|
|
4535
|
+
startIcon: /*#__PURE__*/React.createElement(Add, {
|
|
4536
|
+
width: "10",
|
|
4537
|
+
height: "10",
|
|
4538
|
+
color: "#EC5D25"
|
|
4539
|
+
}),
|
|
4540
|
+
className: styles.paddingTop,
|
|
4541
|
+
onClick: function onClick(e) {
|
|
4542
|
+
return addMemInfoInput('flight');
|
|
4518
4543
|
}
|
|
4519
|
-
}), /*#__PURE__*/React.createElement(
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
},
|
|
4527
|
-
className: styles.
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
})
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
onClick: function onClick(e) {
|
|
4550
|
-
return addMemInfoInput('flight');
|
|
4551
|
-
}
|
|
4552
|
-
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
4553
|
-
buttonText: "Add hotel",
|
|
4554
|
-
type: "text",
|
|
4555
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4556
|
-
width: "10",
|
|
4557
|
-
height: "10",
|
|
4558
|
-
color: "#EC5D25"
|
|
4559
|
-
}),
|
|
4560
|
-
className: styles.paddingTop,
|
|
4561
|
-
onClick: function onClick(e) {
|
|
4562
|
-
return addMemInfoInput('hotel');
|
|
4563
|
-
}
|
|
4564
|
-
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
4565
|
-
buttonText: "Add car rental",
|
|
4566
|
-
type: "text",
|
|
4567
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
4568
|
-
width: "10",
|
|
4569
|
-
height: "10",
|
|
4570
|
-
color: "#EC5D25"
|
|
4571
|
-
}),
|
|
4572
|
-
className: styles.paddingTop,
|
|
4573
|
-
onClick: function onClick(e) {
|
|
4574
|
-
return addMemInfoInput('rental_car');
|
|
4575
|
-
}
|
|
4576
|
-
})))))), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
4577
|
-
className: styles.dividerColor
|
|
4578
|
-
}), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4579
|
-
container: true,
|
|
4580
|
-
className: clsx(styles.personal_info, styles.sectionWrapper)
|
|
4581
|
-
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4582
|
-
item: true,
|
|
4583
|
-
sm: 12,
|
|
4584
|
-
md: 4
|
|
4585
|
-
}, /*#__PURE__*/React.createElement(IUILabel, {
|
|
4586
|
-
label: "Travel preferences",
|
|
4587
|
-
headerType: true
|
|
4588
|
-
})), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4589
|
-
item: true,
|
|
4590
|
-
sm: 12,
|
|
4591
|
-
md: 8,
|
|
4592
|
-
lg: 8,
|
|
4593
|
-
xl: 6
|
|
4594
|
-
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4595
|
-
container: true,
|
|
4596
|
-
className: clsx(styles.formFieldsWrapper, styles.firstRowMargin)
|
|
4597
|
-
}, travelPreference.map(function (p, i) {
|
|
4598
|
-
if (!p.visibility) {
|
|
4599
|
-
return null;
|
|
4600
|
-
}
|
|
4601
|
-
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4544
|
+
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
4545
|
+
buttonText: "Add hotel",
|
|
4546
|
+
type: "text",
|
|
4547
|
+
startIcon: /*#__PURE__*/React.createElement(Add, {
|
|
4548
|
+
width: "10",
|
|
4549
|
+
height: "10",
|
|
4550
|
+
color: "#EC5D25"
|
|
4551
|
+
}),
|
|
4552
|
+
className: styles.paddingTop,
|
|
4553
|
+
onClick: function onClick(e) {
|
|
4554
|
+
return addMemInfoInput('hotel');
|
|
4555
|
+
}
|
|
4556
|
+
}), /*#__PURE__*/React.createElement(IUIButton, {
|
|
4557
|
+
buttonText: "Add car rental",
|
|
4558
|
+
type: "text",
|
|
4559
|
+
startIcon: /*#__PURE__*/React.createElement(icons.Add, {
|
|
4560
|
+
width: "10",
|
|
4561
|
+
height: "10",
|
|
4562
|
+
color: "#EC5D25"
|
|
4563
|
+
}),
|
|
4564
|
+
className: styles.paddingTop,
|
|
4565
|
+
onClick: function onClick(e) {
|
|
4566
|
+
return addMemInfoInput('rental_car');
|
|
4567
|
+
}
|
|
4568
|
+
})))))), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
4569
|
+
className: styles.dividerColor
|
|
4570
|
+
}), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4571
|
+
container: true,
|
|
4572
|
+
className: clsx(styles.personal_info, styles.sectionWrapper)
|
|
4573
|
+
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4602
4574
|
item: true,
|
|
4603
4575
|
sm: 12,
|
|
4604
|
-
md:
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
|
|
4609
|
-
}, /*#__PURE__*/React.createElement(GetInputType, {
|
|
4610
|
-
_p: p,
|
|
4611
|
-
inputState: travelPreferenceInfo,
|
|
4612
|
-
onValueChange: travelPreferenceOnChange,
|
|
4613
|
-
dropdownList: dropdownList,
|
|
4614
|
-
errorArray: errorArray,
|
|
4615
|
-
errorMsg: errorMsgs[p.name]
|
|
4616
|
-
}));
|
|
4617
|
-
})))), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
4618
|
-
className: styles.dividerColor
|
|
4619
|
-
}), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4620
|
-
container: true,
|
|
4621
|
-
className: clsx(styles.personal_info, styles.sectionWrapper)
|
|
4622
|
-
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4623
|
-
item: true,
|
|
4624
|
-
sm: 12,
|
|
4625
|
-
md: 4
|
|
4626
|
-
}, /*#__PURE__*/React.createElement(IUILabel, {
|
|
4627
|
-
label: "Secure traveler information",
|
|
4628
|
-
headerType: true
|
|
4629
|
-
})), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4630
|
-
item: true,
|
|
4631
|
-
sm: 12,
|
|
4632
|
-
md: 8,
|
|
4633
|
-
lg: 8,
|
|
4634
|
-
xl: 6
|
|
4635
|
-
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4636
|
-
container: true,
|
|
4637
|
-
className: clsx(styles.formFieldsWrapper, styles.firstRowMargin)
|
|
4638
|
-
}, secureTravelInfo.map(function (p, i) {
|
|
4639
|
-
if (!p.visibility) {
|
|
4640
|
-
return null;
|
|
4641
|
-
}
|
|
4642
|
-
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4576
|
+
md: 4
|
|
4577
|
+
}, /*#__PURE__*/React.createElement(IUILabel, {
|
|
4578
|
+
label: "Travel preferences",
|
|
4579
|
+
headerType: true
|
|
4580
|
+
})), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4643
4581
|
item: true,
|
|
4644
4582
|
sm: 12,
|
|
4645
|
-
md:
|
|
4646
|
-
lg:
|
|
4647
|
-
xl:
|
|
4648
|
-
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4583
|
+
md: 8,
|
|
4584
|
+
lg: 8,
|
|
4585
|
+
xl: 6
|
|
4586
|
+
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4587
|
+
container: true,
|
|
4588
|
+
className: clsx(styles.formFieldsWrapper, styles.firstRowMargin)
|
|
4589
|
+
}, travelPreference.map(function (p, i) {
|
|
4590
|
+
if (!p.visibility) {
|
|
4591
|
+
return null;
|
|
4592
|
+
}
|
|
4593
|
+
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4594
|
+
item: true,
|
|
4595
|
+
sm: 12,
|
|
4596
|
+
md: 12,
|
|
4597
|
+
lg: p.fullWidth ? 12 : 6,
|
|
4598
|
+
xl: p.fullWidth ? 12 : 6,
|
|
4599
|
+
key: i,
|
|
4600
|
+
className: clsx(styles.margin)
|
|
4601
|
+
}, /*#__PURE__*/React.createElement(GetInputType, {
|
|
4602
|
+
_p: p,
|
|
4603
|
+
inputState: travelPreferenceInfo,
|
|
4604
|
+
onValueChange: travelPreferenceOnChange,
|
|
4605
|
+
dropdownList: dropdownList,
|
|
4606
|
+
errorArray: errorArray,
|
|
4607
|
+
errorMsg: errorMsgs[p.name]
|
|
4608
|
+
}));
|
|
4609
|
+
})))), /*#__PURE__*/React.createElement(IUIDivider, {
|
|
4610
|
+
className: styles.dividerColor
|
|
4611
|
+
}), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4612
|
+
container: true,
|
|
4613
|
+
className: clsx(styles.personal_info, styles.sectionWrapper)
|
|
4614
|
+
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4615
|
+
item: true,
|
|
4616
|
+
sm: 12,
|
|
4617
|
+
md: 4
|
|
4618
|
+
}, /*#__PURE__*/React.createElement(IUILabel, {
|
|
4619
|
+
label: "Secure traveler information",
|
|
4620
|
+
headerType: true
|
|
4621
|
+
})), /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4622
|
+
item: true,
|
|
4623
|
+
sm: 12,
|
|
4624
|
+
md: 8,
|
|
4625
|
+
lg: 8,
|
|
4626
|
+
xl: 6
|
|
4627
|
+
}, /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4628
|
+
container: true,
|
|
4629
|
+
className: clsx(styles.formFieldsWrapper, styles.firstRowMargin)
|
|
4630
|
+
}, secureTravelInfo.map(function (p, i) {
|
|
4631
|
+
if (!p.visibility) {
|
|
4632
|
+
return null;
|
|
4633
|
+
}
|
|
4634
|
+
return /*#__PURE__*/React.createElement(IUIGrid, {
|
|
4635
|
+
item: true,
|
|
4636
|
+
sm: 12,
|
|
4637
|
+
md: 12,
|
|
4638
|
+
lg: p.fullWidth ? 12 : 6,
|
|
4639
|
+
xl: p.fullWidth ? 12 : 6,
|
|
4640
|
+
key: i,
|
|
4641
|
+
className: clsx(styles.margin)
|
|
4642
|
+
}, /*#__PURE__*/React.createElement(GetInputType, {
|
|
4643
|
+
_p: p,
|
|
4644
|
+
inputState: secureTravelInputInfo,
|
|
4645
|
+
onValueChange: onSecureTraveelerInfoInputChange,
|
|
4646
|
+
errorArray: errorArray,
|
|
4647
|
+
errorMsg: errorMsgs[p.name]
|
|
4648
|
+
}));
|
|
4649
|
+
})))));
|
|
4650
|
+
};
|
|
4651
|
+
return /*#__PURE__*/React.createElement(IUIAccordionMain, {
|
|
4652
|
+
expanded: defaultExpand === 'open',
|
|
4653
|
+
onChange: handleChange('open'),
|
|
4654
|
+
accordionClass: styles.additionalInfoContainer,
|
|
4655
|
+
summaryComponent: getAccordianSummary(),
|
|
4656
|
+
summaryClass: clsx(styles.additionalInfoTitle, (_clsx2 = {}, _clsx2[styles.expandIconAlign] = defaultExpand === 'open', _clsx2)),
|
|
4657
|
+
expandIcon: defaultExpand ? /*#__PURE__*/React.createElement(ExpandLess, {
|
|
4658
|
+
width: "12px",
|
|
4659
|
+
height: "7px"
|
|
4660
|
+
}) : /*#__PURE__*/React.createElement(ExpandMore, {
|
|
4661
|
+
width: "12px",
|
|
4662
|
+
height: "7px"
|
|
4663
|
+
}),
|
|
4664
|
+
detailsComponent: getAccordianDetails(),
|
|
4665
|
+
detailsClass: styles.detailsContainer
|
|
4666
|
+
});
|
|
4658
4667
|
};
|
|
4659
4668
|
|
|
4660
4669
|
var styles$3 = {"root":"_b_muK","minWidth":"_3OQXs","bullet":"_1Q5vL","pos":"_6wGWA","cardHeader":"_SWCfJ","pageHeader":"_2ZeWp","buttonHover":"_2Iuy1","cardHeaderBackground":"_3NJWF","actionCustom":"_3Kbfm"};
|
|
@@ -6738,7 +6747,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6738
6747
|
};
|
|
6739
6748
|
};
|
|
6740
6749
|
|
|
6741
|
-
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"};
|
|
6750
|
+
var styles$5 = {"UUIUserManagementList":"_3WNHx","scrollOverlayMenu":"_2_WEg","overlaysearch":"_1Pbhb","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","deactivateAlert":"_3hvWz","departmentHeadText":"_3pOsV","deactivateBtn":"_2v6e4"};
|
|
6742
6751
|
|
|
6743
6752
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6744
6753
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -7999,6 +8008,19 @@ var BulkDownloadIcon = function BulkDownloadIcon(props) {
|
|
|
7999
8008
|
|
|
8000
8009
|
var classes = {"containedBtn":"_2A4_u","customMiniBox":"_QGIKG","muiBtn":"_3iFbO","outlinedBtn":"_3lQYD","menuList":"_1C8bJ","menuListContainer":"_1N83W","menuItemContainer":"_3VtcE","menuItemtext":"_2xqnU","subTxt":"_3CVzX"};
|
|
8001
8010
|
|
|
8011
|
+
var ExpandMoreIcon = function ExpandMoreIcon(props) {
|
|
8012
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
8013
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8014
|
+
width: props.width,
|
|
8015
|
+
height: props.height,
|
|
8016
|
+
fill: "none",
|
|
8017
|
+
viewBox: "0 0 12 7"
|
|
8018
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
8019
|
+
fill: "#6B7280",
|
|
8020
|
+
d: "M.293.294a1 1 0 011.414 0L6 4.587 10.293.294a1 1 0 111.414 1.414l-5 5a1 1 0 01-1.414 0l-5-5a1 1 0 010-1.414z"
|
|
8021
|
+
}));
|
|
8022
|
+
};
|
|
8023
|
+
|
|
8002
8024
|
var DropdownBtn = function DropdownBtn(props) {
|
|
8003
8025
|
var _clsx;
|
|
8004
8026
|
var _props$buttonText = props.buttonText,
|
|
@@ -8391,7 +8413,8 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8391
8413
|
isDataFetching: isDataFetching,
|
|
8392
8414
|
disableRowCheckbox: disableRowCheckbox,
|
|
8393
8415
|
searchBoxWidth: "400px",
|
|
8394
|
-
searchValue: searchValue
|
|
8416
|
+
searchValue: searchValue,
|
|
8417
|
+
hideTopPagination: false
|
|
8395
8418
|
});
|
|
8396
8419
|
};
|
|
8397
8420
|
var SingupRequests = function SingupRequests(props) {
|
|
@@ -8522,6 +8545,25 @@ function InviteInfoIcon() {
|
|
|
8522
8545
|
}));
|
|
8523
8546
|
}
|
|
8524
8547
|
|
|
8548
|
+
function InfoYellowIcon(props) {
|
|
8549
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
8550
|
+
width: props.width,
|
|
8551
|
+
height: props.height,
|
|
8552
|
+
viewBox: "0 0 20 20",
|
|
8553
|
+
fill: "none",
|
|
8554
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8555
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
8556
|
+
d: "M11 4.99951C11 5.5518 10.5523 5.99951 10 5.99951C9.44771 5.99951 9 5.5518 9 4.99951C9 4.44723 9.44771 3.99951 10 3.99951C10.5523 3.99951 11 4.44723 11 4.99951Z",
|
|
8557
|
+
fill: "#CA8A04"
|
|
8558
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
8559
|
+
d: "M8 7.99951C7.44772 7.99951 7 8.44723 7 8.99951C7 9.5518 7.44772 9.99951 8 9.99951H9V12.9995H8C7.44772 12.9995 7 13.4472 7 13.9995C7 14.5518 7.44772 14.9995 8 14.9995H12C12.5523 14.9995 13 14.5518 13 13.9995C13 13.4472 12.5523 12.9995 12 12.9995H11V8.99951C11 8.44723 10.5523 7.99951 10 7.99951H8Z",
|
|
8560
|
+
fill: "#CA8A04"
|
|
8561
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
8562
|
+
d: "M0 9.99951C0 15.5224 4.47715 19.9995 10 19.9995C15.5228 19.9995 20 15.5224 20 9.99951C20 4.47666 15.5228 -0.000488281 10 -0.000488281C4.47715 -0.000488281 0 4.47666 0 9.99951ZM10 1.99951C14.4183 1.99951 18 5.58123 18 9.99951C18 14.4178 14.4183 17.9995 10 17.9995C5.58172 17.9995 2 14.4178 2 9.99951C2 5.58123 5.58172 1.99951 10 1.99951Z",
|
|
8563
|
+
fill: "#CA8A04"
|
|
8564
|
+
}));
|
|
8565
|
+
}
|
|
8566
|
+
|
|
8525
8567
|
var IUIToastMessageService$7 = services.IUIToastMessageService;
|
|
8526
8568
|
var env$7 = configs.env;
|
|
8527
8569
|
var UndoButton = function UndoButton(_ref) {
|
|
@@ -8564,7 +8606,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8564
8606
|
var _React$useState = React.useState(1),
|
|
8565
8607
|
page = _React$useState[0],
|
|
8566
8608
|
setPage = _React$useState[1];
|
|
8567
|
-
var _useState = useState(
|
|
8609
|
+
var _useState = useState(10),
|
|
8568
8610
|
rowsPerPage = _useState[0],
|
|
8569
8611
|
setRowsPerPage = _useState[1];
|
|
8570
8612
|
var _React$useState2 = React.useState({}),
|
|
@@ -8573,9 +8615,12 @@ var UserList = function UserList(_ref2) {
|
|
|
8573
8615
|
var _React$useState3 = React.useState('asc'),
|
|
8574
8616
|
order = _React$useState3[0],
|
|
8575
8617
|
setOrder = _React$useState3[1];
|
|
8576
|
-
var _React$useState4 = React.useState(
|
|
8577
|
-
|
|
8578
|
-
|
|
8618
|
+
var _React$useState4 = React.useState(false),
|
|
8619
|
+
deactivateSingle = _React$useState4[0],
|
|
8620
|
+
setDeactivateSingle = _React$useState4[1];
|
|
8621
|
+
var _React$useState5 = React.useState('first_name'),
|
|
8622
|
+
orderBy = _React$useState5[0],
|
|
8623
|
+
setOrderBy = _React$useState5[1];
|
|
8579
8624
|
var _useState2 = useState(''),
|
|
8580
8625
|
searchValue = _useState2[0],
|
|
8581
8626
|
setSearchValue = _useState2[1];
|
|
@@ -8616,18 +8661,41 @@ var UserList = function UserList(_ref2) {
|
|
|
8616
8661
|
var _useState12 = useState(''),
|
|
8617
8662
|
userIds = _useState12[0],
|
|
8618
8663
|
setUserIds = _useState12[1];
|
|
8619
|
-
var _React$
|
|
8620
|
-
|
|
8621
|
-
|
|
8664
|
+
var _React$useState6 = React.useState(false),
|
|
8665
|
+
overlayMenu = _React$useState6[0],
|
|
8666
|
+
setOverlayMenu = _React$useState6[1];
|
|
8667
|
+
useScrollPosition(function (_ref3) {
|
|
8668
|
+
var prevPos = _ref3.prevPos,
|
|
8669
|
+
currPos = _ref3.currPos;
|
|
8670
|
+
if (prevPos.y - currPos.y > 0) {
|
|
8671
|
+
if (currPos.y <= -275) {
|
|
8672
|
+
setOverlayMenu(true);
|
|
8673
|
+
}
|
|
8674
|
+
} else {
|
|
8675
|
+
if (currPos.y > -295) {
|
|
8676
|
+
setOverlayMenu(false);
|
|
8677
|
+
}
|
|
8678
|
+
}
|
|
8679
|
+
}, [overlayMenu]);
|
|
8680
|
+
var scrollTo = function scrollTo(id) {
|
|
8681
|
+
var el = document.getElementById(id);
|
|
8682
|
+
window.scrollTo({
|
|
8683
|
+
top: el.offsetTop,
|
|
8684
|
+
behavior: 'smooth'
|
|
8685
|
+
});
|
|
8686
|
+
};
|
|
8687
|
+
var _React$useState7 = React.useState(1),
|
|
8688
|
+
signup_page = _React$useState7[0],
|
|
8689
|
+
setSignUpPage = _React$useState7[1];
|
|
8622
8690
|
var _useState13 = useState(5),
|
|
8623
8691
|
signup_rowsPerPage = _useState13[0],
|
|
8624
8692
|
setSignUpRowsPerPage = _useState13[1];
|
|
8625
|
-
var _React$
|
|
8626
|
-
signup_order = _React$
|
|
8627
|
-
setSignUpOrder = _React$
|
|
8628
|
-
var _React$
|
|
8629
|
-
signup_orderBy = _React$
|
|
8630
|
-
setSignUpOrderBy = _React$
|
|
8693
|
+
var _React$useState8 = React.useState('asc'),
|
|
8694
|
+
signup_order = _React$useState8[0],
|
|
8695
|
+
setSignUpOrder = _React$useState8[1];
|
|
8696
|
+
var _React$useState9 = React.useState('fname'),
|
|
8697
|
+
signup_orderBy = _React$useState9[0],
|
|
8698
|
+
setSignUpOrderBy = _React$useState9[1];
|
|
8631
8699
|
var _useState14 = useState(''),
|
|
8632
8700
|
signup_searchValue = _useState14[0],
|
|
8633
8701
|
set_signup_SearchValue = _useState14[1];
|
|
@@ -8647,6 +8715,12 @@ var UserList = function UserList(_ref2) {
|
|
|
8647
8715
|
return state.userList;
|
|
8648
8716
|
}),
|
|
8649
8717
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8718
|
+
var _useState19 = useState({
|
|
8719
|
+
value: '',
|
|
8720
|
+
label: 'Select approver'
|
|
8721
|
+
}),
|
|
8722
|
+
travelFYI = _useState19[0],
|
|
8723
|
+
setTravelFYI = _useState19[1];
|
|
8650
8724
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8651
8725
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8652
8726
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
@@ -8763,17 +8837,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8763
8837
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8764
8838
|
};
|
|
8765
8839
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
8766
|
-
|
|
8767
|
-
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id)).then(function () {
|
|
8768
|
-
if (!isActive) {
|
|
8769
|
-
if (Object.values(selected).flat().includes(id.toString())) {
|
|
8770
|
-
var _extends5;
|
|
8771
|
-
var selectedTemp = _extends({}, selected);
|
|
8772
|
-
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
8773
|
-
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
8774
|
-
}
|
|
8775
|
-
}
|
|
8776
|
-
});
|
|
8840
|
+
setDeactivateSingle(true);
|
|
8777
8841
|
};
|
|
8778
8842
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
8779
8843
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
@@ -8887,6 +8951,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8887
8951
|
dispatch(fetchUsersList(url)).then(function () {
|
|
8888
8952
|
setSearchingChange(false);
|
|
8889
8953
|
setisApiFetching(false);
|
|
8954
|
+
scrollTo('table-root');
|
|
8890
8955
|
});
|
|
8891
8956
|
}, 1000);
|
|
8892
8957
|
return function () {
|
|
@@ -8913,6 +8978,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8913
8978
|
}
|
|
8914
8979
|
if (isSortingChange) {
|
|
8915
8980
|
setisApiFetching(true);
|
|
8981
|
+
scrollTo('table-root');
|
|
8916
8982
|
dispatch(fetchUsersList(url)).then(function () {
|
|
8917
8983
|
setisApiFetching(false);
|
|
8918
8984
|
setSortingChange(false);
|
|
@@ -8953,15 +9019,89 @@ var UserList = function UserList(_ref2) {
|
|
|
8953
9019
|
}
|
|
8954
9020
|
}
|
|
8955
9021
|
}, [isTokenVerified, isSearchingChangeTemp, isSortingChangeTemp, isSignUpSearchingChangeTemp, isSignUpSortingChangeTemp]);
|
|
9022
|
+
var topRightButtons = function topRightButtons() {
|
|
9023
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9024
|
+
component: "div",
|
|
9025
|
+
className: styles$5.buttonWrapper,
|
|
9026
|
+
display: "flex",
|
|
9027
|
+
justifyContent: "space-between",
|
|
9028
|
+
alignItems: "center",
|
|
9029
|
+
alignSelf: "flex-start"
|
|
9030
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9031
|
+
component: "div",
|
|
9032
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9033
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9034
|
+
buttonText: "Export all users",
|
|
9035
|
+
type: "outlined",
|
|
9036
|
+
startIcon: /*#__PURE__*/React.createElement(BulkDownloadIcon, {
|
|
9037
|
+
width: "22",
|
|
9038
|
+
height: "22"
|
|
9039
|
+
}),
|
|
9040
|
+
onClick: handleExportUsers
|
|
9041
|
+
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9042
|
+
component: "div",
|
|
9043
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9044
|
+
}, /*#__PURE__*/React.createElement(IUIDropdownButton, {
|
|
9045
|
+
buttonText: "Bulk actions",
|
|
9046
|
+
type: "outlined",
|
|
9047
|
+
menuListInfo: BulkUploadInfo
|
|
9048
|
+
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9049
|
+
component: "div",
|
|
9050
|
+
className: "pageHeader--button-single button-right"
|
|
9051
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9052
|
+
buttonText: "Add user",
|
|
9053
|
+
type: "contained",
|
|
9054
|
+
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
9055
|
+
width: "9",
|
|
9056
|
+
height: "9",
|
|
9057
|
+
color: "white"
|
|
9058
|
+
}),
|
|
9059
|
+
onClick: handleAddPageNavigation
|
|
9060
|
+
})));
|
|
9061
|
+
};
|
|
8956
9062
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
8957
9063
|
component: "div",
|
|
8958
9064
|
className: styles$5.UUIUserManagementList
|
|
8959
|
-
},
|
|
9065
|
+
}, overlayMenu ? /*#__PURE__*/React.createElement(Box, {
|
|
9066
|
+
className: styles$5.scrollOverlayMenu
|
|
9067
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9068
|
+
component: "div",
|
|
9069
|
+
className: clsx(styles$5.pageHeader)
|
|
9070
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9071
|
+
component: "div",
|
|
9072
|
+
display: "flex",
|
|
9073
|
+
justifyContent: "space-between",
|
|
9074
|
+
alignItems: "center",
|
|
9075
|
+
flexWrap: "wrap",
|
|
9076
|
+
style: {
|
|
9077
|
+
gap: '1rem'
|
|
9078
|
+
}
|
|
9079
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9080
|
+
component: "div",
|
|
9081
|
+
display: "flex",
|
|
9082
|
+
flexDirection: "column",
|
|
9083
|
+
style: {
|
|
9084
|
+
gap: '0.5rem'
|
|
9085
|
+
}
|
|
9086
|
+
}, /*#__PURE__*/React.createElement(IUISearch, {
|
|
9087
|
+
placeholder: "Search by name, email & department",
|
|
9088
|
+
value: searchValue,
|
|
9089
|
+
onChangeHandler: function onChangeHandler(e) {
|
|
9090
|
+
return onSearchHandler(e.target.value);
|
|
9091
|
+
},
|
|
9092
|
+
className: styles$5.overlaysearch
|
|
9093
|
+
})), topRightButtons()), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9094
|
+
component: "div",
|
|
9095
|
+
display: "flex",
|
|
9096
|
+
justifyContent: "space-between",
|
|
9097
|
+
alignItems: "center"
|
|
9098
|
+
}))) : '', !hasVerificationError ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBackdrop, {
|
|
8960
9099
|
open: isFileDownloading || isApiFetching,
|
|
8961
9100
|
className: styles$5.backdrop
|
|
8962
9101
|
}, /*#__PURE__*/React.createElement(IUICircularProgress, {
|
|
8963
9102
|
color: "inherit"
|
|
8964
9103
|
})), isDataFetching ? /*#__PURE__*/React.createElement(SkeletonLoader, null) : /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9104
|
+
id: "table-root",
|
|
8965
9105
|
component: "div",
|
|
8966
9106
|
className: clsx(styles$5.pageHeader)
|
|
8967
9107
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
@@ -8986,44 +9126,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8986
9126
|
}, /*#__PURE__*/React.createElement(IUITypography, {
|
|
8987
9127
|
variant: "h3",
|
|
8988
9128
|
className: clsx(styles$5.heading, styles$5.headingLarge)
|
|
8989
|
-
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
8990
|
-
component: "div",
|
|
8991
|
-
className: styles$5.buttonWrapper,
|
|
8992
|
-
display: "flex",
|
|
8993
|
-
justifyContent: "space-between",
|
|
8994
|
-
alignItems: "center",
|
|
8995
|
-
alignSelf: "flex-start"
|
|
8996
|
-
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
8997
|
-
component: "div",
|
|
8998
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
8999
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9000
|
-
buttonText: "Export all users",
|
|
9001
|
-
type: "outlined",
|
|
9002
|
-
startIcon: /*#__PURE__*/React.createElement(BulkDownloadIcon, {
|
|
9003
|
-
width: "22",
|
|
9004
|
-
height: "22"
|
|
9005
|
-
}),
|
|
9006
|
-
onClick: handleExportUsers
|
|
9007
|
-
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9008
|
-
component: "div",
|
|
9009
|
-
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9010
|
-
}, /*#__PURE__*/React.createElement(IUIDropdownButton, {
|
|
9011
|
-
buttonText: "Bulk actions",
|
|
9012
|
-
type: "outlined",
|
|
9013
|
-
menuListInfo: BulkUploadInfo
|
|
9014
|
-
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9015
|
-
component: "div",
|
|
9016
|
-
className: "pageHeader--button-single button-right"
|
|
9017
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9018
|
-
buttonText: "Add user",
|
|
9019
|
-
type: "contained",
|
|
9020
|
-
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
9021
|
-
width: "9",
|
|
9022
|
-
height: "9",
|
|
9023
|
-
color: "white"
|
|
9024
|
-
}),
|
|
9025
|
-
onClick: handleAddPageNavigation
|
|
9026
|
-
})))), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9129
|
+
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))), topRightButtons()), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9027
9130
|
component: "div",
|
|
9028
9131
|
display: "flex",
|
|
9029
9132
|
justifyContent: "space-between",
|
|
@@ -9118,6 +9221,82 @@ var UserList = function UserList(_ref2) {
|
|
|
9118
9221
|
}))
|
|
9119
9222
|
}]
|
|
9120
9223
|
}))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9224
|
+
isOpen: deactivateSingle,
|
|
9225
|
+
closeHandler: function closeHandler() {
|
|
9226
|
+
setDeactivateSingle(false);
|
|
9227
|
+
},
|
|
9228
|
+
cancelLabel: "Cancel",
|
|
9229
|
+
submitLabel: "Deactivate",
|
|
9230
|
+
submitHandler: handleDeactivateUsers,
|
|
9231
|
+
headerText: "Deactivate this user?",
|
|
9232
|
+
width: "400px",
|
|
9233
|
+
subHanderText: "",
|
|
9234
|
+
submitBtnClass: styles$5.deactivateBtn,
|
|
9235
|
+
isDisabledSubmitBtn: true
|
|
9236
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9237
|
+
className: styles$5.deactivateSingle
|
|
9238
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9239
|
+
className: styles$5.deactivateAlert
|
|
9240
|
+
}, /*#__PURE__*/React.createElement(InfoYellowIcon, {
|
|
9241
|
+
width: "9",
|
|
9242
|
+
height: "9"
|
|
9243
|
+
}), /*#__PURE__*/React.createElement(IUITypography, null, /*#__PURE__*/React.createElement("b", null, "Anvesh Dunna"), " is linked with multiple roles. You can deactivate them only once you transfer the roles to another user.")), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9244
|
+
className: "iui__mb-15 iui__mt-15"
|
|
9245
|
+
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
9246
|
+
isMove: true,
|
|
9247
|
+
additional: {
|
|
9248
|
+
page: 1,
|
|
9249
|
+
product: 'travel',
|
|
9250
|
+
placeholder: 'Select a user'
|
|
9251
|
+
},
|
|
9252
|
+
placeHolderCheck: travelFYI !== undefined && travelFYI.value === '',
|
|
9253
|
+
label: "Transfer admin role to",
|
|
9254
|
+
value: travelFYI,
|
|
9255
|
+
onValueChange: function onValueChange(_ref4) {
|
|
9256
|
+
var _value = _ref4._value;
|
|
9257
|
+
return setTravelFYI(_value);
|
|
9258
|
+
},
|
|
9259
|
+
loadOption: approversOptions,
|
|
9260
|
+
disableText: "Please get in touch with your administrator to change this value."
|
|
9261
|
+
})), /*#__PURE__*/React.createElement(IUITypography, {
|
|
9262
|
+
className: clsx('iui__mb-5', styles$5.departmentHeadText)
|
|
9263
|
+
}, "Anvesh Dunna is the department head for: Product Design."), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9264
|
+
className: "iui__mb-15"
|
|
9265
|
+
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
9266
|
+
isMove: true,
|
|
9267
|
+
additional: {
|
|
9268
|
+
page: 1,
|
|
9269
|
+
product: 'travel',
|
|
9270
|
+
placeholder: 'Select a user'
|
|
9271
|
+
},
|
|
9272
|
+
placeHolderCheck: travelFYI !== undefined && travelFYI.value === '',
|
|
9273
|
+
label: "Transfer department head role to",
|
|
9274
|
+
value: travelFYI,
|
|
9275
|
+
onValueChange: function onValueChange(_ref5) {
|
|
9276
|
+
var _value = _ref5._value;
|
|
9277
|
+
return setTravelFYI(_value);
|
|
9278
|
+
},
|
|
9279
|
+
loadOption: approversOptions,
|
|
9280
|
+
disableText: "Please get in touch with your administrator to change this value."
|
|
9281
|
+
})), /*#__PURE__*/React.createElement(IUIBox, {
|
|
9282
|
+
className: "iui__mb-15"
|
|
9283
|
+
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
9284
|
+
isMove: true,
|
|
9285
|
+
additional: {
|
|
9286
|
+
page: 1,
|
|
9287
|
+
product: 'travel',
|
|
9288
|
+
placeholder: 'Select a user'
|
|
9289
|
+
},
|
|
9290
|
+
placeHolderCheck: travelFYI !== undefined && travelFYI.value === '',
|
|
9291
|
+
label: "Transfer approver role to",
|
|
9292
|
+
value: travelFYI,
|
|
9293
|
+
onValueChange: function onValueChange(_ref6) {
|
|
9294
|
+
var _value = _ref6._value;
|
|
9295
|
+
return setTravelFYI(_value);
|
|
9296
|
+
},
|
|
9297
|
+
loadOption: approversOptions,
|
|
9298
|
+
disableText: "Please get in touch with your administrator to change this value."
|
|
9299
|
+
})))), /*#__PURE__*/React.createElement(IUIModal, {
|
|
9121
9300
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9122
9301
|
closeHandler: closeDeActivateModal,
|
|
9123
9302
|
cancelLabel: "Cancel",
|
|
@@ -9186,8 +9365,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9186
9365
|
errMsg: hasVerificationError
|
|
9187
9366
|
}));
|
|
9188
9367
|
};
|
|
9189
|
-
var TabLabelCount = function TabLabelCount(
|
|
9190
|
-
var count =
|
|
9368
|
+
var TabLabelCount = function TabLabelCount(_ref7) {
|
|
9369
|
+
var count = _ref7.count;
|
|
9191
9370
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9192
9371
|
className: styles$5.TabLabelCount
|
|
9193
9372
|
}, " ", count, " ");
|
|
@@ -9262,11 +9441,12 @@ function Header(props) {
|
|
|
9262
9441
|
})));
|
|
9263
9442
|
}
|
|
9264
9443
|
|
|
9265
|
-
var styles$7 = {"sidebar__container":"_1EFxC","sidebar__wrapper":"_3Mk3_","sidebar__navlinks":"_29KVG","sidebar__navlinks-title":"_2Eg7m","MuiListItem-button":"_3yWwI","Mui-selected":"_3Ou88","buttonWidth":"_13tv0","onBoardText":"_HUoW-","iconStyle":"_3k0Fb","iconLayout":"_v3GT2","baseAlert":"_12zY5","headingWrapper":"_20Qv9","pageHeader":"_36au5","description":"_tULrl","headerText":"_3W_ZV","tableContainer":"_3xdGF"};
|
|
9444
|
+
var styles$7 = {"sidebar__container":"_1EFxC","sidebar__wrapper":"_3Mk3_","sidebar__navlinks":"_29KVG","sidebar__navlinks-title":"_2Eg7m","MuiListItem-button":"_3yWwI","Mui-selected":"_3Ou88","rowText":"_2XKxl","lightColor":"_3uyfh","buttonWidth":"_13tv0","readOnlyInput":"_3yYuQ","addUserButton":"_1zbr_","alertDescContainer":"_3h8DM","onBoardText":"_HUoW-","iconStyle":"_3k0Fb","iconLayout":"_v3GT2","baseAlert":"_12zY5","headingWrapper":"_20Qv9","pageHeader":"_36au5","description":"_tULrl","headerText":"_3W_ZV","tableContainer":"_3xdGF"};
|
|
9266
9445
|
|
|
9267
9446
|
function Listview(_ref) {
|
|
9268
9447
|
var data = _ref.data,
|
|
9269
9448
|
name = _ref.name,
|
|
9449
|
+
tableName = _ref.tableName,
|
|
9270
9450
|
handleEditDialog = _ref.handleEditDialog,
|
|
9271
9451
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9272
9452
|
orderBy = _ref.orderBy,
|
|
@@ -9279,16 +9459,83 @@ function Listview(_ref) {
|
|
|
9279
9459
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9280
9460
|
page = _ref.page,
|
|
9281
9461
|
rowsPerPage = _ref.rowsPerPage;
|
|
9462
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9463
|
+
var _data$dept_head_detai;
|
|
9464
|
+
if ((data === null || data === void 0 ? void 0 : (_data$dept_head_detai = data.dept_head_details) === null || _data$dept_head_detai === void 0 ? void 0 : _data$dept_head_detai.length) > 0) {
|
|
9465
|
+
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9466
|
+
}
|
|
9467
|
+
return 'Unassigned';
|
|
9468
|
+
};
|
|
9282
9469
|
var columns = [{
|
|
9283
9470
|
id: 'name',
|
|
9284
9471
|
label: name,
|
|
9285
|
-
width: '
|
|
9472
|
+
width: '40%',
|
|
9286
9473
|
sortable: true,
|
|
9287
9474
|
cell: function cell(row) {
|
|
9288
9475
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9289
9476
|
component: "div"
|
|
9290
9477
|
}, row.name);
|
|
9291
9478
|
}
|
|
9479
|
+
}, {
|
|
9480
|
+
id: 'no_of_users',
|
|
9481
|
+
label: 'Number of users',
|
|
9482
|
+
width: '40%',
|
|
9483
|
+
sortable: true,
|
|
9484
|
+
cell: function cell(row) {
|
|
9485
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9486
|
+
component: "div"
|
|
9487
|
+
}, row.no_of_users);
|
|
9488
|
+
}
|
|
9489
|
+
}, {
|
|
9490
|
+
id: 'actions',
|
|
9491
|
+
label: 'Actions',
|
|
9492
|
+
width: '20%',
|
|
9493
|
+
cell: function cell(row) {
|
|
9494
|
+
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9495
|
+
display: "flex"
|
|
9496
|
+
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9497
|
+
buttonText: "Edit",
|
|
9498
|
+
className: styles$7.buttonWidth,
|
|
9499
|
+
onClick: function onClick() {
|
|
9500
|
+
return handleEditDialog(row);
|
|
9501
|
+
}
|
|
9502
|
+
}), row.no_of_users > 0 ? /*#__PURE__*/React.createElement(IUIButton, {
|
|
9503
|
+
buttonText: "Delete",
|
|
9504
|
+
className: styles$7.buttonWidth,
|
|
9505
|
+
onClick: function onClick() {
|
|
9506
|
+
return handleDeleteDialog(row, true);
|
|
9507
|
+
}
|
|
9508
|
+
}) : /*#__PURE__*/React.createElement(IUIButton, {
|
|
9509
|
+
buttonText: "Delete",
|
|
9510
|
+
className: styles$7.buttonWidth,
|
|
9511
|
+
onClick: function onClick() {
|
|
9512
|
+
return handleDeleteDialog(row, false);
|
|
9513
|
+
}
|
|
9514
|
+
}));
|
|
9515
|
+
}
|
|
9516
|
+
}];
|
|
9517
|
+
var departmentColumns = [{
|
|
9518
|
+
id: 'name',
|
|
9519
|
+
label: name,
|
|
9520
|
+
width: '30%',
|
|
9521
|
+
sortable: true,
|
|
9522
|
+
cell: function cell(row) {
|
|
9523
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9524
|
+
component: "div"
|
|
9525
|
+
}, row.name);
|
|
9526
|
+
}
|
|
9527
|
+
}, {
|
|
9528
|
+
id: 'department_head',
|
|
9529
|
+
label: 'Department head',
|
|
9530
|
+
width: '30%',
|
|
9531
|
+
sortable: true,
|
|
9532
|
+
cell: function cell(row) {
|
|
9533
|
+
return /*#__PURE__*/React.createElement(Fragment$1, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9534
|
+
component: "div"
|
|
9535
|
+
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React.createElement(IUITypography, {
|
|
9536
|
+
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9537
|
+
}, "Assigned by default"));
|
|
9538
|
+
}
|
|
9292
9539
|
}, {
|
|
9293
9540
|
id: 'no_of_users',
|
|
9294
9541
|
label: 'Number of users',
|
|
@@ -9302,7 +9549,7 @@ function Listview(_ref) {
|
|
|
9302
9549
|
}, {
|
|
9303
9550
|
id: 'actions',
|
|
9304
9551
|
label: 'Actions',
|
|
9305
|
-
width: '
|
|
9552
|
+
width: '15%',
|
|
9306
9553
|
cell: function cell(row) {
|
|
9307
9554
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9308
9555
|
display: "flex"
|
|
@@ -9335,7 +9582,7 @@ function Listview(_ref) {
|
|
|
9335
9582
|
hasFilter: true,
|
|
9336
9583
|
isCheckboxTable: false,
|
|
9337
9584
|
count: data.count,
|
|
9338
|
-
columns: columns,
|
|
9585
|
+
columns: tableName === 'department' ? departmentColumns : columns,
|
|
9339
9586
|
rows: data.results,
|
|
9340
9587
|
page: page,
|
|
9341
9588
|
handleChangePage: handleChangePage,
|
|
@@ -9392,15 +9639,41 @@ function EditPanelDialog(_ref) {
|
|
|
9392
9639
|
var isOpen = _ref.isOpen,
|
|
9393
9640
|
closeHandler = _ref.closeHandler,
|
|
9394
9641
|
onValueChange = _ref.onValueChange,
|
|
9395
|
-
|
|
9642
|
+
_submitHandler = _ref.submitHandler,
|
|
9396
9643
|
isError = _ref.isError,
|
|
9397
9644
|
name = _ref.name,
|
|
9398
9645
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9399
|
-
validation = _ref.validation
|
|
9646
|
+
validation = _ref.validation,
|
|
9647
|
+
rowData = _ref.rowData,
|
|
9648
|
+
tableName = _ref.tableName,
|
|
9649
|
+
config = _ref.config;
|
|
9400
9650
|
var _useSelector = useSelector(function (state) {
|
|
9401
9651
|
return state.userPanel;
|
|
9402
9652
|
}),
|
|
9403
9653
|
dialogData = _useSelector.dialogData;
|
|
9654
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9655
|
+
var _data$dept_head_detai;
|
|
9656
|
+
console.log(data);
|
|
9657
|
+
if ((data === null || data === void 0 ? void 0 : (_data$dept_head_detai = data.dept_head_details) === null || _data$dept_head_detai === void 0 ? void 0 : _data$dept_head_detai.length) > 0) {
|
|
9658
|
+
setHead({
|
|
9659
|
+
value: data.dept_head_details[0].id,
|
|
9660
|
+
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
9661
|
+
});
|
|
9662
|
+
}
|
|
9663
|
+
};
|
|
9664
|
+
var _useState = useState({
|
|
9665
|
+
value: '',
|
|
9666
|
+
label: 'Select'
|
|
9667
|
+
}),
|
|
9668
|
+
head = _useState[0],
|
|
9669
|
+
setHead = _useState[1];
|
|
9670
|
+
useEffect(function () {
|
|
9671
|
+
deptHeadDetails(rowData);
|
|
9672
|
+
}, [rowData]);
|
|
9673
|
+
var history = useHistory();
|
|
9674
|
+
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
9675
|
+
history.push(config.routes.users.add.path);
|
|
9676
|
+
};
|
|
9404
9677
|
return /*#__PURE__*/React.createElement(IUIModal, {
|
|
9405
9678
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9406
9679
|
isOpen: isOpen,
|
|
@@ -9408,25 +9681,59 @@ function EditPanelDialog(_ref) {
|
|
|
9408
9681
|
headerText: "Edit " + name.toLowerCase(),
|
|
9409
9682
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9410
9683
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9411
|
-
submitHandler: submitHandler
|
|
9412
|
-
|
|
9684
|
+
submitHandler: function submitHandler() {
|
|
9685
|
+
return _submitHandler(head);
|
|
9686
|
+
},
|
|
9687
|
+
width: tableName === 'department' ? '400px' : '365px',
|
|
9413
9688
|
hideCloseIcon: false,
|
|
9414
9689
|
modalBodyStyle: {
|
|
9415
|
-
|
|
9416
|
-
overflow: 'auto',
|
|
9417
|
-
margin: '0px'
|
|
9690
|
+
overflowY: 'visible'
|
|
9418
9691
|
},
|
|
9419
9692
|
footerStyle: {
|
|
9420
9693
|
justifyContent: 'end'
|
|
9421
9694
|
}
|
|
9695
|
+
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9696
|
+
display: "flex",
|
|
9697
|
+
justifyContent: "center",
|
|
9698
|
+
alignItems: "center",
|
|
9699
|
+
flexDirection: "column",
|
|
9700
|
+
style: {
|
|
9701
|
+
marginBottom: '30px'
|
|
9702
|
+
}
|
|
9422
9703
|
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9423
|
-
component: "div",
|
|
9424
9704
|
display: "flex",
|
|
9425
9705
|
justifyContent: "center",
|
|
9426
9706
|
alignItems: "center",
|
|
9427
9707
|
flexDirection: "column",
|
|
9428
|
-
|
|
9429
|
-
}, /*#__PURE__*/React.createElement(
|
|
9708
|
+
className: styles$7.baseAlert
|
|
9709
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9710
|
+
className: styles$7.alertDescContainer
|
|
9711
|
+
}, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9712
|
+
className: styles$7.iconLayout,
|
|
9713
|
+
style: {
|
|
9714
|
+
paddingTop: '4px'
|
|
9715
|
+
}
|
|
9716
|
+
}, /*#__PURE__*/React.createElement(BoldInfoIcon, {
|
|
9717
|
+
color: "#CA8A04",
|
|
9718
|
+
width: "25",
|
|
9719
|
+
height: "20",
|
|
9720
|
+
className: styles$7.iconStyle
|
|
9721
|
+
})), /*#__PURE__*/React.createElement(IUILabel, {
|
|
9722
|
+
label: "By default, the primary admin gets assigned as the department head. This department has no users, so to change department head, add a new user.",
|
|
9723
|
+
style: {
|
|
9724
|
+
fontWeight: 'normal'
|
|
9725
|
+
}
|
|
9726
|
+
})), /*#__PURE__*/React.createElement(IUIButton, {
|
|
9727
|
+
buttonText: "Add user",
|
|
9728
|
+
type: "text",
|
|
9729
|
+
startIcon: /*#__PURE__*/React.createElement(AddIcon, {
|
|
9730
|
+
width: "9",
|
|
9731
|
+
height: "9",
|
|
9732
|
+
color: "#EC5D25"
|
|
9733
|
+
}),
|
|
9734
|
+
onClick: handleAddPageNavigation,
|
|
9735
|
+
className: styles$7.addUserButton
|
|
9736
|
+
}))), /*#__PURE__*/React.createElement(IUIInput, {
|
|
9430
9737
|
label: name + " name",
|
|
9431
9738
|
name: "name",
|
|
9432
9739
|
defaultValue: dialogData.data.name,
|
|
@@ -9435,7 +9742,49 @@ function EditPanelDialog(_ref) {
|
|
|
9435
9742
|
isError: isError,
|
|
9436
9743
|
validation: validation,
|
|
9437
9744
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9438
|
-
required: true
|
|
9745
|
+
required: true,
|
|
9746
|
+
style: tableName === 'department' && {
|
|
9747
|
+
width: '350px'
|
|
9748
|
+
}
|
|
9749
|
+
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9750
|
+
className: "iui__mt-15",
|
|
9751
|
+
style: {
|
|
9752
|
+
width: '100%'
|
|
9753
|
+
}
|
|
9754
|
+
}, /*#__PURE__*/React.createElement(IUIInput, {
|
|
9755
|
+
label: "Department head",
|
|
9756
|
+
name: "name",
|
|
9757
|
+
defaultValue: head.label,
|
|
9758
|
+
placeholder: "",
|
|
9759
|
+
readOnly: true,
|
|
9760
|
+
style: {
|
|
9761
|
+
width: '350px'
|
|
9762
|
+
}
|
|
9763
|
+
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
9764
|
+
className: "iui__mt-15",
|
|
9765
|
+
style: {
|
|
9766
|
+
width: '100%'
|
|
9767
|
+
}
|
|
9768
|
+
}, /*#__PURE__*/React.createElement(IUIAsyncSelect, {
|
|
9769
|
+
noResultsText: true,
|
|
9770
|
+
isMove: true,
|
|
9771
|
+
additional: {
|
|
9772
|
+
page: 1,
|
|
9773
|
+
departmentId: rowData.id
|
|
9774
|
+
},
|
|
9775
|
+
placeHolderCheck: head !== undefined && head.value === '',
|
|
9776
|
+
label: "Department head",
|
|
9777
|
+
value: head,
|
|
9778
|
+
onValueChange: function onValueChange(_ref2) {
|
|
9779
|
+
var _value = _ref2._value;
|
|
9780
|
+
return setHead(_value);
|
|
9781
|
+
},
|
|
9782
|
+
loadOption: departmentHeadOptions,
|
|
9783
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
9784
|
+
customLoadingText: "No users found in this department",
|
|
9785
|
+
customLoadingTextStyle: {
|
|
9786
|
+
color: '#374151'
|
|
9787
|
+
}
|
|
9439
9788
|
})));
|
|
9440
9789
|
}
|
|
9441
9790
|
|
|
@@ -9614,12 +9963,15 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9614
9963
|
var _useState13 = useState(false),
|
|
9615
9964
|
isSortingChangeTemp = _useState13[0],
|
|
9616
9965
|
setSortingChangeTemp = _useState13[1];
|
|
9617
|
-
var _useState14 = useState(
|
|
9618
|
-
|
|
9619
|
-
|
|
9620
|
-
var _useState15 = useState(
|
|
9621
|
-
|
|
9622
|
-
|
|
9966
|
+
var _useState14 = useState([]),
|
|
9967
|
+
rowData = _useState14[0],
|
|
9968
|
+
setRowData = _useState14[1];
|
|
9969
|
+
var _useState15 = useState(1),
|
|
9970
|
+
page = _useState15[0],
|
|
9971
|
+
setPage = _useState15[1];
|
|
9972
|
+
var _useState16 = useState(5),
|
|
9973
|
+
rowsPerPage = _useState16[0],
|
|
9974
|
+
setRowsPerPage = _useState16[1];
|
|
9623
9975
|
var orderingParam = orderBy;
|
|
9624
9976
|
var _useSelector = useSelector(function (state) {
|
|
9625
9977
|
return state.userPanel;
|
|
@@ -9715,6 +10067,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9715
10067
|
submitLabel: 'Save'
|
|
9716
10068
|
}, '', data));
|
|
9717
10069
|
setDataList(data.name);
|
|
10070
|
+
setRowData(data);
|
|
9718
10071
|
setEditModal(true);
|
|
9719
10072
|
};
|
|
9720
10073
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -9729,6 +10082,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9729
10082
|
var payload = {
|
|
9730
10083
|
names: [dataList]
|
|
9731
10084
|
};
|
|
10085
|
+
if (tableName === 'department') {
|
|
10086
|
+
payload = {
|
|
10087
|
+
name: dataList,
|
|
10088
|
+
department_head_id: null
|
|
10089
|
+
};
|
|
10090
|
+
}
|
|
9732
10091
|
var message = title + " added successfully.";
|
|
9733
10092
|
handleApiCall(addRecord, payload, message, 'add');
|
|
9734
10093
|
} else {
|
|
@@ -9742,9 +10101,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9742
10101
|
var message = title + " deleted successfully.";
|
|
9743
10102
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9744
10103
|
};
|
|
9745
|
-
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10104
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type, optionalParams) {
|
|
10105
|
+
if (optionalParams === void 0) {
|
|
10106
|
+
optionalParams = null;
|
|
10107
|
+
}
|
|
9746
10108
|
dispatch(userPanelShowLoader());
|
|
9747
|
-
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10109
|
+
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
9748
10110
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9749
10111
|
dispatch(userPanelStopLoader());
|
|
9750
10112
|
if (type === 'delete') {
|
|
@@ -9786,8 +10148,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9786
10148
|
name: dataList
|
|
9787
10149
|
}]
|
|
9788
10150
|
};
|
|
10151
|
+
if (tableName === 'department') {
|
|
10152
|
+
payload = {
|
|
10153
|
+
name: dataList,
|
|
10154
|
+
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10155
|
+
};
|
|
10156
|
+
}
|
|
9789
10157
|
var message = title + " updated successfully.";
|
|
9790
|
-
handleApiCall(editRecord, payload, message, 'edit');
|
|
10158
|
+
handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
|
|
9791
10159
|
setErrorEdit(false);
|
|
9792
10160
|
} else {
|
|
9793
10161
|
setErrorEdit(true);
|
|
@@ -9894,7 +10262,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9894
10262
|
submitHandler: handleEditPanel,
|
|
9895
10263
|
isError: errorEdit,
|
|
9896
10264
|
isDisabledSubmitBtn: loading,
|
|
9897
|
-
validation: validation
|
|
10265
|
+
validation: validation,
|
|
10266
|
+
rowData: rowData,
|
|
10267
|
+
tableName: tableName,
|
|
10268
|
+
config: config
|
|
9898
10269
|
})) : /*#__PURE__*/React.createElement(VerificationError, {
|
|
9899
10270
|
config: config
|
|
9900
10271
|
}));
|