@itilite/iui-user-management 1.1.0 → 1.2.1

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 CHANGED
@@ -684,6 +684,18 @@
684
684
  ._3WNHx {
685
685
  background-color: #ffffff;
686
686
  }
687
+ ._3WNHx ._2_WEg {
688
+ position: sticky;
689
+ background: white;
690
+ z-index: 3;
691
+ right: 0;
692
+ left: 0;
693
+ top: 60px;
694
+ box-shadow: 14px 14px 32px 1px #f9f9f9;
695
+ }
696
+ ._3WNHx ._2_WEg ._1Pbhb {
697
+ width: 400px;
698
+ }
687
699
  ._3WNHx ._1WLpc {
688
700
  padding: 24px 40px;
689
701
  }
@@ -765,7 +777,7 @@
765
777
  ._3WNHx ._1-RPw ._151u_ {
766
778
  width: 55px;
767
779
  height: 24px;
768
- background: #F9FAFB;
780
+ background: #f9fafb;
769
781
  border-radius: 8px;
770
782
  display: flex;
771
783
  justify-content: center;
@@ -777,7 +789,7 @@
777
789
  }
778
790
 
779
791
  ._-LQNH {
780
- background: #1F2937;
792
+ background: #1f2937;
781
793
  font-size: 14px;
782
794
  color: #ffffff;
783
795
  padding: 12px 16px;
@@ -848,7 +860,7 @@
848
860
 
849
861
  ._1ky1x {
850
862
  z-index: 9999 !important;
851
- color: #EB5C24 !important;
863
+ color: #eb5c24 !important;
852
864
  background-color: rgba(0, 0, 0, 0.2) !important;
853
865
  }
854
866
 
@@ -869,15 +881,15 @@
869
881
  font-size: 12px !important;
870
882
  text-align: center;
871
883
  letter-spacing: 0.01em !important;
872
- color: #6B7280 !important;
884
+ color: #6b7280 !important;
873
885
  }
874
886
  ._xWE7K *[aria-selected=true] ._13pXn {
875
- background: #FFF1E1 !important;
887
+ background: #fff1e1 !important;
876
888
  color: #893404 !important;
877
889
  }
878
890
  ._xWE7K *[aria-selected=false] ._13pXn {
879
- color: #6B7280;
880
- background: #F9FAFB;
891
+ color: #6b7280;
892
+ background: #f9fafb;
881
893
  }
