Skip to content

Commit 2e6051b

Browse files
fix: use blue color only for not replicated vdisks (#2110)
1 parent 06d243d commit 2e6051b

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/utils/disks/__test__/calculateVDiskSeverity.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,20 @@ describe('VDisk state', () => {
111111
expect(severity).not.toEqual(DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Blue);
112112
});
113113

114+
test('Should not display VDisk as replicating if DiskSpace or FrontQueues are blue', () => {
115+
const severity1 = calculateVDiskSeverity({
116+
VDiskState: EVDiskState.OK,
117+
FrontQueues: EFlag.Blue,
118+
});
119+
const severity2 = calculateVDiskSeverity({
120+
VDiskState: EVDiskState.OK,
121+
DiskSpace: EFlag.Blue,
122+
});
123+
124+
expect(severity1).not.toEqual(DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Blue);
125+
expect(severity2).not.toEqual(DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Blue);
126+
});
127+
114128
test('Should display replicating VDisks in a not-OK state with a regular color', () => {
115129
const severity1 = calculateVDiskSeverity({
116130
VDiskState: EVDiskState.Initial, // severity 3, yellow

src/utils/disks/calculateVDiskSeverity.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {EFlag} from '../../types/api/enums';
1+
import {EFlag} from '../../types/api/enums';
22
import type {EVDiskState} from '../../types/api/vdisk';
33

44
import {
@@ -52,5 +52,10 @@ function getColorSeverity(color?: EFlag) {
5252
return NOT_AVAILABLE_SEVERITY;
5353
}
5454

55+
// Blue is reserved for not replicated VDisks
56+
if (color === EFlag.Blue) {
57+
return DISK_COLOR_STATE_TO_NUMERIC_SEVERITY.Green;
58+
}
59+
5560
return DISK_COLOR_STATE_TO_NUMERIC_SEVERITY[color] ?? NOT_AVAILABLE_SEVERITY;
5661
}

0 commit comments

Comments
 (0)