@itilite/iui-user-management 0.0.8 → 0.0.10

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.
@@ -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: "Back to Homepage",
4452
- size: "small",
4450
+ buttonText: "BACK TO HOMEPAGE",
4451
+ type: "outlined",
4453
4452
  onClick: function onClick() {
4454
4453
  return history.push(config.routes.fallbackUrl);
4455
4454
  }
@@ -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
- return /*#__PURE__*/React.createElement(IUIBox, {
7481
- className: styles$6.tablewrapper,
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
- margin: 20
7484
+ top: 20,
7485
+ bottom: 20
7484
7486
  }
7485
- }, /*#__PURE__*/React.createElement(IUISkeleton, {
7486
- variant: "rect",
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
- marginBottom: 20
7491
+ bottom: 20
7497
7492
  }
7498
- }), /*#__PURE__*/React.createElement(IUISkeleton, {
7499
- variant: "rect",
7493
+ }, {
7494
+ variant: 'rect',
7500
7495
  height: 500,
7501
7496
  style: {
7502
- marginBottom: 20
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
 
@@ -7810,7 +7813,8 @@ var StickyHeadTable = function StickyHeadTable(props) {
7810
7813
  _props$isDataFetching = props.isDataFetching,
7811
7814
  isDataFetching = _props$isDataFetching === void 0 ? false : _props$isDataFetching,
7812
7815
  _props$disableRowChec = props.disableRowCheckbox,
7813
- disableRowCheckbox = _props$disableRowChec === void 0 ? false : _props$disableRowChec;
7816
+ disableRowCheckbox = _props$disableRowChec === void 0 ? false : _props$disableRowChec,
7817
+ searchValue = props.searchValue;
7814
7818
 
7815
7819
  var getFirstLetterofName = function getFirstLetterofName(firstName, lastName) {
7816
7820
  return firstName.charAt(0).toUpperCase() + lastName.charAt(0).toUpperCase();
@@ -7956,7 +7960,8 @@ var StickyHeadTable = function StickyHeadTable(props) {
7956
7960
  onSearchHandler: onSearchHandler,
7957
7961
  isDataFetching: isDataFetching,
7958
7962
  disableRowCheckbox: disableRowCheckbox,
7959
- searchBoxWidth: "400px"
7963
+ searchBoxWidth: "400px",
7964
+ searchValue: searchValue
7960
7965
  });
7961
7966
  };
7962
7967
 
@@ -8114,8 +8119,6 @@ var UserList = function UserList(_ref) {
8114
8119
  var handleSingleCheckBoxClick = function handleSingleCheckBoxClick(event, id, page) {
8115
8120
  var _extends4;
8116
8121
 
8117
- console.log('test');
8118
-
8119
8122
  var selectedTemp = _extends({}, selected);
8120
8123
 
8121
8124
  if (!(page in selectedTemp)) {
@@ -8364,7 +8367,8 @@ var UserList = function UserList(_ref) {
8364
8367
  onRequestSort: onRequestSort,
8365
8368
  onSearchHandler: onSearchHandler,
8366
8369
  onEditHandler: handleEditUserClick,
8367
- disableRowCheckbox: deactivatedUsers
8370
+ disableRowCheckbox: deactivatedUsers,
8371
+ searchValue: searchValue
8368
8372
  }))), /*#__PURE__*/React.createElement(IUIModal, {
8369
8373
  isOpen: Object.values(selected).flat().length > 0 && isOpenDeActivateModal,
8370
8374
  closeHandler: closeDeActivateModal,
@@ -9274,7 +9278,7 @@ var PageHeader = function PageHeader() {
9274
9278
  }));
9275
9279
  };
9276
9280
 
9277
- function CustomFieldsTable() {
9281
+ function Table() {
9278
9282
  var _useSelector = useSelector(function (state) {
9279
9283
  return state.customFields;
9280
9284
  }),
@@ -9287,41 +9291,51 @@ function CustomFieldsTable() {
9287
9291
  dispatch(toggleModal(true));
9288
9292
  };
9289
9293
 
9294
+ var columns = [{
9295
+ id: 'sno',
9296
+ label: '#',
9297
+ sortable: false,
9298
+ cell: function cell(row, i) {
9299
+ return /*#__PURE__*/React.createElement(IUIBox, {
9300
+ component: "div"
9301
+ }, /*#__PURE__*/React.createElement(IUITypography, null, i + 1));
9302
+ }
9303
+ }, {
9304
+ id: 'name',
9305
+ label: 'Name',
9306
+ sortable: false,
9307
+ cell: function cell(row) {
9308
+ return /*#__PURE__*/React.createElement(IUIBox, {
9309
+ component: "div"
9310
+ }, /*#__PURE__*/React.createElement(IUITypography, null, row.field_name));
9311
+ }
9312
+ }, {
9313
+ id: 'actions',
9314
+ label: 'Actions',
9315
+ align: 'left',
9316
+ cell: function cell(row) {
9317
+ return /*#__PURE__*/React.createElement(IUIButton, {
9318
+ buttonText: "Edit",
9319
+ onClick: function onClick() {
9320
+ return handleEdit(row);
9321
+ }
9322
+ });
9323
+ },
9324
+ style: {
9325
+ paddingLeft: '40px'
9326
+ }
9327
+ }];
9290
9328
  return /*#__PURE__*/React.createElement(IUIBox, {
9291
9329
  className: styles$6.tablewrapper
9292
- }, /*#__PURE__*/React.createElement(TableContainer, null, /*#__PURE__*/React.createElement(Table, {
9293
- "aria-label": "simple table",
9294
- style: {
9295
- height: 'auto !important'
9296
- }
9297
- }, /*#__PURE__*/React.createElement(TableHead, {
9298
- className: styles$6.tableHead
9299
- }, /*#__PURE__*/React.createElement(TableRow, null, /*#__PURE__*/React.createElement(TableCell, {
9300
- align: "left",
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
- })))));
9330
+ }, /*#__PURE__*/React.createElement(IUITable, {
9331
+ hasFilter: false,
9332
+ isCheckboxTable: false,
9333
+ columns: columns,
9334
+ rows: data,
9335
+ count: data.length,
9336
+ searchHide: true,
9337
+ hidePagination: true
9338
+ }));
9325
9339
  }
9326
9340
 
9327
9341
  var env$9 = configs.env;
@@ -9337,27 +9351,40 @@ var CustomFields$1 = function CustomFields(_ref) {
9337
9351
  }),
9338
9352
  isTokenVerified = _useSelector.isTokenVerified;
9339
9353
 
9340
- var _useSelector2 = useSelector(function (state) {
9341
- return state.customFields;
9342
- }),
9343
- loading = _useSelector2.loading;
9354
+ var _useState = useState(true),
9355
+ loading = _useState[0],
9356
+ setLoading = _useState[1];
9344
9357
 
9345
9358
  useEffect(function () {
9346
- dispatch(showLoader$1());
9359
+ setLoading(true);
9347
9360
  var roleCanAccess = ['travel_itilite_admin', 'travel_admin', 'expense_itilite_admin', 'expense_admin'];
9348
9361
  dispatch(verifyAccessToken(roleCanAccess));
9349
9362
  }, []);
9350
9363
  useEffect(function () {
9351
9364
  if (isTokenVerified) {
9352
9365
  dispatch(fetchCustomFields())["finally"](function () {
9353
- dispatch(stopLoader$1());
9366
+ setLoading(false);
9354
9367
  });
9355
9368
  }
9356
9369
  }, [isTokenVerified]);
9357
9370
  return /*#__PURE__*/React.createElement(IUIBox, {
9358
9371
  component: "div",
9359
9372
  className: styles$6.UUICustomFields
9360
- }, /*#__PURE__*/React.createElement(PageHeader, null), loading ? /*#__PURE__*/React.createElement(SkeletonLoader, null) : /*#__PURE__*/React.createElement(CustomFieldsTable, null));
9373
+ }, /*#__PURE__*/React.createElement(PageHeader, null), loading ? /*#__PURE__*/React.createElement(SkeletonLoader, {
9374
+ data: [{
9375
+ variant: 'rect',
9376
+ height: 50,
9377
+ style: {
9378
+ bottom: 20
9379
+ }
9380
+ }, {
9381
+ variant: 'rect',
9382
+ height: 500,
9383
+ style: {
9384
+ bottom: 20
9385
+ }
9386
+ }]
9387
+ }) : /*#__PURE__*/React.createElement(Table, null));
9361
9388
  };
9362
9389
 
9363
9390
  var index$4 = withStore(CustomFields$1);