882
894
  ._tdVCY {
883
895
  background-color: #ffffff;
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) {
@@ -449,10 +450,10 @@ var userPanelUrl = {
449
450
  return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?action=delete&table=" + tableName;
450
451
  },
451
452
  getUnit: function getUnit(tableName, length, sort) {
452
- return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&order=" + sort;
453
+ return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&ordering=" + sort;
453
454
  },
454
455
  getPaginationUnit: function getPaginationUnit(tableName, length, page, sort) {
455
- return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&page=" + page + "&order=" + sort;
456
+ return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/table?table_name=" + tableName + "&length=" + length + "&page=" + page + "&ordering=" + sort;
456
457
  },
457
458
  moveUnit: function moveUnit() {
458
459
  return "api/v1/user-management/company/" + IUILocalStorageService.getCompanyId() + "/transfer-users";
@@ -6741,7 +6742,7 @@ var fetchBulkactionHistory = function fetchBulkactionHistory(url) {
6741
6742
  };
6742
6743
  };
6743
6744
 
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"};
6745
+ 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"};
6745
6746
 
6746
6747
  var BulkUploadModal = function BulkUploadModal(props) {
6747
6748
  var isOpenImportUsersModal = props.isOpenImportUsersModal,
@@ -8223,6 +8224,7 @@ var StickyHeadTable = function StickyHeadTable(props) {
8223
8224
  id: 'first_name',
8224
8225
  label: '',
8225
8226
  minWidth: 60,
8227
+ sortable: false,
8226
8228
  cell: function cell(row) {
8227
8229
  return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
8228
8230
  component: "div",
@@ -8393,7 +8395,8 @@ var StickyHeadTable = function StickyHeadTable(props) {
8393
8395
  isDataFetching: isDataFetching,
8394
8396
  disableRowCheckbox: disableRowCheckbox,
8395
8397
  searchBoxWidth: "400px",
8396
- searchValue: searchValue
8398
+ searchValue: searchValue,
8399
+ hideTopPagination: false
8397
8400
  });
8398
8401
  };
8399
8402
  var SingupRequests = function SingupRequests(props) {
@@ -8566,7 +8569,7 @@ var UserList = function UserList(_ref2) {
8566
8569
  var _React$useState = React__default.useState(1),
8567
8570
  page = _React$useState[0],
8568
8571
  setPage = _React$useState[1];
8569
- var _useState = React.useState(5),
8572
+ var _useState = React.useState(10),
8570
8573
  rowsPerPage = _useState[0],
8571
8574
  setRowsPerPage = _useState[1];
8572
8575
  var _React$useState2 = React__default.useState({}),
@@ -8618,18 +8621,41 @@ var UserList = function UserList(_ref2) {
8618
8621
  var _useState12 = React.useState(''),
8619
8622
  userIds = _useState12[0],
8620
8623
  setUserIds = _useState12[1];
8621
- var _React$useState5 = React__default.useState(1),
8622
- signup_page = _React$useState5[0],
8623
- setSignUpPage = _React$useState5[1];
8624
+ var _React$useState5 = React__default.useState(false),
8625
+ overlayMenu = _React$useState5[0],
8626
+ setOverlayMenu = _React$useState5[1];
8627
+ useScrollPosition.useScrollPosition(function (_ref3) {
8628
+ var prevPos = _ref3.prevPos,
8629
+ currPos = _ref3.currPos;
8630
+ if (prevPos.y - currPos.y > 0) {
8631
+ if (currPos.y <= -275) {
8632
+ setOverlayMenu(true);
8633
+ }
8634
+ } else {
8635
+ if (currPos.y > -295) {
8636
+ setOverlayMenu(false);
8637
+ }
8638
+ }
8639
+ }, [overlayMenu]);
8640
+ var scrollTo = function scrollTo(id) {
8641
+ var el = document.getElementById(id);
8642
+ window.scrollTo({
8643
+ top: el.offsetTop,
8644
+ behavior: 'smooth'
8645
+ });
8646
+ };
8647
+ var _React$useState6 = React__default.useState(1),
8648
+ signup_page = _React$useState6[0],
8649
+ setSignUpPage = _React$useState6[1];
8624
8650
  var _useState13 = React.useState(5),
8625
8651
  signup_rowsPerPage = _useState13[0],
8626
8652
  setSignUpRowsPerPage = _useState13[1];
8627
- var _React$useState6 = React__default.useState('asc'),
8628
- signup_order = _React$useState6[0],
8629
- setSignUpOrder = _React$useState6[1];
8630
- var _React$useState7 = React__default.useState('fname'),
8631
- signup_orderBy = _React$useState7[0],
8632
- setSignUpOrderBy = _React$useState7[1];
8653
+ var _React$useState7 = React__default.useState('asc'),
8654
+ signup_order = _React$useState7[0],
8655
+ setSignUpOrder = _React$useState7[1];
8656
+ var _React$useState8 = React__default.useState('fname'),
8657
+ signup_orderBy = _React$useState8[0],
8658
+ setSignUpOrderBy = _React$useState8[1];
8633
8659
  var _useState14 = React.useState(''),
8634
8660
  signup_searchValue = _useState14[0],
8635
8661
  set_signup_SearchValue = _useState14[1];
@@ -8686,7 +8712,8 @@ var UserList = function UserList(_ref2) {
8686
8712
  ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
8687
8713
  length: signup_rowsPerPage,
8688
8714
  page: signup_page,
8689
- search: signup_searchValue.trim()
8715
+ search: signup_searchValue.trim(),
8716
+ pagename: 'company'
8690
8717
  })).then(function () {
8691
8718
  return dispatch(stopDataFetchingStatus());
8692
8719
  });
@@ -8888,6 +8915,7 @@ var UserList = function UserList(_ref2) {
8888
8915
  dispatch(fetchUsersList(url)).then(function () {
8889
8916
  setSearchingChange(false);
8890
8917
  setisApiFetching(false);
8918
+ scrollTo('table-root');
8891
8919
  });
8892
8920
  }, 1000);
8893
8921
  return function () {
@@ -8901,7 +8929,8 @@ var UserList = function UserList(_ref2) {
8901
8929
  ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
8902
8930
  length: signup_rowsPerPage,
8903
8931
  page: signup_page,
8904
- search: signup_searchValue.trim()
8932
+ search: signup_searchValue.trim(),
8933
+ pagename: 'company'
8905
8934
  })).then(function () {
8906
8935
  setSignUpSearchingChange(false);
8907
8936
  setisApiFetching(false);
@@ -8913,6 +8942,7 @@ var UserList = function UserList(_ref2) {
8913
8942
  }
8914
8943
  if (isSortingChange) {
8915
8944
  setisApiFetching(true);
8945
+ scrollTo('table-root');
8916
8946
  dispatch(fetchUsersList(url)).then(function () {
8917
8947
  setisApiFetching(false);
8918
8948
  setSortingChange(false);
@@ -8927,7 +8957,8 @@ var UserList = function UserList(_ref2) {
8927
8957
  ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
8928
8958
  length: signup_rowsPerPage,
8929
8959
  page: signup_page,
8930
- search: signup_searchValue.trim()
8960
+ search: signup_searchValue.trim(),
8961
+ pagename: 'company'
8931
8962
  })).then(function () {
8932
8963
  setisApiFetching(false);
8933
8964
  setSignUpSortingChange(false);
@@ -8943,7 +8974,8 @@ var UserList = function UserList(_ref2) {
8943
8974
  ordering: signup_order === 'asc' ? signup_orderBy : "-" + signup_orderBy,
8944
8975
  length: signup_rowsPerPage,
8945
8976
  page: signup_page,
8946
- search: signup_searchValue.trim()
8977
+ search: signup_searchValue.trim(),
8978
+ pagename: 'company'
8947
8979
  })).then(function () {
8948
8980
  return dispatch(stopDataFetchingStatus());
8949
8981
  });
@@ -8951,15 +8983,89 @@ var UserList = function UserList(_ref2) {
8951
8983
  }
8952
8984
  }
8953
8985
  }, [isTokenVerified, isSearchingChangeTemp, isSortingChangeTemp, isSignUpSearchingChangeTemp, isSignUpSortingChangeTemp]);
8986
+ var topRightButtons = function topRightButtons() {
8987
+ return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
8988
+ component: "div",
8989
+ className: styles$5.buttonWrapper,
8990
+ display: "flex",
8991
+ justifyContent: "space-between",
8992
+ alignItems: "center",
8993
+ alignSelf: "flex-start"
8994
+ }, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
8995
+ component: "div",
8996
+ className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
8997
+ }, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
8998
+ buttonText: "Export all users",
8999
+ type: "outlined",
9000
+ startIcon: /*#__PURE__*/React__default.createElement(BulkDownloadIcon, {
9001
+ width: "22",
9002
+ height: "22"
9003
+ }),
9004
+ onClick: handleExportUsers
9005
+ })), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
9006
+ component: "div",
9007
+ className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
9008
+ }, /*#__PURE__*/React__default.createElement(iuistyles.IUIDropdownButton, {
9009
+ buttonText: "Bulk actions",
9010
+ type: "outlined",
9011
+ menuListInfo: BulkUploadInfo
9012
+ })), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
9013
+ component: "div",
9014
+ className: "pageHeader--button-single button-right"
9015
+ }, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
9016
+ buttonText: "Add user",
9017
+ type: "contained",
9018
+ startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
9019
+ width: "9",
9020
+ height: "9",
9021
+ color: "white"
9022
+ }),
9023
+ onClick: handleAddPageNavigation
9024
+ })));
9025
+ };
8954
9026
  return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
