Skip to content

Commit

Permalink
fix(Storage): do not display group control if not available (#1449)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemmufazalov authored Oct 11, 2024
1 parent a64db3d commit a647026
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/containers/Storage/PaginatedStorageGroups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ function StorageGroupsComponent({
}: PaginatedStorageProps) {
const {searchValue, visibleEntities, handleShowAllGroups} = useStorageQueryParams();

const storageGroupsHandlerHasGroupping = useStorageGroupsHandlerHasGrouping();

const {columnsToShow, columnsToSelect, setColumns} = useStorageGroupsSelectedColumns({
visibleEntities,
viewContext,
Expand All @@ -69,7 +71,7 @@ function StorageGroupsComponent({
return (
<StorageGroupsControls
withTypeSelector
withGroupBySelect
withGroupBySelect={storageGroupsHandlerHasGroupping}
entitiesCountCurrent={foundEntities}
entitiesCountTotal={totalEntities}
entitiesLoading={!inited}
Expand Down
4 changes: 3 additions & 1 deletion src/containers/Storage/PaginatedStorageNodes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ function StorageNodesComponent({
const {searchValue, visibleEntities, nodesUptimeFilter, handleShowAllNodes} =
useStorageQueryParams();

const viewerNodesHandlerHasGrouping = useViewerNodesHandlerHasGrouping();

const {columnsToShow, columnsToSelect, setColumns} = useStorageNodesColumnsToSelect({
database,
viewContext,
Expand All @@ -77,7 +79,7 @@ function StorageNodesComponent({
return (
<StorageNodesControls
withTypeSelector
withGroupBySelect
withGroupBySelect={viewerNodesHandlerHasGrouping}
entitiesCountCurrent={foundEntities}
entitiesCountTotal={totalEntities}
entitiesLoading={!inited}
Expand Down

0 comments on commit a647026

Please sign in to comment.