Skip to content

Commit

Permalink
fix(D&D): fixes reloading app (opensearch-project#1855)
Browse files Browse the repository at this point in the history
Signed-off-by: Ashwin Pc <ashwinpc@amazon.com>
  • Loading branch information
ashwin-pc authored and kavilla committed Jul 28, 2022
1 parent 4eb0c7e commit e9b4cab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
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

0 comments on commit e9b4cab

Please sign in to comment.