@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.js
CHANGED
|
@@ -19,6 +19,7 @@ var Switch = _interopDefault(require('@material-ui/core/Switch'));
|
|
|
19
19
|
var MoreHorizIcon = _interopDefault(require('@material-ui/icons/MoreHoriz'));
|
|
20
20
|
var Button = _interopDefault(require('@material-ui/core/Button'));
|
|
21
21
|
var core = require('@material-ui/core');
|
|
22
|
+
var useScrollPosition = require('@n8tb1t/use-scroll-position');
|
|
22
23
|
|
|
23
24
|
function _extends() {
|
|
24
25
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -458,6 +459,14 @@ var userPanelUrl = {
|
|
|
458
459
|
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
|
|
459
460
|
}
|
|
460
461
|
};
|
|
462
|
+
var departmentUrl = {
|
|
463
|
+
departmentUrl: function departmentUrl() {
|
|
464
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department";
|
|
465
|
+
},
|
|
466
|
+
getDepartmentHead: function getDepartmentHead(departmentId, page) {
|
|
467
|
+
return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/department/" + departmentId + "/users?page=" + page;
|
|
468
|
+
}
|
|
469
|
+
};
|
|
461
470
|
|
|
462
471
|
var api = utils.configs.api;
|
|
463
472
|
var NAoptionConfig = {
|
|
@@ -686,6 +695,46 @@ var countryOptions = function countryOptions(search, loadedOptions, _ref5) {
|
|
|
686
695
|
return Promise.reject(e);
|
|
687
696
|
}
|
|
688
697
|
};
|
|
698
|
+
var departmentHeadOptions = function departmentHeadOptions(search, loadedOptions, _ref6) {
|
|
699
|
+
var page = _ref6.page,
|
|
700
|
+
departmentId = _ref6.departmentId;
|
|
701
|
+
try {
|
|
702
|
+
return Promise.resolve(_catch(function () {
|
|
703
|
+
return Promise.resolve(api.get(departmentUrl.getDepartmentHead(departmentId, page) + "&search=" + search).then(function (res) {
|
|
704
|
+
return res.data;
|
|
705
|
+
})).then(function (response) {
|
|
706
|
+
var mappedValue = response.results.map(function (item) {
|
|
707
|
+
return {
|
|
708
|
+
value: item.id,
|
|
709
|
+
label: item.first_name + ' ' + item.last_name,
|
|
710
|
+
type: 'detailed',
|
|
711
|
+
data: item
|
|
712
|
+
};
|
|
713
|
+
});
|
|
714
|
+
console.log(response.next);
|
|
715
|
+
return {
|
|
716
|
+
options: mappedValue,
|
|
717
|
+
hasMore: !!response.next,
|
|
718
|
+
additional: {
|
|
719
|
+
page: page + 1,
|
|
720
|
+
departmentId: departmentId
|
|
721
|
+
}
|
|
722
|
+
};
|
|
723
|
+
});
|
|
724
|
+
}, function () {
|
|
725
|
+
return {
|
|
726
|
+
options: [],
|
|
727
|
+
hasMore: false,
|
|
728
|
+
additional: {
|
|
729
|
+
page: 1,
|
|
730
|
+
departmentId: departmentId
|
|
731
|
+
}
|
|
732
|
+
};
|
|
733
|
+
}));
|
|
734
|
+
} catch (e) {
|
|
735
|
+
return Promise.reject(e);
|
|
736
|
+
}
|
|
737
|
+
};
|
|
689
738
|
|
|
690
739
|
var UserRole = function UserRole(_ref) {
|
|
691
740
|
var _ref$list = _ref.list,
|
|
@@ -1056,12 +1105,6 @@ var setSignUpRequestList = function setSignUpRequestList(payload) {
|
|
|
1056
1105
|
payload: payload
|
|
1057
1106
|
};
|
|
1058
1107
|
};
|
|
1059
|
-
var setUserActiveStatus = function setUserActiveStatus(payload) {
|
|
1060
|
-
return {
|
|
1061
|
-
type: SET_ACTIVE_STATUS,
|
|
1062
|
-
payload: payload
|
|
1063
|
-
};
|
|
1064
|
-
};
|
|
1065
1108
|
var setBulkDeactivatedUsers = function setBulkDeactivatedUsers(payload) {
|
|
1066
1109
|
return {
|
|
1067
1110
|
type: SET_BULK_DEACTIVATED_USERS,
|
|
@@ -1154,27 +1197,6 @@ var updateTabValue = function updateTabValue(tabId) {
|
|
|
1154
1197
|
payload: tabId
|
|
1155
1198
|
};
|
|
1156
1199
|
};
|
|
1157
|
-
var updateActiveStatus = function updateActiveStatus(activateVal, id) {
|
|
1158
|
-
return function (dispatch) {
|
|
1159
|
-
return new Promise(function (resolve, reject) {
|
|
1160
|
-
api$1.get(userListUrl.updateActiveStatus + 'user_id=' + id + '&activate=' + activateVal).then(function (res) {
|
|
1161
|
-
dispatch(setUserActiveStatus({
|
|
1162
|
-
is_active: activateVal !== 0,
|
|
1163
|
-
id: id
|
|
1164
|
-
}));
|
|
1165
|
-
IUIToastMessageService.sNotify(res.data.message);
|
|
1166
|
-
resolve(res);
|
|
1167
|
-
})["catch"](function (err) {
|
|
1168
|
-
if (!err.response.data.status) {
|
|
1169
|
-
IUIToastMessageService.warningNotify(err.response.data.message);
|
|
1170
|
-
reject(err);
|
|
1171
|
-
return;
|
|
1172
|
-
}
|
|
1173
|
-
reject(err);
|
|
1174
|
-
});
|
|
1175
|
-
});
|
|
1176
|
-
};
|
|
1177
|
-
};
|
|
1178
1200
|
|
|
1179
1201
|
var api$2 = utils.configs.api;
|
|
1180
1202
|
var IUIToastMessageService$1 = utils.services.IUIToastMessageService,
|
|
@@ -1757,6 +1779,7 @@ var OPEN_DIALOG = 'OPEN_DIALOG';
|
|
|
1757
1779
|
var CLOSE_DIALOG = 'CLOSE_DIALOG';
|
|
1758
1780
|
var FETCH_USERPANEL_DATA = 'FETCH_USERPANEL_DATA';
|
|
1759
1781
|
var UNASSIGNED_USERS = 'Not assigned';
|
|
1782
|
+
var FETCH_DEPARTMENT_USERS_DATA = 'FETCH_DEPARTMENT_USERS_DATA';
|
|
1760
1783
|
|
|
1761
1784
|
var api$3 = utils.configs.api;
|
|
1762
1785
|
var IUIToastMessageService$2 = utils.services.IUIToastMessageService;
|
|
@@ -1806,14 +1829,14 @@ var getUserPanalData = function getUserPanalData(params) {
|
|
|
1806
1829
|
var addRecord = function addRecord(tableName, data, getParam) {
|
|
1807
1830
|
return function (dispatch) {
|
|
1808
1831
|
return new Promise(function (resolve, reject) {
|
|
1809
|
-
api$3.post(userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1832
|
+
api$3.post(tableName === 'department' ? departmentUrl.departmentUrl() : userPanelUrl.addUnit(tableName), data).then(function (res) {
|
|
1810
1833
|
dispatch(getUserPanalData(getParam));
|
|
1811
1834
|
dispatch(closeDialog());
|
|
1812
1835
|
resolve(res);
|
|
1813
1836
|
})["catch"](function (err) {
|
|
1814
|
-
var _err$
|
|
1837
|
+
var _err$response3, _err$response3$data;
|
|
1815
1838
|
dispatch(userPanelStopLoader());
|
|
1816
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1839
|
+
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.');
|
|
1817
1840
|
});
|
|
1818
1841
|
});
|
|
1819
1842
|
};
|
|
@@ -1827,25 +1850,37 @@ var deleteRecord = function deleteRecord(tableName, id, getParam) {
|
|
|
1827
1850
|
dispatch(userPanelStopLoader());
|
|
1828
1851
|
resolve();
|
|
1829
1852
|
})["catch"](function (err) {
|
|
1830
|
-
var _err$
|
|
1831
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1853
|
+
var _err$response4, _err$response4$data;
|
|
1854
|
+
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.');
|
|
1832
1855
|
dispatch(userPanelStopLoader());
|
|
1833
1856
|
});
|
|
1834
1857
|
});
|
|
1835
1858
|
};
|
|
1836
1859
|
};
|
|
1837
|
-
var editRecord = function editRecord(tableName, data, getParam) {
|
|
1860
|
+
var editRecord = function editRecord(tableName, data, getParam, optionalParams) {
|
|
1838
1861
|
return function (dispatch) {
|
|
1839
1862
|
return new Promise(function (resolve, reject) {
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1863
|
+
if (tableName === 'department') {
|
|
1864
|
+
api$3.put(departmentUrl.departmentUrl() + "/" + optionalParams, data).then(function (res) {
|
|
1865
|
+
dispatch(getUserPanalData(getParam));
|
|
1866
|
+
dispatch(closeDialog());
|
|
1867
|
+
resolve();
|
|
1868
|
+
})["catch"](function (err) {
|
|
1869
|
+
var _err$response5, _err$response5$data;
|
|
1870
|
+
dispatch(userPanelStopLoader());
|
|
1871
|
+
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.');
|
|
1872
|
+
});
|
|
1873
|
+
} else {
|
|
1874
|
+
api$3.post(userPanelUrl.editUnit(tableName), data).then(function (res) {
|
|
1875
|
+
dispatch(getUserPanalData(getParam));
|
|
1876
|
+
dispatch(closeDialog());
|
|
1877
|
+
resolve();
|
|
1878
|
+
})["catch"](function (err) {
|
|
1879
|
+
var _err$response6, _err$response6$data;
|
|
1880
|
+
dispatch(userPanelStopLoader());
|
|
1881
|
+
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.');
|
|
1882
|
+
});
|
|
1883
|
+
}
|
|
1849
1884
|
});
|
|
1850
1885
|
};
|
|
1851
1886
|
};
|
|
@@ -1857,8 +1892,8 @@ var moveRecord = function moveRecord(tableName, data, getParam) {
|
|
|
1857
1892
|
dispatch(closeDialog());
|
|
1858
1893
|
resolve(res);
|
|
1859
1894
|
})["catch"](function (err) {
|
|
1860
|
-
var _err$
|
|
1861
|
-
IUIToastMessageService$2.warningNotify((err === null || err === void 0 ? void 0 : (_err$
|
|
1895
|
+
var _err$response7, _err$response7$data;
|
|
1896
|
+
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.');
|
|
1862
1897
|
});
|
|
1863
1898
|
});
|
|
1864
1899
|
};
|
|
@@ -3958,6 +3993,7 @@ var initialState$2 = {
|
|
|
3958
3993
|
previous: null,
|
|
3959
3994
|
results: []
|
|
3960
3995
|
},
|
|
3996
|
+
deptUsers: [],
|
|
3961
3997
|
loading: false
|
|
3962
3998
|
};
|
|
3963
3999
|
var reducer$2 = function reducer(state, action) {
|
|
@@ -4027,6 +4063,12 @@ var reducer$2 = function reducer(state, action) {
|
|
|
4027
4063
|
loading: false
|
|
4028
4064
|
});
|
|
4029
4065
|
}
|
|
4066
|
+
case FETCH_DEPARTMENT_USERS_DATA:
|
|
4067
|
+
{
|
|
4068
|
+
return _extends({}, state, {
|
|
4069
|
+
deptUsers: action.payload
|
|
4070
|
+
});
|
|
4071
|
+
}
|
|
4030
4072
|
default:
|
|
4031
4073
|
return state;
|
|
4032
4074
|
}
|
|
@@ -4224,49 +4266,8 @@ function withStore(Component) {
|
|
|
4224
4266
|
return WrappedComponent;
|
|
4225
4267
|
}
|
|
4226
4268
|
|
|
4227
|
-
var ExpandMoreIcon = function ExpandMoreIcon(props) {
|
|
4228
|
-
return /*#__PURE__*/React__default.createElement("svg", {
|
|
4229
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4230
|
-
width: props.width,
|
|
4231
|
-
height: props.height,
|
|
4232
|
-
fill: "none",
|
|
4233
|
-
viewBox: "0 0 12 7"
|
|
4234
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
4235
|
-
fill: "#6B7280",
|
|
4236
|
-
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"
|
|
4237
|
-
}));
|
|
4238
|
-
};
|
|
4239
|
-
|
|
4240
|
-
var ExpandLessIcon = function ExpandLessIcon(props) {
|
|
4241
|
-
return /*#__PURE__*/React__default.createElement("svg", {
|
|
4242
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4243
|
-
width: props.width,
|
|
4244
|
-
height: props.height,
|
|
4245
|
-
fill: "none",
|
|
4246
|
-
viewBox: "0 0 10 6"
|
|
4247
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
4248
|
-
fill: "#6B7280",
|
|
4249
|
-
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"
|
|
4250
|
-
}));
|
|
4251
|
-
};
|
|
4252
|
-
|
|
4253
|
-
var CrossIcon = function CrossIcon(props) {
|
|
4254
|
-
var _props$color = props.color,
|
|
4255
|
-
color = _props$color === void 0 ? '#6B7280' : _props$color;
|
|
4256
|
-
return /*#__PURE__*/React__default.createElement("svg", {
|
|
4257
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
4258
|
-
width: props.width,
|
|
4259
|
-
height: props.height,
|
|
4260
|
-
fill: "none",
|
|
4261
|
-
viewBox: "0 0 14 14"
|
|
4262
|
-
}, /*#__PURE__*/React__default.createElement("path", {
|
|
4263
|
-
fill: color,
|
|
4264
|
-
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"
|
|
4265
|
-
}));
|
|
4266
|
-
};
|
|
4267
|
-
|
|
4268
4269
|
var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
4269
|
-
var
|
|
4270
|
+
var _clsx2;
|
|
4270
4271
|
var membershipInfoInput = _ref.membershipInfoInput,
|
|
4271
4272
|
onMemInfoInputChange = _ref.onMemInfoInputChange,
|
|
4272
4273
|
addMemInfoInput = _ref.addMemInfoInput,
|
|
@@ -4295,6 +4296,10 @@ var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
|
4295
4296
|
setAdditionalInfoFlag(defaultExpand ? panel : false);
|
|
4296
4297
|
};
|
|
4297
4298
|
};
|
|
4299
|
+
var ExpandMore = iuistyles.icons.ExpandMore,
|
|
4300
|
+
ExpandLess = iuistyles.icons.ExpandLess,
|
|
4301
|
+
Add = iuistyles.icons.Add,
|
|
4302
|
+
Cross = iuistyles.icons.Cross;
|
|
4298
4303
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
4299
4304
|
return state.userAddEdit.renderFields;
|
|
4300
4305
|
}),
|
|
@@ -4352,312 +4357,316 @@ var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
|
4352
4357
|
}
|
|
4353
4358
|
return null;
|
|
4354
4359
|
};
|
|
4355
|
-
|
|
4356
|
-
expanded: defaultExpand === 'open',
|
|
4357
|
-
onChange: handleChange('open'),
|
|
4358
|
-
className: styles.additionalInfoContainer
|
|
4359
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAccordionSummary, {
|
|
4360
|
-
expandIcon: defaultExpand ? /*#__PURE__*/React__default.createElement(ExpandLessIcon, {
|
|
4361
|
-
width: "12px",
|
|
4362
|
-
height: "7px"
|
|
4363
|
-
}) : /*#__PURE__*/React__default.createElement(ExpandMoreIcon, {
|
|
4364
|
-
width: "12px",
|
|
4365
|
-
height: "7px"
|
|
4366
|
-
}),
|
|
4367
|
-
"aria-controls": "panel1bh-content",
|
|
4368
|
-
id: "panel1bh-header",
|
|
4369
|
-
className: clsx(styles.additionalInfoTitle, (_clsx = {}, _clsx[styles.expandIconAlign] = defaultExpand === 'open', _clsx))
|
|
4370
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4371
|
-
container: true,
|
|
4372
|
-
className: clsx(styles.product_info, styles.sectionWrapper)
|
|
4373
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4374
|
-
item: true,
|
|
4375
|
-
sm: 12,
|
|
4376
|
-
md: 4,
|
|
4377
|
-
className: styles.titleContainer
|
|
4378
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
4379
|
-
label: "Additional information",
|
|
4380
|
-
headerType: true,
|
|
4381
|
-
description: "Passport, Membership, Travel preferences..."
|
|
4382
|
-
})))), /*#__PURE__*/React__default.createElement(iuistyles.IUIAccordionDetails, {
|
|
4383
|
-
className: styles.detailsContainer
|
|
4384
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4385
|
-
container: true,
|
|
4386
|
-
className: clsx(styles.work_info, styles.sectionWrapper)
|
|
4387
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4388
|
-
item: true,
|
|
4389
|
-
sm: 12,
|
|
4390
|
-
md: 4
|
|
4391
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
4392
|
-
label: "Passport information",
|
|
4393
|
-
headerType: true
|
|
4394
|
-
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4395
|
-
item: true,
|
|
4396
|
-
sm: 12,
|
|
4397
|
-
md: 8,
|
|
4398
|
-
lg: 8,
|
|
4399
|
-
xl: 6
|
|
4400
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4401
|
-
container: true,
|
|
4402
|
-
className: clsx(styles.formFieldsWrapper, styles.firstRowMargin)
|
|
4403
|
-
}, passportInfo.map(function (p, i) {
|
|
4404
|
-
var _clsx2;
|
|
4405
|
-
if (!p.visibility) {
|
|
4406
|
-
return null;
|
|
4407
|
-
}
|
|
4360
|
+
var getAccordianSummary = function getAccordianSummary() {
|
|
4408
4361
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4362
|
+
container: true,
|
|
4363
|
+
className: clsx(styles.product_info, styles.sectionWrapper)
|
|
4364
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4409
4365
|
item: true,
|
|
4410
4366
|
sm: 12,
|
|
4411
|
-
md:
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
dateFormat: dateFormat
|
|
4424
|
-
}));
|
|
4425
|
-
})))), /*#__PURE__*/React__default.createElement(iuistyles.IUIDivider, {
|
|
4426
|
-
className: styles.dividerColor
|
|
4427
|
-
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4428
|
-
container: true,
|
|
4429
|
-
className: clsx(styles.personal_info, styles.sectionWrapper)
|
|
4430
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4431
|
-
item: true,
|
|
4432
|
-
sm: 12,
|
|
4433
|
-
md: 4
|
|
4434
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
4435
|
-
label: "Membership information",
|
|
4436
|
-
headerType: true,
|
|
4437
|
-
description: "You can add up to " + maxMembershipInput + " membership details"
|
|
4438
|
-
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4439
|
-
item: true,
|
|
4440
|
-
sm: 12,
|
|
4441
|
-
md: 8,
|
|
4442
|
-
lg: 8,
|
|
4443
|
-
xl: 6
|
|
4444
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4445
|
-
container: true,
|
|
4446
|
-
className: styles.formFieldsWrapper
|
|
4447
|
-
}, membershipInfoInput.length === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
4448
|
-
className: styles.emptyFieldContainer
|
|
4449
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
4450
|
-
className: styles.emptyFieldDescription
|
|
4451
|
-
}, "No membership details added yet"), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
4452
|
-
className: clsx(styles.emptyFieldBtnContainer, styles.rowGap),
|
|
4453
|
-
display: "flex"
|
|
4454
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
4455
|
-
buttonText: "Add airline",
|
|
4456
|
-
type: "text",
|
|
4457
|
-
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
4458
|
-
width: "10",
|
|
4459
|
-
height: "10",
|
|
4460
|
-
color: "#EC5D25"
|
|
4461
|
-
}),
|
|
4462
|
-
className: styles.paddingTop,
|
|
4463
|
-
onClick: function onClick(e) {
|
|
4464
|
-
return addMemInfoInput('flight');
|
|
4465
|
-
}
|
|
4466
|
-
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
4467
|
-
buttonText: "Add hotel",
|
|
4468
|
-
type: "text",
|
|
4469
|
-
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
4470
|
-
width: "10",
|
|
4471
|
-
height: "10",
|
|
4472
|
-
color: "#EC5D25"
|
|
4473
|
-
}),
|
|
4474
|
-
className: styles.paddingTop,
|
|
4475
|
-
onClick: function onClick(e) {
|
|
4476
|
-
return addMemInfoInput('hotel');
|
|
4477
|
-
}
|
|
4478
|
-
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
4479
|
-
buttonText: "Add car rental",
|
|
4480
|
-
type: "text",
|
|
4481
|
-
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
4482
|
-
width: "10",
|
|
4483
|
-
height: "10",
|
|
4484
|
-
color: "#EC5D25"
|
|
4485
|
-
}),
|
|
4486
|
-
className: styles.paddingTop,
|
|
4487
|
-
onClick: function onClick(e) {
|
|
4488
|
-
return addMemInfoInput('rental_car');
|
|
4489
|
-
}
|
|
4490
|
-
}))), membershipInfoInput.length > 0 && membershipInfoInput.map(function (val, index) {
|
|
4491
|
-
if (index >= maxMembershipInput) {
|
|
4492
|
-
return null;
|
|
4493
|
-
}
|
|
4494
|
-
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
4495
|
-
key: index.toString()
|
|
4367
|
+
md: 4,
|
|
4368
|
+
className: styles.titleContainer
|
|
4369
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
4370
|
+
label: "Additional information",
|
|
4371
|
+
headerType: true,
|
|
4372
|
+
description: "Passport, Membership, Travel preferences..."
|
|
4373
|
+
})));
|
|
4374
|
+
};
|
|
4375
|
+
var getAccordianDetails = function getAccordianDetails() {
|
|
4376
|
+
return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4377
|
+
container: true,
|
|
4378
|
+
className: clsx(styles.work_info, styles.sectionWrapper)
|
|
4496
4379
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4497
4380
|
item: true,
|
|
4381
|
+
sm: 12,
|
|
4382
|
+
md: 4
|
|
4383
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
4384
|
+
label: "Passport information",
|
|
4385
|
+
headerType: true
|
|
4386
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4387
|
+
item: true,
|
|
4388
|
+
sm: 12,
|
|
4498
4389
|
md: 8,
|
|
4499
|
-
lg:
|
|
4390
|
+
lg: 8,
|
|
4500
4391
|
xl: 6
|
|
4501
|
-
}, /*#__PURE__*/React__default.createElement(
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4392
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4393
|
+
container: true,
|
|
4394
|
+
className: clsx(styles.formFieldsWrapper, styles.firstRowMargin)
|
|
4395
|
+
}, passportInfo.map(function (p, i) {
|
|
4396
|
+
var _clsx;
|
|
4397
|
+
if (!p.visibility) {
|
|
4398
|
+
return null;
|
|
4399
|
+
}
|
|
4400
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4401
|
+
item: true,
|
|
4402
|
+
sm: 12,
|
|
4403
|
+
md: 12,
|
|
4404
|
+
lg: p.type === 'datepicker' ? 2 : p.fullWidth ? 12 : 6,
|
|
4405
|
+
xl: p.type === 'datepicker' ? 2 : p.fullWidth ? 12 : 6,
|
|
4406
|
+
key: i,
|
|
4407
|
+
className: clsx(styles.margin, (_clsx = {}, _clsx[styles.minGridWidth] = p.type === 'datepicker', _clsx))
|
|
4408
|
+
}, /*#__PURE__*/React__default.createElement(GetInputType, {
|
|
4409
|
+
_p: p,
|
|
4410
|
+
inputState: passportInfoInput,
|
|
4411
|
+
onValueChange: onPassportInfoInputChange,
|
|
4412
|
+
dropdownList: dropdownList,
|
|
4413
|
+
errorArray: errorArray,
|
|
4414
|
+
errorMsg: errorMsgs[p.name],
|
|
4415
|
+
dateFormat: dateFormat
|
|
4416
|
+
}));
|
|
4417
|
+
})))), /*#__PURE__*/React__default.createElement(iuistyles.IUIDivider, {
|
|
4418
|
+
className: styles.dividerColor
|
|
4419
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4420
|
+
container: true,
|
|
4421
|
+
className: clsx(styles.personal_info, styles.sectionWrapper)
|
|
4422
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4423
|
+
item: true,
|
|
4424
|
+
sm: 12,
|
|
4425
|
+
md: 4
|
|
4426
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
4427
|
+
label: "Membership information",
|
|
4428
|
+
headerType: true,
|
|
4429
|
+
description: "You can add up to " + maxMembershipInput + " membership details"
|
|
4505
4430
|
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4506
4431
|
item: true,
|
|
4432
|
+
sm: 12,
|
|
4507
4433
|
md: 8,
|
|
4508
|
-
lg:
|
|
4434
|
+
lg: 8,
|
|
4509
4435
|
xl: 6
|
|
4436
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4437
|
+
container: true,
|
|
4438
|
+
className: styles.formFieldsWrapper
|
|
4439
|
+
}, membershipInfoInput.length === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
4440
|
+
className: styles.emptyFieldContainer
|
|
4441
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
4442
|
+
className: styles.emptyFieldDescription
|
|
4443
|
+
}, "No membership details added yet"), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
4444
|
+
className: clsx(styles.emptyFieldBtnContainer, styles.rowGap),
|
|
4445
|
+
display: "flex"
|
|
4446
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
4447
|
+
buttonText: "Add airline",
|
|
4448
|
+
type: "text",
|
|
4449
|
+
startIcon: /*#__PURE__*/React__default.createElement(iuistyles.icons.Add, {
|
|
4450
|
+
width: "10",
|
|
4451
|
+
height: "10",
|
|
4452
|
+
color: "#EC5D25"
|
|
4453
|
+
}),
|
|
4454
|
+
className: styles.paddingTop,
|
|
4455
|
+
onClick: function onClick(e) {
|
|
4456
|
+
return addMemInfoInput('flight');
|
|
4457
|
+
}
|
|
4458
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
4459
|
+
buttonText: "Add hotel",
|
|
4460
|
+
type: "text",
|
|
4461
|
+
startIcon: /*#__PURE__*/React__default.createElement(iuistyles.icons.Add, {
|
|
4462
|
+
width: "10",
|
|
4463
|
+
height: "10",
|
|
4464
|
+
color: "#EC5D25"
|
|
4465
|
+
}),
|
|
4466
|
+
className: styles.paddingTop,
|
|
4467
|
+
onClick: function onClick(e) {
|
|
4468
|
+
return addMemInfoInput('hotel');
|
|
4469
|
+
}
|
|
4470
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
4471
|
+
buttonText: "Add car rental",
|
|
4472
|
+
type: "text",
|
|
4473
|
+
startIcon: /*#__PURE__*/React__default.createElement(iuistyles.icons.Add, {
|
|
4474
|
+
width: "10",
|
|
4475
|
+
height: "10",
|
|
4476
|
+
color: "#EC5D25"
|
|
4477
|
+
}),
|
|
4478
|
+
className: styles.paddingTop,
|
|
4479
|
+
onClick: function onClick(e) {
|
|
4480
|
+
return addMemInfoInput('rental_car');
|
|
4481
|
+
}
|
|
4482
|
+
}))), membershipInfoInput.length > 0 && membershipInfoInput.map(function (val, index) {
|
|
4483
|
+
if (index >= maxMembershipInput) {
|
|
4484
|
+
return null;
|
|
4485
|
+
}
|
|
4486
|
+
return /*#__PURE__*/React__default.createElement(React__default.Fragment, {
|
|
4487
|
+
key: index.toString()
|
|
4488
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4489
|
+
item: true,
|
|
4490
|
+
md: 8,
|
|
4491
|
+
lg: 6,
|
|
4492
|
+
xl: 6
|
|
4493
|
+
}, /*#__PURE__*/React__default.createElement(MembershipField, {
|
|
4494
|
+
val: val,
|
|
4495
|
+
index: index,
|
|
4496
|
+
key: index.toString()
|
|
4497
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4498
|
+
item: true,
|
|
4499
|
+
md: 8,
|
|
4500
|
+
lg: 6,
|
|
4501
|
+
xl: 6
|
|
4502
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
4503
|
+
component: "div",
|
|
4504
|
+
display: "flex"
|
|
4505
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
4506
|
+
label: "Membership number",
|
|
4507
|
+
placeholder: "Enter membership number",
|
|
4508
|
+
fullwidth: false,
|
|
4509
|
+
defaultValue: val.number,
|
|
4510
|
+
onValueChange: function onValueChange(_ref6) {
|
|
4511
|
+
var _value = _ref6._value;
|
|
4512
|
+
return onMemInfoInputChange(index, 'number', _value);
|
|
4513
|
+
}
|
|
4514
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIIconButton, {
|
|
4515
|
+
style: {
|
|
4516
|
+
marginTop: '30px'
|
|
4517
|
+
},
|
|
4518
|
+
disableRipple: true,
|
|
4519
|
+
onClick: function onClick() {
|
|
4520
|
+
return handleRemoveMemFields(index);
|
|
4521
|
+
},
|
|
4522
|
+
className: styles.backGrdColorOnHover
|
|
4523
|
+
}, /*#__PURE__*/React__default.createElement(Cross, {
|
|
4524
|
+
width: "14",
|
|
4525
|
+
height: "14"
|
|
4526
|
+
})))));
|
|
4527
|
+
}), membershipInfoInput.length < maxMembershipInput && membershipInfoInput.length > 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4528
|
+
item: true,
|
|
4529
|
+
md: 8,
|
|
4530
|
+
lg: 8,
|
|
4531
|
+
xl: 8
|
|
4510
4532
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
4511
|
-
|
|
4533
|
+
className: clsx(styles.emptyFieldBtnContainer, styles.rowGap),
|
|
4512
4534
|
display: "flex"
|
|
4513
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4535
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
4536
|
+
buttonText: "Add airline",
|
|
4537
|
+
type: "text",
|
|
4538
|
+
startIcon: /*#__PURE__*/React__default.createElement(Add, {
|
|
4539
|
+
width: "10",
|
|
4540
|
+
height: "10",
|
|
4541
|
+
color: "#EC5D25"
|
|
4542
|
+
}),
|
|
4543
|
+
className: styles.paddingTop,
|
|
4544
|
+
onClick: function onClick(e) {
|
|
4545
|
+
return addMemInfoInput('flight');
|
|
4521
4546
|
}
|
|
4522
|
-
}), /*#__PURE__*/React__default.createElement(iuistyles.
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
},
|
|
4530
|
-
className: styles.
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
})
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
|
|
4551
|
-
|
|
4552
|
-
onClick: function onClick(e) {
|
|
4553
|
-
return addMemInfoInput('flight');
|
|
4554
|
-
}
|
|
4555
|
-
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
4556
|
-
buttonText: "Add hotel",
|
|
4557
|
-
type: "text",
|
|
4558
|
-
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
4559
|
-
width: "10",
|
|
4560
|
-
height: "10",
|
|
4561
|
-
color: "#EC5D25"
|
|
4562
|
-
}),
|
|
4563
|
-
className: styles.paddingTop,
|
|
4564
|
-
onClick: function onClick(e) {
|
|
4565
|
-
return addMemInfoInput('hotel');
|
|
4566
|
-
}
|
|
4567
|
-
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
4568
|
-
buttonText: "Add car rental",
|
|
4569
|
-
type: "text",
|
|
4570
|
-
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
4571
|
-
width: "10",
|
|
4572
|
-
height: "10",
|
|
4573
|
-
color: "#EC5D25"
|
|
4574
|
-
}),
|
|
4575
|
-
className: styles.paddingTop,
|
|
4576
|
-
onClick: function onClick(e) {
|
|
4577
|
-
return addMemInfoInput('rental_car');
|
|
4578
|
-
}
|
|
4579
|
-
})))))), /*#__PURE__*/React__default.createElement(iuistyles.IUIDivider, {
|
|
4580
|
-
className: styles.dividerColor
|
|
4581
|
-
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4582
|
-
container: true,
|
|
4583
|
-
className: clsx(styles.personal_info, styles.sectionWrapper)
|
|
4584
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4585
|
-
item: true,
|
|
4586
|
-
sm: 12,
|
|
4587
|
-
md: 4
|
|
4588
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
4589
|
-
label: "Travel preferences",
|
|
4590
|
-
headerType: true
|
|
4591
|
-
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4592
|
-
item: true,
|
|
4593
|
-
sm: 12,
|
|
4594
|
-
md: 8,
|
|
4595
|
-
lg: 8,
|
|
4596
|
-
xl: 6
|
|
4597
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4598
|
-
container: true,
|
|
4599
|
-
className: clsx(styles.formFieldsWrapper, styles.firstRowMargin)
|
|
4600
|
-
}, travelPreference.map(function (p, i) {
|
|
4601
|
-
if (!p.visibility) {
|
|
4602
|
-
return null;
|
|
4603
|
-
}
|
|
4604
|
-
return /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4547
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
4548
|
+
buttonText: "Add hotel",
|
|
4549
|
+
type: "text",
|
|
4550
|
+
startIcon: /*#__PURE__*/React__default.createElement(Add, {
|
|
4551
|
+
width: "10",
|
|
4552
|
+
height: "10",
|
|
4553
|
+
color: "#EC5D25"
|
|
4554
|
+
}),
|
|
4555
|
+
className: styles.paddingTop,
|
|
4556
|
+
onClick: function onClick(e) {
|
|
4557
|
+
return addMemInfoInput('hotel');
|
|
4558
|
+
}
|
|
4559
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
4560
|
+
buttonText: "Add car rental",
|
|
4561
|
+
type: "text",
|
|
4562
|
+
startIcon: /*#__PURE__*/React__default.createElement(iuistyles.icons.Add, {
|
|
4563
|
+
width: "10",
|
|
4564
|
+
height: "10",
|
|
4565
|
+
color: "#EC5D25"
|
|
4566
|
+
}),
|
|
4567
|
+
className: styles.paddingTop,
|
|
4568
|
+
onClick: function onClick(e) {
|
|
4569
|
+
return addMemInfoInput('rental_car');
|
|
4570
|
+
}
|
|
4571
|
+
})))))), /*#__PURE__*/React__default.createElement(iuistyles.IUIDivider, {
|
|
4572
|
+
className: styles.dividerColor
|
|
4573
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4574
|
+
container: true,
|
|
4575
|
+
className: clsx(styles.personal_info, styles.sectionWrapper)
|
|
4576
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4605
4577
|
item: true,
|
|
4606
4578
|
sm: 12,
|
|
4607
|
-
md:
|
|
4608
|
-
|
|
4609
|
-
|
|
4610
|
-
|
|
4611
|
-
|
|
4612
|
-
}, /*#__PURE__*/React__default.createElement(GetInputType, {
|
|
4613
|
-
_p: p,
|
|
4614
|
-
inputState: travelPreferenceInfo,
|
|
4615
|
-
onValueChange: travelPreferenceOnChange,
|
|
4616
|
-
dropdownList: dropdownList,
|
|
4617
|
-
errorArray: errorArray,
|
|
4618
|
-
errorMsg: errorMsgs[p.name]
|
|
4619
|
-
}));
|
|
4620
|
-
})))), /*#__PURE__*/React__default.createElement(iuistyles.IUIDivider, {
|
|
4621
|
-
className: styles.dividerColor
|
|
4622
|
-
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4623
|
-
container: true,
|
|
4624
|
-
className: clsx(styles.personal_info, styles.sectionWrapper)
|
|
4625
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4626
|
-
item: true,
|
|
4627
|
-
sm: 12,
|
|
4628
|
-
md: 4
|
|
4629
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
4630
|
-
label: "Secure traveler information",
|
|
4631
|
-
headerType: true
|
|
4632
|
-
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4633
|
-
item: true,
|
|
4634
|
-
sm: 12,
|
|
4635
|
-
md: 8,
|
|
4636
|
-
lg: 8,
|
|
4637
|
-
xl: 6
|
|
4638
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4639
|
-
container: true,
|
|
4640
|
-
className: clsx(styles.formFieldsWrapper, styles.firstRowMargin)
|
|
4641
|
-
}, secureTravelInfo.map(function (p, i) {
|
|
4642
|
-
if (!p.visibility) {
|
|
4643
|
-
return null;
|
|
4644
|
-
}
|
|
4645
|
-
return /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4579
|
+
md: 4
|
|
4580
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
4581
|
+
label: "Travel preferences",
|
|
4582
|
+
headerType: true
|
|
4583
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4646
4584
|
item: true,
|
|
4647
4585
|
sm: 12,
|
|
4648
|
-
md:
|
|
4649
|
-
lg:
|
|
4650
|
-
xl:
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4586
|
+
md: 8,
|
|
4587
|
+
lg: 8,
|
|
4588
|
+
xl: 6
|
|
4589
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4590
|
+
container: true,
|
|
4591
|
+
className: clsx(styles.formFieldsWrapper, styles.firstRowMargin)
|
|
4592
|
+
}, travelPreference.map(function (p, i) {
|
|
4593
|
+
if (!p.visibility) {
|
|
4594
|
+
return null;
|
|
4595
|
+
}
|
|
4596
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4597
|
+
item: true,
|
|
4598
|
+
sm: 12,
|
|
4599
|
+
md: 12,
|
|
4600
|
+
lg: p.fullWidth ? 12 : 6,
|
|
4601
|
+
xl: p.fullWidth ? 12 : 6,
|
|
4602
|
+
key: i,
|
|
4603
|
+
className: clsx(styles.margin)
|
|
4604
|
+
}, /*#__PURE__*/React__default.createElement(GetInputType, {
|
|
4605
|
+
_p: p,
|
|
4606
|
+
inputState: travelPreferenceInfo,
|
|
4607
|
+
onValueChange: travelPreferenceOnChange,
|
|
4608
|
+
dropdownList: dropdownList,
|
|
4609
|
+
errorArray: errorArray,
|
|
4610
|
+
errorMsg: errorMsgs[p.name]
|
|
4611
|
+
}));
|
|
4612
|
+
})))), /*#__PURE__*/React__default.createElement(iuistyles.IUIDivider, {
|
|
4613
|
+
className: styles.dividerColor
|
|
4614
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4615
|
+
container: true,
|
|
4616
|
+
className: clsx(styles.personal_info, styles.sectionWrapper)
|
|
4617
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4618
|
+
item: true,
|
|
4619
|
+
sm: 12,
|
|
4620
|
+
md: 4
|
|
4621
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
4622
|
+
label: "Secure traveler information",
|
|
4623
|
+
headerType: true
|
|
4624
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4625
|
+
item: true,
|
|
4626
|
+
sm: 12,
|
|
4627
|
+
md: 8,
|
|
4628
|
+
lg: 8,
|
|
4629
|
+
xl: 6
|
|
4630
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4631
|
+
container: true,
|
|
4632
|
+
className: clsx(styles.formFieldsWrapper, styles.firstRowMargin)
|
|
4633
|
+
}, secureTravelInfo.map(function (p, i) {
|
|
4634
|
+
if (!p.visibility) {
|
|
4635
|
+
return null;
|
|
4636
|
+
}
|
|
4637
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIGrid, {
|
|
4638
|
+
item: true,
|
|
4639
|
+
sm: 12,
|
|
4640
|
+
md: 12,
|
|
4641
|
+
lg: p.fullWidth ? 12 : 6,
|
|
4642
|
+
xl: p.fullWidth ? 12 : 6,
|
|
4643
|
+
key: i,
|
|
4644
|
+
className: clsx(styles.margin)
|
|
4645
|
+
}, /*#__PURE__*/React__default.createElement(GetInputType, {
|
|
4646
|
+
_p: p,
|
|
4647
|
+
inputState: secureTravelInputInfo,
|
|
4648
|
+
onValueChange: onSecureTraveelerInfoInputChange,
|
|
4649
|
+
errorArray: errorArray,
|
|
4650
|
+
errorMsg: errorMsgs[p.name]
|
|
4651
|
+
}));
|
|
4652
|
+
})))));
|
|
4653
|
+
};
|
|
4654
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIAccordionMain, {
|
|
4655
|
+
expanded: defaultExpand === 'open',
|
|
4656
|
+
onChange: handleChange('open'),
|
|
4657
|
+
accordionClass: styles.additionalInfoContainer,
|
|
4658
|
+
summaryComponent: getAccordianSummary(),
|
|
4659
|
+
summaryClass: clsx(styles.additionalInfoTitle, (_clsx2 = {}, _clsx2[styles.expandIconAlign] = defaultExpand === 'open', _clsx2)),
|
|
4660
|
+
expandIcon: defaultExpand ? /*#__PURE__*/React__default.createElement(ExpandLess, {
|
|
4661
|
+
width: "12px",
|
|
4662
|
+
height: "7px"
|
|
4663
|
+
}) : /*#__PURE__*/React__default.createElement(ExpandMore, {
|
|
4664
|
+
width: "12px",
|
|
4665
|
+
height: "7px"
|
|
4666
|
+
}),
|
|
4667
|
+
detailsComponent: getAccordianDetails(),
|
|
4668
|
+
detailsClass: styles.detailsContainer
|
|
4669
|
+
});
|
|
4661
4670
|
};
|
|
4662
4671
|
|
|
4663
4672
|
var styles$3 = {"root":"_b_muK","minWidth":"_3OQXs","bullet":"_1Q5vL","pos":"_6wGWA","cardHeader":"_SWCfJ","pageHeader":"_2ZeWp","buttonHover":"_2Iuy1","cardHeaderBackground":"_3NJWF","actionCustom":"_3Kbfm"};
|
|
@@ -6741,7 +6750,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
|
|
|
6741
6750
|
};
|
|
6742
6751
|
};
|
|
6743
6752
|
|
|
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"};
|
|
6753
|
+
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"};
|
|
6745
6754
|
|
|
6746
6755
|
var BulkUploadModal = function BulkUploadModal(props) {
|
|
6747
6756
|
var isOpenImportUsersModal = props.isOpenImportUsersModal,
|
|
@@ -8002,6 +8011,19 @@ var BulkDownloadIcon = function BulkDownloadIcon(props) {
|
|
|
8002
8011
|
|
|
8003
8012
|
var classes = {"containedBtn":"_2A4_u","customMiniBox":"_QGIKG","muiBtn":"_3iFbO","outlinedBtn":"_3lQYD","menuList":"_1C8bJ","menuListContainer":"_1N83W","menuItemContainer":"_3VtcE","menuItemtext":"_2xqnU","subTxt":"_3CVzX"};
|
|
8004
8013
|
|
|
8014
|
+
var ExpandMoreIcon = function ExpandMoreIcon(props) {
|
|
8015
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8016
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
8017
|
+
width: props.width,
|
|
8018
|
+
height: props.height,
|
|
8019
|
+
fill: "none",
|
|
8020
|
+
viewBox: "0 0 12 7"
|
|
8021
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8022
|
+
fill: "#6B7280",
|
|
8023
|
+
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"
|
|
8024
|
+
}));
|
|
8025
|
+
};
|
|
8026
|
+
|
|
8005
8027
|
var DropdownBtn = function DropdownBtn(props) {
|
|
8006
8028
|
var _clsx;
|
|
8007
8029
|
var _props$buttonText = props.buttonText,
|
|
@@ -8394,7 +8416,8 @@ var StickyHeadTable = function StickyHeadTable(props) {
|
|
|
8394
8416
|
isDataFetching: isDataFetching,
|
|
8395
8417
|
disableRowCheckbox: disableRowCheckbox,
|
|
8396
8418
|
searchBoxWidth: "400px",
|
|
8397
|
-
searchValue: searchValue
|
|
8419
|
+
searchValue: searchValue,
|
|
8420
|
+
hideTopPagination: false
|
|
8398
8421
|
});
|
|
8399
8422
|
};
|
|
8400
8423
|
var SingupRequests = function SingupRequests(props) {
|
|
@@ -8525,6 +8548,25 @@ function InviteInfoIcon() {
|
|
|
8525
8548
|
}));
|
|
8526
8549
|
}
|
|
8527
8550
|
|
|
8551
|
+
function InfoYellowIcon(props) {
|
|
8552
|
+
return /*#__PURE__*/React__default.createElement("svg", {
|
|
8553
|
+
width: props.width,
|
|
8554
|
+
height: props.height,
|
|
8555
|
+
viewBox: "0 0 20 20",
|
|
8556
|
+
fill: "none",
|
|
8557
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
8558
|
+
}, /*#__PURE__*/React__default.createElement("path", {
|
|
8559
|
+
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",
|
|
8560
|
+
fill: "#CA8A04"
|
|
8561
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8562
|
+
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",
|
|
8563
|
+
fill: "#CA8A04"
|
|
8564
|
+
}), /*#__PURE__*/React__default.createElement("path", {
|
|
8565
|
+
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",
|
|
8566
|
+
fill: "#CA8A04"
|
|
8567
|
+
}));
|
|
8568
|
+
}
|
|
8569
|
+
|
|
8528
8570
|
var IUIToastMessageService$7 = utils.services.IUIToastMessageService;
|
|
8529
8571
|
var env$7 = utils.configs.env;
|
|
8530
8572
|
var UndoButton = function UndoButton(_ref) {
|
|
@@ -8567,7 +8609,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8567
8609
|
var _React$useState = React__default.useState(1),
|
|
8568
8610
|
page = _React$useState[0],
|
|
8569
8611
|
setPage = _React$useState[1];
|
|
8570
|
-
var _useState = React.useState(
|
|
8612
|
+
var _useState = React.useState(10),
|
|
8571
8613
|
rowsPerPage = _useState[0],
|
|
8572
8614
|
setRowsPerPage = _useState[1];
|
|
8573
8615
|
var _React$useState2 = React__default.useState({}),
|
|
@@ -8576,9 +8618,12 @@ var UserList = function UserList(_ref2) {
|
|
|
8576
8618
|
var _React$useState3 = React__default.useState('asc'),
|
|
8577
8619
|
order = _React$useState3[0],
|
|
8578
8620
|
setOrder = _React$useState3[1];
|
|
8579
|
-
var _React$useState4 = React__default.useState(
|
|
8580
|
-
|
|
8581
|
-
|
|
8621
|
+
var _React$useState4 = React__default.useState(false),
|
|
8622
|
+
deactivateSingle = _React$useState4[0],
|
|
8623
|
+
setDeactivateSingle = _React$useState4[1];
|
|
8624
|
+
var _React$useState5 = React__default.useState('first_name'),
|
|
8625
|
+
orderBy = _React$useState5[0],
|
|
8626
|
+
setOrderBy = _React$useState5[1];
|
|
8582
8627
|
var _useState2 = React.useState(''),
|
|
8583
8628
|
searchValue = _useState2[0],
|
|
8584
8629
|
setSearchValue = _useState2[1];
|
|
@@ -8619,18 +8664,41 @@ var UserList = function UserList(_ref2) {
|
|
|
8619
8664
|
var _useState12 = React.useState(''),
|
|
8620
8665
|
userIds = _useState12[0],
|
|
8621
8666
|
setUserIds = _useState12[1];
|
|
8622
|
-
var _React$
|
|
8623
|
-
|
|
8624
|
-
|
|
8667
|
+
var _React$useState6 = React__default.useState(false),
|
|
8668
|
+
overlayMenu = _React$useState6[0],
|
|
8669
|
+
setOverlayMenu = _React$useState6[1];
|
|
8670
|
+
useScrollPosition.useScrollPosition(function (_ref3) {
|
|
8671
|
+
var prevPos = _ref3.prevPos,
|
|
8672
|
+
currPos = _ref3.currPos;
|
|
8673
|
+
if (prevPos.y - currPos.y > 0) {
|
|
8674
|
+
if (currPos.y <= -275) {
|
|
8675
|
+
setOverlayMenu(true);
|
|
8676
|
+
}
|
|
8677
|
+
} else {
|
|
8678
|
+
if (currPos.y > -295) {
|
|
8679
|
+
setOverlayMenu(false);
|
|
8680
|
+
}
|
|
8681
|
+
}
|
|
8682
|
+
}, [overlayMenu]);
|
|
8683
|
+
var scrollTo = function scrollTo(id) {
|
|
8684
|
+
var el = document.getElementById(id);
|
|
8685
|
+
window.scrollTo({
|
|
8686
|
+
top: el.offsetTop,
|
|
8687
|
+
behavior: 'smooth'
|
|
8688
|
+
});
|
|
8689
|
+
};
|
|
8690
|
+
var _React$useState7 = React__default.useState(1),
|
|
8691
|
+
signup_page = _React$useState7[0],
|
|
8692
|
+
setSignUpPage = _React$useState7[1];
|
|
8625
8693
|
var _useState13 = React.useState(5),
|
|
8626
8694
|
signup_rowsPerPage = _useState13[0],
|
|
8627
8695
|
setSignUpRowsPerPage = _useState13[1];
|
|
8628
|
-
var _React$
|
|
8629
|
-
signup_order = _React$
|
|
8630
|
-
setSignUpOrder = _React$
|
|
8631
|
-
var _React$
|
|
8632
|
-
signup_orderBy = _React$
|
|
8633
|
-
setSignUpOrderBy = _React$
|
|
8696
|
+
var _React$useState8 = React__default.useState('asc'),
|
|
8697
|
+
signup_order = _React$useState8[0],
|
|
8698
|
+
setSignUpOrder = _React$useState8[1];
|
|
8699
|
+
var _React$useState9 = React__default.useState('fname'),
|
|
8700
|
+
signup_orderBy = _React$useState9[0],
|
|
8701
|
+
setSignUpOrderBy = _React$useState9[1];
|
|
8634
8702
|
var _useState14 = React.useState(''),
|
|
8635
8703
|
signup_searchValue = _useState14[0],
|
|
8636
8704
|
set_signup_SearchValue = _useState14[1];
|
|
@@ -8650,6 +8718,12 @@ var UserList = function UserList(_ref2) {
|
|
|
8650
8718
|
return state.userList;
|
|
8651
8719
|
}),
|
|
8652
8720
|
signupRequestListInfo = _useSelector3.signupRequestListInfo;
|
|
8721
|
+
var _useState19 = React.useState({
|
|
8722
|
+
value: '',
|
|
8723
|
+
label: 'Select approver'
|
|
8724
|
+
}),
|
|
8725
|
+
travelFYI = _useState19[0],
|
|
8726
|
+
setTravelFYI = _useState19[1];
|
|
8653
8727
|
var openDeactivateModal = function openDeactivateModal() {
|
|
8654
8728
|
if (Object.values(selected).flat().length === 0 || Object.values(selected).flat() === undefined) {
|
|
8655
8729
|
IUIToastMessageService$7.warningNotify('Select at least one user to deactivate.');
|
|
@@ -8766,17 +8840,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8766
8840
|
setSortingChangeTemp(!isSortingChangeTemp);
|
|
8767
8841
|
};
|
|
8768
8842
|
var handleActiveUser = function handleActiveUser(e, id, page) {
|
|
8769
|
-
|
|
8770
|
-
dispatch(updateActiveStatus(e.target.checked ? 1 : 0, e.target.id)).then(function () {
|
|
8771
|
-
if (!isActive) {
|
|
8772
|
-
if (Object.values(selected).flat().includes(id.toString())) {
|
|
8773
|
-
var _extends5;
|
|
8774
|
-
var selectedTemp = _extends({}, selected);
|
|
8775
|
-
selectedTemp[page].splice(selectedTemp[page].indexOf(id.toString()), 1);
|
|
8776
|
-
setSelected(_extends({}, selected, (_extends5 = {}, _extends5[page] = selectedTemp[page], _extends5)));
|
|
8777
|
-
}
|
|
8778
|
-
}
|
|
8779
|
-
});
|
|
8843
|
+
setDeactivateSingle(true);
|
|
8780
8844
|
};
|
|
8781
8845
|
var handleDeactivateUsers = function handleDeactivateUsers() {
|
|
8782
8846
|
dispatch(deActivateUsers(Object.values(selected).flat()));
|
|
@@ -8890,6 +8954,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8890
8954
|
dispatch(fetchUsersList(url)).then(function () {
|
|
8891
8955
|
setSearchingChange(false);
|
|
8892
8956
|
setisApiFetching(false);
|
|
8957
|
+
scrollTo('table-root');
|
|
8893
8958
|
});
|
|
8894
8959
|
}, 1000);
|
|
8895
8960
|
return function () {
|
|
@@ -8916,6 +8981,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8916
8981
|
}
|
|
8917
8982
|
if (isSortingChange) {
|
|
8918
8983
|
setisApiFetching(true);
|
|
8984
|
+
scrollTo('table-root');
|
|
8919
8985
|
dispatch(fetchUsersList(url)).then(function () {
|
|
8920
8986
|
setisApiFetching(false);
|
|
8921
8987
|
setSortingChange(false);
|
|
@@ -8956,15 +9022,89 @@ var UserList = function UserList(_ref2) {
|
|
|
8956
9022
|
}
|
|
8957
9023
|
}
|
|
8958
9024
|
}, [isTokenVerified, isSearchingChangeTemp, isSortingChangeTemp, isSignUpSearchingChangeTemp, isSignUpSortingChangeTemp]);
|
|
9025
|
+
var topRightButtons = function topRightButtons() {
|
|
9026
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9027
|
+
component: "div",
|
|
9028
|
+
className: styles$5.buttonWrapper,
|
|
9029
|
+
display: "flex",
|
|
9030
|
+
justifyContent: "space-between",
|
|
9031
|
+
alignItems: "center",
|
|
9032
|
+
alignSelf: "flex-start"
|
|
9033
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9034
|
+
component: "div",
|
|
9035
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9036
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9037
|
+
buttonText: "Export all users",
|
|
9038
|
+
type: "outlined",
|
|
9039
|
+
startIcon: /*#__PURE__*/React__default.createElement(BulkDownloadIcon, {
|
|
9040
|
+
width: "22",
|
|
9041
|
+
height: "22"
|
|
9042
|
+
}),
|
|
9043
|
+
onClick: handleExportUsers
|
|
9044
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9045
|
+
component: "div",
|
|
9046
|
+
className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
|
|
9047
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIDropdownButton, {
|
|
9048
|
+
buttonText: "Bulk actions",
|
|
9049
|
+
type: "outlined",
|
|
9050
|
+
menuListInfo: BulkUploadInfo
|
|
9051
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9052
|
+
component: "div",
|
|
9053
|
+
className: "pageHeader--button-single button-right"
|
|
9054
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9055
|
+
buttonText: "Add user",
|
|
9056
|
+
type: "contained",
|
|
9057
|
+
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
9058
|
+
width: "9",
|
|
9059
|
+
height: "9",
|
|
9060
|
+
color: "white"
|
|
9061
|
+
}),
|
|
9062
|
+
onClick: handleAddPageNavigation
|
|
9063
|
+
})));
|
|
9064
|
+
};
|
|
8959
9065
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
8960
9066
|
component: "div",
|
|
8961
9067
|
className: styles$5.UUIUserManagementList
|
|
8962
|
-
},
|
|
9068
|
+
}, overlayMenu ? /*#__PURE__*/React__default.createElement(core.Box, {
|
|
9069
|
+
className: styles$5.scrollOverlayMenu
|
|
9070
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9071
|
+
component: "div",
|
|
9072
|
+
className: clsx(styles$5.pageHeader)
|
|
9073
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9074
|
+
component: "div",
|
|
9075
|
+
display: "flex",
|
|
9076
|
+
justifyContent: "space-between",
|
|
9077
|
+
alignItems: "center",
|
|
9078
|
+
flexWrap: "wrap",
|
|
9079
|
+
style: {
|
|
9080
|
+
gap: '1rem'
|
|
9081
|
+
}
|
|
9082
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9083
|
+
component: "div",
|
|
9084
|
+
display: "flex",
|
|
9085
|
+
flexDirection: "column",
|
|
9086
|
+
style: {
|
|
9087
|
+
gap: '0.5rem'
|
|
9088
|
+
}
|
|
9089
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUISearch, {
|
|
9090
|
+
placeholder: "Search by name, email & department",
|
|
9091
|
+
value: searchValue,
|
|
9092
|
+
onChangeHandler: function onChangeHandler(e) {
|
|
9093
|
+
return onSearchHandler(e.target.value);
|
|
9094
|
+
},
|
|
9095
|
+
className: styles$5.overlaysearch
|
|
9096
|
+
})), topRightButtons()), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9097
|
+
component: "div",
|
|
9098
|
+
display: "flex",
|
|
9099
|
+
justifyContent: "space-between",
|
|
9100
|
+
alignItems: "center"
|
|
9101
|
+
}))) : '', !hasVerificationError ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBackdrop, {
|
|
8963
9102
|
open: isFileDownloading || isApiFetching,
|
|
8964
9103
|
className: styles$5.backdrop
|
|
8965
9104
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUICircularProgress, {
|
|
8966
9105
|
color: "inherit"
|
|
8967
9106
|
})), isDataFetching ? /*#__PURE__*/React__default.createElement(SkeletonLoader, null) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9107
|
+
id: "table-root",
|
|
8968
9108
|
component: "div",
|
|
8969
9109
|
className: clsx(styles$5.pageHeader)
|
|
8970
9110
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
@@ -8989,44 +9129,7 @@ var UserList = function UserList(_ref2) {
|
|
|
8989
9129
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
8990
9130
|
variant: "h3",
|
|
8991
9131
|
className: clsx(styles$5.heading, styles$5.headingLarge)
|
|
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, {
|
|
9132
|
+
}, isILadmin && companyName ? companyName + " - Users" : 'Users'))), topRightButtons()), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9030
9133
|
component: "div",
|
|
9031
9134
|
display: "flex",
|
|
9032
9135
|
justifyContent: "space-between",
|
|
@@ -9121,6 +9224,82 @@ var UserList = function UserList(_ref2) {
|
|
|
9121
9224
|
}))
|
|
9122
9225
|
}]
|
|
9123
9226
|
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9227
|
+
isOpen: deactivateSingle,
|
|
9228
|
+
closeHandler: function closeHandler() {
|
|
9229
|
+
setDeactivateSingle(false);
|
|
9230
|
+
},
|
|
9231
|
+
cancelLabel: "Cancel",
|
|
9232
|
+
submitLabel: "Deactivate",
|
|
9233
|
+
submitHandler: handleDeactivateUsers,
|
|
9234
|
+
headerText: "Deactivate this user?",
|
|
9235
|
+
width: "400px",
|
|
9236
|
+
subHanderText: "",
|
|
9237
|
+
submitBtnClass: styles$5.deactivateBtn,
|
|
9238
|
+
isDisabledSubmitBtn: true
|
|
9239
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9240
|
+
className: styles$5.deactivateSingle
|
|
9241
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9242
|
+
className: styles$5.deactivateAlert
|
|
9243
|
+
}, /*#__PURE__*/React__default.createElement(InfoYellowIcon, {
|
|
9244
|
+
width: "9",
|
|
9245
|
+
height: "9"
|
|
9246
|
+
}), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, null, /*#__PURE__*/React__default.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__default.createElement(iuistyles.IUIBox, {
|
|
9247
|
+
className: "iui__mb-15 iui__mt-15"
|
|
9248
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9249
|
+
isMove: true,
|
|
9250
|
+
additional: {
|
|
9251
|
+
page: 1,
|
|
9252
|
+
product: 'travel',
|
|
9253
|
+
placeholder: 'Select a user'
|
|
9254
|
+
},
|
|
9255
|
+
placeHolderCheck: travelFYI !== undefined && travelFYI.value === '',
|
|
9256
|
+
label: "Transfer admin role to",
|
|
9257
|
+
value: travelFYI,
|
|
9258
|
+
onValueChange: function onValueChange(_ref4) {
|
|
9259
|
+
var _value = _ref4._value;
|
|
9260
|
+
return setTravelFYI(_value);
|
|
9261
|
+
},
|
|
9262
|
+
loadOption: approversOptions,
|
|
9263
|
+
disableText: "Please get in touch with your administrator to change this value."
|
|
9264
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9265
|
+
className: clsx('iui__mb-5', styles$5.departmentHeadText)
|
|
9266
|
+
}, "Anvesh Dunna is the department head for: Product Design."), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9267
|
+
className: "iui__mb-15"
|
|
9268
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9269
|
+
isMove: true,
|
|
9270
|
+
additional: {
|
|
9271
|
+
page: 1,
|
|
9272
|
+
product: 'travel',
|
|
9273
|
+
placeholder: 'Select a user'
|
|
9274
|
+
},
|
|
9275
|
+
placeHolderCheck: travelFYI !== undefined && travelFYI.value === '',
|
|
9276
|
+
label: "Transfer department head role to",
|
|
9277
|
+
value: travelFYI,
|
|
9278
|
+
onValueChange: function onValueChange(_ref5) {
|
|
9279
|
+
var _value = _ref5._value;
|
|
9280
|
+
return setTravelFYI(_value);
|
|
9281
|
+
},
|
|
9282
|
+
loadOption: approversOptions,
|
|
9283
|
+
disableText: "Please get in touch with your administrator to change this value."
|
|
9284
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9285
|
+
className: "iui__mb-15"
|
|
9286
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9287
|
+
isMove: true,
|
|
9288
|
+
additional: {
|
|
9289
|
+
page: 1,
|
|
9290
|
+
product: 'travel',
|
|
9291
|
+
placeholder: 'Select a user'
|
|
9292
|
+
},
|
|
9293
|
+
placeHolderCheck: travelFYI !== undefined && travelFYI.value === '',
|
|
9294
|
+
label: "Transfer approver role to",
|
|
9295
|
+
value: travelFYI,
|
|
9296
|
+
onValueChange: function onValueChange(_ref6) {
|
|
9297
|
+
var _value = _ref6._value;
|
|
9298
|
+
return setTravelFYI(_value);
|
|
9299
|
+
},
|
|
9300
|
+
loadOption: approversOptions,
|
|
9301
|
+
disableText: "Please get in touch with your administrator to change this value."
|
|
9302
|
+
})))), /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9124
9303
|
isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
|
|
9125
9304
|
closeHandler: closeDeActivateModal,
|
|
9126
9305
|
cancelLabel: "Cancel",
|
|
@@ -9189,8 +9368,8 @@ var UserList = function UserList(_ref2) {
|
|
|
9189
9368
|
errMsg: hasVerificationError
|
|
9190
9369
|
}));
|
|
9191
9370
|
};
|
|
9192
|
-
var TabLabelCount = function TabLabelCount(
|
|
9193
|
-
var count =
|
|
9371
|
+
var TabLabelCount = function TabLabelCount(_ref7) {
|
|
9372
|
+
var count = _ref7.count;
|
|
9194
9373
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9195
9374
|
className: styles$5.TabLabelCount
|
|
9196
9375
|
}, " ", count, " ");
|
|
@@ -9265,11 +9444,12 @@ function Header(props) {
|
|
|
9265
9444
|
})));
|
|
9266
9445
|
}
|
|
9267
9446
|
|
|
9268
|
-
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"};
|
|
9447
|
+
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"};
|
|
9269
9448
|
|
|
9270
9449
|
function Listview(_ref) {
|
|
9271
9450
|
var data = _ref.data,
|
|
9272
9451
|
name = _ref.name,
|
|
9452
|
+
tableName = _ref.tableName,
|
|
9273
9453
|
handleEditDialog = _ref.handleEditDialog,
|
|
9274
9454
|
handleDeleteDialog = _ref.handleDeleteDialog,
|
|
9275
9455
|
orderBy = _ref.orderBy,
|
|
@@ -9282,16 +9462,83 @@ function Listview(_ref) {
|
|
|
9282
9462
|
handleChangePage = _ref$handleChangePage === void 0 ? function () {} : _ref$handleChangePage,
|
|
9283
9463
|
page = _ref.page,
|
|
9284
9464
|
rowsPerPage = _ref.rowsPerPage;
|
|
9465
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9466
|
+
var _data$dept_head_detai;
|
|
9467
|
+
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) {
|
|
9468
|
+
return data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name;
|
|
9469
|
+
}
|
|
9470
|
+
return 'Unassigned';
|
|
9471
|
+
};
|
|
9285
9472
|
var columns = [{
|
|
9286
9473
|
id: 'name',
|
|
9287
9474
|
label: name,
|
|
9288
|
-
width: '
|
|
9475
|
+
width: '40%',
|
|
9289
9476
|
sortable: true,
|
|
9290
9477
|
cell: function cell(row) {
|
|
9291
9478
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9292
9479
|
component: "div"
|
|
9293
9480
|
}, row.name);
|
|
9294
9481
|
}
|
|
9482
|
+
}, {
|
|
9483
|
+
id: 'no_of_users',
|
|
9484
|
+
label: 'Number of users',
|
|
9485
|
+
width: '40%',
|
|
9486
|
+
sortable: true,
|
|
9487
|
+
cell: function cell(row) {
|
|
9488
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9489
|
+
component: "div"
|
|
9490
|
+
}, row.no_of_users);
|
|
9491
|
+
}
|
|
9492
|
+
}, {
|
|
9493
|
+
id: 'actions',
|
|
9494
|
+
label: 'Actions',
|
|
9495
|
+
width: '20%',
|
|
9496
|
+
cell: function cell(row) {
|
|
9497
|
+
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9498
|
+
display: "flex"
|
|
9499
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9500
|
+
buttonText: "Edit",
|
|
9501
|
+
className: styles$7.buttonWidth,
|
|
9502
|
+
onClick: function onClick() {
|
|
9503
|
+
return handleEditDialog(row);
|
|
9504
|
+
}
|
|
9505
|
+
}), row.no_of_users > 0 ? /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9506
|
+
buttonText: "Delete",
|
|
9507
|
+
className: styles$7.buttonWidth,
|
|
9508
|
+
onClick: function onClick() {
|
|
9509
|
+
return handleDeleteDialog(row, true);
|
|
9510
|
+
}
|
|
9511
|
+
}) : /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9512
|
+
buttonText: "Delete",
|
|
9513
|
+
className: styles$7.buttonWidth,
|
|
9514
|
+
onClick: function onClick() {
|
|
9515
|
+
return handleDeleteDialog(row, false);
|
|
9516
|
+
}
|
|
9517
|
+
}));
|
|
9518
|
+
}
|
|
9519
|
+
}];
|
|
9520
|
+
var departmentColumns = [{
|
|
9521
|
+
id: 'name',
|
|
9522
|
+
label: name,
|
|
9523
|
+
width: '30%',
|
|
9524
|
+
sortable: true,
|
|
9525
|
+
cell: function cell(row) {
|
|
9526
|
+
return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9527
|
+
component: "div"
|
|
9528
|
+
}, row.name);
|
|
9529
|
+
}
|
|
9530
|
+
}, {
|
|
9531
|
+
id: 'department_head',
|
|
9532
|
+
label: 'Department head',
|
|
9533
|
+
width: '30%',
|
|
9534
|
+
sortable: true,
|
|
9535
|
+
cell: function cell(row) {
|
|
9536
|
+
return /*#__PURE__*/React__default.createElement(React.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9537
|
+
component: "div"
|
|
9538
|
+
}, deptHeadDetails(row)), row.is_default_dept_head && /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
|
|
9539
|
+
className: clsx(styles$7.rowText, styles$7.textTransform, styles$7.lightColor)
|
|
9540
|
+
}, "Assigned by default"));
|
|
9541
|
+
}
|
|
9295
9542
|
}, {
|
|
9296
9543
|
id: 'no_of_users',
|
|
9297
9544
|
label: 'Number of users',
|
|
@@ -9305,7 +9552,7 @@ function Listview(_ref) {
|
|
|
9305
9552
|
}, {
|
|
9306
9553
|
id: 'actions',
|
|
9307
9554
|
label: 'Actions',
|
|
9308
|
-
width: '
|
|
9555
|
+
width: '15%',
|
|
9309
9556
|
cell: function cell(row) {
|
|
9310
9557
|
return row.code !== UNASSIGNED_USERS && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9311
9558
|
display: "flex"
|
|
@@ -9338,7 +9585,7 @@ function Listview(_ref) {
|
|
|
9338
9585
|
hasFilter: true,
|
|
9339
9586
|
isCheckboxTable: false,
|
|
9340
9587
|
count: data.count,
|
|
9341
|
-
columns: columns,
|
|
9588
|
+
columns: tableName === 'department' ? departmentColumns : columns,
|
|
9342
9589
|
rows: data.results,
|
|
9343
9590
|
page: page,
|
|
9344
9591
|
handleChangePage: handleChangePage,
|
|
@@ -9395,15 +9642,41 @@ function EditPanelDialog(_ref) {
|
|
|
9395
9642
|
var isOpen = _ref.isOpen,
|
|
9396
9643
|
closeHandler = _ref.closeHandler,
|
|
9397
9644
|
onValueChange = _ref.onValueChange,
|
|
9398
|
-
|
|
9645
|
+
_submitHandler = _ref.submitHandler,
|
|
9399
9646
|
isError = _ref.isError,
|
|
9400
9647
|
name = _ref.name,
|
|
9401
9648
|
isDisabledSubmitBtn = _ref.isDisabledSubmitBtn,
|
|
9402
|
-
validation = _ref.validation
|
|
9649
|
+
validation = _ref.validation,
|
|
9650
|
+
rowData = _ref.rowData,
|
|
9651
|
+
tableName = _ref.tableName,
|
|
9652
|
+
config = _ref.config;
|
|
9403
9653
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9404
9654
|
return state.userPanel;
|
|
9405
9655
|
}),
|
|
9406
9656
|
dialogData = _useSelector.dialogData;
|
|
9657
|
+
var deptHeadDetails = function deptHeadDetails(data) {
|
|
9658
|
+
var _data$dept_head_detai;
|
|
9659
|
+
console.log(data);
|
|
9660
|
+
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) {
|
|
9661
|
+
setHead({
|
|
9662
|
+
value: data.dept_head_details[0].id,
|
|
9663
|
+
label: data.dept_head_details[0].first_name + ' ' + data.dept_head_details[0].last_name
|
|
9664
|
+
});
|
|
9665
|
+
}
|
|
9666
|
+
};
|
|
9667
|
+
var _useState = React.useState({
|
|
9668
|
+
value: '',
|
|
9669
|
+
label: 'Select'
|
|
9670
|
+
}),
|
|
9671
|
+
head = _useState[0],
|
|
9672
|
+
setHead = _useState[1];
|
|
9673
|
+
React.useEffect(function () {
|
|
9674
|
+
deptHeadDetails(rowData);
|
|
9675
|
+
}, [rowData]);
|
|
9676
|
+
var history = reactRouterDom.useHistory();
|
|
9677
|
+
var handleAddPageNavigation = function handleAddPageNavigation() {
|
|
9678
|
+
history.push(config.routes.users.add.path);
|
|
9679
|
+
};
|
|
9407
9680
|
return /*#__PURE__*/React__default.createElement(iuistyles.IUIModal, {
|
|
9408
9681
|
isDisabledSubmitBtn: isDisabledSubmitBtn,
|
|
9409
9682
|
isOpen: isOpen,
|
|
@@ -9411,25 +9684,59 @@ function EditPanelDialog(_ref) {
|
|
|
9411
9684
|
headerText: "Edit " + name.toLowerCase(),
|
|
9412
9685
|
cancelLabel: (_dialogData$labels = dialogData.labels) === null || _dialogData$labels === void 0 ? void 0 : _dialogData$labels.cancelLabel,
|
|
9413
9686
|
submitLabel: (_dialogData$labels2 = dialogData.labels) === null || _dialogData$labels2 === void 0 ? void 0 : _dialogData$labels2.submitLabel,
|
|
9414
|
-
submitHandler: submitHandler
|
|
9415
|
-
|
|
9687
|
+
submitHandler: function submitHandler() {
|
|
9688
|
+
return _submitHandler(head);
|
|
9689
|
+
},
|
|
9690
|
+
width: tableName === 'department' ? '400px' : '365px',
|
|
9416
9691
|
hideCloseIcon: false,
|
|
9417
9692
|
modalBodyStyle: {
|
|
9418
|
-
|
|
9419
|
-
overflow: 'auto',
|
|
9420
|
-
margin: '0px'
|
|
9693
|
+
overflowY: 'visible'
|
|
9421
9694
|
},
|
|
9422
9695
|
footerStyle: {
|
|
9423
9696
|
justifyContent: 'end'
|
|
9424
9697
|
}
|
|
9698
|
+
}, tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9699
|
+
display: "flex",
|
|
9700
|
+
justifyContent: "center",
|
|
9701
|
+
alignItems: "center",
|
|
9702
|
+
flexDirection: "column",
|
|
9703
|
+
style: {
|
|
9704
|
+
marginBottom: '30px'
|
|
9705
|
+
}
|
|
9425
9706
|
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9426
|
-
component: "div",
|
|
9427
9707
|
display: "flex",
|
|
9428
9708
|
justifyContent: "center",
|
|
9429
9709
|
alignItems: "center",
|
|
9430
9710
|
flexDirection: "column",
|
|
9431
|
-
|
|
9432
|
-
}, /*#__PURE__*/React__default.createElement(iuistyles.
|
|
9711
|
+
className: styles$7.baseAlert
|
|
9712
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9713
|
+
className: styles$7.alertDescContainer
|
|
9714
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9715
|
+
className: styles$7.iconLayout,
|
|
9716
|
+
style: {
|
|
9717
|
+
paddingTop: '4px'
|
|
9718
|
+
}
|
|
9719
|
+
}, /*#__PURE__*/React__default.createElement(BoldInfoIcon, {
|
|
9720
|
+
color: "#CA8A04",
|
|
9721
|
+
width: "25",
|
|
9722
|
+
height: "20",
|
|
9723
|
+
className: styles$7.iconStyle
|
|
9724
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUILabel, {
|
|
9725
|
+
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.",
|
|
9726
|
+
style: {
|
|
9727
|
+
fontWeight: 'normal'
|
|
9728
|
+
}
|
|
9729
|
+
})), /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
|
|
9730
|
+
buttonText: "Add user",
|
|
9731
|
+
type: "text",
|
|
9732
|
+
startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
|
|
9733
|
+
width: "9",
|
|
9734
|
+
height: "9",
|
|
9735
|
+
color: "#EC5D25"
|
|
9736
|
+
}),
|
|
9737
|
+
onClick: handleAddPageNavigation,
|
|
9738
|
+
className: styles$7.addUserButton
|
|
9739
|
+
}))), /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
9433
9740
|
label: name + " name",
|
|
9434
9741
|
name: "name",
|
|
9435
9742
|
defaultValue: dialogData.data.name,
|
|
@@ -9438,7 +9745,49 @@ function EditPanelDialog(_ref) {
|
|
|
9438
9745
|
isError: isError,
|
|
9439
9746
|
validation: validation,
|
|
9440
9747
|
errorMsg: "Please enter " + name.toLowerCase() + " name.",
|
|
9441
|
-
required: true
|
|
9748
|
+
required: true,
|
|
9749
|
+
style: tableName === 'department' && {
|
|
9750
|
+
width: '350px'
|
|
9751
|
+
}
|
|
9752
|
+
}), tableName === 'department' && rowData.no_of_users === 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9753
|
+
className: "iui__mt-15",
|
|
9754
|
+
style: {
|
|
9755
|
+
width: '100%'
|
|
9756
|
+
}
|
|
9757
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIInput, {
|
|
9758
|
+
label: "Department head",
|
|
9759
|
+
name: "name",
|
|
9760
|
+
defaultValue: head.label,
|
|
9761
|
+
placeholder: "",
|
|
9762
|
+
readOnly: true,
|
|
9763
|
+
style: {
|
|
9764
|
+
width: '350px'
|
|
9765
|
+
}
|
|
9766
|
+
})), tableName === 'department' && rowData.no_of_users > 0 && /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
|
|
9767
|
+
className: "iui__mt-15",
|
|
9768
|
+
style: {
|
|
9769
|
+
width: '100%'
|
|
9770
|
+
}
|
|
9771
|
+
}, /*#__PURE__*/React__default.createElement(iuistyles.IUIAsyncSelect, {
|
|
9772
|
+
noResultsText: true,
|
|
9773
|
+
isMove: true,
|
|
9774
|
+
additional: {
|
|
9775
|
+
page: 1,
|
|
9776
|
+
departmentId: rowData.id
|
|
9777
|
+
},
|
|
9778
|
+
placeHolderCheck: head !== undefined && head.value === '',
|
|
9779
|
+
label: "Department head",
|
|
9780
|
+
value: head,
|
|
9781
|
+
onValueChange: function onValueChange(_ref2) {
|
|
9782
|
+
var _value = _ref2._value;
|
|
9783
|
+
return setHead(_value);
|
|
9784
|
+
},
|
|
9785
|
+
loadOption: departmentHeadOptions,
|
|
9786
|
+
disableText: "Please get in touch with your administrator to change this value.",
|
|
9787
|
+
customLoadingText: "No users found in this department",
|
|
9788
|
+
customLoadingTextStyle: {
|
|
9789
|
+
color: '#374151'
|
|
9790
|
+
}
|
|
9442
9791
|
})));
|
|
9443
9792
|
}
|
|
9444
9793
|
|
|
@@ -9617,12 +9966,15 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9617
9966
|
var _useState13 = React.useState(false),
|
|
9618
9967
|
isSortingChangeTemp = _useState13[0],
|
|
9619
9968
|
setSortingChangeTemp = _useState13[1];
|
|
9620
|
-
var _useState14 = React.useState(
|
|
9621
|
-
|
|
9622
|
-
|
|
9623
|
-
var _useState15 = React.useState(
|
|
9624
|
-
|
|
9625
|
-
|
|
9969
|
+
var _useState14 = React.useState([]),
|
|
9970
|
+
rowData = _useState14[0],
|
|
9971
|
+
setRowData = _useState14[1];
|
|
9972
|
+
var _useState15 = React.useState(1),
|
|
9973
|
+
page = _useState15[0],
|
|
9974
|
+
setPage = _useState15[1];
|
|
9975
|
+
var _useState16 = React.useState(5),
|
|
9976
|
+
rowsPerPage = _useState16[0],
|
|
9977
|
+
setRowsPerPage = _useState16[1];
|
|
9626
9978
|
var orderingParam = orderBy;
|
|
9627
9979
|
var _useSelector = reactRedux.useSelector(function (state) {
|
|
9628
9980
|
return state.userPanel;
|
|
@@ -9718,6 +10070,7 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9718
10070
|
submitLabel: 'Save'
|
|
9719
10071
|
}, '', data));
|
|
9720
10072
|
setDataList(data.name);
|
|
10073
|
+
setRowData(data);
|
|
9721
10074
|
setEditModal(true);
|
|
9722
10075
|
};
|
|
9723
10076
|
var closeEditDialog = function closeEditDialog() {
|
|
@@ -9732,6 +10085,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9732
10085
|
var payload = {
|
|
9733
10086
|
names: [dataList]
|
|
9734
10087
|
};
|
|
10088
|
+
if (tableName === 'department') {
|
|
10089
|
+
payload = {
|
|
10090
|
+
name: dataList,
|
|
10091
|
+
department_head_id: null
|
|
10092
|
+
};
|
|
10093
|
+
}
|
|
9735
10094
|
var message = title + " added successfully.";
|
|
9736
10095
|
handleApiCall(addRecord, payload, message, 'add');
|
|
9737
10096
|
} else {
|
|
@@ -9745,9 +10104,12 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9745
10104
|
var message = title + " deleted successfully.";
|
|
9746
10105
|
handleApiCall(deleteRecord, payload, message, 'delete');
|
|
9747
10106
|
};
|
|
9748
|
-
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type) {
|
|
10107
|
+
var handleApiCall = function handleApiCall(dispatchFun, payload, message, type, optionalParams) {
|
|
10108
|
+
if (optionalParams === void 0) {
|
|
10109
|
+
optionalParams = null;
|
|
10110
|
+
}
|
|
9749
10111
|
dispatch(userPanelShowLoader());
|
|
9750
|
-
dispatch(dispatchFun(tableName, payload, getApiData())).then(function (res) {
|
|
10112
|
+
dispatch(dispatchFun(tableName, payload, getApiData(), optionalParams)).then(function (res) {
|
|
9751
10113
|
IUIToastMessageService$8.sNotify(type === 'move' ? res.data.message : "" + message);
|
|
9752
10114
|
dispatch(userPanelStopLoader());
|
|
9753
10115
|
if (type === 'delete') {
|
|
@@ -9789,8 +10151,14 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9789
10151
|
name: dataList
|
|
9790
10152
|
}]
|
|
9791
10153
|
};
|
|
10154
|
+
if (tableName === 'department') {
|
|
10155
|
+
payload = {
|
|
10156
|
+
name: dataList,
|
|
10157
|
+
department_head_id: data.value === '' || rowData.is_default_dept_head && rowData.dept_head === data.value ? null : data.value
|
|
10158
|
+
};
|
|
10159
|
+
}
|
|
9792
10160
|
var message = title + " updated successfully.";
|
|
9793
|
-
handleApiCall(editRecord, payload, message, 'edit');
|
|
10161
|
+
handleApiCall(editRecord, payload, message, 'edit', dialogData.data.id);
|
|
9794
10162
|
setErrorEdit(false);
|
|
9795
10163
|
} else {
|
|
9796
10164
|
setErrorEdit(true);
|
|
@@ -9897,7 +10265,10 @@ var UserPanel = function UserPanel(_ref) {
|
|
|
9897
10265
|
submitHandler: handleEditPanel,
|
|
9898
10266
|
isError: errorEdit,
|
|
9899
10267
|
isDisabledSubmitBtn: loading,
|
|
9900
|
-
validation: validation
|
|
10268
|
+
validation: validation,
|
|
10269
|
+
rowData: rowData,
|
|
10270
|
+
tableName: tableName,
|
|
10271
|
+
config: config
|
|
9901
10272
|
})) : /*#__PURE__*/React__default.createElement(VerificationError, {
|
|
9902
10273
|
config: config
|
|
9903
10274
|
}));
|