Skip to content

Commit c81a708

Browse files
fix(Healthcheck): separate issue location, increase gaps (#2837)
1 parent 1a0d0a5 commit c81a708

File tree

7 files changed

+78
-47
lines changed

7 files changed

+78
-47
lines changed

src/containers/Tenant/Healthcheck/Healthcheck.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
}
5454
}
5555
&__issue-content {
56-
--g-definition-list-item-gap: var(--g-spacing-2);
56+
--g-definition-list-item-gap: var(--g-spacing-3);
5757
width: 100%;
5858
}
5959
&__issue-divider {

src/containers/Tenant/Healthcheck/Healthcheck.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export function Healthcheck({
8585
return (
8686
<Flex direction="column" grow={1}>
8787
{renderControls()}
88-
<Flex direction="column" gap={3} grow={1} className={b('issues')}>
88+
<Flex direction="column" gap={4} grow={1} className={b('issues')}>
8989
<Issues issues={leavesIssues} />
9090
</Flex>
9191
</Flex>

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

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

5959
return (
6060
<SectionWithTitle title={i18n('label_compute_location')} titleVariant="subheader-2">
61-
<Flex direction="column" gap={2}>
61+
<Flex direction="column" gap={3}>
6262
{fields.map((field) => LocationFieldRenderer[field](location))}
6363
</Flex>
6464
</SectionWithTitle>

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

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

33
import {Flex} from '@gravity-ui/uikit';
4-
import {isEmpty} from 'lodash';
54

65
import {InternalLink} from '../../../../../components/InternalLink';
76
import {getTabletPagePath} from '../../../../../routes';
87
import type {IssuesTree} from '../../../../../store/reducers/healthcheckInfo/types';
9-
import type {Location} from '../../../../../types/api/healthcheck';
108
import {useTenantQueryParams} from '../../../useTenantQueryParams';
119
import i18n from '../../i18n';
1210

13-
import {ComputeLocation} from './ComputeLocation';
1411
import type {LocationFieldCompute} from './ComputeLocation';
15-
import {NodeInfo} from './NodeInfo';
12+
import {IssueLocation} from './IssueLocation';
1613
import type {LocationFieldStorage} from './StorageLocation';
17-
import {StorageLocation} from './StorageLocation';
18-
import {IdList, LocationDetails, SectionWithTitle} from './utils';
14+
import {IdList, LocationDetails} from './utils';
1915

2016
interface HealthcheckIssueDetailsProps {
2117
issue: IssuesTree;
@@ -83,42 +79,11 @@ export function IssueDetails({issue}: HealthcheckIssueDetailsProps) {
8379
fields={detailsFields}
8480
titleVariant="subheader-2"
8581
/>
86-
<StorageLocation location={location?.storage} hiddenFields={hiddenStorageFields} />
87-
<ComputeLocation location={location?.compute} hiddenFields={hiddenComputeFields} />
88-
<NodeLocation location={location?.node} />
89-
<PeerLocation location={location?.peer} />
82+
<IssueLocation
83+
location={location}
84+
hiddenStorageFields={hiddenStorageFields}
85+
hiddenComputeFields={hiddenComputeFields}
86+
/>
9087
</Flex>
9188
);
9289
}
93-
94-
interface NodeLocationProps {
95-
location: Location['node'];
96-
}
97-
98-
function NodeLocation({location}: NodeLocationProps) {
99-
if (!location || isEmpty(location)) {
100-
return null;
101-
}
102-
103-
return (
104-
<SectionWithTitle title={i18n('label_node_location')}>
105-
<NodeInfo node={location} />
106-
</SectionWithTitle>
107-
);
108-
}
109-
110-
interface PeerLocationProps {
111-
location: Location['peer'];
112-
}
113-
114-
function PeerLocation({location}: PeerLocationProps) {
115-
if (!location || isEmpty(location)) {
116-
return null;
117-
}
118-
119-
return (
120-
<SectionWithTitle title={i18n('label_peer_location')}>
121-
<NodeInfo node={location} />
122-
</SectionWithTitle>
123-
);
124-
}
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import React from 'react';
2+
3+
import {isEmpty} from 'lodash';
4+
5+
import type {Location} from '../../../../../types/api/healthcheck';
6+
import i18n from '../../i18n';
7+
8+
import type {LocationFieldCompute} from './ComputeLocation';
9+
import {ComputeLocation} from './ComputeLocation';
10+
import {NodeInfo} from './NodeInfo';
11+
import type {LocationFieldStorage} from './StorageLocation';
12+
import {StorageLocation} from './StorageLocation';
13+
import {SectionWithTitle} from './utils';
14+
15+
interface IssueLocationProps {
16+
location?: Location;
17+
hiddenStorageFields?: LocationFieldStorage[];
18+
hiddenComputeFields?: LocationFieldCompute[];
19+
}
20+
21+
export function IssueLocation({
22+
location,
23+
hiddenStorageFields,
24+
hiddenComputeFields,
25+
}: IssueLocationProps) {
26+
return (
27+
<React.Fragment>
28+
<StorageLocation location={location?.storage} hiddenFields={hiddenStorageFields} />
29+
<ComputeLocation location={location?.compute} hiddenFields={hiddenComputeFields} />
30+
<NodeLocation location={location?.node} />
31+
<PeerLocation location={location?.peer} />
32+
</React.Fragment>
33+
);
34+
}
35+
36+
interface NodeLocationProps {
37+
location: Location['node'];
38+
}
39+
40+
function NodeLocation({location}: NodeLocationProps) {
41+
if (!location || isEmpty(location)) {
42+
return null;
43+
}
44+
45+
return (
46+
<SectionWithTitle title={i18n('label_node_location')}>
47+
<NodeInfo node={location} />
48+
</SectionWithTitle>
49+
);
50+
}
51+
52+
interface PeerLocationProps {
53+
location: Location['peer'];
54+
}
55+
56+
function PeerLocation({location}: PeerLocationProps) {
57+
if (!location || isEmpty(location)) {
58+
return null;
59+
}
60+
61+
return (
62+
<SectionWithTitle title={i18n('label_peer_location')}>
63+
<NodeInfo node={location} />
64+
</SectionWithTitle>
65+
);
66+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export function StorageLocation({location, hiddenFields = []}: StorageLocationPr
6565

6666
return (
6767
<SectionWithTitle title={i18n('label_storage_location')} titleVariant="subheader-2">
68-
<Flex direction="column" gap={2}>
68+
<Flex direction="column" gap={3}>
6969
{fields.map((field) => LocationFieldRenderer[field](location))}
7070
</Flex>
7171
</SectionWithTitle>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function SectionWithTitle({
1414
title,
1515
children,
1616
titleVariant = 'body-2',
17-
gap = 2,
17+
gap = 3,
1818
}: SectionWithTitleProps) {
1919
return (
2020
<Flex direction="column" gap={gap}>

0 commit comments

Comments
 (0)