Skip to content

Commit def76ea

Browse files
committed
fix: design review
1 parent 3915fc5 commit def76ea

File tree

8 files changed

+47
-71
lines changed

8 files changed

+47
-71
lines changed

src/containers/Tenant/Healthcheck/components/HealthcheckIssue.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ export function HealthcheckIssue({issue}: HealthcheckIssueProps) {
5454
</div>
5555
)}
5656
</Flex>
57-
<Flex wrap="nowrap" gap={2}>
57+
<Flex
58+
wrap="nowrap"
59+
gap={2}
60+
alignItems="center"
61+
height="max-content"
62+
>
5863
<Divider
5964
className={b('issue-divider')}
6065
orientation="vertical"

src/containers/Tenant/Healthcheck/components/HealthcheckIssueDetails/ComputeLocation.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export function ComputeLocation({location, hiddenFields = []}: ComputeLocationPr
5757
}
5858

5959
return (
60-
<SectionWithTitle title={i18n('label_compute_location')}>
60+
<SectionWithTitle title={i18n('label_compute_location')} titleVariant="subheader-2">
6161
<Flex direction="column" gap={2}>
6262
{fields.map((field) => LocationFieldRenderer[field](location))}
6363
</Flex>
@@ -79,7 +79,6 @@ function TabletInfo({location}: ComputeSectionProps) {
7979

8080
return (
8181
<LocationDetails
82-
title={i18n('label_tablet')}
8382
fields={[
8483
{
8584
value: tablet.id?.length ? (
@@ -110,7 +109,6 @@ function SchemaInfo({location}: ComputeSectionProps) {
110109

111110
return (
112111
<LocationDetails
113-
title={i18n('label_schema')}
114112
fields={[
115113
{value: schema.type, title: i18n('label_schema-type')},
116114
{value: schema.path, title: i18n('label_schema-path')},

src/containers/Tenant/Healthcheck/components/HealthcheckIssueDetails/HealthcheckIssueDetails.tsx

Lines changed: 21 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,17 @@ export function IssueDetails({issue}: HealthcheckIssueDetailsProps) {
3434
if (issue.type === 'STORAGE_POOL') {
3535
fields.push({
3636
value: issue.location?.storage?.pool?.name,
37-
title: `${i18n('label_pool')} ${i18n('label_pool-name')}`,
37+
title: i18n('label_pool-name'),
3838
});
3939
hiddenStorageFields.push('pool');
4040
}
41+
if (issue.type === 'COMPUTE_POOL') {
42+
fields.push({
43+
value: issue.location?.compute?.pool?.name,
44+
title: i18n('label_pool-name'),
45+
});
46+
hiddenComputeFields.push('pool');
47+
}
4148
if (issue.type === 'TABLET') {
4249
const tablet = issue.location?.compute?.tablet;
4350
fields.push(
@@ -52,15 +59,15 @@ export function IssueDetails({issue}: HealthcheckIssueDetailsProps) {
5259
)}
5360
/>
5461
) : undefined,
55-
title: `${i18n('label_tablet')} ${i18n('label_tablet-id')}`,
62+
title: i18n('label_tablet-id'),
5663
},
5764
{
5865
value: tablet?.type,
59-
title: `${i18n('label_tablet')} ${i18n('label_tablet-type')}`,
66+
title: i18n('label_tablet-type'),
6067
},
6168
{
6269
value: tablet?.count,
63-
title: `${i18n('label_tablet')} ${i18n('label_tablet-count')}`,
70+
title: i18n('label_tablet-count'),
6471
},
6572
);
6673
hiddenComputeFields.push('tablet');
@@ -70,35 +77,19 @@ export function IssueDetails({issue}: HealthcheckIssueDetailsProps) {
7077

7178
return (
7279
<Flex direction="column" gap={4}>
73-
<LocationDetails title={i18n('label_details')} fields={detailsFields} />
74-
<SectionWithTitle titleVariant="subheader-2" title={i18n('label_location')} gap={3}>
75-
<StorageLocation location={location.storage} hiddenFields={hiddenStorageFields} />
76-
<ComputeLocation location={location.compute} hiddenFields={hiddenComputeFields} />
77-
<DatabaseLocation location={location.database} />
78-
<NodeLocation location={location.node} />
79-
<PeerLocation location={location.peer} />
80-
</SectionWithTitle>
80+
<LocationDetails
81+
title={i18n('label_details')}
82+
fields={detailsFields}
83+
titleVariant="subheader-2"
84+
/>
85+
<StorageLocation location={location.storage} hiddenFields={hiddenStorageFields} />
86+
<ComputeLocation location={location.compute} hiddenFields={hiddenComputeFields} />
87+
<NodeLocation location={location.node} />
88+
<PeerLocation location={location.peer} />
8189
</Flex>
8290
);
8391
}
8492

85-
interface DatabaseLocationProps {
86-
location: Location['database'];
87-
}
88-
89-
function DatabaseLocation({location}: DatabaseLocationProps) {
90-
if (!location || !location.name) {
91-
return null;
92-
}
93-
94-
return (
95-
<LocationDetails
96-
title={i18n('label_database_location')}
97-
fields={[{value: location.name, title: i18n('label_database')}]}
98-
/>
99-
);
100-
}
101-
10293
interface NodeLocationProps {
10394
location: Location['node'];
10495
}
@@ -126,7 +117,7 @@ function PeerLocation({location}: PeerLocationProps) {
126117

127118
return (
128119
<SectionWithTitle title={i18n('label_peer_location')}>
129-
<NodeInfo node={location} title={i18n('label_peer')} />
120+
<NodeInfo node={location} />
130121
</SectionWithTitle>
131122
);
132123
}

src/containers/Tenant/Healthcheck/components/HealthcheckIssueDetails/NodeInfo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface NodeInfoProps {
1111
title?: string;
1212
}
1313

14-
export function NodeInfo({node, title = i18n('label_node')}: NodeInfoProps) {
14+
export function NodeInfo({node, title}: NodeInfoProps) {
1515
const {database} = useTenantQueryParams();
1616
if (!node) {
1717
return null;

src/containers/Tenant/Healthcheck/components/HealthcheckIssueDetails/PoolInfo.tsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,5 @@ export function PoolInfo({location}: PoolInfoProps) {
1515
return null;
1616
}
1717

18-
return (
19-
<LocationDetails
20-
title={i18n('label_pool')}
21-
fields={[{value: name, title: i18n('label_pool-name')}]}
22-
/>
23-
);
18+
return <LocationDetails fields={[{value: name, title: i18n('label_pool-name')}]} />;
2419
}

src/containers/Tenant/Healthcheck/components/HealthcheckIssueDetails/StorageLocation.tsx

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export function StorageLocation({location, hiddenFields = []}: StorageLocationPr
6363
}
6464

6565
return (
66-
<SectionWithTitle title={i18n('label_storage_location')}>
66+
<SectionWithTitle title={i18n('label_storage_location')} titleVariant="subheader-2">
6767
<Flex direction="column" gap={2}>
6868
{fields.map((field) => LocationFieldRenderer[field](location))}
6969
</Flex>
@@ -87,7 +87,6 @@ function GroupInfo({location}: StorageSectionProps) {
8787

8888
return (
8989
<LocationDetails
90-
title={i18n('label_group')}
9190
fields={[
9291
{
9392
value: ids?.length ? <IdList ids={ids} /> : undefined,
@@ -111,7 +110,6 @@ function VDiskInfo({location}: StorageSectionProps) {
111110

112111
return (
113112
<LocationDetails
114-
title={i18n('label_vdisk')}
115113
fields={[
116114
{
117115
value: ids?.length ? (
@@ -148,7 +146,6 @@ function PDiskInfo({location}: StorageSectionProps) {
148146
return pdisk.map((el: {id: string; path: string}) => (
149147
<LocationDetails
150148
key={el.id}
151-
title={i18n('label_pdisk')}
152149
fields={[
153150
{
154151
value:

src/containers/Tenant/Healthcheck/components/HealthcheckIssueDetails/utils.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,18 @@ export function SectionWithTitle({
2727
interface LocationDetailsProps {
2828
title?: string;
2929
fields: {value?: React.ReactNode; title: string; copy?: string}[];
30+
titleVariant?: TextProps['variant'];
3031
}
3132

32-
export function LocationDetails({title, fields}: LocationDetailsProps) {
33+
export function LocationDetails({title, fields, titleVariant}: LocationDetailsProps) {
3334
const filteredFields = fields.filter((f) => f.value);
3435

3536
if (filteredFields.length === 0) {
3637
return null;
3738
}
3839

3940
return (
40-
<SectionWithTitle title={title}>
41+
<SectionWithTitle title={title} titleVariant={titleVariant}>
4142
<DefinitionList nameMaxWidth={200}>
4243
{filteredFields.map((field) => (
4344
<DefinitionList.Item name={field.title} key={field.title} copyText={field.copy}>

src/containers/Tenant/Healthcheck/i18n/en.json

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,22 @@
2020
"label_no-issues": "No issues",
2121
"description_no-issues": "Here you will see issues that require your attention",
2222
"label_details": "Details",
23-
"label_location": "Location",
2423
"label_storage_location": "Storage Location",
2524
"label_compute_location": "Compute Location",
26-
"label_database_location": "Database Location",
27-
"label_node": "Node",
28-
"label_pool": "Pool",
29-
"label_group": "Group",
30-
"label_vdisk": "VDisk",
31-
"label_pdisk": "PDisk",
32-
"label_tablet": "Tablet",
33-
"label_schema": "Schema",
34-
"label_database": "Database",
3525
"label_description": "Description",
36-
"label_node-id": "ID",
37-
"label_node-host": "Host",
38-
"label_node-port": "Port",
39-
"label_pool-name": "Name",
40-
"label_tablet-id": "ID",
41-
"label_tablet-type": "Type",
42-
"label_tablet-count": "Count",
43-
"label_schema-type": "Type",
44-
"label_schema-path": "Path",
45-
"label_group-id": "ID",
46-
"label_vdisk-id": "ID",
47-
"label_pdisk-id": "ID",
48-
"label_pdisk-path": "Path",
49-
"label_peer": "Peer Node",
26+
"label_node-id": "Node ID",
27+
"label_node-host": "Node Host",
28+
"label_node-port": "Node Port",
29+
"label_pool-name": "Pool Name",
30+
"label_tablet-id": "Tablet ID",
31+
"label_tablet-type": "Tablet Type",
32+
"label_tablet-count": "Tablets Count",
33+
"label_schema-type": "Schema Type",
34+
"label_schema-path": "Schema Path",
35+
"label_group-id": "Group ID",
36+
"label_vdisk-id": "VDisk ID",
37+
"label_pdisk-id": "Pdisk ID",
38+
"label_pdisk-path": "PDisk Path",
5039
"label_node_location": "Node Location",
5140
"label_peer_location": "Peer Node Location"
5241
}

0 commit comments

Comments
 (0)