Skip to content

Commit

Permalink
initial navigateToApp functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed Dec 20, 2019
1 parent cf30a01 commit 7b1499f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions src/plugins/management/public/management_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import { KibanaLegacySetup } from '../../kibana_legacy/public';
// @ts-ignore
import { LegacyManagementSection } from './legacy';
import { CreateSection } from './types';
import { CoreStart } from '../../../core/public';

export class ManagementService {
private sections: ManagementSection[] = [];
constructor() {
this.sections = [];
}

// todo verify input,
private register(
registerLegacyApp: KibanaLegacySetup['registerLegacyApp'],
getLegacyManagement: () => LegacyManagementSection
Expand Down Expand Up @@ -79,12 +79,11 @@ export class ManagementService {
};
};

public start = {
public start = (navigateToApp: CoreStart['application']['navigateToApp']) => ({
getSection: this.getSection.bind(this),
getAllSections: this.getAllSections.bind(this),
navigateToApp: (appId: string, options?: { path?: string; state?: any }) => {
// @ts-ignore
// console.log('navigateToApp', appId, options);
navigateToApp(appId, options);
},
};
});
}
2 changes: 1 addition & 1 deletion src/plugins/management/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class ManagementPlugin implements Plugin<ManagementSetup, ManagementStart

public start(core: CoreStart) {
return {
sections: this.managementSections.start,
sections: this.managementSections.start(core.application.navigateToApp),
legacy: this.legacyManagement.init(core.application.capabilities),
};
}
Expand Down

0 comments on commit 7b1499f

Please sign in to comment.