Skip to content

Commit

Permalink
[EUI][INFRA] Updated hardcoded colors (elastic#204133)
Browse files Browse the repository at this point in the history
## Summary
This PR replaces a couple of places where hardcoded colors are used in
the Infra portion of Kibana with EUITheme colors.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

### Details
Below are before and after screenshots:

#### Inventory History

##### Before
<img width="721" alt="inventory history before"
src="https://github.com/user-attachments/assets/5dab5dee-aecd-4e81-8f4f-f838faeb2f66"
/>

##### After 
<img width="755" alt="Screenshot 2024-12-12 at 13 05 45"
src="https://github.com/user-attachments/assets/8d4b2d03-0326-4f69-b2b4-68550ebb6b0f"
/>


#### Alert Threshold & Alert Range annotation

##### Before 
<img width="2272" alt="Screenshot 2024-12-11 at 14 10 54"
src="https://github.com/user-attachments/assets/fa01cac2-62ff-451c-b191-5814a03840bc"
/>

##### After 
<img width="1220" alt="Screenshot 2024-12-12 at 12 58 32"
src="https://github.com/user-attachments/assets/eb4953ab-1c4d-42d1-b5ca-b5c16f0b41c5"
/>
  • Loading branch information
bryce-b authored Dec 18, 2024
1 parent ce8fa36 commit e991e6e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function createBaseLensDefinition<D extends {}>(
yConfig: [
{
forAccessor: '607b2253-ed20-4f0a-bf62-07a1f846cca4',
color: '#6092c0',
color: euiTheme.colors.vis.euiColorVis2,
},
],
},
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import {
transparentize,
useEuiTheme,
} from '@elastic/eui';
import chroma from 'chroma-js';

import { RuleConditionChart, TopAlert } from '@kbn/observability-plugin/public';
import { ALERT_END, ALERT_START, ALERT_EVALUATION_VALUES, ALERT_GROUP } from '@kbn/rule-data-utils';
Expand Down Expand Up @@ -90,7 +89,7 @@ export function AlertDetailsAppSection({ alert, rule }: AppSectionProps) {
timestamp: alertStart!,
endTimestamp: alertEnd ?? moment().toISOString(),
},
color: chroma(transparentize('#F04E981A', 0.2)).hex().toUpperCase(),
color: transparentize(euiTheme.colors.danger, 0.2),
id: `metric_threshold_${alertEnd ? 'recovered' : 'active'}_alert_range_annotation`,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import moment from 'moment';
import { first, last } from 'lodash';
import { EuiLoadingChart, EuiText, EuiEmptyPrompt, EuiButton } from '@elastic/eui';
import { EuiLoadingChart, EuiText, EuiEmptyPrompt, EuiButton, useEuiTheme } from '@elastic/eui';
import {
Axis,
Chart,
Expand Down Expand Up @@ -56,7 +56,7 @@ export const Timeline: React.FC<Props> = ({ interval, yAxisFormatter, isVisible
const { metric, nodeType, accountId, region } = useWaffleOptionsContext();
const { currentTime, jumpToTime, stopAutoReload } = useWaffleTimeContext();
const { filterQueryAsJson } = useWaffleFiltersContext();

const { euiTheme } = useEuiTheme();
const chartTheme = useTimelineChartTheme();

const { loading, error, startTime, endTime, timeseries, reload } = useTimeline(
Expand Down Expand Up @@ -238,7 +238,11 @@ export const Timeline: React.FC<Props> = ({ interval, yAxisFormatter, isVisible
<EuiFlexGroup gutterSize={'s'} alignItems={'center'} responsive={false}>
<EuiFlexItem
grow={false}
style={{ backgroundColor: '#D36086', height: 5, width: 10 }}
style={{
backgroundColor: euiTheme.colors.backgroundFilledAccent,
height: 5,
width: 10,
}}
/>
<EuiFlexItem>
<EuiText size={'xs'}>
Expand All @@ -261,7 +265,7 @@ export const Timeline: React.FC<Props> = ({ interval, yAxisFormatter, isVisible
dataValues={generateAnnotationData(
anomalies.map((a) => [a.startTime, a.influencers])
)}
style={{ fill: '#D36086' }}
style={{ fill: euiTheme.colors.backgroundFilledAccent }}
/>
)}
<MetricExplorerSeriesChart
Expand Down

0 comments on commit e991e6e

Please sign in to comment.