-
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 table-list-view to kibana-react #50046
Conversation
Pinging @elastic/kibana-app (Team:KibanaApp) |
💚 Build Succeeded |
@@ -25,7 +25,7 @@ import { Query } from 'src/legacy/core_plugins/data/public'; | |||
import { Filter } from '@kbn/es-query'; | |||
|
|||
export interface SavedObjectDashboard extends SavedObject { | |||
id?: string; | |||
id: string; |
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.
Did you change this because of the map()
in the list view? I think it is possible that there is a SavedObjectDashboard
around without an id (in cases where the dashboard isn't saved yet), so I would like to not change the type here. You can filter out the dashboards without id to stop typescript from complaining (it won't be a runtime problem because there won't be unsaved dashboards in the listing even though that might change in the future):
selectedIds: obj.map(item => item.id).filter((id: undefined | string): id is string => Boolean(id))
@@ -26,5 +26,5 @@ export interface SaveOptions { | |||
export interface SavedObject { | |||
save: (saveOptions: SaveOptions) => Promise<string>; | |||
copyOnSave: boolean; | |||
id?: string; | |||
id: string; |
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.
Same thing here, see above
await this.props.deleteItems(this.state.selectedIds.map(id => itemsById[id])); | ||
} catch (error) { | ||
toastNotifications.addDanger({ | ||
npStart.core.notifications.toasts.addDanger({ |
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.
core.notifications
should either get passed in as a prop or be pulled out of the useKibana()
hook. In both cases you have to make sure the places where the component is used do pass the core services in correctly. AFAIK it's used in visualize, dashboard, graph.
@@ -658,6 +658,20 @@ | |||
"core.euiSuperUpdateButton.refreshButtonLabel": "更新", | |||
"core.euiSuperUpdateButton.updateButtonLabel": "更新", | |||
"core.euiSuperUpdateButton.updatingButtonLabel": "更新中", | |||
"kibana-react.table_list_view.listing.deleteButtonMessage": "{itemCount} 件の {entityName} を削除", |
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 think the ids should use camel case: kibana-react.tableListView.listing.deleteButtonMessage
initialFilter: EMPTY_FILTER, | ||
}; | ||
|
||
export const TableListView = injectI18n(TableListViewUi); |
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 wrap the render tree into an I18nProvider
if we are removing this - I haven't checked but it looks like there is no I18nProvider anymore for the dashboard listing. But even if not it's easier to use with an I18nProvider
.
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 Did you address this comment somewhere?
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.
Not yet, I'll do it today.
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.
@flash1293 I checked this PR with the zh-CN
locale and as you can see on the screenshot the labels are localized:
injectI18n
is HOC that just passes intl
object into props
.
The Dashboard listing is already wrapped into i18nContext here https://github.com/maryia-lapata/kibana/blob/master/src/legacy/core_plugins/kibana/public/dashboard/index.js#L53 . So it's no need to do it again.
import { npStart } from 'ui/new_platform'; | ||
import { SavedObject } from 'ui/saved_objects/saved_object'; |
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.
These two ui/*
imports are not allowed here. You can pass those to the component through props or context instread.
💔 Build Failed |
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.
App Arch changes LGTM
💔 Build Failed |
💚 Build Succeeded |
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, did not test locally. If the i18n thing is solved and I just didn't get how this can be merged.
* upstream/master: Move table-list-view to kibana-react (elastic#50046) [ML] Stats bar for data frame analytics (elastic#49464) [ML] Make navigation in tests more stable (elastic#50132) Migrate authorization subsystem to the new platform. (elastic#46145) Bugfix: Interpreter conversion of string to number should throw on NaN elastic#27788 (elastic#50063) Update dependency @elastic/charts to v14 (elastic#49947) [ML] Adding cloud specific ML node warning (elastic#50139) Fixing bugs in the Shareable Runtime (elastic#49965) Revert router base name for Uptime plugin to use hash in default path. (elastic#50095) Ability to have telemetry always opted in (elastic#49798) Add "Get Help" and "Kibana Feedback" links to the help popover (elastic#49797) Removes references to Elasticsearch mapping types (elastic#47610) [skip-ci] Replace coordinate map in Kibana getting started docs with Maps (elastic#50167) [ML] Indicate missing required privileges for import in File Data Viz (elastic#50147) [SIEM][Detection Engine] Removes technical debt and minor bug fixes (elastic#50111)
…skip ci] * upstream/master: Move table-list-view to kibana-react (elastic#50046) [ML] Stats bar for data frame analytics (elastic#49464) [ML] Make navigation in tests more stable (elastic#50132) Migrate authorization subsystem to the new platform. (elastic#46145) Bugfix: Interpreter conversion of string to number should throw on NaN elastic#27788 (elastic#50063) Update dependency @elastic/charts to v14 (elastic#49947) [ML] Adding cloud specific ML node warning (elastic#50139) Fixing bugs in the Shareable Runtime (elastic#49965) Revert router base name for Uptime plugin to use hash in default path. (elastic#50095) Ability to have telemetry always opted in (elastic#49798) Add "Get Help" and "Kibana Feedback" links to the help popover (elastic#49797) Removes references to Elasticsearch mapping types (elastic#47610) [skip-ci] Replace coordinate map in Kibana getting started docs with Maps (elastic#50167) [ML] Indicate missing required privileges for import in File Data Viz (elastic#50147) [SIEM][Detection Engine] Removes technical debt and minor bug fixes (elastic#50111)
…-fallback * 'master' of github.com:elastic/kibana: Remove internal platform types exports (elastic#50427) [APM] Document `apm_oss.metricsIndices` and `apm_oss.sourcemap… (elastic#50312) [Telemetry] Server side fetcher (elastic#50015) [SIEM] Detection engine placeholders (elastic#50220) [Uptime] Donut chart loader position centered vertically (elastic#50219) update telemetry banner notice text (elastic#50403) Fix aborting when searching without batching (elastic#49966) [Telemetry] Remove telemetry splash page and add conditional messaging (elastic#50189) Revert chromedriver update (elastic#50324) Remove deprecated argument include_type_name from ES calls (elastic#50285) [Maps] add settings to maps telemetry (elastic#50161) remove visualize loader (elastic#46910) Fix misuse of react-router and react-router-dom (elastic#50120) Move table-list-view to kibana-react (elastic#50046) [ML] Stats bar for data frame analytics (elastic#49464)
…ger-ace-theme * 'master' of github.com:elastic/kibana: (56 commits) [ML] Server info service refactor (elastic#50302) Remove internal platform types exports (elastic#50427) [APM] Document `apm_oss.metricsIndices` and `apm_oss.sourcemap… (elastic#50312) [Telemetry] Server side fetcher (elastic#50015) [SIEM] Detection engine placeholders (elastic#50220) [Uptime] Donut chart loader position centered vertically (elastic#50219) update telemetry banner notice text (elastic#50403) Fix aborting when searching without batching (elastic#49966) [Telemetry] Remove telemetry splash page and add conditional messaging (elastic#50189) Revert chromedriver update (elastic#50324) Remove deprecated argument include_type_name from ES calls (elastic#50285) [Maps] add settings to maps telemetry (elastic#50161) remove visualize loader (elastic#46910) Fix misuse of react-router and react-router-dom (elastic#50120) Move table-list-view to kibana-react (elastic#50046) [ML] Stats bar for data frame analytics (elastic#49464) [ML] Make navigation in tests more stable (elastic#50132) Migrate authorization subsystem to the new platform. (elastic#46145) Bugfix: Interpreter conversion of string to number should throw on NaN elastic#27788 (elastic#50063) Update dependency @elastic/charts to v14 (elastic#49947) ...
Summary
Move table_list_view to kibana_react
Fixes #49599
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.For maintainers