Skip to content

Commit 1879d3d

Browse files
authored
feat: move healthcheck to tabs (#531)
1 parent 9f7837c commit 1879d3d

File tree

36 files changed

+513
-157
lines changed

36 files changed

+513
-157
lines changed

src/components/CircularProgressBar/CircularProgressBar.scss

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
&__wrapper {
99
position: relative;
10-
11-
display: inline;
1210
}
1311
&__content {
1412
position: absolute;
@@ -26,8 +24,6 @@
2624
stroke: var(--yc-color-base-simple-hover);
2725

2826
fill: none;
29-
30-
transition: stroke 0.1s;
3127
}
3228

3329
&__circle {

src/components/DiagnosticCard/DiagnosticCard.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
border-radius: 8px;
1010
background-color: transparent;
1111

12-
transition: all 0.1s;
13-
transition-property: box-shadow, background-color, border-color;
14-
1512
&_active {
1613
border-color: var(--yc-color-base-info-heavy);
1714
background-color: var(--yc-color-base-selection);

src/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.scss

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
$section-title-margin: 20px;
2-
$section-title-line-height: 24px;
3-
41
.kv-detailed-overview {
52
display: flex;
63

src/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {Icon} from '../../../../components/Icon';
1010
import {useSetting} from '../../../../utils/hooks';
1111
import {ENABLE_NEW_TENANT_DIAGNOSTICS_DESIGN} from '../../../../utils/constants';
1212
import Overview from '../Overview/Overview';
13-
import {Healthcheck} from '../Healthcheck';
13+
import {Healthcheck} from '../OldHealthcheck';
1414
import {TenantOverview} from '../TenantOverview/TenantOverview';
1515
import {OldTenantOverview} from '../TenantOverview/OldTenantOverview';
1616

@@ -65,7 +65,6 @@ function DetailedOverview(props: DetailedOverviewProps) {
6565
<TenantOverview
6666
tenantName={tenantName}
6767
additionalTenantProps={additionalTenantProps}
68-
showMoreHandler={openModalHandler}
6968
/>
7069
</div>
7170
);

src/containers/Tenant/Diagnostics/Healthcheck/Details/Details.tsx renamed to src/containers/Tenant/Diagnostics/OldHealthcheck/Details/Details.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ import type {IResponseError} from '../../../../../types/api/error';
88
import type {IIssuesTree} from '../../../../../types/store/healthcheck';
99
import {ResponseError} from '../../../../../components/Errors/ResponseError';
1010

11-
import IssueTree from '../IssuesViewer/IssueTree';
11+
import IssueTree from '../../TenantOverview/Healthcheck/IssuesViewer/IssueTree';
1212

13-
import i18n from '../i18n';
13+
import i18n from '../../TenantOverview/Healthcheck/i18n';
1414

15-
const b = cn('healthcheck');
15+
const b = cn('old-healthcheck');
1616

1717
interface DetailsProps {
1818
issueTrees?: IIssuesTree[];

src/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.scss renamed to src/containers/Tenant/Diagnostics/OldHealthcheck/Healthcheck.scss

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
@use '../DetailedOverview/DetailedOverview.scss' as detailedOverview;
21
@import '../../../../styles/mixins.scss';
32
@import '@gravity-ui/uikit/styles/mixins.scss';
43

5-
.healthcheck {
4+
.old-healthcheck {
65
display: flex;
76

87
&_expanded {
@@ -12,6 +11,7 @@
1211
}
1312

1413
&__details {
14+
width: 860px;
1515
padding: 25px 20px 20px;
1616
}
1717

@@ -27,11 +27,6 @@
2727
max-height: 70vh;
2828
}
2929

30-
&__loader {
31-
display: flex;
32-
justify-content: center;
33-
}
34-
3530
&__message-container {
3631
padding: 15px 0;
3732
}
@@ -53,8 +48,18 @@
5348
margin-left: 10px;
5449
}
5550

51+
&__preview {
52+
width: 206px;
53+
padding: 16px;
54+
padding-bottom: 28px;
55+
56+
border: 1px solid var(--yc-color-line-generic);
57+
border-radius: 8px;
58+
background-color: transparent;
59+
}
60+
5661
&__preview-header {
57-
margin-bottom: detailedOverview.$section-title-margin;
62+
margin-bottom: var(--diagnostics-section-title-margin);
5863
gap: 8px;
5964
}
6065

src/containers/Tenant/Diagnostics/Healthcheck/Healthcheck.tsx renamed to src/containers/Tenant/Diagnostics/OldHealthcheck/Healthcheck.tsx

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
selectIssuesTrees,
1313
setDataWasNotLoaded,
1414
} from '../../../../store/reducers/healthcheckInfo';
15-
import {DiagnosticCard} from '../../../../components/DiagnosticCard/DiagnosticCard';
1615

1716
import {Details} from './Details';
1817
import {Preview} from './Preview';
@@ -24,13 +23,12 @@ interface HealthcheckProps {
2423
preview?: boolean;
2524
fetchData?: boolean;
2625
showMoreHandler?: VoidFunction;
27-
active?: boolean;
2826
}
2927

30-
const b = cn('healthcheck');
28+
const b = cn('old-healthcheck');
3129

3230
export const Healthcheck = (props: HealthcheckProps) => {
33-
const {tenant, preview, fetchData = true, showMoreHandler, active} = props;
31+
const {tenant, preview, fetchData = true, showMoreHandler} = props;
3432

3533
const dispatch = useDispatch();
3634

@@ -65,11 +63,12 @@ export const Healthcheck = (props: HealthcheckProps) => {
6563
const renderContent = () => {
6664
if (loading && !wasLoaded) {
6765
return (
68-
<DiagnosticCard className={b('loader')}>
66+
<div className={b('old-preview', {loader: true})}>
6967
<Loader size="m" />
70-
</DiagnosticCard>
68+
</div>
7169
);
7270
}
71+
7372
return preview ? (
7473
<Preview
7574
issuesStatistics={issuesStatistics}
@@ -78,7 +77,6 @@ export const Healthcheck = (props: HealthcheckProps) => {
7877
onShowMore={showMoreHandler}
7978
onUpdate={fetchHealthcheck}
8079
error={error}
81-
active={active}
8280
/>
8381
) : (
8482
<Details

src/containers/Tenant/Diagnostics/Healthcheck/Preview/Preview.tsx renamed to src/containers/Tenant/Diagnostics/OldHealthcheck/Preview/Preview.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,12 @@ import updateArrow from '../../../../../assets/icons/update-arrow.svg';
66

77
import {SelfCheckResult, type StatusFlag} from '../../../../../types/api/healthcheck';
88
import type {IResponseError} from '../../../../../types/api/error';
9-
import {DiagnosticCard} from '../../../../../components/DiagnosticCard/DiagnosticCard';
109
import EntityStatus from '../../../../../components/EntityStatus/EntityStatus';
1110
import {ResponseError} from '../../../../../components/Errors/ResponseError';
1211

13-
import i18n from '../i18n';
12+
import i18n from '../../TenantOverview/Healthcheck/i18n';
1413

15-
const b = cn('healthcheck');
14+
const b = cn('old-healthcheck');
1615

1716
interface PreviewProps {
1817
selfCheckResult: SelfCheckResult;
@@ -21,13 +20,10 @@ interface PreviewProps {
2120
onShowMore?: VoidFunction;
2221
onUpdate: VoidFunction;
2322
error?: IResponseError;
24-
active?: boolean;
2523
}
2624

2725
export const Preview = (props: PreviewProps) => {
28-
const {selfCheckResult, issuesStatistics, loading, onShowMore, onUpdate, error, active} = props;
29-
30-
const isStatusOK = selfCheckResult === SelfCheckResult.GOOD;
26+
const {selfCheckResult, issuesStatistics, loading, onShowMore, onUpdate, error} = props;
3127

3228
const renderHeader = () => {
3329
const modifier = selfCheckResult.toLowerCase();
@@ -54,7 +50,7 @@ export const Preview = (props: PreviewProps) => {
5450

5551
return (
5652
<div className={b('preview-content')}>
57-
{isStatusOK || !issuesStatistics || !issuesStatistics.length ? (
53+
{!issuesStatistics || !issuesStatistics.length ? (
5854
i18n('status_message.ok')
5955
) : (
6056
<>
@@ -78,9 +74,9 @@ export const Preview = (props: PreviewProps) => {
7874
};
7975

8076
return (
81-
<DiagnosticCard active={active}>
77+
<div className={b('preview')}>
8278
{renderHeader()}
8379
{renderContent()}
84-
</DiagnosticCard>
80+
</div>
8581
);
8682
};

0 commit comments

Comments
 (0)