Skip to content

Commit f457e90

Browse files
committed
fix: review fixes
1 parent b0795fd commit f457e90

File tree

13 files changed

+42
-167
lines changed

13 files changed

+42
-167
lines changed

src/components/MemoryViewer/MemoryViewer.scss

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ $memory-type-colors: (
3131
}
3232

3333
&__container {
34-
display: flex;
35-
3634
padding: 2px 0;
3735
}
3836

@@ -93,10 +91,4 @@ $memory-type-colors: (
9391
}
9492
}
9593
}
96-
97-
&__text {
98-
display: flex;
99-
justify-content: center;
100-
align-items: center;
101-
}
10294
}

src/components/MemoryViewer/MemoryViewer.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {DefinitionList, useTheme} from '@gravity-ui/uikit';
1+
import {DefinitionList, Flex, useTheme} from '@gravity-ui/uikit';
22

33
import type {TMemoryStats} from '../../types/api/nodes';
44
import {formatBytes} from '../../utils/bytesParsers';
@@ -107,10 +107,10 @@ export function MemoryViewer({
107107
<DefinitionList.Item
108108
key={label}
109109
name={
110-
<div className={b('container')}>
110+
<Flex alignItems="center" gap="1" className={b('container')}>
111111
<div className={b('legend', {type: key})}></div>
112112
<div className={b('name')}>{label}</div>
113-
</div>
113+
</Flex>
114114
}
115115
>
116116
{segmentCapacity ? (
@@ -161,7 +161,9 @@ export function MemoryViewer({
161161
/>
162162
);
163163
})}
164-
<div className={b('text')}>{renderContent()}</div>
164+
<Flex justifyContent="center" alignItems="center">
165+
{renderContent()}
166+
</Flex>
165167
</div>
166168
</div>
167169
</HoverPopup>

src/components/ProgressWrapper/ProgressContainer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import type {ProgressContainerProps} from './types';
66
export function ProgressContainer({
77
children,
88
displayText,
9-
withValue = false,
9+
withCapacityUsage = false,
1010
className,
1111
width,
1212
}: ProgressContainerProps) {
@@ -15,7 +15,7 @@ export function ProgressContainer({
1515
return (
1616
<Flex alignItems="center" gap="2" className={className}>
1717
<div style={progressStyle}>{children}</div>
18-
{withValue && displayText && (
18+
{withCapacityUsage && displayText && (
1919
<Text variant="body-1" color="secondary">
2020
{displayText}
2121
</Text>

src/components/ProgressWrapper/SingleProgress.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function SingleProgress({
2323
className,
2424
width,
2525
size = PROGRESS_SIZE,
26-
withValue = false,
26+
withCapacityUsage = false,
2727
}: ProgressWrapperSingleProps) {
2828
if (!isValidValue(value)) {
2929
return <div className={className}>{i18n('alert_no-data')}</div>;
@@ -44,7 +44,7 @@ export function SingleProgress({
4444
return (
4545
<ProgressContainer
4646
displayText={displayText}
47-
withValue={withValue}
47+
withCapacityUsage={withCapacityUsage}
4848
className={className}
4949
width={width}
5050
>

src/components/ProgressWrapper/StackProgress.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function StackProgress({
2323
className,
2424
width,
2525
size = PROGRESS_SIZE,
26-
withValue = false,
26+
withCapacityUsage = false,
2727
}: ProgressWrapperStackProps) {
2828
const displaySegments = React.useMemo(() => {
2929
return stack.filter((segment) => !segment.isInfo && segment.value > 0);
@@ -62,7 +62,7 @@ export function StackProgress({
6262
return (
6363
<ProgressContainer
6464
displayText={displayText}
65-
withValue={withValue}
65+
withCapacityUsage={withCapacityUsage}
6666
className={className}
6767
width={width}
6868
>

src/components/ProgressWrapper/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export interface ProgressWrapperBaseProps {
88
className?: string;
99
width?: number | 'full';
1010
size?: ProgressSize;
11-
withValue?: boolean;
11+
withCapacityUsage?: boolean;
1212
}
1313

1414
export interface ProgressWrapperSingleProps extends ProgressWrapperBaseProps {
@@ -29,7 +29,7 @@ export type ProgressWrapperProps = ProgressWrapperSingleProps | ProgressWrapperS
2929
export interface ProgressContainerProps {
3030
children: React.ReactNode;
3131
displayText?: string;
32-
withValue?: boolean;
32+
withCapacityUsage?: boolean;
3333
className?: string;
3434
width?: number | 'full';
3535
}

src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/MemoryDetailsSection.scss

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
@use '../../../../../styles/mixins.scss';
22

33
.memory-details {
4-
display: flex;
5-
flex-direction: column;
6-
align-items: flex-start;
7-
align-self: stretch;
8-
gap: var(--g-spacing-3);
9-
104
&__header {
115
align-self: stretch;
126
}
@@ -16,14 +10,6 @@
1610
@include mixins.subheader-1-typography();
1711
}
1812

19-
&__content {
20-
display: flex;
21-
flex-direction: column;
22-
align-items: flex-start;
23-
align-self: stretch;
24-
gap: var(--g-spacing-4);
25-
}
26-
2713
&__main-progress {
2814
align-self: stretch;
2915
}
@@ -33,22 +19,9 @@
3319
}
3420

3521
&__segments-container {
36-
display: flex;
37-
flex-direction: column;
38-
align-items: flex-start;
39-
align-self: stretch;
40-
gap: var(--g-spacing-2);
41-
4222
margin-bottom: var(--g-spacing-4);
4323
}
4424

45-
&__segment-row {
46-
display: flex;
47-
align-items: center;
48-
align-self: stretch;
49-
gap: var(--g-spacing-1);
50-
}
51-
5225
&__segment-indicator {
5326
flex-shrink: 0;
5427

@@ -72,12 +45,6 @@
7245
height: 10px;
7346
}
7447

75-
&__popup-container {
76-
display: flex;
77-
align-items: center;
78-
gap: var(--g-spacing-2);
79-
}
80-
8148
&__popup-legend {
8249
flex-shrink: 0;
8350

src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/MemoryDetailsSection.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22

3-
import {Text} from '@gravity-ui/uikit';
3+
import {Flex, Text} from '@gravity-ui/uikit';
44

55
import i18n from '../../../../../components/MemoryViewer/i18n';
66
import {getMemorySegments} from '../../../../../components/MemoryViewer/utils';
@@ -57,13 +57,13 @@ export function MemoryDetailsSection({memoryStats}: MemoryDetailsSectionProps) {
5757
}, []);
5858

5959
return (
60-
<div className={b()}>
60+
<Flex direction="column" alignItems="flex-start" gap="3">
6161
<div className={b('header')}>
6262
<Text variant="body-1" className={b('title')}>
6363
{i18n('text_memory-details')}
6464
</Text>
6565
</div>
66-
<div className={b('content')}>
66+
<Flex direction="column" alignItems="flex-start" gap="4">
6767
<div className={b('main-progress')}>
6868
<ProgressWrapper
6969
stack={memorySegments}
@@ -74,12 +74,17 @@ export function MemoryDetailsSection({memoryStats}: MemoryDetailsSectionProps) {
7474
width="full"
7575
/>
7676
</div>
77-
<div className={b('segments-container')}>
77+
<Flex
78+
direction="column"
79+
alignItems="flex-start"
80+
gap="2"
81+
className={b('segments-container')}
82+
>
7883
{displaySegments.map((segment) => (
7984
<MemorySegmentItem key={segment.key} segment={segment} />
8085
))}
81-
</div>
82-
</div>
83-
</div>
86+
</Flex>
87+
</Flex>
88+
</Flex>
8489
);
8590
}

src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/MemoryProgressBar.scss

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/MemoryProgressBar.tsx

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)