Skip to content

Commit 017c82a

Browse files
fix: replace EntityStatus with StatusIcon where possible (#1518)
1 parent a9f79a3 commit 017c82a

File tree

6 files changed

+19
-17
lines changed

6 files changed

+19
-17
lines changed

src/components/PDiskInfo/PDiskInfo.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import {formatStorageValuesToGb} from '../../utils/dataFormatters/dataFormatters
99
import {createPDiskDeveloperUILink} from '../../utils/developerUI/developerUI';
1010
import type {PreparedPDisk} from '../../utils/disks/types';
1111
import {useTypedSelector} from '../../utils/hooks';
12-
import {EntityStatus} from '../EntityStatus/EntityStatus';
1312
import type {InfoViewerItem} from '../InfoViewer';
1413
import {InfoViewer} from '../InfoViewer/InfoViewer';
1514
import {LinkWithIcon} from '../LinkWithIcon/LinkWithIcon';
1615
import {ProgressViewer} from '../ProgressViewer/ProgressViewer';
16+
import {StatusIcon} from '../StatusIcon/StatusIcon';
1717

1818
import {pDiskInfoKeyset} from './i18n';
1919

@@ -92,13 +92,13 @@ function getPDiskInfo<T extends PreparedPDisk>({
9292
if (valueIsDefined(Device)) {
9393
statusInfo.push({
9494
label: pDiskInfoKeyset('device'),
95-
value: <EntityStatus status={Device} />,
95+
value: <StatusIcon status={Device} />,
9696
});
9797
}
9898
if (valueIsDefined(Realtime)) {
9999
statusInfo.push({
100100
label: pDiskInfoKeyset('realtime'),
101-
value: <EntityStatus status={Realtime} />,
101+
value: <StatusIcon status={Realtime} />,
102102
});
103103
}
104104

src/components/StatusIcon/StatusIcon.scss

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
&__status-color,
3939
&__status-icon {
40+
display: inline-flex;
4041
flex-shrink: 0;
4142

4243
border-radius: 3px;

src/components/StorageGroupInfo/StorageGroupInfo.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import {valueIsDefined} from '../../utils';
55
import {formatStorageValuesToGb} from '../../utils/dataFormatters/dataFormatters';
66
import {formatToMs} from '../../utils/timeParsers';
77
import {bytesToSpeed} from '../../utils/utils';
8-
import {EntityStatus} from '../EntityStatus/EntityStatus';
98
import {InfoViewer} from '../InfoViewer';
109
import type {InfoViewerProps} from '../InfoViewer/InfoViewer';
1110
import {ProgressViewer} from '../ProgressViewer/ProgressViewer';
11+
import {StatusIcon} from '../StatusIcon/StatusIcon';
1212

1313
import {storageGroupInfoKeyset} from './i18n';
1414

@@ -70,7 +70,7 @@ export function StorageGroupInfo({data, className, ...infoViewerProps}: StorageG
7070
if (valueIsDefined(Overall)) {
7171
storageGroupInfoFirstColumn.push({
7272
label: storageGroupInfoKeyset('overall'),
73-
value: <EntityStatus status={Overall} />,
73+
value: <StatusIcon status={Overall} />,
7474
});
7575
}
7676
if (valueIsDefined(State)) {
@@ -113,13 +113,13 @@ export function StorageGroupInfo({data, className, ...infoViewerProps}: StorageG
113113
if (valueIsDefined(DiskSpace)) {
114114
storageGroupInfoSecondColumn.push({
115115
label: storageGroupInfoKeyset('disk-space'),
116-
value: <EntityStatus status={DiskSpace} />,
116+
value: <StatusIcon status={DiskSpace} />,
117117
});
118118
}
119119
if (valueIsDefined(Latency)) {
120120
storageGroupInfoSecondColumn.push({
121121
label: storageGroupInfoKeyset('latency'),
122-
value: <EntityStatus status={Latency} />,
122+
value: <StatusIcon status={Latency} />,
123123
});
124124
}
125125
if (valueIsDefined(LatencyPutTabletLogMs)) {

src/components/VDiskInfo/VDiskInfo.tsx

+5-4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {InfoViewer} from '../InfoViewer';
1515
import type {InfoViewerProps} from '../InfoViewer/InfoViewer';
1616
import {LinkWithIcon} from '../LinkWithIcon/LinkWithIcon';
1717
import {ProgressViewer} from '../ProgressViewer/ProgressViewer';
18+
import {StatusIcon} from '../StatusIcon/StatusIcon';
1819

1920
import {vDiskInfoKeyset} from './i18n';
2021

@@ -106,25 +107,25 @@ export function VDiskInfo<T extends PreparedVDisk>({
106107
if (valueIsDefined(DiskSpace)) {
107108
vdiskInfo.push({
108109
label: vDiskInfoKeyset('space-status'),
109-
value: <EntityStatus status={DiskSpace} />,
110+
value: <StatusIcon status={DiskSpace} />,
110111
});
111112
}
112113
if (valueIsDefined(SatisfactionRank?.FreshRank?.Flag)) {
113114
vdiskInfo.push({
114115
label: vDiskInfoKeyset('fresh-rank-satisfaction'),
115-
value: <EntityStatus status={SatisfactionRank?.FreshRank?.Flag} />,
116+
value: <StatusIcon status={SatisfactionRank?.FreshRank?.Flag} />,
116117
});
117118
}
118119
if (valueIsDefined(SatisfactionRank?.LevelRank?.Flag)) {
119120
vdiskInfo.push({
120121
label: vDiskInfoKeyset('level-rank-satisfaction'),
121-
value: <EntityStatus status={SatisfactionRank?.LevelRank?.Flag} />,
122+
value: <StatusIcon status={SatisfactionRank?.LevelRank?.Flag} />,
122123
});
123124
}
124125
if (valueIsDefined(FrontQueues)) {
125126
vdiskInfo.push({
126127
label: vDiskInfoKeyset('front-queues'),
127-
value: <EntityStatus status={FrontQueues} />,
128+
value: <StatusIcon status={FrontQueues} />,
128129
});
129130
}
130131
if (valueIsDefined(HasUnreadableBlobs)) {

src/containers/Node/NodeStructure/Pdisk.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import type {Column} from '@gravity-ui/react-data-table';
66
import {ArrowToggle, Button, Icon, Popover} from '@gravity-ui/uikit';
77
import isEmpty from 'lodash/isEmpty';
88

9-
import {EntityStatus} from '../../../components/EntityStatus/EntityStatus';
109
import {PDiskInfo} from '../../../components/PDiskInfo/PDiskInfo';
1110
import {ProgressViewer} from '../../../components/ProgressViewer/ProgressViewer';
11+
import {StatusIcon} from '../../../components/StatusIcon/StatusIcon';
1212
import {VDiskInfo} from '../../../components/VDiskInfo/VDiskInfo';
1313
import type {
1414
PreparedStructurePDisk,
@@ -107,7 +107,7 @@ function getColumns({
107107
width: 70,
108108
render: ({row}) => {
109109
return (
110-
<EntityStatus
110+
<StatusIcon
111111
status={row.VDiskState === EVDiskState.OK ? EFlag.Green : EFlag.Red}
112112
/>
113113
);
@@ -220,7 +220,7 @@ export function PDisk({
220220
<div className={b('pdisk')} id={id}>
221221
<div className={b('pdisk-header')}>
222222
<div className={b('pdisk-title-wrapper')}>
223-
<EntityStatus status={Device} />
223+
<StatusIcon status={Device} />
224224
<PDiskTitleBadge
225225
label="PDiskID"
226226
value={PDiskId}

src/containers/Storage/StorageGroups/columns/columns.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import DataTable from '@gravity-ui/react-data-table';
55
import {Icon, Label, Popover, PopoverBehavior} from '@gravity-ui/uikit';
66

77
import {CellWithPopover} from '../../../../components/CellWithPopover/CellWithPopover';
8-
import {EntityStatus} from '../../../../components/EntityStatus/EntityStatus';
98
import {InternalLink} from '../../../../components/InternalLink';
9+
import {StatusIcon} from '../../../../components/StatusIcon/StatusIcon';
1010
import {UsageLabel} from '../../../../components/UsageLabel/UsageLabel';
1111
import {VDiskWithDonorsStack} from '../../../../components/VDisk/VDiskWithDonorsStack';
1212
import {getStorageGroupPath} from '../../../../routes';
@@ -171,9 +171,9 @@ const limitColumn: StorageGroupsColumn = {
171171
const usedSpaceFlagColumn: StorageGroupsColumn = {
172172
name: STORAGE_GROUPS_COLUMNS_IDS.DiskSpace,
173173
header: STORAGE_GROUPS_COLUMNS_TITLES.DiskSpace,
174-
width: 110,
174+
width: 70,
175175
render: ({row}) => {
176-
return <EntityStatus status={row.DiskSpace} />;
176+
return <StatusIcon status={row.DiskSpace} />;
177177
},
178178
align: DataTable.CENTER,
179179
};

0 commit comments

Comments
 (0)