-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(Components/Node/MemoryPopup): do not display lines with '0B' [YTF…
…RONT-4625]
- Loading branch information
1 parent
79ed22f
commit 00268e3
Showing
12 changed files
with
212 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
packages/ui/src/ui/containers/SettingsMenu/BooleanSettingItem.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import React from 'react'; | ||
import {useDispatch, useSelector} from 'react-redux'; | ||
|
||
import {Checkbox} from '@gravity-ui/uikit'; | ||
|
||
import {DescribedSettings} from '../../../shared/constants/settings-types'; | ||
import {KeysByType} from '../../../@types/types'; | ||
|
||
import {getSettingsData} from '../../store/selectors/settings/settings-base'; | ||
import {setSettingByKey} from '../../store/actions/settings'; | ||
import {SettingsItemLayot, SettingsItemLayotProps} from './SettingsItemLayout'; | ||
|
||
export type BooleanSettingItemProps<T> = {settingKey: T} & Omit<SettingsItemLayotProps, 'children'>; | ||
|
||
export function BooleanSettingItem<T extends KeysByType<DescribedSettings, boolean>>({ | ||
settingKey, | ||
...rest | ||
}: BooleanSettingItemProps<T>) { | ||
const dispatch = useDispatch(); | ||
const {[settingKey]: checked} = useSelector(getSettingsData); | ||
|
||
return ( | ||
<SettingsItemLayot {...rest}> | ||
<Checkbox | ||
content={rest.title} | ||
checked={Boolean(checked)} | ||
onUpdate={(value) => { | ||
dispatch(setSettingByKey(settingKey, value)); | ||
}} | ||
qa={settingKey} | ||
/> | ||
</SettingsItemLayot> | ||
); | ||
} |
30 changes: 30 additions & 0 deletions
30
packages/ui/src/ui/containers/SettingsMenu/SettingsItemLayout.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
.yt-settings-item { | ||
margin-bottom: 15px; | ||
|
||
& > .checkbox_size_s { | ||
font-size: 14px; | ||
} | ||
|
||
&_one-line { | ||
display: flex; | ||
} | ||
|
||
&_select { | ||
margin-left: 0; | ||
margin-bottom: 0; | ||
} | ||
|
||
&-description { | ||
font-size: 13px; | ||
padding-top: 3px; | ||
padding-bottom: 10px; | ||
} | ||
|
||
&__annotation { | ||
padding-left: 19px; | ||
} | ||
|
||
&-annotation-highlight { | ||
color: var(--danger-color); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
packages/ui/src/ui/containers/SettingsMenu/SettingsItemLayout.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import cn from 'bem-cn-lite'; | ||
|
||
import './SettingsItemLayout.scss'; | ||
|
||
const block = cn('yt-settings-item'); | ||
|
||
export type SettingsItemLayotProps = { | ||
children: React.ReactNode; | ||
|
||
title?: string; | ||
description?: React.ReactNode; | ||
oneLine?: boolean; | ||
}; | ||
|
||
export function SettingsItemLayot({title, children, description, oneLine}: SettingsItemLayotProps) { | ||
return ( | ||
<div | ||
className={block({ | ||
size: 's', | ||
'one-line': oneLine, | ||
})} | ||
title={title} | ||
> | ||
{children} | ||
<div className={block('annotation', 'elements-secondary-text')}>{description}</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-7.28 KB
(94%)
....base.screen.ts-snapshots/Components---Node---Memory-popup-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-884 Bytes
(99%)
...tions/operations.base.screen.ts-snapshots/Operation---Jobs-1-chromium-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.