From 9020897201748083708243e845f20e0aca8382c8 Mon Sep 17 00:00:00 2001 From: Shenoy Pratik Date: Wed, 19 Apr 2023 15:09:38 -0700 Subject: [PATCH] fix panel visualization preview, new viz workflow (#401) Signed-off-by: Shenoy Pratik (cherry picked from commit 78347d9015848dea729c82fbbb4b1f69ebf5c686) --- .../custom_panels/custom_panel_view_so.tsx | 2 ++ public/components/custom_panels/home.tsx | 2 ++ .../visualization_flyout_so.tsx | 23 ++++++++++++++++--- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/public/components/custom_panels/custom_panel_view_so.tsx b/public/components/custom_panels/custom_panel_view_so.tsx index 19eb6cde4..c39ef71b1 100644 --- a/public/components/custom_panels/custom_panel_view_so.tsx +++ b/public/components/custom_panels/custom_panel_view_so.tsx @@ -127,6 +127,8 @@ interface CustomPanelViewProps { appId?: string; updateAvailabilityVizId?: any; onAddClick?: any; + pplService: PPLService; + dslService: DSLService; } export const CustomPanelViewSO = (props: CustomPanelViewProps) => { diff --git a/public/components/custom_panels/home.tsx b/public/components/custom_panels/home.tsx index 6c86318e2..14de98e91 100644 --- a/public/components/custom_panels/home.tsx +++ b/public/components/custom_panels/home.tsx @@ -237,6 +237,8 @@ export const Home = ({ { - return http - .get(`${CUSTOM_PANELS_API_PREFIX}/visualizations`) + return SavedObjectsActions.getBulk({ + objectType: [SAVED_VISUALIZATION], + sortOrder: 'desc', + fromIndex: 0, + }) + .then((response) => ({ + visualizations: response.observabilityObjectList.map(parseSavedVisualizations), + })) .then((res) => { if (res.visualizations.length > 0) { setSavedVisualizations(res.visualizations);