Migrate logstash frontend to KP#63417
Conversation
cabc774 to
ca6c71a
Compare
x-pack/plugins/logstash/public/services/license/logstash_license_service.js
Outdated
Show resolved
Hide resolved
...ck/legacy/plugins/logstash/public/lib/update_management_sections/update_logstash_sections.js
Show resolved
Hide resolved
| // When monitoring is migrated this should be fetched from monitoring's plugin contract | ||
| core.injectedMetadata.getInjectedVar('monitoringUiEnabled'), |
There was a problem hiding this comment.
Not sure how to make sure this doesn't get missed when #62908 is merged. I will coordinate with @igoristic to make sure this doesn't break.
|
Pinging @elastic/kibana-platform (Team:Platform) |
| order: 10, | ||
| mount: async params => { | ||
| const [coreStart] = await core.getStartServices(); | ||
| const { renderApp } = await import('./sections'); |
There was a problem hiding this comment.
Should we unify the pattern of the mounter declaration? Place in a folder structure, name, etc? Not a blocker for the current work.
There was a problem hiding this comment.
We actually do have a folder convention for 1st class applications, though I wasn't sure if it should apply to management sections. It looks like other plugins are using this convention for sections as well, so I'll move everything to that for now.
There was a problem hiding this comment.
They do. However, we might want to separate the application & management section folders. Also, we could introduce a convention to place mounter functions in the *_mounter file to unify the declarations.
| @@ -32,16 +30,16 @@ export class MonitoringService { | |||
| .then(cluster => { | |||
| const url = `${this.basePath}/v1/clusters/${cluster.uuid}/logstash/pipeline_ids`; | |||
There was a problem hiding this comment.
this also should move to monitoring service maybe? it's not good that logstash calls monitoring plugin endpoint
There was a problem hiding this comment.
Opened an issue: #63931. Will be easier to fix after monitoring plugin has migrated.
x-pack/plugins/logstash/public/models/pipeline_list_item/pipeline_list_item.js
Outdated
Show resolved
Hide resolved
ycombinator
left a comment
There was a problem hiding this comment.
Smoke tested this PR. Functionally LGTM. Thanks, @joshdover!
|
Base path issue fixed! |
pgayvallet
left a comment
There was a problem hiding this comment.
Some very minor nits. Feel free to ignore them if outside of the scope of the migration.
Seems like the jest test failure is caused because
kibana/src/plugins/management/public/management_service.test.ts
Lines 32 to 35 in d6a500c
needs to be adapted as the logstash section is no longer registered from legacy.
x-pack/plugins/logstash/public/application/pipeline_edit_view.tsx
Outdated
Show resolved
Hide resolved
| const close = useCallback(() => { | ||
| history.push('/'); | ||
| }, [history]); | ||
| const open = useCallback( | ||
| (newId: string) => { | ||
| history.push(`/pipeline/${newId}/edit`); | ||
| }, | ||
| [history] | ||
| ); |
There was a problem hiding this comment.
NIT: useCallback make sense for onRetry (even if debatable), but it seems unnecessary here.
There was a problem hiding this comment.
Correct me if I'm wrong (I'm still new to hooks), but I thought the purpose of useCallback was to avoid creating a new function on each render, possibly triggering unnecessary re-renders of the child components. I'm basically just using this for memoization.
There was a problem hiding this comment.
Yea you are right. Sorry, I thought history was also passed down to the child component (which would have made the useCallback usage useless) but it is not. All good :)
| } | ||
|
|
||
| get isSecurityEnabled() { | ||
| return this.license.getFeature(`security`).isEnabled; |
There was a problem hiding this comment.
Can't use arrow functions on get properties (if that's what you meant).
| * Rejects if the plugin is not available due to license. | ||
| */ | ||
| checkValidity() { | ||
| return new Promise((resolve, reject) => { |
There was a problem hiding this comment.
It's one of the weirdest ways to check a boolean value I've ever seen. 😄
There was a problem hiding this comment.
Yeah maybe I'm err'ing too much on the side of "don't changing anything in this plugin that we don't have to"... Just worried about lack of unit test coverage.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
| const close = useCallback(() => { | ||
| history.push('/'); | ||
| }, [history]); | ||
| const open = useCallback( | ||
| (newId: string) => { | ||
| history.push(`/pipeline/${newId}/edit`); | ||
| }, | ||
| [history] | ||
| ); |
There was a problem hiding this comment.
Yea you are right. Sorry, I thought history was also passed down to the child component (which would have made the useCallback usage useless) but it is not. All good :)
Summary
Closes #60937
This completed the logstash plugin migration to the Kibana Platform:
TODO:
cloneandretryquery paramsChecklist
Delete any items that are not applicable to this PR.
For maintainers