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

Upgrade EUI to v95.4.0 #188865

Merged
merged 5 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"@elastic/ecs": "^8.11.1",
"@elastic/elasticsearch": "^8.14.0",
"@elastic/ems-client": "8.5.3",
"@elastic/eui": "95.3.0",
"@elastic/eui": "95.4.0",
"@elastic/filesaver": "1.1.2",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.1",
Expand Down
2 changes: 1 addition & 1 deletion src/dev/license_checker/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export const LICENSE_OVERRIDES = {
'jsts@1.6.2': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts
'@mapbox/jsonlint-lines-primitives@2.0.2': ['MIT'], // license in readme https://github.com/tmcw/jsonlint
'@elastic/ems-client@8.5.3': ['Elastic License 2.0'],
'@elastic/eui@95.3.0': ['SSPL-1.0 OR Elastic License 2.0'],
'@elastic/eui@95.4.0': ['SSPL-1.0 OR Elastic License 2.0'],
'language-subtag-registry@0.3.21': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry
'buffers@0.1.1': ['MIT'], // license in importing module https://www.npmjs.com/package/binary
'@bufbuild/protobuf@1.2.1': ['Apache-2.0'], // license (Apache-2.0 AND BSD-3-Clause)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ describe('helpers', () => {
</TestProviders>
);

expect(screen.getByTestId('incompatibleStat')).toHaveTextContent('-- --'); // the euiScreenReaderOnly content renders an additional set of --
expect(screen.getByTestId('incompatibleStat')).toHaveTextContent('--');
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import type { FC } from 'react';
import React, { useMemo } from 'react';

import type { EuiBasicTableColumn } from '@elastic/eui';
import { type EuiBasicTableColumn, useEuiTheme } from '@elastic/eui';
import { EuiSpacer, EuiInMemoryTable, EuiButtonIcon, EuiToolTip } from '@elastic/eui';

