Skip to content

Commit

Permalink
[Logs onboarding] replace euiThemeVars usage (#157729)
Browse files Browse the repository at this point in the history
This Pr is a follow up of
[PR#157008](#157008) and
[PR#157147](#157147).

Changes:

1. Replaced usage of `euiThemeVars` by `useEuiTheme` and
`useEuiFontSize`.
2. e2e cloudId following [cloud plugin
format](https://github.com/elastic/kibana/tree/main/x-pack/plugins/cloud#cloudid).
  • Loading branch information
yngrdyn authored May 15, 2023
1 parent 23682d2 commit 37d9db0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion x-pack/plugins/observability_onboarding/e2e/ftr_kibana.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
xpack.observability_onboarding.ui.enabled: true

xpack.cloud.id: 'foo'
xpack.cloud.id: 'myDeployment:03ce773830e104e139243c8f053c974d'
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,11 @@ import {
EuiSpacer,
EuiText,
EuiTextArea,
useEuiFontSize,
useEuiTheme,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n-react';
import { euiThemeVars } from '@kbn/ui-theme';
import React, { useState } from 'react';
import { useWizard } from '.';
import { OptionalFormRow } from '../../../shared/optional_form_row';
Expand All @@ -35,6 +36,9 @@ import {
import { getFilename, replaceSpecialChars } from './get_filename';

export function ConfigureLogs() {
const { euiTheme } = useEuiTheme();
const xsFontSize = useEuiFontSize('xs').fontSize;

const { goToStep, goBack, getState, setState } = useWizard();
const wizardState = getState();
const [datasetName, setDatasetName] = useState(wizardState.datasetName);
Expand Down Expand Up @@ -196,13 +200,13 @@ export function ConfigureLogs() {
id="advancedSettingsAccordion"
css={{
'.euiAccordion__buttonContent': {
color: euiThemeVars.euiColorPrimaryText,
fontSize: euiThemeVars.euiFontSizeXS,
color: euiTheme.colors.primaryText,
fontSize: xsFontSize,
},
'.euiAccordion__iconButton svg': {
stroke: euiThemeVars.euiButtonTypes.primary,
width: euiThemeVars.euiSizeM,
height: euiThemeVars.euiSizeM,
stroke: euiTheme.colors.primary,
width: euiTheme.size.m,
height: euiTheme.size.m,
},
}}
buttonContent={i18n.translate(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@ import {
EuiFlexItem,
EuiFormRow,
EuiFormRowProps,
useEuiTheme,
} from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { euiThemeVars } from '@kbn/ui-theme';
import React from 'react';

type OptionalFormRowProps = EuiFormRowProps;

export function OptionalFormRow(props: OptionalFormRowProps) {
const { euiTheme } = useEuiTheme();

const { label, children, helpText } = props;
return (
<EuiFormRow
Expand All @@ -27,7 +29,7 @@ export function OptionalFormRow(props: OptionalFormRowProps) {
},
'.euiFormLabel > .euiFlexGroup > div:last-of-type': {
fontWeight: 'normal',
color: euiThemeVars.euiTextSubduedColor,
color: euiTheme.colors.subduedText,
},
}}
label={
Expand Down

0 comments on commit 37d9db0

Please sign in to comment.