8955
9027
  component: "div",
8956
9028
  className: styles$5.UUIUserManagementList
8957
- }, !hasVerificationError ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBackdrop, {
9029
+ }, overlayMenu ? /*#__PURE__*/React__default.createElement(core.Box, {
9030
+ className: styles$5.scrollOverlayMenu
9031
+ }, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
9032
+ component: "div",
9033
+ className: clsx(styles$5.pageHeader)
9034
+ }, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
9035
+ component: "div",
9036
+ display: "flex",
9037
+ justifyContent: "space-between",
9038
+ alignItems: "center",
9039
+ flexWrap: "wrap",
9040
+ style: {
9041
+ gap: '1rem'
9042
+ }
9043
+ }, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
9044
+ component: "div",
9045
+ display: "flex",
9046
+ flexDirection: "column",
9047
+ style: {
9048
+ gap: '0.5rem'
9049
+ }
9050
+ }, /*#__PURE__*/React__default.createElement(iuistyles.IUISearch, {
9051
+ placeholder: "Search by name, email & department",
9052
+ value: searchValue,
9053
+ onChangeHandler: function onChangeHandler(e) {
9054
+ return onSearchHandler(e.target.value);
9055
+ },
9056
+ className: styles$5.overlaysearch
9057
+ })), topRightButtons()), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
9058
+ component: "div",
9059
+ display: "flex",
9060
+ justifyContent: "space-between",
9061
+ alignItems: "center"
9062
+ }))) : '', !hasVerificationError ? /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBackdrop, {
8958
9063
  open: isFileDownloading || isApiFetching,
8959
9064
  className: styles$5.backdrop
8960
9065
  }, /*#__PURE__*/React__default.createElement(iuistyles.IUICircularProgress, {
8961
9066
  color: "inherit"
8962
9067
  })), isDataFetching ? /*#__PURE__*/React__default.createElement(SkeletonLoader, null) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