import { i18n } from '@kbn/i18n';
Expand Down Expand Up @@ -41,6 +41,7 @@ export const JobMessages: FC<JobMessagesProps> = ({
refreshMessage,
actionHandler,
}) => {
const { euiTheme } = useEuiTheme();
const { showNodeInfo } = useEnabledFeatures();
const columns: Array<EuiBasicTableColumn<JobMessage>> = useMemo(() => {
const cols: Array<EuiBasicTableColumn<JobMessage>> = [
Expand All @@ -65,7 +66,7 @@ export const JobMessages: FC<JobMessagesProps> = ({
''
),
render: (message: JobMessage) => <JobIcon message={message} />,
width: '6%',
width: `${euiTheme.size.l}`,
},
{
field: 'timestamp',
Expand Down Expand Up @@ -130,7 +131,7 @@ export const JobMessages: FC<JobMessagesProps> = ({
}

return cols;
}, [showNodeInfo, refreshMessage, actionHandler]);
}, [showNodeInfo, refreshMessage, actionHandler, euiTheme]);

const defaultSorting = {
sort: {
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 @@ -7,6 +7,7 @@

import React from 'react';
import * as fetcherHook from '@kbn/observability-shared-plugin/public/hooks/use_fetcher';
import { screen } from '@elastic/eui/lib/test/rtl';
import { render, data as dataMock } from '../../../../../utils/test_helper';
import { CoreStart } from '@kbn/core/public';
import { ConfigSchema, ObservabilityPublicPluginsStart } from '../../../../../plugin';
Expand All @@ -31,6 +32,14 @@ jest.mock('react-router-dom', () => ({
const { ObservabilityAIAssistantContextualInsight } =
observabilityAIAssistantPluginMock.createStartContract();

const assertServiceStat = (description: string, stat: string) => {
const serviceStat = screen.getByTestSubject('apmServiceStat');

expect(serviceStat).toBeInTheDocument();
expect(serviceStat!.children[0]).toHaveTextContent(description);
expect(serviceStat!.children[1]).toHaveTextContent(stat);
};

describe('APMSection', () => {
const bucketSize = { intervalString: '60s', bucketSize: 60, dateFormat: 'YYYY-MM-DD HH:mm' };

Expand Down Expand Up @@ -90,7 +99,7 @@ describe('APMSection', () => {

expect(getByRole('heading')).toHaveTextContent('Services');
expect(getByText('Show service inventory')).toBeInTheDocument();
expect(getByText('Services 11')).toBeInTheDocument();
assertServiceStat('Services', '11');
expect(getByText('900.0 tpm')).toBeInTheDocument();
expect(queryAllByTestId('loading')).toEqual([]);
});
Expand All @@ -107,7 +116,7 @@ describe('APMSection', () => {

expect(getByRole('heading')).toHaveTextContent('Services');
expect(getByText('Show service inventory')).toBeInTheDocument();
expect(getByText('Services 11')).toBeInTheDocument();
assertServiceStat('Services', '11');
expect(getByText('312.00k tpm')).toBeInTheDocument();
expect(queryAllByTestId('loading')).toEqual([]);
});
Expand All @@ -117,14 +126,14 @@ describe('APMSection', () => {
status: fetcherHook.FETCH_STATUS.LOADING,
refetch: jest.fn(),
});
const { getByRole, queryAllByText, getByTestId } = render(
const { getByRole, queryAllByText, getByTestId, getAllByLabelText } = render(
<APMSection bucketSize={bucketSize} />
);

expect(getByRole('heading')).toHaveTextContent('Services');
expect(getByTestId('loading')).toBeInTheDocument();
expect(queryAllByText('Show service inventory')).toEqual([]);
expect(queryAllByText('Services 11')).toEqual([]);
expect(getAllByLabelText('Statistic is loading').length).toEqual(2);
expect(queryAllByText('312.00k tpm')).toEqual([]);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ export function APMSection({ bucketSize }: Props) {
defaultMessage: 'Services',
})}
isLoading={isLoading}
data-test-subj="apmServiceStat"
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React, { type FC } from 'react';
import { css } from '@emotion/react';

import { useEuiTheme, EuiTabbedContent } from '@elastic/eui';
import { EuiTabbedContent } from '@elastic/eui';

import { i18n } from '@kbn/i18n';
import { stringHash } from '@kbn/ml-string-hash';
Expand All @@ -30,7 +30,6 @@ interface Props {
}

export const ExpandedRow: FC<Props> = ({ item, onAlertEdit }) => {
const { euiTheme } = useEuiTheme();
const tabId = stringHash(item.id);

const tabs = [
Expand Down Expand Up @@ -113,8 +112,7 @@ export const ExpandedRow: FC<Props> = ({ item, onAlertEdit }) => {
onTabClick={() => {}}
expand={false}
css={css`
margin-left: -${euiTheme.size.xl};
width: calce(100% + ${euiTheme.size.xl});
width: 100%;

.euiTable {
background-color: transparent;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const ExpandedRowMessagesPane: FC<ExpandedRowMessagesPaneProps> = ({ tran
''
),
render: (message: TransformMessage) => (
<div css={{ marginLeft: `-${euiTheme.base * 1.75}px` }}>
<div css={{ margin: 'auto' }}>
<JobIcon message={message} />
</div>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ describe('RulesListTableStatusCell', () => {
});

it('should render loading indicator for new rules', async () => {
const { getByText } = render(
const { getByLabelText } = render(
<ComponentWithLocale
rule={
{
Expand All @@ -137,7 +137,7 @@ describe('RulesListTableStatusCell', () => {
/>
);

expect(getByText('Statistic is loading')).not.toBe(null);
expect(getByLabelText('Statistic is loading')).not.toBe(null);
});

it('should render rule with no last run', async () => {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1752,10 +1752,10 @@
resolved "https://registry.yarnpkg.com/@elastic/eslint-plugin-eui/-/eslint-plugin-eui-0.0.2.tgz#56b9ef03984a05cc213772ae3713ea8ef47b0314"
integrity sha512-IoxURM5zraoQ7C8f+mJb9HYSENiZGgRVcG4tLQxE61yHNNRDXtGDWTZh8N1KIHcsqN1CEPETjuzBXkJYF/fDiQ==

"@elastic/eui@95.3.0":
version "95.3.0"
resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-95.3.0.tgz#b880012120f748e71bc2c1e4dbcf5acd514f043e"
integrity sha512-KKe2Yuswm0pnOpEnFdWjnekOqFQpN1rlWLp4MPLQwHTc9hMIujiRfOo66RGgc4K3p8qWhyRl/DxbxXC+NnsKiQ==
"@elastic/eui@95.4.0":
version "95.4.0"
resolved "https://registry.yarnpkg.com/@elastic/eui/-/eui-95.4.0.tgz#57ac111c2a3e8125db244928a95787bbb2f318c8"
integrity sha512-UXmn+xgJj4pwq6MV7xMjM79GN+taTv7LBfrtRfurGwhkmvXJrOjMXWq+mfR8rU44lOS2R4AwzH5gcCBjAafLsA==
dependencies:
"@hello-pangea/dnd" "^16.6.0"
"@types/lodash" "^4.14.202"
Expand Down