-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Shim dev tools #49349
Merged
Merged
Shim dev tools #49349
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
62f3164
centralize dependencies
flash1293 0bf00ae
move more stuff into kibana_services
flash1293 e72e51a
fix tests and dependency
flash1293 b42f417
bootstrap home via local application service
flash1293 0d2521e
fix routing for home app
flash1293 12fb70b
Merge remote-tracking branch 'upstream/master' into centralize-home
flash1293 af3ad7f
switch to dependency getter instead of direct exports
flash1293 a455322
Merge branch 'centralize-home' into local-application-service
flash1293 a1295d3
clean up
flash1293 082748a
add redirect functionality to local application service
flash1293 2bf3bf6
return early from route change handlers on dummy wrapper route
flash1293 398299c
fix jest tests
flash1293 822cdac
Merge remote-tracking branch 'upstream/master' into centralize-home
flash1293 4ea2e63
fix broken tests
flash1293 22c5588
Merge branch 'centralize-home' into local-application-service
flash1293 1bd6b3b
local application service
flash1293 c417060
fix mounting home several times
flash1293 48ecdf7
Merge branch 'master' into flash1293/local-application-service
elasticmachine 2bc8856
started shimming dev tools and switching to new registry
flash1293 74fb184
Merge remote-tracking branch 'upstream/master' into flash1293/local-a…
flash1293 79a1a14
Merge branch 'flash1293/local-application-service' of github.com:flas…
flash1293 caa489a
Merge branch 'flash1293/local-application-service' into shim-dev_tools
flash1293 5195ebf
review fixes
flash1293 ebc5d96
move registry into new platform and honor ui capabilities
flash1293 cff57c2
document dev tools registry
flash1293 22ee254
Merge remote-tracking branch 'upstream/master' into shim-dev_tools
flash1293 6bc61a8
Merge remote-tracking branch 'upstream/master' into flash1293/local-a…
flash1293 a724d7b
review fixes
flash1293 5aedc62
decouple from home PR
flash1293 f7e3079
Merge branch 'flash1293/local-application-service' into shim-dev_tools
flash1293 23558e3
deangularize grokdebugger
flash1293 2717229
clean up grokdebugger and dev tools integration
flash1293 b455c15
Merge remote-tracking branch 'upstream/master' into shim-dev_tools
flash1293 fc08919
Merge remote-tracking branch 'upstream/master' into shim-dev_tools
flash1293 2c63955
Merge remote-tracking branch 'upstream/master' into shim-dev_tools
flash1293 6f2235c
finalize dev tools PR
flash1293 84b3e4b
add karma mock
flash1293 3f176f4
fix import
flash1293 8936fbb
Merge remote-tracking branch 'upstream/master' into shim-dev_tools
flash1293 0e6d46f
add data-test subj for dev toola
flash1293 e2a29ab
fix infra by avoiding route_setup import
flash1293 21ef98a
fix functional tests
flash1293 1aff48e
add todos
flash1293 1604156
move console feature registration to right place
flash1293 7ec64ba
fix translations
flash1293 2b26b78
Merge branch 'master' into shim-dev_tools
elasticmachine 79a38a2
Merge remote-tracking branch 'upstream/master' into shim-dev_tools
flash1293 f93ceb0
do not render on redirect
flash1293 57e0197
Merge branch 'shim-dev_tools' of github.com:flash1293/kibana into shi…
flash1293 1d6faa6
Merge branch 'master' into shim-dev_tools
elasticmachine 38498db
address review comments
flash1293 7017789
Merge branch 'master' into shim-dev_tools
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
move registry into new platform and honor ui capabilities
- Loading branch information
commit ebc5d96856d329afc66d577079b0c8650bdc522e
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -17,12 +17,12 @@ | |||||
* under the License. | ||||||
*/ | ||||||
|
||||||
import { sortBy } from 'lodash'; | ||||||
import { App, CoreSetup, Plugin } from 'kibana/public'; | ||||||
import { CoreSetup, CoreStart, Plugin } from 'kibana/public'; | ||||||
import { i18n } from '@kbn/i18n'; | ||||||
import { FeatureCatalogueCategory } from 'ui/registry/feature_catalogue'; | ||||||
|
||||||
import { LocalApplicationService } from '../local_application_service'; | ||||||
import { DevTool, DevToolsStart } from '../../../../../plugins/dev_tools/public'; | ||||||
|
||||||
export interface DevToolsPluginSetupDependencies { | ||||||
__LEGACY: { | ||||||
|
@@ -31,27 +31,12 @@ export interface DevToolsPluginSetupDependencies { | |||||
}; | ||||||
} | ||||||
|
||||||
export interface DevToolsSetup { | ||||||
register: (devTool: DevTool) => void; | ||||||
export interface DevToolsPluginStartDependencies { | ||||||
newPlatformDevTools: DevToolsStart; | ||||||
} | ||||||
|
||||||
export interface DevTool { | ||||||
id: string; | ||||||
title: string; | ||||||
mount: App['mount']; | ||||||
disabled?: boolean; | ||||||
tooltipContent?: string; | ||||||
enableRouting: boolean; | ||||||
order: number; | ||||||
} | ||||||
|
||||||
export class DevToolsPlugin implements Plugin<DevToolsSetup> { | ||||||
private devTools: DevTool[] = []; | ||||||
|
||||||
private getSortedDevTools() { | ||||||
// TODO make sure this works | ||||||
return sortBy(this.devTools, 'order'); | ||||||
} | ||||||
export class DevToolsPlugin implements Plugin { | ||||||
private getSortedDevTools: (() => DevTool[]) | null = null; | ||||||
|
||||||
public setup( | ||||||
core: CoreSetup, | ||||||
|
@@ -78,8 +63,9 @@ export class DevToolsPlugin implements Plugin<DevToolsSetup> { | |||||
id: 'dev_tools', | ||||||
title: 'Dev Tools', | ||||||
mount: async (appMountContext, params) => { | ||||||
// TODO check capabilities whether this page is allowed to be rendered | ||||||
// TODO badge and breadcrumb handling | ||||||
if (!this.getSortedDevTools) { | ||||||
throw new Error('not started yet'); | ||||||
} | ||||||
const { renderApp } = await import('./render_app'); | ||||||
return renderApp( | ||||||
params.element, | ||||||
|
@@ -89,13 +75,9 @@ export class DevToolsPlugin implements Plugin<DevToolsSetup> { | |||||
); | ||||||
}, | ||||||
}); | ||||||
|
||||||
return { | ||||||
register: (devTool: DevTool) => { | ||||||
this.devTools.push(devTool); | ||||||
}, | ||||||
}; | ||||||
} | ||||||
|
||||||
start() {} | ||||||
start(core: CoreStart, { newPlatformDevTools }: DevToolsPluginStartDependencies) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
this.getSortedDevTools = newPlatformDevTools.getSortedDevTools; | ||||||
} | ||||||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"id": "devTools", | ||
"version": "kibana", | ||
"server": false, | ||
"ui": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { PluginInitializerContext } from 'kibana/public'; | ||
import { DevToolsPlugin } from './plugin'; | ||
|
||
export function plugin(initializerContext: PluginInitializerContext) { | ||
return new DevToolsPlugin(); | ||
} | ||
|
||
export * from './plugin'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { App, CoreSetup, Plugin } from 'kibana/public'; | ||
import { sortBy } from 'lodash'; | ||
|
||
export interface DevToolsSetup { | ||
register: (devTool: DevTool) => void; | ||
} | ||
|
||
export interface DevToolsStart { | ||
getSortedDevTools: () => DevTool[]; | ||
} | ||
|
||
export interface DevTool { | ||
id: string; | ||
title: string; | ||
mount: App['mount']; | ||
disabled?: boolean; | ||
tooltipContent?: string; | ||
enableRouting: boolean; | ||
order: number; | ||
} | ||
|
||
export class DevToolsPlugin implements Plugin<DevToolsSetup, DevToolsStart> { | ||
private devTools: DevTool[] = []; | ||
|
||
private getSortedDevTools() { | ||
// TODO make sure this works | ||
return sortBy(this.devTools, 'order'); | ||
} | ||
|
||
public setup(core: CoreSetup) { | ||
return { | ||
register: (devTool: DevTool) => { | ||
this.devTools.push(devTool); | ||
}, | ||
}; | ||
} | ||
|
||
start() { | ||
return { | ||
getSortedDevTools: this.getSortedDevTools.bind(this), | ||
}; | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By convention, this module should live in
./application
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@maryia-lapata @kertal we probably have to fix that in a few places ;)