Skip to content

Commit 44fc571

Browse files
committed
feat(Healthcheck): redesign
1 parent 0ef169c commit 44fc571

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1892
-618
lines changed

src/components/Drawer/Drawer.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
}
99

1010
&__item {
11-
z-index: 4;
11+
z-index: calc(var(--ydb-drawer-veil-z-index) + 1);
1212

1313
height: 100%;
1414
}

src/components/Drawer/Drawer.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ interface DrawerPaneContentWrapperProps {
3232
detectClickOutside?: boolean;
3333
defaultWidth?: number;
3434
isPercentageWidth?: boolean;
35+
showVeil?: boolean;
3536
}
3637

3738
const DrawerPaneContentWrapper = ({
@@ -45,6 +46,7 @@ const DrawerPaneContentWrapper = ({
4546
className,
4647
detectClickOutside = false,
4748
isPercentageWidth,
49+
showVeil,
4850
}: DrawerPaneContentWrapperProps) => {
4951
const [drawerWidth, setDrawerWidth] = React.useState(() => {
5052
const savedWidth = localStorage.getItem(storageKey);
@@ -113,7 +115,7 @@ const DrawerPaneContentWrapper = ({
113115
<GravityDrawer
114116
onEscape={onClose}
115117
onVeilClick={onClose}
116-
hideVeil
118+
hideVeil={!showVeil}
117119
className={b('container', className)}
118120
>
119121
<DrawerItem
@@ -156,6 +158,7 @@ interface DrawerPaneProps {
156158
drawerControls?: DrawerControl[];
157159
title?: React.ReactNode;
158160
headerClassName?: string;
161+
showVeil?: boolean;
159162
}
160163

161164
export const DrawerWrapper = ({
@@ -173,6 +176,7 @@ export const DrawerWrapper = ({
173176
drawerControls = [],
174177
title,
175178
headerClassName,
179+
showVeil,
176180
}: DrawerPaneProps) => {
177181
React.useEffect(() => {
178182
return () => {
@@ -220,6 +224,7 @@ export const DrawerWrapper = ({
220224
<React.Fragment>
221225
{children}
222226
<DrawerPaneContentWrapper
227+
showVeil={showVeil}
223228
isVisible={isDrawerVisible}
224229
onClose={onCloseDrawer}
225230
drawerId={drawerId}

src/components/EmptyState/EmptyState.scss

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

33
.empty-state {
4+
$block: &;
45
padding: 20px;
56

67
&_size_m {
@@ -13,6 +14,14 @@
1314
'image title'
1415
'image description'
1516
'image actions';
17+
18+
&_size_xs {
19+
width: 321px;
20+
height: 100px;
21+
#{$block}__image {
22+
margin-right: 20px;
23+
}
24+
}
1625
&_size_s {
1726
width: 460px;
1827
height: 120px;

src/components/EmptyState/EmptyState.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import './EmptyState.scss';
99
const block = cn('empty-state');
1010

1111
const sizes = {
12+
xs: 100,
1213
s: 150,
1314
m: 250,
1415
l: 350,

src/components/EnableFullscreenButton/EnableFullscreenButton.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import {SquareDashed} from '@gravity-ui/icons';
22
import type {ButtonView} from '@gravity-ui/uikit';
3-
import {Button, Icon} from '@gravity-ui/uikit';
3+
import {ActionTooltip, Button, Icon} from '@gravity-ui/uikit';
44

55
import {enableFullscreen} from '../../store/reducers/fullscreen';
66
import {useTypedDispatch} from '../../utils/hooks';
@@ -16,9 +16,11 @@ function EnableFullscreenButton({disabled, view = 'flat-secondary'}: EnableFulls
1616
dispatch(enableFullscreen());
1717
};
1818
return (
19-
<Button onClick={onEnableFullscreen} view={view} disabled={disabled} title="Fullscreen">
20-
<Icon data={SquareDashed} />
21-
</Button>
19+
<ActionTooltip title="Fullscreen">
20+
<Button onClick={onEnableFullscreen} view={view} disabled={disabled}>
21+
<Icon data={SquareDashed} />
22+
</Button>
23+
</ActionTooltip>
2224
);
2325
}
2426

src/components/Fullscreen/Fullscreen.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// should expand to fill the content area, keeping aside navigation visible
77
// counts on .gn-aside-header__content to have position: relative, it is set in App.scss
88
position: absolute;
9-
z-index: 10;
9+
z-index: calc(var(--ydb-drawer-veil-z-index) + 3);
1010
inset: 0;
1111

1212
background-color: var(--g-color-base-background);
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import {
2+
CircleCheck,
3+
CircleExclamation,
4+
CircleInfo,
5+
PlugConnection,
6+
TriangleExclamation,
7+
} from '@gravity-ui/icons';
8+
import type {LabelProps} from '@gravity-ui/uikit';
9+
import {Icon, Label} from '@gravity-ui/uikit';
10+
11+
import {SelfCheckResult} from '../../types/api/healthcheck';
12+
13+
import i18n from './i18n';
14+
15+
const SelfCheckResultToLabelTheme: Record<SelfCheckResult, LabelProps['theme']> = {
16+
[SelfCheckResult.GOOD]: 'success',
17+
[SelfCheckResult.DEGRADED]: 'info',
18+
[SelfCheckResult.MAINTENANCE_REQUIRED]: 'warning',
19+
[SelfCheckResult.EMERGENCY]: 'danger',
20+
[SelfCheckResult.UNSPECIFIED]: 'normal',
21+
};
22+
23+
const SelfCheckResultToIcon: Record<
24+
SelfCheckResult,
25+
(props: React.SVGProps<SVGSVGElement>) => React.JSX.Element
26+
> = {
27+
[SelfCheckResult.GOOD]: CircleCheck,
28+
[SelfCheckResult.DEGRADED]: CircleInfo,
29+
[SelfCheckResult.MAINTENANCE_REQUIRED]: TriangleExclamation,
30+
[SelfCheckResult.EMERGENCY]: CircleExclamation,
31+
[SelfCheckResult.UNSPECIFIED]: PlugConnection,
32+
};
33+
34+
const SelfCheckResultToText: Record<SelfCheckResult, string> = {
35+
get [SelfCheckResult.GOOD]() {
36+
return i18n('title_good');
37+
},
38+
get [SelfCheckResult.DEGRADED]() {
39+
return i18n('title_degraded');
40+
},
41+
get [SelfCheckResult.MAINTENANCE_REQUIRED]() {
42+
return i18n('title_maintenance');
43+
},
44+
get [SelfCheckResult.EMERGENCY]() {
45+
return i18n('title_emergency');
46+
},
47+
get [SelfCheckResult.UNSPECIFIED]() {
48+
return i18n('title_unspecified');
49+
},
50+
};
51+
52+
interface HealthcheckStatusProps {
53+
status: SelfCheckResult;
54+
size?: LabelProps['size'];
55+
}
56+
57+
export function HealthcheckStatus({status, size = 'm'}: HealthcheckStatusProps) {
58+
const theme = SelfCheckResultToLabelTheme[status];
59+
60+
return (
61+
<Label
62+
theme={theme}
63+
icon={<Icon size={14} data={SelfCheckResultToIcon[status]} />}
64+
size={size}
65+
>
66+
{SelfCheckResultToText[status]}
67+
</Label>
68+
);
69+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"title_degraded": "Degraded",
3+
"title_emergency": "Emergency",
4+
"title_maintenance": "Maintenance required",
5+
"title_good": "Good",
6+
"title_unspecified": "Unspecified"
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import {registerKeysets} from '../../../utils/i18n';
2+
3+
import en from './en.json';
4+
5+
const COMPONENT = 'ydb-healthcheck-status';
6+
7+
export default registerKeysets(COMPONENT, {en});

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

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

0 commit comments

Comments
 (0)