From a74bfe307b731318c513333dc6649d93b4a5a5df Mon Sep 17 00:00:00 2001 From: Chandler Prall Date: Fri, 20 Nov 2020 15:40:04 -0700 Subject: [PATCH 1/8] Updated to eui@30.4.1, fixed types and unit tests --- package.json | 2 +- .../header/__snapshots__/header.test.tsx.snap | 56 +- .../chrome/ui/header/header_help_menu.tsx | 1 - .../dashboard_empty_screen.test.tsx.snap | 4 +- .../actions/library_notification_popover.tsx | 1 - .../data/public/ui/filter_bar/filter_bar.tsx | 1 - .../query_string_input/language_switcher.tsx | 1 - .../saved_query_management_component.tsx | 1 - .../sidebar/change_indexpattern.tsx | 1 - .../components/sidebar/discover_field.tsx | 1 - .../sidebar/discover_field_search.test.tsx | 29 - .../sample_data_view_data_button.test.js.snap | 2 +- .../components/recently_accessed.js | 1 - .../__snapshots__/indices_list.test.tsx.snap | 10 +- .../inspector_panel.test.tsx.snap | 110 ++-- .../public/ui/inspector_view_chooser.tsx | 1 - .../__snapshots__/table.test.tsx.snap | 4 +- .../public/context_menu/open_context_menu.tsx | 1 - .../vislib/components/legend/legend_item.tsx | 1 - .../__test__/__snapshots__/List.test.tsx.snap | 10 - .../app/ServiceMap/Popover/Info.tsx | 2 +- .../ServiceMap/Popover/ServiceStatsList.tsx | 2 +- .../app/ServiceMap/cytoscape_options.ts | 2 +- .../shared/Stacktrace/CauseStacktrace.tsx | 2 +- .../time_filter.stories.storyshot | 45 -- .../__snapshots__/palette.stories.storyshot | 256 ++++++++- .../__snapshots__/asset.stories.storyshot | 4 +- .../asset_manager.stories.storyshot | 4 +- .../color_picker_popover.stories.storyshot | 20 - .../palette_picker.stories.storyshot | 512 ++++++++++++++++-- .../shape_picker_popover.stories.storyshot | 15 - .../text_style_picker.stories.storyshot | 10 - .../__snapshots__/edit_menu.stories.storyshot | 30 - .../element_menu.stories.storyshot | 5 - .../share_menu.stories.storyshot | 5 - .../__snapshots__/view_menu.stories.storyshot | 20 - .../workpad_templates.stories.storyshot | 10 - .../extended_template.stories.storyshot | 15 - .../simple_template.stories.storyshot | 10 - .../__snapshots__/canvas.stories.storyshot | 15 - .../__snapshots__/footer.stories.storyshot | 10 - .../__snapshots__/settings.stories.storyshot | 10 - .../__snapshots__/settings.test.tsx.snap | 42 +- .../settings/__tests__/settings.test.tsx | 4 +- .../danger_eui_context_menu_item.tsx | 2 +- .../settings/use_list_keys.test.tsx | 4 + .../extend_index_management.test.tsx.snap | 122 ++--- .../logging/log_minimap/time_ruler.tsx | 2 +- .../upload_license.test.tsx.snap | 16 + .../tooltip_popover.test.js.snap | 4 +- .../__snapshots__/tools_control.test.tsx.snap | 4 +- .../toc_entry_actions_popover.test.tsx.snap | 8 +- .../job_map/components/cytoscape_options.tsx | 3 +- .../report_info_button.test.tsx.snap | 4 +- .../__snapshots__/anomaly_score.test.tsx.snap | 2 +- .../__snapshots__/index.test.tsx.snap | 43 +- .../common/components/subtitle/index.tsx | 2 +- .../common/components/utility_bar/styles.tsx | 2 +- .../pages/policy/view/policy_list.tsx | 2 +- .../note_card_body.test.tsx.snap | 43 +- .../components/resolve_all_conflicts.test.tsx | 2 +- ...onnected_flyout_manage_drilldowns.test.tsx | 4 + .../url_drilldown_collect_config.test.tsx | 4 + .../location_missing.test.tsx.snap | 2 +- .../step_screenshot_display.test.tsx | 100 ++-- .../alerts/__tests__/add_filter_btn.test.tsx | 6 +- yarn.lock | 8 +- 67 files changed, 1051 insertions(+), 626 deletions(-) diff --git a/package.json b/package.json index 8e94e5277b8e3..465dec3ff020d 100644 --- a/package.json +++ b/package.json @@ -107,7 +107,7 @@ "@elastic/datemath": "link:packages/elastic-datemath", "@elastic/elasticsearch": "7.10.0-rc.1", "@elastic/ems-client": "7.10.0", - "@elastic/eui": "30.2.0", + "@elastic/eui": "30.4.1", "@elastic/filesaver": "1.1.2", "@elastic/good": "8.1.1-kibana2", "@elastic/node-crypto": "1.2.1", diff --git a/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap index ee2fcbd5078af..299a11ae1fc9c 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap @@ -4757,51 +4757,41 @@ exports[`Header renders 1`] = ` panelPaddingSize="m" repositionOnScroll={true} > -
-
- - - -
+ /> + + +
-
+ diff --git a/src/core/public/chrome/ui/header/header_help_menu.tsx b/src/core/public/chrome/ui/header/header_help_menu.tsx index 6d2938e3345a6..c7dd8c7e8bb1c 100644 --- a/src/core/public/chrome/ui/header/header_help_menu.tsx +++ b/src/core/public/chrome/ui/header/header_help_menu.tsx @@ -319,7 +319,6 @@ class HeaderHelpMenuUI extends Component { data-test-subj="helpMenuButton" id="headerHelpMenu" isOpen={this.state.isOpen} - ownFocus repositionOnScroll > diff --git a/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap b/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap index dac84c87faf97..4fb061ec816ad 100644 --- a/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap +++ b/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap @@ -304,7 +304,7 @@ exports[`DashboardEmptyScreen renders correctly with readonly mode 1`] = ` url="/plugins/home/assets/welcome_graphic_light_2x.png" >
setIsAddFilterPopoverOpen(false)} anchorPosition="downLeft" panelPaddingSize="none" - ownFocus={true} initialFocus=".filterEditor__hiddenItem" repositionOnScroll > diff --git a/src/plugins/data/public/ui/query_string_input/language_switcher.tsx b/src/plugins/data/public/ui/query_string_input/language_switcher.tsx index 3957e59388acf..63bf47671a84a 100644 --- a/src/plugins/data/public/ui/query_string_input/language_switcher.tsx +++ b/src/plugins/data/public/ui/query_string_input/language_switcher.tsx @@ -71,7 +71,6 @@ export function QueryLanguageSwitcher(props: Props) {
diff --git a/src/plugins/discover/public/application/components/sidebar/discover_field.tsx b/src/plugins/discover/public/application/components/sidebar/discover_field.tsx index 35515a6a0e7a5..87dfbdc0a4a6a 100644 --- a/src/plugins/discover/public/application/components/sidebar/discover_field.tsx +++ b/src/plugins/discover/public/application/components/sidebar/discover_field.tsx @@ -188,7 +188,6 @@ export function DiscoverField({ return ( { popover = component.find(EuiPopover); expect(popover.prop('isOpen')).toBe(false); }); - - test('click outside popover should close popover', () => { - const triggerDocumentMouseDown: EventHandler = (e: ReactMouseEvent) => { - const event = new Event('mousedown'); - // @ts-ignore - event.euiGeneratedBy = e.nativeEvent.euiGeneratedBy; - document.dispatchEvent(event); - }; - const triggerDocumentMouseUp: EventHandler = (e: ReactMouseEvent) => { - const event = new Event('mouseup'); - // @ts-ignore - event.euiGeneratedBy = e.nativeEvent.euiGeneratedBy; - document.dispatchEvent(event); - }; - const component = mountWithIntl( -
- -
- ); - const btn = findTestSubject(component, 'toggleFieldFilterButton'); - btn.simulate('click'); - let popover = component.find(EuiPopover); - expect(popover.length).toBe(1); - expect(popover.prop('isOpen')).toBe(true); - component.find('#wrapperId').simulate('mousedown'); - component.find('#wrapperId').simulate('mouseup'); - popover = component.find(EuiPopover); - expect(popover.prop('isOpen')).toBe(false); - }); }); diff --git a/src/plugins/home/public/application/components/__snapshots__/sample_data_view_data_button.test.js.snap b/src/plugins/home/public/application/components/__snapshots__/sample_data_view_data_button.test.js.snap index 1484ce6b1a81f..1889d14238cac 100644 --- a/src/plugins/home/public/application/components/__snapshots__/sample_data_view_data_button.test.js.snap +++ b/src/plugins/home/public/application/components/__snapshots__/sample_data_view_data_button.test.js.snap @@ -19,7 +19,7 @@ exports[`should render popover when appLinks is not empty 1`] = ` hasArrow={true} id="sampleDataLinksecommerce" isOpen={false} - ownFocus={false} + ownFocus={true} panelPaddingSize="none" > -
-
- - - -
+ + + +
-
+
diff --git a/src/plugins/inspector/public/ui/inspector_view_chooser.tsx b/src/plugins/inspector/public/ui/inspector_view_chooser.tsx index e1502e5e912e6..be84488589423 100644 --- a/src/plugins/inspector/public/ui/inspector_view_chooser.tsx +++ b/src/plugins/inspector/public/ui/inspector_view_chooser.tsx @@ -121,7 +121,6 @@ export class InspectorViewChooser extends Component { return ( ( List should render empty state 1`] = ` >
List should render with data 1`] = ` >
theme.eui.textColors.subdued}; + color: ${({ theme }) => theme.eui.euiTextSubduedColor}; } `; diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/ServiceStatsList.tsx b/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/ServiceStatsList.tsx index 8463da0824bde..2898194dc40e7 100644 --- a/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/ServiceStatsList.tsx +++ b/x-pack/plugins/apm/public/components/app/ServiceMap/Popover/ServiceStatsList.tsx @@ -20,7 +20,7 @@ export const ItemRow = styled('tr')` `; export const ItemTitle = styled('td')` - color: ${({ theme }) => theme.eui.textColors.subdued}; + color: ${({ theme }) => theme.eui.euiTextSubduedColor}; padding-right: 1rem; `; diff --git a/x-pack/plugins/apm/public/components/app/ServiceMap/cytoscape_options.ts b/x-pack/plugins/apm/public/components/app/ServiceMap/cytoscape_options.ts index d8a8a3c8e9ab4..ed5fbe3be0058 100644 --- a/x-pack/plugins/apm/public/components/app/ServiceMap/cytoscape_options.ts +++ b/x-pack/plugins/apm/public/components/app/ServiceMap/cytoscape_options.ts @@ -129,7 +129,7 @@ const getStyle = (theme: EuiTheme): cytoscape.Stylesheet[] => { color: (el: cytoscape.NodeSingular) => el.hasClass('primary') || el.selected() ? theme.eui.euiColorPrimaryText - : theme.eui.textColors.text, + : theme.eui.euiTextColor, // theme.euiFontFamily doesn't work here for some reason, so we're just // specifying a subset of the fonts for the label text. 'font-family': 'Inter UI, Segoe UI, Helvetica, Arial, sans-serif', diff --git a/x-pack/plugins/apm/public/components/shared/Stacktrace/CauseStacktrace.tsx b/x-pack/plugins/apm/public/components/shared/Stacktrace/CauseStacktrace.tsx index 50f87184f8ee7..a36980d49db3a 100644 --- a/x-pack/plugins/apm/public/components/shared/Stacktrace/CauseStacktrace.tsx +++ b/x-pack/plugins/apm/public/components/shared/Stacktrace/CauseStacktrace.tsx @@ -22,7 +22,7 @@ const CausedByContainer = styled('h5')` `; const CausedByHeading = styled('span')` - color: ${({ theme }) => theme.eui.textColors.subdued}; + color: ${({ theme }) => theme.eui.euiTextSubduedColor}; display: block; font-size: ${({ theme }) => theme.eui.euiFontSizeXS}; font-weight: ${({ theme }) => theme.eui.euiFontWeightBold}; diff --git a/x-pack/plugins/canvas/canvas_plugin_src/renderers/filters/time_filter/components/__stories__/__snapshots__/time_filter.stories.storyshot b/x-pack/plugins/canvas/canvas_plugin_src/renderers/filters/time_filter/components/__stories__/__snapshots__/time_filter.stories.storyshot index 3fba41069253e..59771973f2aa5 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/renderers/filters/time_filter/components/__stories__/__snapshots__/time_filter.stories.storyshot +++ b/x-pack/plugins/canvas/canvas_plugin_src/renderers/filters/time_filter/components/__stories__/__snapshots__/time_filter.stories.storyshot @@ -23,11 +23,6 @@ exports[`Storyshots renderers/TimeFilter default 1`] = `
Select an option: -
+ + + + + + + + + + + + + + + + + + , is selected
Asset thumbnail
Asset thumbnail
Asset thumbnail
Asset thumbnail
Select an option: -
+ + + + + + + + + + + + + + + + + + , is selected
Select an option: -
+ + + + + + + + + + + + + + + + + + , is selected
can navigate Autoplay Settings 1`] = ` data-eui="EuiFocusTrap" >