Skip to content

Commit fe61df8

Browse files
feat(Diagnostics): remove tenant diagnostics cards setting (#602)
1 parent 5ade61c commit fe61df8

File tree

15 files changed

+13
-693
lines changed

15 files changed

+13
-693
lines changed

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

Lines changed: 11 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
1-
import React, {useState} from 'react';
21
import {useSelector} from 'react-redux';
32
import cn from 'bem-cn-lite';
43

5-
import {Button, Modal} from '@gravity-ui/uikit';
6-
74
import type {EPathType} from '../../../../types/api/schema';
85
import type {AdditionalNodesProps, AdditionalTenantsProps} from '../../../../types/additionalProps';
9-
import {Icon} from '../../../../components/Icon';
10-
import {useSetting} from '../../../../utils/hooks';
11-
import {DISPLAY_METRICS_CARDS_FOR_TENANT_DIAGNOSTICS} from '../../../../utils/constants';
126
import Overview from '../Overview/Overview';
13-
import {Healthcheck} from '../OldHealthcheck';
147
import {TenantOverview} from '../TenantOverview/TenantOverview';
15-
import {OldTenantOverview} from '../TenantOverview/OldTenantOverview';
168

179
import './DetailedOverview.scss';
1810

@@ -29,86 +21,26 @@ const b = cn('kv-detailed-overview');
2921
function DetailedOverview(props: DetailedOverviewProps) {
3022
const {type, tenantName, additionalTenantProps, additionalNodesProps} = props;
3123

32-
const [isModalVisible, setIsModalVisible] = useState(false);
33-
3424
const {currentSchemaPath} = useSelector((state: any) => state.schema);
3525

36-
const [displayMetricsCards] = useSetting(DISPLAY_METRICS_CARDS_FOR_TENANT_DIAGNOSTICS);
37-
38-
const openModalHandler = () => {
39-
setIsModalVisible(true);
40-
};
41-
42-
const closeModalHandler = () => {
43-
setIsModalVisible(false);
44-
};
45-
46-
const renderModal = () => {
47-
return (
48-
<Modal open={isModalVisible} onClose={closeModalHandler} className={b('modal')}>
49-
<Healthcheck tenant={props.tenantName} fetchData={false} />
50-
<Button
51-
className={b('close-modal-button')}
52-
onClick={closeModalHandler}
53-
view="flat-secondary"
54-
title="Close"
55-
>
56-
<Icon name="close" viewBox={'0 0 16 16 '} height={20} width={20} />
57-
</Button>
58-
</Modal>
59-
);
60-
};
61-
6226
const renderTenantOverview = () => {
63-
if (displayMetricsCards) {
64-
return (
65-
<div className={b('section')}>
66-
<TenantOverview
67-
tenantName={tenantName}
68-
additionalTenantProps={additionalTenantProps}
69-
additionalNodesProps={additionalNodesProps}
70-
/>
71-
</div>
72-
);
73-
}
74-
75-
return (
76-
<>
77-
<div className={b('section')}>
78-
<OldTenantOverview
79-
tenantName={tenantName}
80-
additionalTenantProps={additionalTenantProps}
81-
/>
82-
</div>
83-
<div className={b('section')}>
84-
<Healthcheck
85-
tenant={tenantName}
86-
preview={true}
87-
showMoreHandler={openModalHandler}
88-
/>
89-
</div>
90-
</>
91-
);
92-
};
93-
94-
const renderContent = () => {
95-
const isTenant = tenantName === currentSchemaPath;
9627
return (
97-
<div className={b()}>
98-
{isTenant ? (
99-
renderTenantOverview()
100-
) : (
101-
<Overview type={type} tenantName={tenantName} />
102-
)}
28+
<div className={b('section')}>
29+
<TenantOverview
30+
tenantName={tenantName}
31+
additionalTenantProps={additionalTenantProps}
32+
additionalNodesProps={additionalNodesProps}
33+
/>
10334
</div>
10435
);
10536
};
10637

38+
const isTenant = tenantName === currentSchemaPath;
39+
10740
return (
108-
<React.Fragment>
109-
{renderContent()}
110-
{renderModal()}
111-
</React.Fragment>
41+
<div className={b()}>
42+
{isTenant ? renderTenantOverview() : <Overview type={type} tenantName={tenantName} />}
43+
</div>
11244
);
11345
}
11446

src/containers/Tenant/Diagnostics/OldHealthcheck/Details/Details.tsx

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

src/containers/Tenant/Diagnostics/OldHealthcheck/Details/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

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

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

0 commit comments

Comments
 (0)