-
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
[NP] Remove ui/agg_types
dependencies and move paginated table to kibana_legacy
#60276
Conversation
# Conflicts: # src/legacy/core_plugins/kibana/public/visualize/kibana_services.ts # src/legacy/core_plugins/kibana/public/visualize/np_ready/types.d.ts # src/legacy/core_plugins/kibana/public/visualize/plugin.ts # src/legacy/core_plugins/vis_default_editor/public/components/agg_params.tsx # src/legacy/core_plugins/vis_default_editor/public/components/agg_params_helper.test.ts # src/legacy/core_plugins/vis_default_editor/public/components/agg_params_helper.ts # src/legacy/core_plugins/vis_default_editor/public/components/sidebar/state/reducers.ts # src/legacy/core_plugins/vis_default_editor/public/default_editor.tsx # src/legacy/core_plugins/vis_default_editor/public/legacy_imports.ts # src/legacy/core_plugins/vis_type_table/public/legacy_imports.ts # src/legacy/core_plugins/vis_type_vislib/public/legacy_imports.ts # x-pack/plugins/translations/translations/ja-JP.json # x-pack/plugins/translations/translations/zh-CN.json
ui/agg_types
dependencies and move paginated table to kibana_legacy
# Conflicts: # src/legacy/core_plugins/kibana/public/discover/kibana_services.ts # src/legacy/core_plugins/vis_type_tagcloud/public/legacy_imports.ts # x-pack/plugins/translations/translations/ja-JP.json # x-pack/plugins/translations/translations/zh-CN.json
Pinging @elastic/kibana-app (Team:KibanaApp) |
@@ -49,8 +49,6 @@ export default { | |||
'!packages/kbn-ui-framework/src/services/**/*/index.js', | |||
'src/legacy/core_plugins/**/*.{js,jsx,ts,tsx}', | |||
'!src/legacy/core_plugins/**/{__test__,__snapshots__}/**/*', | |||
'src/legacy/ui/public/{agg_types,vis}/**/*.{ts,tsx}', | |||
'!src/legacy/ui/public/{agg_types,vis}/**/*.d.ts', |
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.
There is no necessity to collect coverage from these folders (agg_types
doesn't exist anymore, vis
contains only legacy mocka tests since the most of code was moved)
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.
👍
# Conflicts: # src/legacy/core_plugins/kibana/public/discover/kibana_services.ts
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.
Please re-request review from @elastic/kibana-operations when this is passing CI oops, misinterpreted the latest test results
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.
LGTM from an operations perspective
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.
Code changes LGTM for app arch! Reviewed everything other than the paginate directive updates, which I am unfamiliar with.
And thanks for deleting ui/agg_types
here. Nice to see that going away 🙂
data: { | ||
search: { | ||
aggs: { | ||
types: { | ||
getAll: () => [], | ||
}, | ||
}, | ||
__LEGACY: { | ||
aggTypeFieldFilters: { | ||
filter: () => [], | ||
}, | ||
}, | ||
}, | ||
}, |
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.
nit - It would probably make maintenance easier if you passed the mocks from src/plugins/data/public/mocks.ts
here (assuming that works for these specific tests)
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.
done.
Wrapped KibanaContextProvider
with dataPluginMock
service .
@@ -136,13 +132,14 @@ function getAggParamsToRender({ | |||
} | |||
|
|||
function getAggTypeOptions( | |||
aggTypes: any, |
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.
We should probably expose a proper interface for this from the data plugin, because I don't think there's an easy way to type aggTypes
otherwise. I've added it to our roadmap list in #60126
siblingPipelineType, | ||
termsAggFilter, | ||
} = search.aggs; | ||
|
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.
🎊
@@ -19,13 +19,10 @@ | |||
|
|||
export { npSetup, npStart } from 'ui/new_platform'; | |||
export { getFormat } from 'ui/visualize/loader/pipeline_helpers/utilities'; | |||
export { IAggConfig, AggGroupNames, Schemas } from 'ui/agg_types'; | |||
// @ts-ignore | |||
export { PaginateDirectiveProvider } from 'ui/directives/paginate'; | |||
// @ts-ignore | |||
export { PaginateControlsDirectiveProvider } from 'ui/directives/paginate'; |
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.
you could also adapt imports PaginateDirectiveProvider
and PaginateControlsDirectiveProvider
from kibana_legacy
. then ui/directives/paginate
is only used in src/legacy/core_plugins/timelion/public/directives/saved_object_finder.js
, so it could be inlined there
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.
It's a really good catch, removed reference here and completely removed ui/directives/paginate
references.
src/legacy/core_plugins/vis_default_editor/public/components/agg_params.tsx
Show resolved
Hide resolved
# Conflicts: # x-pack/legacy/plugins/rollup/public/legacy_imports.ts
@elasticmachine merge upstream |
💚 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.
Code LGTM, tested locally with chrome, Kibana continues to loose weight, 154 LOC this time 👍
…ibana_legacy (elastic#60276) * fix agg type shims and move paginated table to kibana_legacy * fix types * fix i18n ids * fix unit tests * Update imports * Remove ui/agg_types imports * Clean up vis_default_editor plugin * Remove agg_types imports in vis_type_table * Clean up x-pack * Clean up vis_type_vislib * Last cleanups * Update docs * Mock Schemas in vis_type_metric * Use data plugin mocks * Remove ui/directives/paginate reference * Remove snapshot * Remove shallow Co-authored-by: Joe Reuter <[email protected]> Co-authored-by: Elastic Machine <[email protected]> # Conflicts: # src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_state.test.ts
* master: (55 commits) Update dependency @elastic/charts to v18.1.0 (elastic#60578) Only set timezone when user setting is a valid timezone (elastic#57850) [NP] Remove `ui/agg_types` dependencies and move paginated table to kibana_legacy (elastic#60276) [SIEM] Fix types in rules tests (elastic#60736) [Alerting] prevent flickering when fields are updated in an alert (elastic#60666) License checks for actions plugin (elastic#59070) Implemented ability to clear and properly validate alert interval (elastic#60571) WebElementWrapper: add findByTestSubject/findAllByTestSubject to search with data-test-subj (elastic#60568) [Maps] Update layer dependencies to NP (elastic#59585) [Discover] Remove StateManagementConfigProvider (elastic#60221) [ML] Listing all categorization wizard checks (elastic#60502) [Upgrade Assistant] First iteration of batch reindex docs (elastic#59887) [SIEM] Export timeline (elastic#58368) [SIEM] Add support for actions and throttle in Rules (elastic#59641) Fix ace a11y listener (elastic#60639) Add addInfo toast to core notifications service (elastic#60574) fix test description (elastic#60638) [SIEM] Cypress screenshots upload to google cloud (elastic#60556) [canvas/shareable_runtime] sync sass loaders with kbn/optimizer (elastic#60653) [SIEM] Fixes Modification of ML Rules (elastic#60662) ...
* master: Only set timezone when user setting is a valid timezone (elastic#57850) [NP] Remove `ui/agg_types` dependencies and move paginated table to kibana_legacy (elastic#60276) [SIEM] Fix types in rules tests (elastic#60736) [Alerting] prevent flickering when fields are updated in an alert (elastic#60666) License checks for actions plugin (elastic#59070) Implemented ability to clear and properly validate alert interval (elastic#60571) WebElementWrapper: add findByTestSubject/findAllByTestSubject to search with data-test-subj (elastic#60568) [Maps] Update layer dependencies to NP (elastic#59585) [Discover] Remove StateManagementConfigProvider (elastic#60221)
…ibana_legacy (#60276) (#60769) * fix agg type shims and move paginated table to kibana_legacy * fix types * fix i18n ids * fix unit tests * Update imports * Remove ui/agg_types imports * Clean up vis_default_editor plugin * Remove agg_types imports in vis_type_table * Clean up x-pack * Clean up vis_type_vislib * Last cleanups * Update docs * Mock Schemas in vis_type_metric * Use data plugin mocks * Remove ui/directives/paginate reference * Remove snapshot * Remove shallow Co-authored-by: Joe Reuter <[email protected]> Co-authored-by: Elastic Machine <[email protected]> # Conflicts: # src/legacy/core_plugins/kibana/public/dashboard/np_ready/dashboard_state.test.ts
Summary
Based on #57695 .
This removes all imports from
ui/agg_types
and uses NP data plugin instead.This also moves paginated table to
kibana_legacy
plugin.For reviewers:
It shouldn't be hard to review this, since the most cases are:
src/plugins/data/public
instead ofui/agg_types
where only types are used;../**/plugins/data/public
instead ofui/agg_types
where static stuff is used;data
plugin contract to access common data services;Checklist
Delete any items that are not applicable to this PR.
For maintainers