diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_view/index.tsx b/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_view/index.tsx index a141c78b856df..38d1e8b16e08b 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_view/index.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_view/index.tsx @@ -4,23 +4,21 @@ * 2.0; you may not use this file except in compliance with the Elastic License * 2.0. */ -import { EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner, EuiButton } from '@elastic/eui'; +import { EuiButton, EuiFlexGroup, EuiFlexItem, EuiLoadingSpinner } from '@elastic/eui'; import { css } from '@emotion/css'; import { i18n } from '@kbn/i18n'; import type { InvestigateWidget, InvestigateWidgetCreate } from '@kbn/investigate-plugin/public'; import { DATE_FORMAT_ID } from '@kbn/management-settings-ids'; +import { AuthenticatedUser } from '@kbn/security-plugin/common'; import { keyBy, omit, pick } from 'lodash'; -import { rgba } from 'polished'; import React, { useEffect, useMemo, useRef, useState } from 'react'; import useAsync from 'react-use/lib/useAsync'; -import { AuthenticatedUser } from '@kbn/security-plugin/common'; +import { AddWidgetMode } from '../../constants/add_widget_mode'; import { useDateRange } from '../../hooks/use_date_range'; import { useKibana } from '../../hooks/use_kibana'; -import { useTheme } from '../../hooks/use_theme'; import { getOverridesFromGlobalParameters } from '../../utils/get_overrides_from_global_parameters'; import { AddWidgetUI } from '../add_widget_ui'; import { InvestigateWidgetGrid } from '../investigate_widget_grid'; -import { AddWidgetMode } from '../../constants/add_widget_mode'; const containerClassName = css` overflow: auto; @@ -50,12 +48,7 @@ function InvestigateViewWithUser({ user }: { user: AuthenticatedUser }) { }, } = useKibana(); - const theme = useTheme(); - - const [displayedKuery, setDisplayedKuery] = useState(''); - - const backgroundColorOpaque = rgba(theme.colors.emptyShade, 1); - const backgroundColorTransparent = rgba(theme.colors.emptyShade, 0); + const [_displayedKuery, setDisplayedKuery] = useState(''); const widgetDefinitions = useMemo(() => investigate.getWidgetDefinitions(), [investigate]); @@ -79,7 +72,7 @@ function InvestigateViewWithUser({ user }: { user: AuthenticatedUser }) { to: range.end.toISOString(), }); - const [editingItem, setEditingItem] = useState(undefined); + const [_editingItem, setEditingItem] = useState(undefined); const createWidget = (widgetCreate: InvestigateWidgetCreate) => { return addItem(widgetCreate); diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_widget_grid/index.stories.tsx b/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_widget_grid/index.stories.tsx index 4ac689921233c..f4436051d76c2 100644 --- a/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_widget_grid/index.stories.tsx +++ b/x-pack/plugins/observability_solution/investigate_app/public/components/investigate_widget_grid/index.stories.tsx @@ -11,7 +11,6 @@ import { v4 } from 'uuid'; import { ChromeOption } from '@kbn/investigate-plugin/public'; import { InvestigateWidgetGrid as Component, InvestigateWidgetGridItem } from '.'; import { KibanaReactStorybookDecorator } from '../../../.storybook/storybook_decorator'; -import { MiniMapContextProvider } from '../../hooks/use_mini_map'; import { TimelineUserPrompt, TimelineAssistantResponse } from '../timeline_message'; const meta: ComponentMeta = { @@ -26,26 +25,24 @@ function WithPersistedChanges(props: React.ComponentProps) { const [items, setItems] = useState(props.items); return ( - - { - setItems(() => nextItems); - }} - onItemCopy={async (item) => { - setItems((prevItems) => - prevItems.concat({ - ...item, - id: v4(), - }) - ); - }} - onItemDelete={async (item) => { - setItems((prevItems) => prevItems.filter((currentItem) => currentItem.id !== item.id)); - }} - items={items} - /> - + { + setItems(() => nextItems); + }} + onItemCopy={async (item) => { + setItems((prevItems) => + prevItems.concat({ + ...item, + id: v4(), + }) + ); + }} + onItemDelete={async (item) => { + setItems((prevItems) => prevItems.filter((currentItem) => currentItem.id !== item.id)); + }} + items={items} + /> ); } diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/mini_timeline/get_anchor_id_for_timeline_item.ts b/x-pack/plugins/observability_solution/investigate_app/public/components/mini_timeline/get_anchor_id_for_timeline_item.ts deleted file mode 100644 index dda4cbee4fe8c..0000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/components/mini_timeline/get_anchor_id_for_timeline_item.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -export function getAnchorIdForTimelineItem(id: string) { - return `investigate-widget-${id}`; -} diff --git a/x-pack/plugins/observability_solution/investigate_app/public/components/mini_timeline/index.stories.tsx b/x-pack/plugins/observability_solution/investigate_app/public/components/mini_timeline/index.stories.tsx deleted file mode 100644 index a54ca5e84864b..0000000000000 --- a/x-pack/plugins/observability_solution/investigate_app/public/components/mini_timeline/index.stories.tsx +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the Elastic License - * 2.0; you may not use this file except in compliance with the Elastic License - * 2.0. - */ - -import { Meta, StoryObj } from '@storybook/react'; -import React from 'react'; -import { KibanaReactStorybookDecorator } from '../../../.storybook/storybook_decorator'; - -interface Args { - props: React.ComponentProps; -} - -type StoryMeta = Meta; -type Story = StoryObj; - -const meta: StoryMeta = { - component: Component, - title: 'app/Molecules/MiniTimeline', - decorators: [KibanaReactStorybookDecorator], -}; - -export default meta; - -export const defaultStory: Story = { - args: { - props: { - items: [ - { - id: '1', - title: 'My widget', - }, - { - id: '2', - title: 'My other widget', - }, - { - id: '2', - title: 'A widget with a really long title that overflows to see how that is handled', - }, - ], - onItemClick: () => {}, - }, - }, - name: 'default', - render: function Render(args) { - return ( -
- -
- ); - }, -};