Skip to content

fix(Cluster): layout for tabs content #2219

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 1 commit into from
Apr 30, 2025
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,7 +8,6 @@ const b = cn('ydb-table-with-controls-layout');
interface TableWithControlsLayoutItemProps {
children: React.ReactNode;
className?: string;
wrapperClassName?: string;
}

interface TableProps extends TableWithControlsLayoutItemProps {
Expand All @@ -25,10 +24,9 @@ export const TableWithControlsLayout = ({
TableWithControlsLayout.Controls = function TableControls({
children,
className,
wrapperClassName,
}: TableWithControlsLayoutItemProps) {
return (
<div className={b('controls-wrapper', wrapperClassName)}>
<div className={b('controls-wrapper')}>
<div className={b('controls', className)}>{children}</div>
</div>
);
Expand Down
15 changes: 7 additions & 8 deletions src/containers/Cluster/Cluster.scss
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
@use '../../styles/mixins.scss';

.ydb-cluster {
--cluster-side-padding: var(--g-spacing-5);
position: relative;

display: flex;
overflow: auto;
flex-grow: 1;
flex-direction: column;

width: 100%;
height: 100%;
padding: 0 20px;
padding: 0 var(--cluster-side-padding);

&__header {
position: sticky;
Expand All @@ -33,11 +32,11 @@
z-index: 3;

margin-top: 20px;
margin-right: -40px;
padding-right: 40px;
padding-left: 20px;
margin-right: calc(var(--cluster-side-padding) * -2);
padding-right: calc(var(--cluster-side-padding) * 2);
padding-left: var(--cluster-side-padding);

transform: translateX(-20px);
transform: translateX(calc(var(--cluster-side-padding) * -1));
@include mixins.sticky-top();
}
&__tabs {
Expand Down
18 changes: 7 additions & 11 deletions src/containers/Storage/PaginatedStorageGroups.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,12 @@ function GroupedStorageGroupsComponent({
};

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

return (
<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>
<TableWithControlsLayout>
<TableWithControlsLayout.Controls>{renderControls()}</TableWithControlsLayout.Controls>
{error ? <ResponseError error={error} /> : null}
<TableWithControlsLayout.Table loading={isLoading} className={b('groups-wrapper')}>
{renderGroups()}
</TableWithControlsLayout.Table>
</TableWithControlsLayout>
);
}

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

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

transform: translateX(-20px);
}
}
4 changes: 0 additions & 4 deletions src/containers/Tenants/Tenants.scss
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,6 @@
overflow: hidden;
}

&__controls {
width: 100%;
}

&__table-wrapper {
width: max-content;
}
Expand Down
2 changes: 1 addition & 1 deletion src/containers/Tenants/Tenants.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ export const Tenants = ({additionalTenantsProps}: TenantsProps) => {
return (
<div className={b('table-wrapper')}>
<TableWithControlsLayout>
<TableWithControlsLayout.Controls className={b('controls')}>
<TableWithControlsLayout.Controls>
{renderControls()}
</TableWithControlsLayout.Controls>
{error ? <ResponseError error={error} /> : null}
Expand Down
Loading