9068
+ id: "table-root",
8963
9069
  component: "div",
8964
9070
  className: clsx(styles$5.pageHeader)
8965
9071
  }, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
@@ -8984,44 +9090,7 @@ var UserList = function UserList(_ref2) {
8984
9090
  }, /*#__PURE__*/React__default.createElement(iuistyles.IUITypography, {
8985
9091
  variant: "h3",
8986
9092
  className: clsx(styles$5.heading, styles$5.headingLarge)
8987
- }, isILadmin && companyName ? companyName + " - Users" : 'Users'))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
8988
- component: "div",
8989
- className: styles$5.buttonWrapper,
8990
- display: "flex",
8991
- justifyContent: "space-between",
8992
- alignItems: "center",
8993
- alignSelf: "flex-start"
8994
- }, /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
8995
- component: "div",
8996
- className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
8997
- }, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
8998
- buttonText: "Export all users",
8999
- type: "outlined",
9000
- startIcon: /*#__PURE__*/React__default.createElement(BulkDownloadIcon, {
9001
- width: "22",
9002
- height: "22"
9003
- }),
9004
- onClick: handleExportUsers
9005
- })), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
9006
- component: "div",
9007
- className: clsx(styles$5.buttonSingle, styles$5.buttonLeft)
9008
- }, /*#__PURE__*/React__default.createElement(iuistyles.IUIDropdownButton, {
9009
- buttonText: "Bulk actions",
9010
- type: "outlined",
9011
- menuListInfo: BulkUploadInfo
9012
- })), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
9013
- component: "div",
9014
- className: "pageHeader--button-single button-right"
9015
- }, /*#__PURE__*/React__default.createElement(iuistyles.IUIButton, {
9016
- buttonText: "Add user",
9017
- type: "contained",
9018
- startIcon: /*#__PURE__*/React__default.createElement(AddIcon, {
9019
- width: "9",
9020
- height: "9",
9021
- color: "white"
9022
- }),
9023
- onClick: handleAddPageNavigation
9024
- })))), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
9093
+ }, isILadmin && companyName ? companyName + " - Users" : 'Users'))), topRightButtons()), /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
9025
9094
  component: "div",
9026
9095
  display: "flex",
9027
9096
  justifyContent: "space-between",
@@ -9184,8 +9253,8 @@ var UserList = function UserList(_ref2) {
9184
9253
  errMsg: hasVerificationError
9185
9254
  }));
9186
9255
  };
9187
- var TabLabelCount = function TabLabelCount(_ref3) {
9188
- var count = _ref3.count;
9256
+ var TabLabelCount = function TabLabelCount(_ref4) {
9257
+ var count = _ref4.count;
9189
9258
  return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
9190
9259
  className: styles$5.TabLabelCount
9191
9260
  }, " ", count, " ");
@@ -9291,7 +9360,7 @@ function Listview(_ref) {
9291
9360
  id: 'no_of_users',
9292
9361
  label: 'Number of users',
9293
9362
  width: '45%',
9294
- sortable: true,
9363
+ sortable: false,
9295
9364
  cell: function cell(row) {
9296
9365
  return /*#__PURE__*/React__default.createElement(iuistyles.IUIBox, {
9297
9366
  component: "div"