Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ const b = cn('ydb-table-with-controls-layout');
interface TableWithControlsLayoutItemProps {
children: React.ReactNode;
className?: string;
wrapperClassName?: string;
}

interface TableProps extends TableWithControlsLayoutItemProps {
Expand All @@ -24,9 +25,10 @@ export const TableWithControlsLayout = ({
TableWithControlsLayout.Controls = function TableControls({
children,
className,
wrapperClassName,
}: TableWithControlsLayoutItemProps) {
return (
<div className={b('controls-wrapper')}>
<div className={b('controls-wrapper', wrapperClassName)}>
<div className={b('controls', className)}>{children}</div>
</div>
);
Expand Down
18 changes: 11 additions & 7 deletions src/containers/Storage/PaginatedStorageGroups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,16 @@ function GroupedStorageGroupsComponent({
};

return (
<TableWithControlsLayout>
<TableWithControlsLayout.Controls>{renderControls()}</TableWithControlsLayout.Controls>
{error ? <ResponseError error={error} /> : null}
<TableWithControlsLayout.Table loading={isLoading} className={b('groups-wrapper')}>
{renderGroups()}
</TableWithControlsLayout.Table>
</TableWithControlsLayout>
<React.Fragment>
<TableWithControlsLayout.Controls wrapperClassName={b('controls')}>
{renderControls()}
</TableWithControlsLayout.Controls>
<TableWithControlsLayout>
{error ? <ResponseError error={error} /> : null}
<TableWithControlsLayout.Table loading={isLoading} className={b('groups-wrapper')}>
{renderGroups()}
</TableWithControlsLayout.Table>
</TableWithControlsLayout>
</React.Fragment>
);
}
18 changes: 11 additions & 7 deletions src/containers/Storage/PaginatedStorageNodes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,17 @@ function GroupedStorageNodesComponent({
};

return (
<TableWithControlsLayout>
<TableWithControlsLayout.Controls>{renderControls()}</TableWithControlsLayout.Controls>
{error ? <ResponseError error={error} /> : null}
<TableWithControlsLayout.Table loading={isLoading} className={b('groups-wrapper')}>
{renderGroups()}
</TableWithControlsLayout.Table>
</TableWithControlsLayout>
<React.Fragment>
<TableWithControlsLayout.Controls wrapperClassName={b('controls')}>
{renderControls()}
</TableWithControlsLayout.Controls>
<TableWithControlsLayout>
{error ? <ResponseError error={error} /> : null}
<TableWithControlsLayout.Table loading={isLoading} className={b('groups-wrapper')}>
{renderGroups()}
</TableWithControlsLayout.Table>
</TableWithControlsLayout>
</React.Fragment>
);
}

Expand Down
9 changes: 9 additions & 0 deletions src/containers/Storage/Storage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,13 @@
&__groups-wrapper {
padding-right: 20px;
}

&__controls {
width: unset;
margin-right: -40px;
padding-right: 40px;
padding-left: 20px;

transform: translateX(-20px);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please explain how it works and where 40 and 20 px come from?
mb move them to css variables for clearance

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In short, it's black magic :)
If serious, we have our scroll container ydb-cluster with side paddings. And thats the trouble. So, I just mislead this paddings (we have similar styles for tabs). Maybe we should rework layout for all cluster page, what do u think?

Copy link
Collaborator

@astandrik astandrik Apr 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if current solution fixes current problem - we could merge it but as well we could create task to techdebt with description of what should be reworked

I dont think for now we have that much of a resource for massive reworks of that type

However sometimes it could be done

I checked this issue with many pdisks and vdidks with mocks from this pr #1793 and it seems to work

}
}
Loading