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 v86.0.0 #163088

Merged
merged 41 commits into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
eac35c2
Upgrading EUI to version 86.0.0 with React 18.
1Copenut Aug 3, 2023
cf58be3
Updated Shared UX Markdown snapshot.
1Copenut Aug 3, 2023
dc7f1a2
Fixing typings for drag and drop.
1Copenut Aug 3, 2023
06f9b83
Typing a few instances in one test file.
1Copenut Aug 4, 2023
400f21a
Merge branch 'main' into eui/v86.0.0
1Copenut Aug 7, 2023
2380db2
Updating two test files for typing.
1Copenut Aug 7, 2023
7a44e7b
fix: update cellActions FC return types to return null instead of false
tkajtoch Aug 7, 2023
78835ee
fix: convert rule_tag_badge.test.tsx open and close popover test to rtl
tkajtoch Aug 7, 2023
3943c5e
Updating more drag and drop typing to latest EUI.
1Copenut Aug 8, 2023
2998f06
Merge branch 'main' into eui/v86.0.0
1Copenut Aug 8, 2023
2cdad75
Updating a Pick type for Observability.
1Copenut Aug 8, 2023
a3a4ddf
Update x-pack/plugins/lens/public/visualizations/datatable/components…
tkajtoch Aug 8, 2023
952da52
Updating more drag and drop, test types.
1Copenut Aug 8, 2023
096f122
add type cast for dataTableCellAction() return type in test suite
tkajtoch Aug 9, 2023
f4028c1
Updating two drag and drop module imports.
1Copenut Aug 9, 2023
c965374
replace react-beautiful-dnd with its fork @hello-pangea/dnd
tkajtoch Aug 9, 2023
29947e5
fix kbn-ui-shared-deps-npm and kbn-ui-shared-deps-src
tkajtoch Aug 9, 2023
26eca2b
Updating three Jest snapshots.
1Copenut Aug 9, 2023
cad458a
Merge branch 'main' into eui/v86.0.0
1Copenut Aug 9, 2023
e393b01
Merge branch 'eui/v86.0.0' of github.com:1Copenut/kibana into eui/v86…
1Copenut Aug 9, 2023
9d8524c
fix: import Position type from css-box-model
tkajtoch Aug 9, 2023
d3d2e0d
fix: use findByTestId to wait for cancel button to appear
tkajtoch Aug 9, 2023
45f2f7a
Remapped types for 5 files.
1Copenut Aug 9, 2023
7d88e63
Merge branch 'main' into eui/v86.0.0
1Copenut Aug 9, 2023
b19385f
Merging upstream/main.
1Copenut Aug 9, 2023
d8d1a41
Re-running yarn.lock after pulling upstream/main.
1Copenut Aug 9, 2023
3f3e0bb
Updated types for DraggableStateSnapshot in 2 files.
1Copenut Aug 10, 2023
0b33a44
Adjusting a test param I switched accidentally while updating types.
1Copenut Aug 10, 2023
e7b5efc
Updating deprecated EuiPaletteComplimentary.
1Copenut Aug 10, 2023
c8934a5
Swapping an any type for Enzyme ShallowWrapper.
1Copenut Aug 10, 2023
99a063f
Updating multi_field_selector.test EuiBasicTableColumn type to object.
1Copenut Aug 10, 2023
607f2b1
Updated dimension_panel.test to dry out label types.
1Copenut Aug 10, 2023
1957598
Updated hard-coded types to use EuiComboBoxOptionOption type.
1Copenut Aug 10, 2023
c14b7bd
Updating two tests to use EuiComboBoxOptionOption type.
1Copenut Aug 10, 2023
c23d63b
Main merge after resolving yarn.lock conflict.
1Copenut Aug 10, 2023
4b7fe3d
Updated yarn.lock file after merging upstream/main.
1Copenut Aug 10, 2023
3bd5160
update DND error message issue references
drewdaemon Aug 14, 2023
9036ea7
get field select combo box
drewdaemon Aug 14, 2023
3385547
Merge pull request #1 from drewdaemon/visualization-suggestions
1Copenut Aug 14, 2023
ce79303
Merge branch 'main' into eui/v86.0.0
1Copenut Aug 14, 2023
f3cad3b
Adding a type to referece_editor.test.tsx.
1Copenut Aug 14, 2023
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
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"@elastic/datemath": "5.0.3",
"@elastic/elasticsearch": "npm:@elastic/[email protected]",
"@elastic/ems-client": "8.4.0",
"@elastic/eui": "85.1.0",
"@elastic/eui": "86.0.0",
"@elastic/filesaver": "1.1.2",
"@elastic/node-crypto": "1.2.1",
"@elastic/numeral": "^2.5.1",
Expand All @@ -123,6 +123,7 @@
"@hapi/hoek": "^9.2.1",
"@hapi/inert": "^6.0.4",
"@hapi/wreck": "^17.1.0",
"@hello-pangea/dnd": "^16.3.0",
"@juggle/resize-observer": "^3.4.0",
"@kbn/aad-fixtures-plugin": "link:x-pack/test/alerting_api_integration/common/plugins/aad",
"@kbn/ace": "link:packages/kbn-ace",
Expand Down Expand Up @@ -824,6 +825,7 @@
"copy-to-clipboard": "^3.0.8",
"core-js": "^3.31.0",
"cronstrue": "^1.51.0",
"css-box-model": "^1.2.1",
"cuid": "^2.1.8",
"cytoscape": "^3.10.0",
"cytoscape-dagre": "^2.2.2",
Expand Down Expand Up @@ -943,7 +945,6 @@
"re2": "1.20.1",
"react": "^17.0.2",
"react-ace": "^7.0.5",
"react-beautiful-dnd": "^13.1.0",
"react-color": "^2.13.8",
"react-dom": "^17.0.2",
"react-dropzone": "^4.2.9",
Expand Down Expand Up @@ -1329,7 +1330,6 @@
"@types/prop-types": "^15.7.5",
"@types/rbush": "^3.0.0",
"@types/react": "^17.0.45",
"@types/react-beautiful-dnd": "^13.0.0",
"@types/react-dom": "^17.0.17",
"@types/react-grid-layout": "^1.3.2",
"@types/react-intl": "^2.3.15",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* `react-beautiful-dnd` relies on `transition` for functionality
* `@hello-pangea/dnd` relies on `transition` for functionality
* https://github.com/elastic/kibana/issues/95133
*/
*:not(.essentialAnimation):not([data-rbd-draggable-context-id]):not([data-rbd-droppable-context-id]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Side Public License, v 1.
*/

import type { DropResult } from 'react-beautiful-dnd';
import type { DropResult } from '@hello-pangea/dnd';

export const draggableIdPrefix = 'draggableId';

Expand Down
4 changes: 3 additions & 1 deletion packages/kbn-ui-shared-deps-npm/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ SRCS = glob(

# deps needed when importing this module from another location
RUNTIME_DEPS = [
"@npm//babel-loader",
"@npm//@babel/plugin-proposal-optional-chaining",
"@npm//loader-utils",
"@npm//val-loader",
"//packages/kbn-repo-info",
Expand All @@ -40,6 +42,7 @@ RUNTIME_DEPS = [
"@npm//@elastic/numeral",
"@npm//@emotion/cache",
"@npm//@emotion/react",
"@npm//@hello-pangea/dnd",
"@npm//@tanstack/react-query",
"@npm//@tanstack/react-query-devtools",
"@npm//classnames",
Expand All @@ -49,7 +52,6 @@ RUNTIME_DEPS = [
"@npm//lodash",
"@npm//moment-timezone",
"@npm//react-ace",
"@npm//react-beautiful-dnd",
"@npm//react-dom",
"@npm//react-router-dom",
"@npm//react-router-dom-v5-compat",
Expand Down
15 changes: 14 additions & 1 deletion packages/kbn-ui-shared-deps-npm/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ module.exports = (_, argv) => {
'@elastic/numeral',
'@emotion/cache',
'@emotion/react',
'@hello-pangea/dnd/dist/dnd.js',
'@tanstack/react-query',
'@tanstack/react-query-devtools',
'classnames',
Expand All @@ -96,7 +97,6 @@ module.exports = (_, argv) => {
'moment-timezone/data/packed/latest.json',
'moment',
'react-ace',
'react-beautiful-dnd',
'react-dom',
'react-dom/server',
'react-router-dom',
Expand Down Expand Up @@ -138,6 +138,19 @@ module.exports = (_, argv) => {
},
],
},
// @hello-pangea/dnd emits optional chaining that confuses webpack.
// We need to transform it using babel before going further
{
test: /@hello-pangea\/dnd\/dist\/dnd\.js$/,
use: [
{
loader: 'babel-loader',
options: {
plugins: [require.resolve('@babel/plugin-proposal-optional-chaining')],
},
},
],
},
{
test: /\.css$/,
use: [MiniCssExtractPlugin.loader, 'css-loader'],
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-ui-shared-deps-src/src/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const externals = {
'@elastic/eui/dist/eui_charts_theme': '__kbnSharedDeps__.ElasticEuiChartsTheme',

// transient dep of eui
'react-beautiful-dnd': '__kbnSharedDeps__.ReactBeautifulDnD',
'@hello-pangea/dnd': '__kbnSharedDeps__.HelloPangeaDnd',
lodash: '__kbnSharedDeps__.Lodash',
'lodash/fp': '__kbnSharedDeps__.LodashFp',
fflate: '__kbnSharedDeps__.Fflate',
Expand Down
2 changes: 1 addition & 1 deletion packages/kbn-ui-shared-deps-src/src/entry.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const ElasticEuiLibServices = require('@elastic/eui/optimize/es/services'
export const ElasticEuiLibServicesFormat = require('@elastic/eui/optimize/es/services/format');
export const ElasticEuiChartsTheme = require('@elastic/eui/dist/eui_charts_theme');
export const KbnDatemath = require('@kbn/datemath');
export const ReactBeautifulDnD = require('react-beautiful-dnd');
export const HelloPangeaDnd = require('@hello-pangea/dnd/dist/dnd');

export const Lodash = require('lodash');
export const LodashFp = require('lodash/fp');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

import React from 'react';
import type { DraggableProvided } from 'react-beautiful-dnd';
import type { DraggableProvided } from '@hello-pangea/dnd';

export interface BucketContainerProps {
children: React.ReactNode;
Expand Down

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

2 changes: 1 addition & 1 deletion src/dev/license_checker/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export const LICENSE_OVERRIDES = {
'[email protected]': ['Eclipse Distribution License - v 1.0'], // cf. https://github.com/bjornharrtell/jsts
'@mapbox/[email protected]': ['MIT'], // license in readme https://github.com/tmcw/jsonlint
'@elastic/[email protected]': ['Elastic License 2.0'],
'@elastic/eui@85.1.0': ['SSPL-1.0 OR Elastic License 2.0'],
'@elastic/eui@86.0.0': ['SSPL-1.0 OR Elastic License 2.0'],
'[email protected]': ['CC-BY-4.0'], // retired ODC‑By license https://github.com/mattcg/language-subtag-registry
'[email protected]': ['MIT'], // license in importing module https://www.npmjs.com/package/binary
};
4 changes: 2 additions & 2 deletions src/plugins/charts/public/services/palettes/palettes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
euiPaletteWarm,
euiPaletteForStatus,
euiPaletteForTemperature,
euiPaletteComplimentary,
euiPaletteComplementary,
euiPaletteColorBlindBehindText,
} from '@elastic/eui';
import type { ChartColorConfiguration, PaletteDefinition, SeriesLayer } from '@kbn/coloring';
Expand Down Expand Up @@ -277,7 +277,7 @@ export const buildPalettes: (
title: i18n.translate('charts.palettes.complimentaryLabel', {
defaultMessage: 'Complimentary',
}),
...buildGradient('complimentary', euiPaletteComplimentary),
...buildGradient('complimentary', euiPaletteComplementary),
},
negative: {
title: i18n.translate('charts.palettes.negativeLabel', { defaultMessage: 'Negative' }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { I18nProvider } from '@kbn/i18n-react';
import { DeprecatedCellValueElementProps } from '@kbn/timelines-plugin/common';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import React from 'react';
import { DragDropContext, DropResult, ResponderProvided } from 'react-beautiful-dnd';
import { DragDropContext, DropResult, ResponderProvided } from '@hello-pangea/dnd';
// eslint-disable-next-line @kbn/eslint/module_migration
import { ThemeProvider } from 'styled-components';
import { Provider as ReduxStoreProvider } from 'react-redux';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import { euiDarkVars } from '@kbn/ui-theme';
import { I18nProvider } from '@kbn/i18n-react';

import React from 'react';
import type { DropResult, ResponderProvided } from 'react-beautiful-dnd';
import { DragDropContext } from 'react-beautiful-dnd';
import type { DropResult, ResponderProvided } from '@hello-pangea/dnd';
import { DragDropContext } from '@hello-pangea/dnd';
import { Provider as ReduxStoreProvider } from 'react-redux';
import type { Store } from 'redux';
import { ThemeProvider } from 'styled-components';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface Props {
operation: string;
type: string;
probe: string;
providedDragHandleProps?: DraggableProvidedDragHandleProps;
providedDragHandleProps?: DraggableProvidedDragHandleProps | null;
onDelete: (discoveryItemId: string) => void;
onEdit: (discoveryItemId: string) => void;
operationTypes: Operation[];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,13 @@ describe('CrawlRequestsTable', () => {
const table = wrapper.find(EuiBasicTable);
const columns = table.prop('columns');

// @ts-expect-error 4.3.5 upgrade
const crawlID = shallow(columns[0].render('618d0e66abe97bc688328900', { stage: 'crawl' }));
expect(crawlID.text()).toContain('618d0e66abe97bc688328900');

crawlID.simulate('click');
expect(actions.fetchCrawlRequest).toHaveBeenCalledWith('618d0e66abe97bc688328900');
expect(actions.openFlyout).toHaveBeenCalled();

// @ts-expect-error 4.3.5 upgrade
const processCrawlID = shallow(columns[0].render('54325423aef7890543', { stage: 'process' }));
expect(processCrawlID.text()).toContain('54325423aef7890543');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import { setMockValues } from '../../../../../__mocks__/kea_logic';

import React from 'react';
import { DraggableProvidedDragHandleProps } from 'react-beautiful-dnd';

import type { DraggableProvidedDragHandleProps } from '@hello-pangea/dnd';

import { shallow, ShallowWrapper } from 'enzyme';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
*/

import React from 'react';
import { DraggableProvidedDragHandleProps } from 'react-beautiful-dnd';

import type { DraggableProvidedDragHandleProps } from '@hello-pangea/dnd';

import { useValues } from 'kea';

Expand All @@ -18,7 +19,7 @@ import { ResultAction } from '../../../result/types';

interface Props {
actions: ResultAction[];
dragHandleProps?: DraggableProvidedDragHandleProps;
dragHandleProps?: DraggableProvidedDragHandleProps | null;
result: SearchResult;
index?: number;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ describe('IgnoredQueriesPanel', () => {
});

it('show a query', () => {
// @ts-expect-error 4.3.5 upgrade
const column = getColumn(0).render('test query');
expect(column).toEqual('test query');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import { mockKibanaValues } from '../../../__mocks__/kea_logic';

import React from 'react';
import { DraggableProvidedDragHandleProps } from 'react-beautiful-dnd';

import type { DraggableProvidedDragHandleProps } from '@hello-pangea/dnd';

import { shallow, ShallowWrapper } from 'enzyme';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
*/

import React, { useState, useMemo } from 'react';
import { DraggableProvidedDragHandleProps } from 'react-beautiful-dnd';

import type { DraggableProvidedDragHandleProps } from '@hello-pangea/dnd';

import './result.scss';

Expand Down Expand Up @@ -34,7 +35,7 @@ interface Props {
shouldLinkToDetailPage?: boolean;
schemaForTypeHighlights?: Schema | AdvancedSchema;
actions?: ResultAction[];
dragHandleProps?: DraggableProvidedDragHandleProps;
dragHandleProps?: DraggableProvidedDragHandleProps | null;
showClick?: boolean;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import '../../../../../shared/doc_links/__mocks__/doc_links.mock';

import React from 'react';

import { shallow } from 'enzyme';
import { shallow, ShallowWrapper } from 'enzyme';

import { EuiContextMenuItem, EuiContextMenuPanel } from '@elastic/eui';

Expand Down Expand Up @@ -85,11 +85,11 @@ describe('ClientLibrariesPopover', () => {
wrapper
.find(EuiContextMenuPanel)
.prop('items')
?.map((item) => shallow(<div>{item}</div>)) || [];
?.map((item: HTMLElement) => shallow(<div>{item}</div>)) || [];

expect(contextMenuItems.length > 0).toBeTruthy();

contextMenuItems.forEach((item, index) => {
contextMenuItems.forEach((item: ShallowWrapper, index: number) => {
const menuItem = item.find(EuiContextMenuItem);
expect(menuItem.prop('href')).toEqual(librariesList[index].href);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,14 +83,12 @@ describe('CrawlRequestsTable', () => {
const table = wrapper.find(EuiBasicTable);
const columns = table.prop('columns');

// @ts-expect-error 4.3.5 upgrade
const crawlID = shallow(columns[0].render('618d0e66abe97bc688328900', { stage: 'crawl' }));
expect(crawlID.text()).toContain('618d0e66abe97bc688328900');

crawlID.simulate('click');
expect(actions.fetchCrawlRequest).toHaveBeenCalledWith('618d0e66abe97bc688328900');

// @ts-expect-error 4.3.5 upgrade
const processCrawlID = shallow(columns[0].render('54325423aef7890543', { stage: 'process' }));
expect(processCrawlID.text()).toContain('54325423aef7890543');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ import React from 'react';

import { shallow } from 'enzyme';

import { EuiBasicTable, EuiButton, EuiComboBox, EuiFieldText } from '@elastic/eui';
import {
EuiBasicTable,
EuiBasicTableColumn,
EuiButton,
EuiComboBox,
EuiFieldText,
} from '@elastic/eui';

import { MultiFieldMapping, SelectedFieldMappings } from './multi_field_selector';

Expand Down Expand Up @@ -180,7 +186,7 @@ describe('SelectedFieldMappings', () => {

expect(wrapper.find(EuiBasicTable)).toHaveLength(1);
const table = wrapper.find(EuiBasicTable);
expect(table.prop('columns').map((c) => c.name)).toEqual([
expect(table.prop('columns').map((c: EuiBasicTableColumn<{}>) => c.name)).toEqual([
'Source text field',
'',
'Target field',
Expand Down
Loading