Skip to content

chore!: only pagination tables in storage #1745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/containers/Cluster/Cluster.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {cn} from '../../utils/cn';
import {useTypedDispatch, useTypedSelector} from '../../utils/hooks';
import {parseVersionsToVersionToColorMap} from '../../utils/versions';
import {Nodes} from '../Nodes/Nodes';
import {StorageWrapper} from '../Storage/StorageWrapper';
import {PaginatedStorage} from '../Storage/PaginatedStorage';
import {TabletsTable} from '../Tablets/TabletsTable';
import {Tenants} from '../Tenants/Tenants';
import {Versions} from '../Versions/Versions';
Expand Down Expand Up @@ -199,7 +199,7 @@ export function Cluster({
getLocationObjectFromHref(getClusterPath(clusterTabsIds.storage)).pathname
}
>
<StorageWrapper parentRef={container} />
<PaginatedStorage parentRef={container} />
</Route>
<Route
path={
Expand Down
10 changes: 8 additions & 2 deletions src/containers/Node/Node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {nodeApi} from '../../store/reducers/node/node';
import type {AdditionalNodesProps} from '../../types/additionalProps';
import {cn} from '../../utils/cn';
import {useAutoRefreshInterval, useTypedDispatch} from '../../utils/hooks';
import {StorageWrapper} from '../Storage/StorageWrapper';
import {PaginatedStorage} from '../Storage/PaginatedStorage';
import {Tablets} from '../Tablets';

import type {NodeTab} from './NodePages';
Expand Down Expand Up @@ -142,7 +142,13 @@ export function Node(props: NodeProps) {
case STORAGE: {
return (
<div className={b('storage')} ref={container}>
<StorageWrapper nodeId={nodeId} parentRef={container} />
<PaginatedStorage
nodeId={nodeId}
parentRef={container}
viewContext={{
nodeId: nodeId?.toString(),
}}
/>
</div>
);
}
Expand Down
12 changes: 10 additions & 2 deletions src/containers/PDiskPage/PDiskPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {valueIsDefined} from '../../utils';
import {cn} from '../../utils/cn';
import {getPDiskId, getSeverityColor} from '../../utils/disks/helpers';
import {useAutoRefreshInterval, useTypedDispatch, useTypedSelector} from '../../utils/hooks';
import {StorageWrapper} from '../Storage/StorageWrapper';
import {PaginatedStorage} from '../Storage/PaginatedStorage';

import {DecommissionButton} from './DecommissionButton/DecommissionButton';
import {DecommissionLabel} from './DecommissionLabel/DecommissionLabel';
Expand Down Expand Up @@ -246,7 +246,15 @@ export function PDiskPage() {
}
case 'storage': {
return pDiskParamsDefined ? (
<StorageWrapper nodeId={nodeId} pDiskId={pDiskId} parentRef={containerRef} />
<PaginatedStorage
nodeId={nodeId}
pDiskId={pDiskId}
parentRef={containerRef}
viewContext={{
nodeId: nodeId?.toString(),
pDiskId: pDiskId?.toString(),
}}
/>
) : null;
}
default:
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Storage/PaginatedStorage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export interface PaginatedStorageProps {
groupId?: string | number;
pDiskId?: string | number;

viewContext: StorageViewContext;
viewContext?: StorageViewContext;

parentRef: React.RefObject<HTMLElement>;

Expand Down
2 changes: 1 addition & 1 deletion src/containers/Storage/PaginatedStorageNodes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function useStorageNodesColumnsToSelect({
viewContext,
}: {
database?: string;
viewContext: StorageViewContext;
viewContext?: StorageViewContext;
}) {
const {balancer} = useClusterBaseInfo();
const {additionalNodesProps} = useAdditionalNodeProps({balancer});
Expand Down
236 changes: 0 additions & 236 deletions src/containers/Storage/Storage.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/containers/Storage/StorageGroups/columns/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {
} from './constants';
import type {GetStorageGroupsColumnsParams} from './types';

export function useGetStorageGroupsColumns(viewContext: StorageViewContext) {
export function useGetStorageGroupsColumns(viewContext?: StorageViewContext) {
return React.useMemo(() => {
return getStorageGroupsColumns({viewContext});
}, [viewContext]);
Expand Down
4 changes: 2 additions & 2 deletions src/containers/Storage/StorageGroups/columns/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import type {StorageViewContext} from '../../types';
export type StorageGroupsColumn = Column<PreparedStorageGroup>;

export interface GetStorageColumnsData {
viewContext: StorageViewContext;
viewContext?: StorageViewContext;
}

export interface GetStorageGroupsColumnsParams {
visibleEntities?: VisibleEntities;
viewContext: StorageViewContext;
viewContext?: StorageViewContext;
}

export type StorageColumnsGetter = (data?: GetStorageColumnsData) => StorageGroupsColumn[];
Loading
Loading