From 6832a76fe086a02199458c66fd390b33af701f80 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 19:35:17 -0700 Subject: [PATCH] fix panel visualization preview, new viz workflow (#401) (#404) Signed-off-by: Shenoy Pratik (cherry picked from commit 78347d9015848dea729c82fbbb4b1f69ebf5c686) Co-authored-by: Shenoy Pratik --- .../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 68529f801..0b8cd491d 100644 --- a/public/components/custom_panels/custom_panel_view_so.tsx +++ b/public/components/custom_panels/custom_panel_view_so.tsx @@ -113,6 +113,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 f0a501b14..c113307e1 100644 --- a/public/components/custom_panels/home.tsx +++ b/public/components/custom_panels/home.tsx @@ -177,6 +177,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);