Skip to content

Commit

Permalink
Apply navigating to dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
sulemanof committed Jun 24, 2020
1 parent ca17287 commit 3e943e2
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 791 deletions.
1 change: 0 additions & 1 deletion src/plugins/visualize/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"navigation",
"savedObjects",
"visualizations",
"dashboard",
"embeddable"
],
"optionalPlugins": ["home", "share"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,10 @@
import './visualize_editor.scss';
import React, { useEffect, useState } from 'react';
import { useParams } from 'react-router-dom';
import { parse } from 'query-string';
import { EventEmitter } from 'events';
import { FormattedMessage } from '@kbn/i18n/react';
import { EuiScreenReaderOnly } from '@elastic/eui';

import { EMBEDDABLE_ORIGINATING_APP_PARAM } from '../../../../embeddable/public';
import { removeQueryParam } from '../../../../kibana_utils/public';
import { useKibana } from '../../../../kibana_react/public';
import {
useChromeVisibility,
Expand Down Expand Up @@ -69,14 +66,11 @@ export const VisualizeEditor = () => {
useLinkedSearchUpdates(services, eventEmitter, appState, savedVisInstance);

useEffect(() => {
const originatingAppValue = parse(services.history.location.search)[
EMBEDDABLE_ORIGINATING_APP_PARAM
] as string | undefined;
if (originatingAppValue) {
removeQueryParam(services.history, EMBEDDABLE_ORIGINATING_APP_PARAM);
}
setOriginatingApp(originatingAppValue);
}, [services.history]);
const { originatingApp: value } =
services.embeddable.getStateTransfer(services.scopedHistory).getIncomingOriginatingApp() ||
{};
setOriginatingApp(value);
}, [services]);

useEffect(() => {
// clean up all registered listeners if any is left
Expand Down
Loading

0 comments on commit 3e943e2

Please sign in to comment.