From 8a604a0ccfd6f621bb95b5c88da7ebf993bf917a Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Tue, 18 Apr 2023 14:04:11 -0700 Subject: [PATCH] Fix redirection to legacy event_analytics URL (#383) Signed-off-by: Joshua Li (cherry picked from commit 23e09e54f86a205443d78ef900b554a4fa66e4a0) --- .../notebooks/components/paragraph_components/para_output.tsx | 3 ++- .../saved_object_savers/ppl/save_as_new_query.ts | 4 ++-- .../saved_objects/saved_object_savers/ppl/save_as_new_vis.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/public/components/notebooks/components/paragraph_components/para_output.tsx b/public/components/notebooks/components/paragraph_components/para_output.tsx index 0a3776e9fc..f1848872e7 100644 --- a/public/components/notebooks/components/paragraph_components/para_output.tsx +++ b/public/components/notebooks/components/paragraph_components/para_output.tsx @@ -134,7 +134,7 @@ export const ParaOutput = (props: { fromObs = fromObs === 'Invalid date' ? visInput.timeRange.from : fromObs; toObs = toObs === 'Invalid date' ? visInput.timeRange.to : toObs; const onEditClick = (savedVisualizationId: string) => { - window.location.assign(`#/event_analytics/explorer/${savedVisualizationId}`); + window.location.assign(`observability-logs#/explorer/${savedVisualizationId}`); }; return ( <> @@ -161,6 +161,7 @@ export const ParaOutput = (props: { case 'HTML': return ( + {/* eslint-disable-next-line react/jsx-pascal-case */} ); diff --git a/public/services/saved_objects/saved_object_savers/ppl/save_as_new_query.ts b/public/services/saved_objects/saved_object_savers/ppl/save_as_new_query.ts index 1c174438d0..b1ada63e4c 100644 --- a/public/services/saved_objects/saved_object_savers/ppl/save_as_new_query.ts +++ b/public/services/saved_objects/saved_object_savers/ppl/save_as_new_query.ts @@ -28,7 +28,7 @@ export class SaveAsNewQuery extends SavedQuerySaver { this.saveClient .create({ ...this.saveParams }) .then((res: any) => { - history.replace(`/event_analytics/explorer/${res.objectId}`); + history.replace(`/explorer/${res.objectId}`); notifications.toasts.addSuccess({ title: 'Saved successfully.', text: `New query '${name}' has been successfully saved.`, @@ -50,7 +50,7 @@ export class SaveAsNewQuery extends SavedQuerySaver { }) ); }); - history.replace(`/event_analytics/explorer/${res.objectId}`); + history.replace(`/explorer/${res.objectId}`); return res; }) .catch((error: any) => { diff --git a/public/services/saved_objects/saved_object_savers/ppl/save_as_new_vis.ts b/public/services/saved_objects/saved_object_savers/ppl/save_as_new_vis.ts index 5ca6bb8c40..814ef97e4a 100644 --- a/public/services/saved_objects/saved_object_savers/ppl/save_as_new_vis.ts +++ b/public/services/saved_objects/saved_object_savers/ppl/save_as_new_vis.ts @@ -54,7 +54,7 @@ export class SaveAsNewVisualization extends SavedQuerySaver { if (appLogEvents) { addVisualizationToPanel(res.objectId, name); } else { - history.replace(`/event_analytics/explorer/${res.objectId}`); + history.replace(`/explorer/${res.objectId}`); } batch(() => {