Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(D&D): fixes reloading app #1855

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/plugins/wizard/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { TypeService } from './services/type_service';
import { getPreloadedStore } from './application/utils/state_management';
import { setAggService, setIndexPatterns } from './plugin_services';
import { createSavedWizardLoader } from './saved_visualizations';
import { registerDefaultTypes } from './visualizations';

export class WizardPlugin
implements
Expand All @@ -38,6 +39,8 @@ export class WizardPlugin
{ visualizations }: WizardPluginSetupDependencies
) {
const typeService = this.typeService;
registerDefaultTypes(typeService.setup());

// Register the plugin to core
core.application.register({
id: 'wizard',
Expand All @@ -63,8 +66,6 @@ export class WizardPlugin
setIndexPatterns(data.indexPatterns);

// Register Default Visualizations
const { registerDefaultTypes } = await import('./visualizations');
registerDefaultTypes(typeService.setup(), pluginsStart);

const services: WizardServices = {
...coreStart,
Expand Down
6 changes: 1 addition & 5 deletions src/plugins/wizard/public/visualizations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@

import type { TypeServiceSetup } from '../services/type_service';
import { createMetricConfig } from './metric';
import { WizardPluginStartDependencies } from '../types';

export function registerDefaultTypes(
typeServiceSetup: TypeServiceSetup,
pluginsStart: WizardPluginStartDependencies
) {
export function registerDefaultTypes(typeServiceSetup: TypeServiceSetup) {
const visualizationTypes = [createMetricConfig];

visualizationTypes.forEach((createTypeConfig) => {
Expand Down