Skip to content

Commit

Permalink
Remove navigation from Discover to Visualize (#89132)
Browse files Browse the repository at this point in the history
* Remove navigation from Discover to Visualize

* Remove unused translation

* Remove oss check from functional test

* Fix functional test

* Skip test for OSS

* Fix

* Should not remove the uiSettings getter and setter

* Move the isOss flag inside the test

* Cleanup

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
stratoula and kibanamachine authored Feb 3, 2021
1 parent d560b1c commit d8f7997
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 597 deletions.
1 change: 0 additions & 1 deletion src/plugins/visualize/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"visualizations",
"embeddable",
"dashboard",
"uiActions",
"presentationUtil"
],
"optionalPlugins": [
Expand Down
88 changes: 0 additions & 88 deletions src/plugins/visualize/public/actions/visualize_field_action.ts

This file was deleted.

34 changes: 3 additions & 31 deletions src/plugins/visualize/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,8 @@ import { DEFAULT_APP_CATEGORIES } from '../../../core/public';
import { SavedObjectsStart } from '../../saved_objects/public';
import { EmbeddableStart } from '../../embeddable/public';
import { DashboardStart } from '../../dashboard/public';
import { UiActionsSetup, VISUALIZE_FIELD_TRIGGER } from '../../ui_actions/public';
import type { SavedObjectTaggingOssPluginStart } from '../../saved_objects_tagging_oss/public';
import {
setUISettings,
setApplication,
setIndexPatterns,
setQueryService,
setShareService,
setVisEditorsRegistry,
} from './services';
import { visualizeFieldAction } from './actions/visualize_field_action';
import { createVisualizeUrlGenerator } from './url_generator';
import { setVisEditorsRegistry, setUISettings } from './services';
import { createVisEditorsRegistry, VisEditorsRegistry } from './vis_editors_registry';

export interface VisualizePluginStartDependencies {
Expand All @@ -71,7 +61,6 @@ export interface VisualizePluginSetupDependencies {
urlForwarding: UrlForwardingSetup;
data: DataPublicPluginSetup;
share?: SharePluginSetup;
uiActions: UiActionsSetup;
}

export interface VisualizePluginSetup {
Expand All @@ -96,7 +85,7 @@ export class VisualizePlugin

public async setup(
core: CoreSetup<VisualizePluginStartDependencies>,
{ home, urlForwarding, data, share, uiActions }: VisualizePluginSetupDependencies
{ home, urlForwarding, data }: VisualizePluginSetupDependencies
) {
const {
appMounted,
Expand Down Expand Up @@ -129,19 +118,8 @@ export class VisualizePlugin
this.stopUrlTracking = () => {
stopUrlTracker();
};
if (share) {
share.urlGenerators.registerUrlGenerator(
createVisualizeUrlGenerator(async () => {
const [coreStart] = await core.getStartServices();
return {
appBasePath: coreStart.application.getUrlForApp('visualize'),
useHashedUrl: coreStart.uiSettings.get('state:storeInSessionStorage'),
};
})
);
}

setUISettings(core.uiSettings);
uiActions.addTriggerAction(VISUALIZE_FIELD_TRIGGER, visualizeFieldAction);

core.application.register({
id: 'visualize',
Expand Down Expand Up @@ -245,12 +223,6 @@ export class VisualizePlugin

public start(core: CoreStart, plugins: VisualizePluginStartDependencies) {
setVisEditorsRegistry(this.visEditorsRegistry);
setApplication(core.application);
setIndexPatterns(plugins.data.indexPatterns);
setQueryService(plugins.data.query);
if (plugins.share) {
setShareService(plugins.share);
}
}

stop() {
Expand Down
17 changes: 1 addition & 16 deletions src/plugins/visualize/public/services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,13 @@
* compliance with, at your election, the Elastic License or the Server Side
* Public License, v 1.
*/

import { ApplicationStart, IUiSettingsClient } from '../../../core/public';
import { IUiSettingsClient } from '../../../core/public';
import { createGetterSetter } from '../../../plugins/kibana_utils/public';
import { IndexPatternsContract, DataPublicPluginStart } from '../../../plugins/data/public';
import { SharePluginStart } from '../../../plugins/share/public';
import { VisEditorsRegistry } from './vis_editors_registry';

export const [getUISettings, setUISettings] = createGetterSetter<IUiSettingsClient>('UISettings');

export const [getApplication, setApplication] = createGetterSetter<ApplicationStart>('Application');

export const [getShareService, setShareService] = createGetterSetter<SharePluginStart>('Share');

export const [getIndexPatterns, setIndexPatterns] = createGetterSetter<IndexPatternsContract>(
'IndexPatterns'
);

export const [
getVisEditorsRegistry,
setVisEditorsRegistry,
] = createGetterSetter<VisEditorsRegistry>('VisEditorsRegistry');

export const [getQueryService, setQueryService] = createGetterSetter<
DataPublicPluginStart['query']
>('Query');
89 changes: 0 additions & 89 deletions src/plugins/visualize/public/url_generator.test.ts

This file was deleted.

Loading

0 comments on commit d8f7997

Please sign in to comment.