Skip to content

Commit

Permalink
Merge branch 'main' into reporting-share-menu
Browse files Browse the repository at this point in the history
  • Loading branch information
rshen91 committed Aug 14, 2023
2 parents 8402beb + 83d9644 commit 17fe124
Show file tree
Hide file tree
Showing 70 changed files with 1,035 additions and 818 deletions.
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -98,7 +98,7 @@
"@elastic/datemath": "5.0.3",
"@elastic/elasticsearch": "npm:@elastic/elasticsearch@8.9.0",
"@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 @@ -825,6 +826,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 @@ -944,7 +946,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 @@ -1330,7 +1331,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
@@ -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
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
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
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
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
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
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
Expand Up @@ -85,7 +85,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.4.0': ['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'],
'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
};
4 changes: 2 additions & 2 deletions src/plugins/charts/public/services/palettes/palettes.tsx
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
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
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
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
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
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
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
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
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
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
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
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
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

0 comments on commit 17fe124

Please sign in to comment.