diff --git a/dashboards-observability/common/types/explorer.ts b/dashboards-observability/common/types/explorer.ts index c1c6ccc07..3174d5c0b 100644 --- a/dashboards-observability/common/types/explorer.ts +++ b/dashboards-observability/common/types/explorer.ts @@ -139,7 +139,7 @@ export interface IExplorerProps { appBaseQuery?: string; callback?: any; callbackInApp?: any; - queryManager: QueryManager; + queryManager?: QueryManager; } export interface SavedQuery { diff --git a/dashboards-observability/public/components/custom_panels/helpers/__tests__/__snapshots__/utils.test.tsx.snap b/dashboards-observability/public/components/custom_panels/helpers/__tests__/__snapshots__/utils.test.tsx.snap index 4d71b9e61..3b6fa66d6 100644 --- a/dashboards-observability/public/components/custom_panels/helpers/__tests__/__snapshots__/utils.test.tsx.snap +++ b/dashboards-observability/public/components/custom_panels/helpers/__tests__/__snapshots__/utils.test.tsx.snap @@ -402,13 +402,6 @@ exports[`Utils helper functions renders displayVisualization function 1`] = ` }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -864,13 +857,6 @@ exports[`Utils helper functions renders displayVisualization function 1`] = ` }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -1333,13 +1319,6 @@ exports[`Utils helper functions renders displayVisualization function 1`] = ` }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -2027,13 +2006,6 @@ exports[`Utils helper functions renders displayVisualization function 2`] = ` }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, Object { "defaultState": Array [], "editor": [Function], @@ -2557,13 +2529,6 @@ exports[`Utils helper functions renders displayVisualization function 2`] = ` }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, Object { "defaultState": Array [], "editor": [Function], @@ -3101,13 +3066,6 @@ exports[`Utils helper functions renders displayVisualization function 2`] = ` }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, Object { "defaultState": Array [], "editor": [Function], @@ -3796,13 +3754,6 @@ exports[`Utils helper functions renders displayVisualization function 3`] = ` }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -4258,13 +4209,6 @@ exports[`Utils helper functions renders displayVisualization function 3`] = ` }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -4727,13 +4671,6 @@ exports[`Utils helper functions renders displayVisualization function 3`] = ` }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { diff --git a/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx b/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx index 82071906d..8090aa402 100644 --- a/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx +++ b/dashboards-observability/public/components/event_analytics/explorer/explorer.tsx @@ -104,6 +104,7 @@ import { Sidebar } from './sidebar'; import { TimechartHeader } from './timechart_header'; import { ExplorerVisualizations } from './visualizations'; import { CountDistribution } from './visualizations/count_distribution'; +import { QueryManager } from '../../../../common/query_manager'; const TYPE_TAB_MAPPING = { [SAVED_QUERY]: TAB_EVENT_ID, @@ -132,7 +133,7 @@ export const Explorer = ({ setEndTime, callback, callbackInApp, - queryManager, + queryManager = new QueryManager(), }: IExplorerProps) => { const dispatch = useDispatch(); const requestParams = { tabId }; @@ -182,8 +183,6 @@ export const Explorer = ({ const [liveTimestamp, setLiveTimestamp] = useState(DATE_PICKER_FORMAT); const [triggerAvailability, setTriggerAvailability] = useState(false); const [viewLogPatterns, setViewLogPatterns] = useState(false); - const [isValidDataConfigOptionSelected, setIsValidDataConfigOptionSelected] = - useState(false); const [spanValue, setSpanValue] = useState(false); const [subType, setSubType] = useState('visualization'); const [metricMeasure, setMetricMeasure] = useState(''); @@ -309,8 +308,9 @@ export const Explorer = ({ // fill saved user configs if (objectData?.type) { let visConfig = {}; - if (!isEmpty(objectData.user_configs) && !isEmpty(objectData.user_configs.series)) { - visConfig = JSON.parse(objectData.user_configs); + const customConfig = objectData.user_configs ? JSON.parse(objectData.user_configs) : {}; + if (!isEmpty(customConfig.dataConfig) && !isEmpty(customConfig.dataConfig?.series)) { + visConfig = { ...customConfig }; } else { const statsTokens = queryManager.queryParser().parse(objectData.query).getStats(); visConfig = { dataConfig: { ...getDefaultVisConfig(statsTokens) } }; @@ -1350,7 +1350,7 @@ export const Explorer = ({ delayTime: number ) => { setLiveTailName(name); - setLiveTailTabId(curSelectedTabId.current as unknown as string); + setLiveTailTabId((curSelectedTabId.current as unknown) as string); setIsLiveTailOn(true); setToast('Live tail On', 'success'); setIsLiveTailPopoverOpen(false); diff --git a/dashboards-observability/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap b/dashboards-observability/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap index 7283927bb..cc5cc9941 100644 --- a/dashboards-observability/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap +++ b/dashboards-observability/public/components/event_analytics/explorer/visualizations/config_panel/__tests__/__snapshots__/config_panel.test.tsx.snap @@ -452,13 +452,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -775,13 +768,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -1081,13 +1067,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -1410,13 +1389,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, Object { "defaultState": Array [], "editor": [Function], @@ -1670,28 +1642,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] "mapTo": "labelSize", "name": "Label size", }, - Object { - "component": [Function], - "defaultState": Object { - "name": "default", - }, - "eleType": "colorpicker", - "isSingleSelection": true, - "mapTo": "colorTheme", - "name": "Color theme", - "options": Array [ - Object { - "title": "Default", - "type": "text", - "value": "default", - }, - Object { - "title": "Single Color", - "type": "text", - "value": "singleColor", - }, - ], - }, ], }, ], @@ -2507,13 +2457,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -2845,13 +2788,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -3188,13 +3124,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -3466,13 +3395,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -3810,13 +3732,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -4124,13 +4039,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -4606,13 +4514,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], } } @@ -5064,13 +4965,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -5397,13 +5291,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], } } @@ -5855,13 +5742,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -6401,13 +6281,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -6778,13 +6651,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], } } @@ -7236,13 +7102,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -7796,13 +7655,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -8623,13 +8475,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -9949,13 +9794,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -11296,13 +11134,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] }, ], }, - Object { - "editor": [Function], - "id": "color-theme", - "mapTo": "colorTheme", - "name": "Color theme", - "schemas": Array [], - }, ], }, Object { @@ -13736,679 +13567,6 @@ exports[`Config panel component Renders config panel with visualization data 1`] - -
-
- - -
-
- -
-
- -
-
- - - - - - -
- -
-
- -
-
- - -
-
-
diff --git a/dashboards-observability/public/components/metrics/sidebar/__tests__/__snapshots__/sidebar.test.tsx.snap b/dashboards-observability/public/components/metrics/sidebar/__tests__/__snapshots__/sidebar.test.tsx.snap index 9cee54555..b7f4adfcd 100644 --- a/dashboards-observability/public/components/metrics/sidebar/__tests__/__snapshots__/sidebar.test.tsx.snap +++ b/dashboards-observability/public/components/metrics/sidebar/__tests__/__snapshots__/sidebar.test.tsx.snap @@ -125,7 +125,7 @@ exports[`Side Bar Component renders Side Bar Component 1`] = ` initialIsOpen={true} isLoading={false} isLoadingMessage={false} - paddingSize="xs" + paddingSize="none" >
        ({ }, ], }, - { - id: 'color-theme', - name: 'Color theme', - editor: ConfigColorTheme, - mapTo: 'colorTheme', - schemas: [], - }, ], }, { diff --git a/dashboards-observability/public/components/visualizations/charts/data_table/data_table_type.ts b/dashboards-observability/public/components/visualizations/charts/data_table/data_table_type.ts index effa7b716..7ad582ccd 100644 --- a/dashboards-observability/public/components/visualizations/charts/data_table/data_table_type.ts +++ b/dashboards-observability/public/components/visualizations/charts/data_table/data_table_type.ts @@ -97,13 +97,6 @@ export const createDatatableTypeDefinition = (params: any = {}) => ({ }, ], }, - { - id: 'style-panel', - name: 'Layout', - mapTo: 'layoutConfig', - editor: ConfigEditor, - content: [], - }, ], }, visconfig: { diff --git a/dashboards-observability/public/components/visualizations/charts/lines/line_type.ts b/dashboards-observability/public/components/visualizations/charts/lines/line_type.ts index d02558b66..b82e44eb0 100644 --- a/dashboards-observability/public/components/visualizations/charts/lines/line_type.ts +++ b/dashboards-observability/public/components/visualizations/charts/lines/line_type.ts @@ -204,13 +204,6 @@ export const createLineTypeDefinition = (params: any = {}) => ({ }, ], }, - { - id: 'color-theme', - name: 'Color theme', - editor: ConfigColorTheme, - mapTo: 'colorTheme', - schemas: [], - }, { id: 'thresholds', name: 'Thresholds', diff --git a/dashboards-observability/public/components/visualizations/charts/pie/pie_type.ts b/dashboards-observability/public/components/visualizations/charts/pie/pie_type.ts index 690754556..2ec2dc1e7 100644 --- a/dashboards-observability/public/components/visualizations/charts/pie/pie_type.ts +++ b/dashboards-observability/public/components/visualizations/charts/pie/pie_type.ts @@ -121,15 +121,6 @@ export const createPieTypeDefinition = (params: any) => ({ mapTo: 'labelSize', eleType: 'input', }, - { - name: 'Color theme', - isSingleSelection: true, - component: ColorPalettePicker, - mapTo: 'colorTheme', - eleType: 'colorpicker', - options: PIE_PALETTES, - defaultState: { name: DEFAULT_PALETTE }, - }, ], }, ],