Skip to content

Commit

Permalink
feat(Storage): hide nodes table for node page (#557)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemmufazalov authored Oct 16, 2023
1 parent 7f1266d commit 9a25a00
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/containers/Storage/Storage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const Storage = ({additionalNodesProps, tenant, nodeId}: StorageProps) =>
loading,
wasLoaded,
error,
type: storageType,
type,
visible: visibleEntities,
filter,
usageFilter,
Expand All @@ -87,6 +87,10 @@ export const Storage = ({additionalNodesProps, tenant, nodeId}: StorageProps) =>
const nodesSortParams = useTypedSelector(selectNodesSortParams);
const groupsSortParams = useTypedSelector(selectGroupsSortParams);

// Do not display Nodes table for Node page (NodeId present)
const isNodePage = nodeId !== undefined;
const storageType = isNodePage ? STORAGE_TYPES.groups : type;

useEffect(() => {
dispatch(getNodesList());

Expand Down Expand Up @@ -228,7 +232,10 @@ export const Storage = ({additionalNodesProps, tenant, nodeId}: StorageProps) =>
/>
</div>

<StorageTypeFilter value={storageType} onChange={handleStorageTypeChange} />
{!isNodePage && (
<StorageTypeFilter value={storageType} onChange={handleStorageTypeChange} />
)}

<StorageVisibleEntitiesFilter
value={visibleEntities}
onChange={handleGroupVisibilityChange}
Expand Down

0 comments on commit 9a25a00

Please sign in to comment.