Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[One Discover] Update log.level indicators color #202985

Merged
merged 10 commits into from
Dec 12, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { LogLevelCoalescedValue } from './get_log_level_coalesed_value';

const euiTheme = {
colors: {
lightShade: '#ffffff',
mediumShade: '#d3dae6',
},
};

Expand All @@ -32,20 +32,20 @@ describe('getLogLevelColor', () => {
'#d6bf57'
);
expect(getLogLevelColor(LogLevelCoalescedValue.error, euiTheme as EuiThemeComputed)).toBe(
'#df9352'
'#e7664c'
);
expect(getLogLevelColor(LogLevelCoalescedValue.critical, euiTheme as EuiThemeComputed)).toBe(
'#e7664c'
'#dc5640'
);
expect(getLogLevelColor(LogLevelCoalescedValue.alert, euiTheme as EuiThemeComputed)).toBe(
'#da5e47'
'#d24635'
);
expect(getLogLevelColor(LogLevelCoalescedValue.emergency, euiTheme as EuiThemeComputed)).toBe(
'#cc5642'
'#c73729'
);
// other
expect(getLogLevelColor(LogLevelCoalescedValue.trace, euiTheme as EuiThemeComputed)).toBe(
'#ffffff'
'#d3dae6'
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export const getLogLevelColor = (
const euiPaletteForStatus9 = euiPaletteForStatus(9);

switch (logLevelCoalescedValue) {
case LogLevelCoalescedValue.trace:
return euiTheme.colors.mediumShade;
tonyghiani marked this conversation as resolved.
Show resolved Hide resolved
case LogLevelCoalescedValue.debug:
return euiPaletteForTemperature6[2]; // lighter, closer to the default color for all other unknown log levels
case LogLevelCoalescedValue.info:
Expand All @@ -27,15 +29,16 @@ export const getLogLevelColor = (
case LogLevelCoalescedValue.warning:
return euiPaletteForStatus9[4];
case LogLevelCoalescedValue.error:
return euiPaletteForStatus9[5];
case LogLevelCoalescedValue.critical:
return euiPaletteForStatus9[6];
case LogLevelCoalescedValue.critical:
return '#dc5640'; // This hardcoded value doesn't correspond to any token, it will be updated in v9 with an appropriate token-based scale for borealis theme
case LogLevelCoalescedValue.alert:
return euiPaletteForStatus9[7];
return '#d24635'; // This hardcoded value doesn't correspond to any token, it will be updated in v9 with an appropriate token-based scale for borealis theme
case LogLevelCoalescedValue.emergency:
return '#c73729'; // This hardcoded value doesn't correspond to any token, it will be updated in v9 with an appropriate token-based scale for borealis theme
case LogLevelCoalescedValue.fatal:
return euiPaletteForStatus9[8];
return euiTheme.colors.danger;
default:
return euiTheme.colors.lightShade;
return euiTheme.colors.mediumShade;
}
};