Skip to content

Commit

Permalink
redirect to visualize listing page when by value visualization editor…
Browse files Browse the repository at this point in the history
… doesn't have a value input (elastic#84287)
  • Loading branch information
ThomThomson committed Nov 25, 2020
1 parent 9440389 commit eb241f0
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
import { VisualizeServices } from '../types';
import { VisualizeEditorCommon } from './visualize_editor_common';
import { VisualizeAppProps } from '../app';
import { VisualizeConstants } from '../..';

export const VisualizeByValueEditor = ({ onAppLeave }: VisualizeAppProps) => {
const [originatingApp, setOriginatingApp] = useState<string>();
Expand All @@ -52,7 +53,8 @@ export const VisualizeByValueEditor = ({ onAppLeave }: VisualizeAppProps) => {
setValueInput(valueInputValue);
setEmbeddableId(embeddableIdValue);
if (!valueInputValue) {
history.back();
// if there is no value input to load, redirect to the visualize listing page.
services.history.replace(VisualizeConstants.LANDING_PAGE_PATH);
}
}, [services]);

Expand Down

0 comments on commit eb241f0

Please sign in to comment.