From 03fb453f3f9a81d6fb2410da39bc536ff9b68778 Mon Sep 17 00:00:00 2001 From: Eric Wei Date: Fri, 30 Jun 2023 00:09:27 +0000 Subject: [PATCH 1/4] code clean up Signed-off-by: Eric Wei --- .../__tests__/shared_components.test.tsx | 12 ---- .../__snapshots__/assets.test.tsx.snap | 64 ------------------- .../assets/__tests__/assets.test.tsx | 56 ---------------- .../visualizations/assets/chart_bar.tsx | 29 --------- .../assets/chart_bar_horizontal.tsx | 33 ---------- .../visualizations/assets/chart_datatable.tsx | 35 ---------- .../visualizations/assets/chart_line.tsx | 29 --------- .../visualizations/assets/chart_pie.tsx | 31 --------- .../visualizations/charts/bar/bar_type.ts | 2 - .../charts/bubble/bubble_type.ts | 2 - .../charts/data_table/data_table_type.ts | 2 - .../charts/financial/gauge/gauge_type.ts | 2 - .../visualizations/charts/lines/line_type.ts | 2 - .../charts/maps/heatmap_type.ts | 2 - .../charts/maps/treemap_type.ts | 6 +- .../charts/metrics/metrics_type.ts | 2 - .../visualizations/charts/pie/pie_type.ts | 2 - .../visualizations/charts/text/text_type.ts | 2 - 18 files changed, 1 insertion(+), 312 deletions(-) delete mode 100644 public/components/visualizations/assets/__tests__/__snapshots__/assets.test.tsx.snap delete mode 100644 public/components/visualizations/assets/__tests__/assets.test.tsx delete mode 100644 public/components/visualizations/assets/chart_bar.tsx delete mode 100644 public/components/visualizations/assets/chart_bar_horizontal.tsx delete mode 100644 public/components/visualizations/assets/chart_datatable.tsx delete mode 100644 public/components/visualizations/assets/chart_line.tsx delete mode 100644 public/components/visualizations/assets/chart_pie.tsx diff --git a/public/components/event_analytics/explorer/visualizations/shared_components/__tests__/shared_components.test.tsx b/public/components/event_analytics/explorer/visualizations/shared_components/__tests__/shared_components.test.tsx index f7ba12836..8b5405906 100644 --- a/public/components/event_analytics/explorer/visualizations/shared_components/__tests__/shared_components.test.tsx +++ b/public/components/event_analytics/explorer/visualizations/shared_components/__tests__/shared_components.test.tsx @@ -7,23 +7,11 @@ import { configure, mount } from 'enzyme'; import Adapter from 'enzyme-adapter-react-16'; import React from 'react'; import { waitFor } from '@testing-library/react'; -import { EmptyPlaceholder } from '../empty_placeholder'; -import { LensIconChartBar } from '../../../../../visualizations/assets/chart_bar'; import { ToolbarButton } from '../toolbar_button'; describe('Shared components', () => { configure({ adapter: new Adapter() }); - it('Renders empty placeholder component', async () => { - const wrapper = mount(); - - wrapper.update(); - - await waitFor(() => { - expect(wrapper).toMatchSnapshot(); - }); - }); - it('Renders tool bar button component', async () => { const handleClick = jest.fn(); const WrappedComponent = () =>
testing
; diff --git a/public/components/visualizations/assets/__tests__/__snapshots__/assets.test.tsx.snap b/public/components/visualizations/assets/__tests__/__snapshots__/assets.test.tsx.snap deleted file mode 100644 index 4e61b4176..000000000 --- a/public/components/visualizations/assets/__tests__/__snapshots__/assets.test.tsx.snap +++ /dev/null @@ -1,64 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`Assets components Renders lens icon of bar component 1`] = ` - - - - - - -`; - -exports[`Assets components Renders lens icon of horizontal bar component 1`] = ` - - - - - - -`; - -exports[`Assets components Renders lens icon of line component 1`] = ` - - - - - - -`; diff --git a/public/components/visualizations/assets/__tests__/assets.test.tsx b/public/components/visualizations/assets/__tests__/assets.test.tsx deleted file mode 100644 index 3b3263533..000000000 --- a/public/components/visualizations/assets/__tests__/assets.test.tsx +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import { configure, mount } from 'enzyme'; -import Adapter from 'enzyme-adapter-react-16'; -import React from 'react'; -import { waitFor } from '@testing-library/react'; -import { LensIconChartBar } from '../chart_bar'; -import { LensIconChartBarHorizontal } from '../chart_bar_horizontal'; -import { LensIconChartLine } from '../chart_line'; - - -describe('Assets components', () => { - configure({ adapter: new Adapter() }); - - it('Renders lens icon of bar component', async () => { - - const wrapper = mount( - - ); - - wrapper.update(); - - await waitFor(() => { - expect(wrapper).toMatchSnapshot(); - }); - }); - - it('Renders lens icon of horizontal bar component', async () => { - - const wrapper = mount( - - ); - - wrapper.update(); - - await waitFor(() => { - expect(wrapper).toMatchSnapshot(); - }); - }); - - it('Renders lens icon of line component', async () => { - - const wrapper = mount( - - ); - - wrapper.update(); - - await waitFor(() => { - expect(wrapper).toMatchSnapshot(); - }); - }); -}); \ No newline at end of file diff --git a/public/components/visualizations/assets/chart_bar.tsx b/public/components/visualizations/assets/chart_bar.tsx deleted file mode 100644 index 3ee43ea22..000000000 --- a/public/components/visualizations/assets/chart_bar.tsx +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import React from 'react'; -import { EuiIconProps } from '@elastic/eui'; - -export const LensIconChartBar = ({ title, titleId, ...props }: Omit) => ( - - {title ? {title} : null} - - - -); diff --git a/public/components/visualizations/assets/chart_bar_horizontal.tsx b/public/components/visualizations/assets/chart_bar_horizontal.tsx deleted file mode 100644 index 0ccfa6a6c..000000000 --- a/public/components/visualizations/assets/chart_bar_horizontal.tsx +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import React from 'react'; -import { EuiIconProps } from '@elastic/eui'; - -export const LensIconChartBarHorizontal = ({ - title, - titleId, - ...props -}: Omit) => ( - - {title ? {title} : null} - - - -); diff --git a/public/components/visualizations/assets/chart_datatable.tsx b/public/components/visualizations/assets/chart_datatable.tsx deleted file mode 100644 index d6a5cb733..000000000 --- a/public/components/visualizations/assets/chart_datatable.tsx +++ /dev/null @@ -1,35 +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 React from 'react'; -import { EuiIconProps } from '@elastic/eui'; - -export const LensIconChartDatatable = ({ - title, - titleId, - ...props -}: Omit) => ( - - {title ? {title} : null} - - - -); diff --git a/public/components/visualizations/assets/chart_line.tsx b/public/components/visualizations/assets/chart_line.tsx deleted file mode 100644 index af6b1294c..000000000 --- a/public/components/visualizations/assets/chart_line.tsx +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright OpenSearch Contributors - * SPDX-License-Identifier: Apache-2.0 - */ - -import React from 'react'; -import { EuiIconProps } from '@elastic/eui'; - -export const LensIconChartLine = ({ title, titleId, ...props }: Omit) => ( - - {title ? {title} : null} - - - -); diff --git a/public/components/visualizations/assets/chart_pie.tsx b/public/components/visualizations/assets/chart_pie.tsx deleted file mode 100644 index 56a18b9d6..000000000 --- a/public/components/visualizations/assets/chart_pie.tsx +++ /dev/null @@ -1,31 +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 React from 'react'; -import { EuiIconProps } from '@elastic/eui'; - -export const LensIconChartPie = ({ title, titleId, ...props }: Omit) => ( - - {title ? {title} : null} - - - -); diff --git a/public/components/visualizations/charts/bar/bar_type.ts b/public/components/visualizations/charts/bar/bar_type.ts index f07555159..7df4fab26 100644 --- a/public/components/visualizations/charts/bar/bar_type.ts +++ b/public/components/visualizations/charts/bar/bar_type.ts @@ -5,7 +5,6 @@ import { Bar } from './bar'; import { getPlotlySharedConfigs, getPlotlyCategory } from '../shared/shared_configs'; -import { LensIconChartBar } from '../../assets/chart_bar'; import { VizDataPanel } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/default_vis_editor'; import { ConfigEditor } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/json_editor'; import { @@ -41,7 +40,6 @@ export const createBarTypeDefinition = (params: any) => ({ dataLoss: 'nothing', }, category: VIS_CATEGORY.BASICS, - icon: LensIconChartBar, categoryaxis: 'xaxis', seriesaxis: 'yaxis', orientation: isHorizontalBar(params.type) ? BarOrientation.horizontal : BarOrientation.vertical, diff --git a/public/components/visualizations/charts/bubble/bubble_type.ts b/public/components/visualizations/charts/bubble/bubble_type.ts index b4cac8ded..a5ed32f2e 100644 --- a/public/components/visualizations/charts/bubble/bubble_type.ts +++ b/public/components/visualizations/charts/bubble/bubble_type.ts @@ -5,7 +5,6 @@ import { Bubble } from './bubble'; import { getPlotlySharedConfigs, getPlotlyCategory } from '../shared/shared_configs'; -import { LensIconChartPie } from '../../assets/chart_pie'; import { VizDataPanel } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/default_vis_editor'; import { ConfigEditor } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/json_editor'; import { ConfigValueOptions } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/config_controls'; @@ -62,7 +61,6 @@ export const createBubbleVisDefinition = () => ({ }, ], }, - icon: LensIconChartPie, visconfig: { layout: { ...sharedConfigs.layout, diff --git a/public/components/visualizations/charts/data_table/data_table_type.ts b/public/components/visualizations/charts/data_table/data_table_type.ts index 7ad582ccd..f49b9d6c6 100644 --- a/public/components/visualizations/charts/data_table/data_table_type.ts +++ b/public/components/visualizations/charts/data_table/data_table_type.ts @@ -5,7 +5,6 @@ import { DataTable } from './data_table'; import { getPlotlySharedConfigs, getPlotlyCategory } from '../shared/shared_configs'; -import { LensIconChartDatatable } from '../../assets/chart_datatable'; import { ConfigEditor } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/json_editor'; import { ConfigAvailability } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/config_controls/config_availability'; import { VizDataPanel } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/default_vis_editor'; @@ -28,7 +27,6 @@ export const createDatatableTypeDefinition = (params: any = {}) => ({ fulllabel: 'Table View', icontype: 'visTable', category: VIS_CATEGORY.BASICS, - icon: LensIconChartDatatable, showtableheader: true, enablepagination: true, colunmfilter: false, diff --git a/public/components/visualizations/charts/financial/gauge/gauge_type.ts b/public/components/visualizations/charts/financial/gauge/gauge_type.ts index 2da38fefd..d273b19c5 100644 --- a/public/components/visualizations/charts/financial/gauge/gauge_type.ts +++ b/public/components/visualizations/charts/financial/gauge/gauge_type.ts @@ -5,7 +5,6 @@ import { Gauge } from './gauge'; import { getPlotlySharedConfigs, getPlotlyCategory } from '../../shared/shared_configs'; -import { LensIconChartLine } from '../../../assets/chart_line'; import { VizDataPanel } from '../../../../event_analytics/explorer/visualizations/config_panel/config_panes/default_vis_editor'; import { ConfigEditor } from '../../../../event_analytics/explorer/visualizations/config_panel/config_panes/json_editor'; import { @@ -32,7 +31,6 @@ export const createGaugeTypeDefinition = (params: any = {}) => ({ selection: { dataLoss: 'nothing', }, - icon: LensIconChartLine, valueseries: 'yaxis', editorconfig: { panelTabs: [ diff --git a/public/components/visualizations/charts/lines/line_type.ts b/public/components/visualizations/charts/lines/line_type.ts index b82e44eb0..2c7bc5fc7 100644 --- a/public/components/visualizations/charts/lines/line_type.ts +++ b/public/components/visualizations/charts/lines/line_type.ts @@ -5,7 +5,6 @@ import { Line } from './line'; import { getPlotlySharedConfigs, getPlotlyCategory } from '../shared/shared_configs'; -import { LensIconChartLine } from '../../assets/chart_line'; import { VizDataPanel } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/default_vis_editor'; import { ConfigEditor } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/json_editor'; import { @@ -49,7 +48,6 @@ export const createLineTypeDefinition = (params: any = {}) => ({ selection: { dataLoss: 'nothing', }, - icon: LensIconChartLine, categoryaxis: 'xaxis', seriesaxis: 'yaxis', editorconfig: { diff --git a/public/components/visualizations/charts/maps/heatmap_type.ts b/public/components/visualizations/charts/maps/heatmap_type.ts index 6501aa04a..d4b32936c 100644 --- a/public/components/visualizations/charts/maps/heatmap_type.ts +++ b/public/components/visualizations/charts/maps/heatmap_type.ts @@ -5,7 +5,6 @@ import { HeatMap } from './heatmap'; import { getPlotlySharedConfigs, getPlotlyCategory } from '../shared/shared_configs'; -import { LensIconChartPie } from '../../assets/chart_pie'; import { VizDataPanel } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/default_vis_editor'; import { ConfigEditor } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/json_editor'; import { @@ -37,7 +36,6 @@ export const createMapsVisDefinition = () => ({ selection: { dataLoss: 'nothing', }, - icon: LensIconChartPie, editorconfig: { panelTabs: [ { diff --git a/public/components/visualizations/charts/maps/treemap_type.ts b/public/components/visualizations/charts/maps/treemap_type.ts index 1a87a428b..788a75e4b 100644 --- a/public/components/visualizations/charts/maps/treemap_type.ts +++ b/public/components/visualizations/charts/maps/treemap_type.ts @@ -5,7 +5,6 @@ import { TreeMap } from './treemaps'; import { getPlotlySharedConfigs, getPlotlyCategory } from '../shared/shared_configs'; -import { LensIconChartBar } from '../../assets/chart_bar'; import { VizDataPanel } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/default_vis_editor'; import { ConfigEditor } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/json_editor'; import { @@ -24,9 +23,7 @@ const VIS_CATEGORY = getPlotlyCategory(); const { SortSectors } = DEFAULT_CHART_STYLES; -export interface BarTypeParams {} - -export const createTreeMapDefinition = (params: BarTypeParams = {}) => ({ +export const createTreeMapDefinition = (params: any) => ({ name: 'tree_map', type: 'tree_map', id: 'tree_map', @@ -37,7 +34,6 @@ export const createTreeMapDefinition = (params: BarTypeParams = {}) => ({ }, category: VIS_CATEGORY.BASICS, icontype: 'heatmap', - icon: LensIconChartBar, categoryaxis: 'xaxis', seriesaxis: 'yaxis', orientation: 'v', diff --git a/public/components/visualizations/charts/metrics/metrics_type.ts b/public/components/visualizations/charts/metrics/metrics_type.ts index bc8f6b546..8bcf318ed 100644 --- a/public/components/visualizations/charts/metrics/metrics_type.ts +++ b/public/components/visualizations/charts/metrics/metrics_type.ts @@ -5,7 +5,6 @@ import { Metrics } from './metrics'; import { getPlotlySharedConfigs, getPlotlyCategory } from '../shared/shared_configs'; -import { LensIconChartLine } from '../../assets/chart_line'; import { PLOTLY_COLOR } from '../../../../../common/constants/shared'; import { VizDataPanel } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/default_vis_editor'; import { ConfigEditor } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/json_editor'; @@ -40,7 +39,6 @@ export const createMetricsTypeDefinition = (params: any = {}) => ({ fulllabel: 'Metrics', icontype: 'stats', category: VIS_CATEGORY.BASICS, - icon: LensIconChartLine, categoryaxis: 'xaxis', seriesaxis: 'yaxis', charttype: DefaultChartType, diff --git a/public/components/visualizations/charts/pie/pie_type.ts b/public/components/visualizations/charts/pie/pie_type.ts index 2ec2dc1e7..ef6536140 100644 --- a/public/components/visualizations/charts/pie/pie_type.ts +++ b/public/components/visualizations/charts/pie/pie_type.ts @@ -5,7 +5,6 @@ import { Pie } from './pie'; import { getPlotlySharedConfigs, getPlotlyCategory } from '../shared/shared_configs'; -import { LensIconChartPie } from '../../assets/chart_pie'; import { VizDataPanel } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/default_vis_editor'; import { ConfigEditor } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/json_editor'; import { @@ -39,7 +38,6 @@ export const createPieTypeDefinition = (params: any) => ({ categoryaxis: 'xaxis', seriesaxis: 'yaxis', mode: DefaultMode, - icon: LensIconChartPie, editorconfig: { panelTabs: [ { diff --git a/public/components/visualizations/charts/text/text_type.ts b/public/components/visualizations/charts/text/text_type.ts index 183fe9235..3e096ac5a 100644 --- a/public/components/visualizations/charts/text/text_type.ts +++ b/public/components/visualizations/charts/text/text_type.ts @@ -5,7 +5,6 @@ import { Text } from './text'; import { getPlotlySharedConfigs, getPlotlyCategory } from '../shared/shared_configs'; -import { LensIconChartLine } from '../../assets/chart_line'; import { PLOTLY_COLOR } from '../../../../../common/constants/shared'; import { VizDataPanel } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/default_vis_editor'; import { ConfigText } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/config_controls'; @@ -24,7 +23,6 @@ export const createTextTypeDefinition = (params: any = {}) => ({ selection: { dataLoss: 'nothing', }, - icon: LensIconChartLine, categoryaxis: 'xaxis', seriesaxis: 'yaxis', editorconfig: { From 3dd859c5e248127af18af9278e7765143001d82d Mon Sep 17 00:00:00 2001 From: Eric Wei Date: Fri, 30 Jun 2023 00:13:36 +0000 Subject: [PATCH 2/4] update snapshots Signed-off-by: Eric Wei --- .../__snapshots__/utils.test.tsx.snap | 9 -- .../__snapshots__/config_panel.test.tsx.snap | 21 ----- .../shared_components.test.tsx.snap | 90 ------------------- .../__tests__/__snapshots__/bar.test.tsx.snap | 1 - .../__snapshots__/gauge.test.tsx.snap | 1 - .../__snapshots__/heatmap.test.tsx.snap | 1 - .../__snapshots__/histogram.test.tsx.snap | 1 - .../horizontal_bar.test.tsx.snap | 1 - .../__snapshots__/line.test.tsx.snap | 1 - .../__snapshots__/metrics.test.tsx.snap | 1 - .../__tests__/__snapshots__/pie.test.tsx.snap | 1 - .../__snapshots__/text.test.tsx.snap | 1 - .../__snapshots__/treemap.test.tsx.snap | 1 - 13 files changed, 130 deletions(-) diff --git a/public/components/custom_panels/helpers/__tests__/__snapshots__/utils.test.tsx.snap b/public/components/custom_panels/helpers/__tests__/__snapshots__/utils.test.tsx.snap index b701ecfa4..6a9095181 100644 --- a/public/components/custom_panels/helpers/__tests__/__snapshots__/utils.test.tsx.snap +++ b/public/components/custom_panels/helpers/__tests__/__snapshots__/utils.test.tsx.snap @@ -416,7 +416,6 @@ exports[`Utils helper functions renders displayVisualization function 1`] = ` "fillopacity": 100, "fulllabel": "Vertical bar", "groupwidth": 0.7, - "icon": [Function], "icontype": "visBarVerticalStacked", "id": "bar", "label": "Vertical bar", @@ -872,7 +871,6 @@ exports[`Utils helper functions renders displayVisualization function 1`] = ` "fillopacity": 100, "fulllabel": "Vertical bar", "groupwidth": 0.7, - "icon": [Function], "icontype": "visBarVerticalStacked", "id": "bar", "label": "Vertical bar", @@ -1335,7 +1333,6 @@ exports[`Utils helper functions renders displayVisualization function 1`] = ` "fillopacity": 100, "fulllabel": "Vertical bar", "groupwidth": 0.7, - "icon": [Function], "icontype": "visBarVerticalStacked", "id": "bar", "label": "Vertical bar", @@ -2036,7 +2033,6 @@ exports[`Utils helper functions renders displayVisualization function 2`] = ` ], }, "fulllabel": "Time series", - "icon": [Function], "icontype": "visLine", "id": "line", "label": "Time series", @@ -2553,7 +2549,6 @@ exports[`Utils helper functions renders displayVisualization function 2`] = ` ], }, "fulllabel": "Time series", - "icon": [Function], "icontype": "visLine", "id": "line", "label": "Time series", @@ -3084,7 +3079,6 @@ exports[`Utils helper functions renders displayVisualization function 2`] = ` ], }, "fulllabel": "Time series", - "icon": [Function], "icontype": "visLine", "id": "line", "label": "Time series", @@ -3767,7 +3761,6 @@ exports[`Utils helper functions renders displayVisualization function 3`] = ` "fillopacity": 100, "fulllabel": "Horizontal bar", "groupwidth": 0.7, - "icon": [Function], "icontype": "visBarHorizontalStacked", "id": "horizontal_bar", "label": "Horizontal bar", @@ -4223,7 +4216,6 @@ exports[`Utils helper functions renders displayVisualization function 3`] = ` "fillopacity": 100, "fulllabel": "Horizontal bar", "groupwidth": 0.7, - "icon": [Function], "icontype": "visBarHorizontalStacked", "id": "horizontal_bar", "label": "Horizontal bar", @@ -4686,7 +4678,6 @@ exports[`Utils helper functions renders displayVisualization function 3`] = ` "fillopacity": 100, "fulllabel": "Horizontal bar", "groupwidth": 0.7, - "icon": [Function], "icontype": "visBarHorizontalStacked", "id": "horizontal_bar", "label": "Horizontal bar", diff --git a/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap b/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap index 67c7e5837..5be9321c7 100644 --- a/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap +++ b/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap @@ -624,7 +624,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] "fillopacity": 100, "fulllabel": "Vertical bar", "groupwidth": 0.7, - "icon": [Function], "icontype": "visBarVerticalStacked", "id": "bar", "label": "Vertical bar", @@ -947,7 +946,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] "fillopacity": 100, "fulllabel": "Vertical bar", "groupwidth": 0.7, - "icon": [Function], "iconType": "visBarVerticalStacked", "icontype": "visBarVerticalStacked", "id": "bar", @@ -1253,7 +1251,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] "fillopacity": 100, "fulllabel": "Horizontal bar", "groupwidth": 0.7, - "icon": [Function], "icontype": "visBarHorizontalStacked", "id": "horizontal_bar", "label": "Horizontal bar", @@ -1581,7 +1578,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] ], }, "fulllabel": "Time series", - "icon": [Function], "icontype": "visLine", "id": "line", "label": "Time series", @@ -1822,7 +1818,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] ], }, "fulllabel": "Pie", - "icon": [Function], "icontype": "visPie", "id": "pie", "label": "Pie", @@ -2262,7 +2257,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] ], }, "fulllabel": "Hubble", - "icon": [Function], "icontype": "heatmap", "id": "heatmap", "label": "Heatmap", @@ -2315,7 +2309,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] ], }, "fulllabel": "Markdown", - "icon": [Function], "icontype": "visText", "id": "text", "label": "Markdown", @@ -2650,7 +2643,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] "fillopacity": 100, "fulllabel": "Vertical bar", "groupwidth": 0.7, - "icon": [Function], "iconType": "visBarVerticalStacked", "icontype": "visBarVerticalStacked", "id": "bar", @@ -2988,7 +2980,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] "fillopacity": 100, "fulllabel": "Vertical bar", "groupwidth": 0.7, - "icon": [Function], "iconType": "visBarVerticalStacked", "icontype": "visBarVerticalStacked", "id": "bar", @@ -3332,7 +3323,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] fillopacity={100} fulllabel="Vertical bar" groupwidth={0.7} - icon={[Function]} iconType="visBarVerticalStacked" icontype="visBarVerticalStacked" id="bar" @@ -3609,7 +3599,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] "fillopacity": 100, "fulllabel": "Vertical bar", "groupwidth": 0.7, - "icon": [Function], "iconType": "visBarVerticalStacked", "icontype": "visBarVerticalStacked", "id": "bar", @@ -3954,7 +3943,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] fillopacity={100} fulllabel="Vertical bar" groupwidth={0.7} - icon={[Function]} iconType="visBarVerticalStacked" icontype="visBarVerticalStacked" id="bar" @@ -4268,7 +4256,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] fillopacity={100} fulllabel="Vertical bar" groupwidth={0.7} - icon={[Function]} icontype="visBarVerticalStacked" id="bar" labelangle={0} @@ -5359,7 +5346,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] "fillopacity": 100, "fulllabel": "Vertical bar", "groupwidth": 0.7, - "icon": [Function], "icontype": "visBarVerticalStacked", "id": "bar", "label": "Vertical bar", @@ -6302,7 +6288,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] "fillopacity": 100, "fulllabel": "Vertical bar", "groupwidth": 0.7, - "icon": [Function], "icontype": "visBarVerticalStacked", "id": "bar", "label": "Vertical bar", @@ -7286,7 +7271,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] "fillopacity": 100, "fulllabel": "Vertical bar", "groupwidth": 0.7, - "icon": [Function], "icontype": "visBarVerticalStacked", "id": "bar", "label": "Vertical bar", @@ -7998,7 +7982,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] "fillopacity": 100, "fulllabel": "Vertical bar", "groupwidth": 0.7, - "icon": [Function], "icontype": "visBarVerticalStacked", "id": "bar", "label": "Vertical bar", @@ -8977,7 +8960,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] "fillopacity": 100, "fulllabel": "Vertical bar", "groupwidth": 0.7, - "icon": [Function], "icontype": "visBarVerticalStacked", "id": "bar", "label": "Vertical bar", @@ -10455,7 +10437,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] "fillopacity": 100, "fulllabel": "Vertical bar", "groupwidth": 0.7, - "icon": [Function], "icontype": "visBarVerticalStacked", "id": "bar", "label": "Vertical bar", @@ -11954,7 +11935,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] "fillopacity": 100, "fulllabel": "Vertical bar", "groupwidth": 0.7, - "icon": [Function], "icontype": "visBarVerticalStacked", "id": "bar", "label": "Vertical bar", @@ -15018,7 +14998,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] "fillopacity": 100, "fulllabel": "Vertical bar", "groupwidth": 0.7, - "icon": [Function], "icontype": "visBarVerticalStacked", "id": "bar", "label": "Vertical bar", diff --git a/public/components/event_analytics/explorer/visualizations/shared_components/__tests__/__snapshots__/shared_components.test.tsx.snap b/public/components/event_analytics/explorer/visualizations/shared_components/__tests__/__snapshots__/shared_components.test.tsx.snap index adb37ebb1..29dcef545 100644 --- a/public/components/event_analytics/explorer/visualizations/shared_components/__tests__/__snapshots__/shared_components.test.tsx.snap +++ b/public/components/event_analytics/explorer/visualizations/shared_components/__tests__/__snapshots__/shared_components.test.tsx.snap @@ -1,95 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Shared components Renders empty placeholder component 1`] = ` - - -
- -
- -
- - - - - - - - - -
- -

- - - No data found - - -

-
- -
- -
- - -`; - exports[`Shared components Renders tool bar button component 1`] = ` Date: Fri, 30 Jun 2023 00:19:38 +0000 Subject: [PATCH 3/4] remove unused utils, color theme, and editor components Signed-off-by: Eric Wei --- .../visualizations/charts/data_table/data_table_type.ts | 2 -- public/components/visualizations/charts/lines/line_type.ts | 2 -- public/components/visualizations/charts/maps/heatmap.tsx | 3 +-- public/components/visualizations/charts/maps/heatmap_type.ts | 2 -- .../components/visualizations/charts/metrics/metrics_type.ts | 1 - public/components/visualizations/charts/pie/pie_type.ts | 3 --- 6 files changed, 1 insertion(+), 12 deletions(-) diff --git a/public/components/visualizations/charts/data_table/data_table_type.ts b/public/components/visualizations/charts/data_table/data_table_type.ts index f49b9d6c6..eacb37be3 100644 --- a/public/components/visualizations/charts/data_table/data_table_type.ts +++ b/public/components/visualizations/charts/data_table/data_table_type.ts @@ -5,8 +5,6 @@ import { DataTable } from './data_table'; import { getPlotlySharedConfigs, getPlotlyCategory } from '../shared/shared_configs'; -import { ConfigEditor } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/json_editor'; -import { ConfigAvailability } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/config_controls/config_availability'; import { VizDataPanel } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/default_vis_editor'; import { InputFieldItem, diff --git a/public/components/visualizations/charts/lines/line_type.ts b/public/components/visualizations/charts/lines/line_type.ts index 2c7bc5fc7..aa145ea86 100644 --- a/public/components/visualizations/charts/lines/line_type.ts +++ b/public/components/visualizations/charts/lines/line_type.ts @@ -6,13 +6,11 @@ import { Line } from './line'; import { getPlotlySharedConfigs, getPlotlyCategory } from '../shared/shared_configs'; import { VizDataPanel } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/default_vis_editor'; -import { ConfigEditor } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/json_editor'; import { ConfigThresholds, ConfigLineChartStyles, ConfigLegend, InputFieldItem, - ConfigColorTheme, } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/config_controls'; import { ConfigAvailability } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/config_controls/config_availability'; import { diff --git a/public/components/visualizations/charts/maps/heatmap.tsx b/public/components/visualizations/charts/maps/heatmap.tsx index 9bca96d8f..42e2e8555 100644 --- a/public/components/visualizations/charts/maps/heatmap.tsx +++ b/public/components/visualizations/charts/maps/heatmap.tsx @@ -4,7 +4,7 @@ */ import React, { useMemo } from 'react'; import { colorPalette } from '@elastic/eui'; -import { forEach, isEmpty, isEqual, map } from 'lodash'; +import { forEach, isEmpty, map } from 'lodash'; import Plotly from 'plotly.js-dist'; import { HEATMAP_PALETTE_COLOR, @@ -18,7 +18,6 @@ import { getPropName, } from '../../../../components/event_analytics/utils/utils'; import { IVisualizationContainerProps } from '../../../../../common/types/explorer'; -import { VisCanvassPlaceholder } from '../../../event_analytics/explorer/visualizations/shared_components/vis_canvass_placeholder'; import { Plt } from '../../plotly/plot'; import { AGGREGATIONS, GROUPBY } from '../../../../../common/constants/explorer'; import { PLOT_MARGIN } from '../../../../../common/constants/shared'; diff --git a/public/components/visualizations/charts/maps/heatmap_type.ts b/public/components/visualizations/charts/maps/heatmap_type.ts index d4b32936c..ff9e7abd7 100644 --- a/public/components/visualizations/charts/maps/heatmap_type.ts +++ b/public/components/visualizations/charts/maps/heatmap_type.ts @@ -6,9 +6,7 @@ import { HeatMap } from './heatmap'; import { getPlotlySharedConfigs, getPlotlyCategory } from '../shared/shared_configs'; import { VizDataPanel } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/default_vis_editor'; -import { ConfigEditor } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/json_editor'; import { - ConfigValueOptions, HeatmapColorPalettePicker, ConfigChartOptions, PanelItem, diff --git a/public/components/visualizations/charts/metrics/metrics_type.ts b/public/components/visualizations/charts/metrics/metrics_type.ts index 8bcf318ed..e13df7744 100644 --- a/public/components/visualizations/charts/metrics/metrics_type.ts +++ b/public/components/visualizations/charts/metrics/metrics_type.ts @@ -16,7 +16,6 @@ import { TextInputFieldItem, } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/config_controls'; import { fetchConfigObject } from '../../../event_analytics/utils/utils'; -import { ConfigAvailability } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/config_controls/config_availability'; import { DEFAULT_METRICS_CHART_PARAMETERS } from '../../../../../common/constants/explorer'; const sharedConfigs = getPlotlySharedConfigs(); diff --git a/public/components/visualizations/charts/pie/pie_type.ts b/public/components/visualizations/charts/pie/pie_type.ts index ef6536140..b161c515f 100644 --- a/public/components/visualizations/charts/pie/pie_type.ts +++ b/public/components/visualizations/charts/pie/pie_type.ts @@ -6,16 +6,13 @@ import { Pie } from './pie'; import { getPlotlySharedConfigs, getPlotlyCategory } from '../shared/shared_configs'; import { VizDataPanel } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/default_vis_editor'; -import { ConfigEditor } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/json_editor'; import { - ColorPalettePicker, ConfigChartOptions, ConfigLegend, InputFieldItem, ButtonGroupItem, } from '../../../event_analytics/explorer/visualizations/config_panel/config_panes/config_controls'; import { fetchConfigObject } from '../../../../components/event_analytics/utils/utils'; -import { DEFAULT_PALETTE, PIE_PALETTES } from '../../../../../common/constants/colors'; import { PLOTLY_COLOR, DEFAULT_CHART_STYLES } from '../../../../../common/constants/shared'; import { DEFAULT_PIE_CHART_PARAMETERS } from '../../../../../common/constants/explorer'; From bd11c23a04221badc9b3287fa677cd005daa4827 Mon Sep 17 00:00:00 2001 From: Eric Wei Date: Fri, 30 Jun 2023 00:27:11 +0000 Subject: [PATCH 4/4] add to index file Signed-off-by: Eric Wei --- .../shared_components/plotly_viz_editor/index.tsx | 1 + .../explorer/visualizations/visualization_specs/default_spec.ts | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/public/components/event_analytics/explorer/visualizations/shared_components/plotly_viz_editor/index.tsx b/public/components/event_analytics/explorer/visualizations/shared_components/plotly_viz_editor/index.tsx index 1238af2fe..088751a9f 100644 --- a/public/components/event_analytics/explorer/visualizations/shared_components/plotly_viz_editor/index.tsx +++ b/public/components/event_analytics/explorer/visualizations/shared_components/plotly_viz_editor/index.tsx @@ -1 +1,2 @@ export { PlotlyVizEditor } from './plotly_viz_editor'; +export { PlotlyEditorActionsMenu } from './plotly_actions'; diff --git a/public/components/event_analytics/explorer/visualizations/visualization_specs/default_spec.ts b/public/components/event_analytics/explorer/visualizations/visualization_specs/default_spec.ts index 310f6613f..e71363c94 100644 --- a/public/components/event_analytics/explorer/visualizations/visualization_specs/default_spec.ts +++ b/public/components/event_analytics/explorer/visualizations/visualization_specs/default_spec.ts @@ -1,6 +1,4 @@ // @ts-ignore - -import hjson from 'hjson'; import defaultLayoutSpec from '!!raw-loader!./default.layout.spec.hjson'; import defaultDataSpec from '!!raw-loader!./default.data.spec.hjson';