@itilite/iui-user-management 0.0.7 → 0.0.9
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 +5 -1
- package/dist/index.js +97 -71
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +98 -72
- package/dist/index.modern.js.map +1 -1
- package/package.json +3 -19
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, IUIAccordion, IUIAccordionSummary, IUIAccordionDetails, IUIIconButton, IUICard, IUIBackdrop, IUICircularProgress, IUIBreadCrumb, IUIDropzone, IUIStepper, IUIFormControlLabel, IUICheckBox, IUITable, IUISkeleton, IUIFormGroup, IUIDropdownButton } from '@itilite/iuistyles';
|
|
1
|
+
import { IUIAsyncSelect, IUIBox, IUILabel, IUIFileUpload, IUICheckboxButton, IUIPhone, IUISelect, IUIDatePicker, IUIInput, IUIDivider, IUIGrid, IUITypography, IUIRadio, IUIButton, IUIModal, IUIAccordion, IUIAccordionSummary, IUIAccordionDetails, IUIIconButton, IUICard, IUIBackdrop, IUICircularProgress, IUIBreadCrumb, IUIDropzone, IUIStepper, IUIFormControlLabel, IUICheckBox, IUIPrimaryRadio, IUITable, IUISkeleton, IUIFormGroup, IUIDropdownButton } from '@itilite/iuistyles';
|
|
2
2
|
import React, { useState, useEffect, Fragment as Fragment$1 } from 'react';
|
|
3
3
|
import { configs, services, utilUrls } from '@itilite/utils';
|
|
4
4
|
import moment from 'moment';
|
|
@@ -12,7 +12,6 @@ import { composeWithDevTools } from 'redux-devtools-extension';
|
|
|
12
12
|
import { useHistory } from 'react-router-dom';
|
|
13
13
|
import { withStyles } from '@material-ui/core/styles';
|
|
14
14
|
import Switch from '@material-ui/core/Switch';
|
|
15
|
-
import { TableContainer, Table, TableHead, TableRow, TableCell, TableBody } from '@material-ui/core';
|
|
16
15
|
|
|
17
16
|
function _extends() {
|
|
18
17
|
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
@@ -4425,7 +4424,7 @@ var AdditionalInfo = function AdditionalInfo(_ref) {
|
|
|
4425
4424
|
}))))));
|
|
4426
4425
|
};
|
|
4427
4426
|
|
|
4428
|
-
var styles$3 = {"root":"_b_muK","minWidth":"_3OQXs","bullet":"_1Q5vL","pos":"_6wGWA","cardHeader":"_SWCfJ","pageHeader":"_2ZeWp","buttonHover":"_2Iuy1","cardHeaderBackground":"_3NJWF"};
|
|
4427
|
+
var styles$3 = {"root":"_b_muK","minWidth":"_3OQXs","bullet":"_1Q5vL","pos":"_6wGWA","cardHeader":"_SWCfJ","pageHeader":"_2ZeWp","buttonHover":"_2Iuy1","cardHeaderBackground":"_3NJWF","actionCustom":"_3Kbfm"};
|
|
4429
4428
|
|
|
4430
4429
|
var VerificationError = function VerificationError(_ref) {
|
|
4431
4430
|
var config = _ref.config,
|
|
@@ -4448,8 +4447,8 @@ var VerificationError = function VerificationError(_ref) {
|
|
|
4448
4447
|
description: errMsg,
|
|
4449
4448
|
actionComponent: /*#__PURE__*/React.createElement(IUIButton, {
|
|
4450
4449
|
className: styles$3.buttonHover,
|
|
4451
|
-
buttonText: "
|
|
4452
|
-
|
|
4450
|
+
buttonText: "BACK TO HOMEPAGE",
|
|
4451
|
+
type: "outlined",
|
|
4453
4452
|
onClick: function onClick() {
|
|
4454
4453
|
return history.push(config.routes.fallbackUrl);
|
|
4455
4454
|
}
|
|
@@ -6827,8 +6826,8 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
6827
6826
|
};
|
|
6828
6827
|
|
|
6829
6828
|
var CustomStepIcon = function CustomStepIcon(step) {
|
|
6830
|
-
if ((importStatus === 1 || importStatus === 2 || importStatus === 4) && step
|
|
6831
|
-
return /*#__PURE__*/React.createElement(
|
|
6829
|
+
if ((importStatus === 1 || importStatus === 2 || importStatus === 4) && step === Number(activeStep)) {
|
|
6830
|
+
return /*#__PURE__*/React.createElement(IUIPrimaryRadio, {
|
|
6832
6831
|
checked: true,
|
|
6833
6832
|
className: clsx(styles$4.customRadioEach),
|
|
6834
6833
|
size: "small",
|
|
@@ -6836,16 +6835,16 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
6836
6835
|
});
|
|
6837
6836
|
}
|
|
6838
6837
|
|
|
6839
|
-
if ((importStatus === 1 || importStatus === 2 || importStatus === 4) && step
|
|
6840
|
-
return /*#__PURE__*/React.createElement(
|
|
6838
|
+
if ((importStatus === 1 || importStatus === 2 || importStatus === 4) && step !== Number(activeStep)) {
|
|
6839
|
+
return /*#__PURE__*/React.createElement(IUIPrimaryRadio, {
|
|
6841
6840
|
className: clsx(styles$4.customRadioEach),
|
|
6842
6841
|
size: "small",
|
|
6843
6842
|
disabled: true
|
|
6844
6843
|
});
|
|
6845
6844
|
}
|
|
6846
6845
|
|
|
6847
|
-
if (importStatus === 3 && step
|
|
6848
|
-
return /*#__PURE__*/React.createElement(
|
|
6846
|
+
if (importStatus === 3 && step === Number(activeStep)) {
|
|
6847
|
+
return /*#__PURE__*/React.createElement(IUIPrimaryRadio, {
|
|
6849
6848
|
checked: true,
|
|
6850
6849
|
className: clsx(styles$4.customRadioEach),
|
|
6851
6850
|
size: "small",
|
|
@@ -6853,7 +6852,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
6853
6852
|
});
|
|
6854
6853
|
}
|
|
6855
6854
|
|
|
6856
|
-
if (importStatus === 3 && step
|
|
6855
|
+
if (importStatus === 3 && step !== Number(activeStep)) {
|
|
6857
6856
|
return /*#__PURE__*/React.createElement(CheckCircleIcon, {
|
|
6858
6857
|
width: "20",
|
|
6859
6858
|
height: "20",
|
|
@@ -6958,7 +6957,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
6958
6957
|
activeStep: activeStep,
|
|
6959
6958
|
nonLinear: true,
|
|
6960
6959
|
className: styles$4.stepper,
|
|
6961
|
-
|
|
6960
|
+
CustomStepIcon: CustomStepIcon,
|
|
6962
6961
|
steps: steps
|
|
6963
6962
|
}), importStatus === 1 && /*#__PURE__*/React.createElement(IUIBox, {
|
|
6964
6963
|
display: "flex",
|
|
@@ -7138,7 +7137,7 @@ var UserBulkUpload = function UserBulkUpload(_ref) {
|
|
|
7138
7137
|
}, /*#__PURE__*/React.createElement(IUIFormControlLabel, {
|
|
7139
7138
|
control: /*#__PURE__*/React.createElement(IUICheckBox, {
|
|
7140
7139
|
handleCheckBoxHandler: handleExistingUserUpdation,
|
|
7141
|
-
|
|
7140
|
+
checked: canUpdateExistingUsers
|
|
7142
7141
|
}),
|
|
7143
7142
|
label: "Update any existing users",
|
|
7144
7143
|
className: clsx(styles$4.checkboxlabel, (_clsx5 = {}, _clsx5[styles$4.disabledText] = +userBulkImportInfo.exist_users === 0, _clsx5)),
|
|
@@ -7476,31 +7475,35 @@ var BulkActionHistoryTable = function BulkActionHistoryTable(props) {
|
|
|
7476
7475
|
|
|
7477
7476
|
var styles$6 = {"UUICustomFields":"_tdVCY","pageHeader":"_8iQvL","buttonWrapper":"_2k_GJ","headingWrapper":"_1rYVz","heading":"_2nxXO","headingLarge":"_2auvl","headingMedium":"_Wjaw1","headingSmall":"_1UmTe","description":"_2BS2i","headerText":"_3SZ_X","letterImage":"_2AwAF","tablewrapper":"_3qSxj","rowText":"_2ZSw6","textTransform":"_1F6ss","lightColor":"_2Wjom","importModalBodyContainer":"_2JCWP","dividerColor":"_3EsJG","downloadTemplateContainer":"_2uRic","downloadTemplateDescContainer":"_55kg5","labelContainer":"_78mCn","downlTempHeader":"_lqUA2","downlTempDescription":"_1vT5l","colGap":"_1x_9W","tableHead":"_5SygC","actionButtons":"_3PeqN","emptyData":"_1bHs-"};
|
|
7478
7477
|
|
|
7479
|
-
function SkeletonLoader() {
|
|
7480
|
-
|
|
7481
|
-
|
|
7478
|
+
function SkeletonLoader(_ref) {
|
|
7479
|
+
var _ref$data = _ref.data,
|
|
7480
|
+
data = _ref$data === void 0 ? [{
|
|
7481
|
+
variant: 'rect',
|
|
7482
|
+
height: 100,
|
|
7482
7483
|
style: {
|
|
7483
|
-
|
|
7484
|
+
top: 20,
|
|
7485
|
+
bottom: 20
|
|
7484
7486
|
}
|
|
7485
|
-
},
|
|
7486
|
-
variant:
|
|
7487
|
-
height: 120,
|
|
7488
|
-
style: {
|
|
7489
|
-
marginTop: 40,
|
|
7490
|
-
marginBottom: 20
|
|
7491
|
-
}
|
|
7492
|
-
}), /*#__PURE__*/React.createElement(IUISkeleton, {
|
|
7493
|
-
variant: "rect",
|
|
7487
|
+
}, {
|
|
7488
|
+
variant: 'rect',
|
|
7494
7489
|
height: 50,
|
|
7495
7490
|
style: {
|
|
7496
|
-
|
|
7491
|
+
bottom: 20
|
|
7497
7492
|
}
|
|
7498
|
-
}
|
|
7499
|
-
variant:
|
|
7493
|
+
}, {
|
|
7494
|
+
variant: 'rect',
|
|
7500
7495
|
height: 500,
|
|
7501
7496
|
style: {
|
|
7502
|
-
|
|
7497
|
+
bottom: 20
|
|
7503
7498
|
}
|
|
7499
|
+
}] : _ref$data;
|
|
7500
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
7501
|
+
className: styles$6.tablewrapper,
|
|
7502
|
+
style: {
|
|
7503
|
+
margin: 20
|
|
7504
|
+
}
|
|
7505
|
+
}, /*#__PURE__*/React.createElement(IUISkeleton, {
|
|
7506
|
+
data: data
|
|
7504
7507
|
}));
|
|
7505
7508
|
}
|
|
7506
7509
|
|
|
@@ -9274,7 +9277,7 @@ var PageHeader = function PageHeader() {
|
|
|
9274
9277
|
}));
|
|
9275
9278
|
};
|
|
9276
9279
|
|
|
9277
|
-
function
|
|
9280
|
+
function Table() {
|
|
9278
9281
|
var _useSelector = useSelector(function (state) {
|
|
9279
9282
|
return state.customFields;
|
|
9280
9283
|
}),
|
|
@@ -9287,41 +9290,51 @@ function CustomFieldsTable() {
|
|
|
9287
9290
|
dispatch(toggleModal(true));
|
|
9288
9291
|
};
|
|
9289
9292
|
|
|
9293
|
+
var columns = [{
|
|
9294
|
+
id: 'sno',
|
|
9295
|
+
label: '#',
|
|
9296
|
+
sortable: false,
|
|
9297
|
+
cell: function cell(row, i) {
|
|
9298
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9299
|
+
component: "div"
|
|
9300
|
+
}, /*#__PURE__*/React.createElement(IUITypography, null, i + 1));
|
|
9301
|
+
}
|
|
9302
|
+
}, {
|
|
9303
|
+
id: 'name',
|
|
9304
|
+
label: 'Name',
|
|
9305
|
+
sortable: false,
|
|
9306
|
+
cell: function cell(row) {
|
|
9307
|
+
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9308
|
+
component: "div"
|
|
9309
|
+
}, /*#__PURE__*/React.createElement(IUITypography, null, row.field_name));
|
|
9310
|
+
}
|
|
9311
|
+
}, {
|
|
9312
|
+
id: 'actions',
|
|
9313
|
+
label: 'Actions',
|
|
9314
|
+
align: 'left',
|
|
9315
|
+
cell: function cell(row) {
|
|
9316
|
+
return /*#__PURE__*/React.createElement(IUIButton, {
|
|
9317
|
+
buttonText: "Edit",
|
|
9318
|
+
onClick: function onClick() {
|
|
9319
|
+
return handleEdit(row);
|
|
9320
|
+
}
|
|
9321
|
+
});
|
|
9322
|
+
},
|
|
9323
|
+
style: {
|
|
9324
|
+
paddingLeft: '40px'
|
|
9325
|
+
}
|
|
9326
|
+
}];
|
|
9290
9327
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9291
9328
|
className: styles$6.tablewrapper
|
|
9292
|
-
}, /*#__PURE__*/React.createElement(
|
|
9293
|
-
|
|
9294
|
-
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
width: "40%"
|
|
9302
|
-
}, "#"), /*#__PURE__*/React.createElement(TableCell, {
|
|
9303
|
-
width: "40%"
|
|
9304
|
-
}, "Name"), /*#__PURE__*/React.createElement(TableCell, {
|
|
9305
|
-
width: "20%",
|
|
9306
|
-
style: {
|
|
9307
|
-
paddingLeft: '3%'
|
|
9308
|
-
}
|
|
9309
|
-
}, "Action"))), /*#__PURE__*/React.createElement(TableBody, null, data.length === 0 ? /*#__PURE__*/React.createElement(TableRow, null, /*#__PURE__*/React.createElement(TableCell, null), /*#__PURE__*/React.createElement(TableCell, null, /*#__PURE__*/React.createElement(IUIBox, {
|
|
9310
|
-
className: styles$6.emptyData
|
|
9311
|
-
}, "No data available")), /*#__PURE__*/React.createElement(TableCell, null)) : data.map(function (row, i) {
|
|
9312
|
-
return /*#__PURE__*/React.createElement(TableRow, {
|
|
9313
|
-
key: row.id.toString()
|
|
9314
|
-
}, /*#__PURE__*/React.createElement(TableCell, {
|
|
9315
|
-
align: "left"
|
|
9316
|
-
}, i + 1), /*#__PURE__*/React.createElement(TableCell, null, row.field_name), /*#__PURE__*/React.createElement(TableCell, {
|
|
9317
|
-
className: styles$6.actionButtons
|
|
9318
|
-
}, /*#__PURE__*/React.createElement(IUIButton, {
|
|
9319
|
-
buttonText: "Edit",
|
|
9320
|
-
onClick: function onClick() {
|
|
9321
|
-
return handleEdit(row);
|
|
9322
|
-
}
|
|
9323
|
-
})));
|
|
9324
|
-
})))));
|
|
9329
|
+
}, /*#__PURE__*/React.createElement(IUITable, {
|
|
9330
|
+
hasFilter: false,
|
|
9331
|
+
isCheckboxTable: false,
|
|
9332
|
+
columns: columns,
|
|
9333
|
+
rows: data,
|
|
9334
|
+
count: data.length,
|
|
9335
|
+
searchHide: true,
|
|
9336
|
+
hidePagination: true
|
|
9337
|
+
}));
|
|
9325
9338
|
}
|
|
9326
9339
|
|
|
9327
9340
|
var env$9 = configs.env;
|
|
@@ -9337,27 +9350,40 @@ var CustomFields$1 = function CustomFields(_ref) {
|
|
|
9337
9350
|
}),
|
|
9338
9351
|
isTokenVerified = _useSelector.isTokenVerified;
|
|
9339
9352
|
|
|
9340
|
-
var
|
|
9341
|
-
|
|
9342
|
-
|
|
9343
|
-
loading = _useSelector2.loading;
|
|
9353
|
+
var _useState = useState(true),
|
|
9354
|
+
loading = _useState[0],
|
|
9355
|
+
setLoading = _useState[1];
|
|
9344
9356
|
|
|
9345
9357
|
useEffect(function () {
|
|
9346
|
-
|
|
9358
|
+
setLoading(true);
|
|
9347
9359
|
var roleCanAccess = ['travel_itilite_admin', 'travel_admin', 'expense_itilite_admin', 'expense_admin'];
|
|
9348
9360
|
dispatch(verifyAccessToken(roleCanAccess));
|
|
9349
9361
|
}, []);
|
|
9350
9362
|
useEffect(function () {
|
|
9351
9363
|
if (isTokenVerified) {
|
|
9352
9364
|
dispatch(fetchCustomFields())["finally"](function () {
|
|
9353
|
-
|
|
9365
|
+
setLoading(false);
|
|
9354
9366
|
});
|
|
9355
9367
|
}
|
|
9356
9368
|
}, [isTokenVerified]);
|
|
9357
9369
|
return /*#__PURE__*/React.createElement(IUIBox, {
|
|
9358
9370
|
component: "div",
|
|
9359
9371
|
className: styles$6.UUICustomFields
|
|
9360
|
-
}, /*#__PURE__*/React.createElement(PageHeader, null), loading ? /*#__PURE__*/React.createElement(SkeletonLoader,
|
|
9372
|
+
}, /*#__PURE__*/React.createElement(PageHeader, null), loading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
|
|
9373
|
+
data: [{
|
|
9374
|
+
variant: 'rect',
|
|
9375
|
+
height: 50,
|
|
9376
|
+
style: {
|
|
9377
|
+
bottom: 20
|
|
9378
|
+
}
|
|
9379
|
+
}, {
|
|
9380
|
+
variant: 'rect',
|
|
9381
|
+
height: 500,
|
|
9382
|
+
style: {
|
|
9383
|
+
bottom: 20
|
|
9384
|
+
}
|
|
9385
|
+
}]
|
|
9386
|
+
}) : /*#__PURE__*/React.createElement(Table, null));
|
|
9361
9387
|
};
|
|
9362
9388
|
|
|
9363
9389
|
var index$4 = withStore(CustomFields$1);
|