-
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
move management registry to new platform #53020
move management registry to new platform #53020
Conversation
it('provides ManagementSection', () => { | ||
expect(management).to.be.a(ManagementSection); | ||
}); | ||
const createStartContract = () => ({ |
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.
strange diff, not a file move.
@elasticmachine merge upstream |
merge conflict between base and head |
Pinging @elastic/kibana-app-arch (Team:AppArch) |
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.
Tested and works well.
Added a couple comments about type usage
@@ -31,7 +31,7 @@ import { | |||
} from '@elastic/eui'; | |||
import { PRIVACY_STATEMENT_URL } from '../../common/constants'; | |||
import { OptInExampleFlyout } from './opt_in_details_component'; | |||
import { Field } from 'ui/management'; | |||
import { Field } from '../../../kibana/public/management/sections/settings/components/field/field'; |
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.
I would consider renaming this in a subsequent PR to something more management specific.
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.
I don't even think this is management specific TBH. I think Field
is the component used to render each of the advanced settings options.
Originally we had discussed having a dedicated settings
plugin for dealing with the advanced settings UI, but maybe we decided to move it into management instead? I can't remember what the latest thought was on that.
If we do keep it in management though, I 100% agree we should rename. Maybe add a "settings" app / service inside the management plugin, and call it AdvancedSettingsField
or something, IDK.
|
||
import { CoreSetup, CoreStart, Plugin } from 'kibana/public'; | ||
import { ManagementStart } from './types'; | ||
// @ts-ignorets-ignore |
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.
Double ts ignore
*/ | ||
|
||
export interface ManagementStart { | ||
legacy: unknown; |
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.
Why not give this type any
and avoid adding multiple ts-ignores?
import { createUiStatsReporter } from '../../../../../src/legacy/core_plugins/ui_metric/public'; | ||
|
||
export interface LegacyStart { | ||
management: { | ||
getSection: typeof management.getSection; | ||
// @ts-ignore | ||
getSection: typeof npStart.plugins.management.legacy.getSection; |
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.
his applies to all places where typeof npStart...
is used
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.
Tested ML and Transforms edits, and LGTM. Just wondering if the ts-ignores
on npStart.plugins.management.legacy
and management.sections.getSection
can be avoided?
url: `#${JOBS_LIST_PATH}`, | ||
}); | ||
// @ts-ignore | ||
npStart.plugins.management.legacy |
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.
Is this ts-ignore
because legacy
has been given unknown
type in ManagementStart
?
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.
will take a look
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.
They were, thanks for the nudge
@elasticmachine merge upstream |
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.
Security changes LGTM
@elasticmachine merge upstream |
@@ -77,6 +77,7 @@ const managementSections = [ | |||
|
|||
describe('Management', () => { | |||
it('filters and filters and maps section objects into SidebarNav items', () => { | |||
// @ts-ignore |
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.
This was giving me some trouble so I decided to ignore it. I'm happy to revisit with some help. Should be addressed in my next PR since there will be a layer of abstraction to merge two different section formats (new and old platforms)
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.
Reviewed code and tested everything locally. Everything seems to work as expected. I also tested adding a new management section from a NP plugin, and that works too (so I suppose technically this could unblock folks from moving to the new platform today if they really wanted to... although we know this API will be removed before 8.0 still)
I think we might be able to avoid making this change "breaking" altogether by re-exporting the NP contract from the legacy ui/management
. If that works, it could simplify the footprint of this PR greatly and put less pressure on any 3rd party devs who may be registering management sections in their own plugins.
I attempted this and ran into difficulty. I think I ran into lifecycle / compilation problems. I'm seeing trouble navigating between kibana apps. I created a scratch PR to play with to verify - #53253 Edit: Reviewing this. I may have misattributed a problem I saw previously. |
a60d252
to
9e837c3
Compare
9e837c3
to
75e4616
Compare
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.
Diff is much more simple now!
I didn't retest after the recent changes, but overall LGTM
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
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.
Haven't re-tested since the latest updates were pushed, but code all LGTM!
@@ -31,7 +31,7 @@ import { | |||
} from '@elastic/eui'; | |||
import { PRIVACY_STATEMENT_URL } from '../../common/constants'; | |||
import { OptInExampleFlyout } from './opt_in_details_component'; | |||
import { Field } from 'ui/management'; | |||
import { Field } from '../../../kibana/public/management/sections/settings/components/field/field'; |
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.
I don't even think this is management specific TBH. I think Field
is the component used to render each of the advanced settings options.
Originally we had discussed having a dedicated settings
plugin for dealing with the advanced settings UI, but maybe we decided to move it into management instead? I can't remember what the latest thought was on that.
If we do keep it in management though, I 100% agree we should rename. Maybe add a "settings" app / service inside the management plugin, and call it AdvancedSettingsField
or something, IDK.
* move management registry to new platform
Summary
tldr; Move management registry to new platform to provide for transition to new api.
Steps
capabilities
dependencyimport { management } from 'ui/management';
tonpStart.plugins.management.legacy
.ui/management