Skip to content

Commit 25c513e

Browse files
authored
fix: updated fallback color (#10525)
* fix: updated fallback color * fix: updated testcase
1 parent ae71f26 commit 25c513e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

frontend/src/container/LogsExplorerChart/__tests__/frequencyGraphColor.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { getColorsForSeverityLabels, isRedLike } from '../utils';
44

55
describe('getColorsForSeverityLabels', () => {
66
it('should return slate for blank labels', () => {
7-
expect(getColorsForSeverityLabels('', 0)).toBe(Color.BG_SLATE_300);
8-
expect(getColorsForSeverityLabels(' ', 0)).toBe(Color.BG_SLATE_300);
7+
expect(getColorsForSeverityLabels('', 0)).toBe(Color.BG_VANILLA_400);
8+
expect(getColorsForSeverityLabels(' ', 0)).toBe(Color.BG_VANILLA_400);
99
});
1010

1111
it('should return correct colors for known severity variants', () => {

frontend/src/container/LogsExplorerChart/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export function getColorsForSeverityLabels(
7979
const trimmed = label.trim();
8080

8181
if (!trimmed) {
82-
return Color.BG_SLATE_300;
82+
return Color.BG_VANILLA_400; // Default color for empty labels
8383
}
8484

8585
const variantColor = SEVERITY_VARIANT_COLORS[trimmed];
@@ -119,6 +119,6 @@ export function getColorsForSeverityLabels(
119119

120120
return (
121121
SAFE_FALLBACK_COLORS[index % SAFE_FALLBACK_COLORS.length] ||
122-
Color.BG_SLATE_400
122+
Color.BG_VANILLA_400
123123
);
124124
}

0 commit comments

Comments
 (0)