Skip to content
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

Merged
merged 6 commits into from
Nov 12, 2019

Conversation

maryia-lapata
Copy link
Contributor

Summary

Move table_list_view to kibana_react

Fixes #49599

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

For maintainers

@maryia-lapata maryia-lapata added Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.6.0 labels Nov 6, 2019
@maryia-lapata maryia-lapata requested a review from a team November 6, 2019 13:04
@maryia-lapata maryia-lapata requested a review from a team as a code owner November 6, 2019 13:04
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app (Team:KibanaApp)

@elasticmachine
Copy link
Contributor

💚 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;
Copy link
Contributor

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;
Copy link
Contributor

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({
Copy link
Contributor

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} を削除",
Copy link
Contributor

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);
Copy link
Contributor

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.

Copy link
Contributor

@flash1293 flash1293 Nov 12, 2019

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

@maryia-lapata maryia-lapata Nov 12, 2019

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:
image

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.

Comment on lines 40 to 41
import { npStart } from 'ui/new_platform';
import { SavedObject } from 'ui/saved_objects/saved_object';
Copy link
Contributor

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.

@elasticmachine
Copy link
Contributor

💔 Build Failed

Copy link
Contributor

@streamich streamich left a 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

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Copy link
Contributor

@flash1293 flash1293 left a 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.

@maryia-lapata maryia-lapata merged commit 3a8e65a into elastic:master Nov 12, 2019
@maryia-lapata maryia-lapata deleted the table-list-view branch November 12, 2019 14:18
jloleysens added a commit to jloleysens/kibana that referenced this pull request Nov 12, 2019
* 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)
jloleysens added a commit to jloleysens/kibana that referenced this pull request Nov 12, 2019
…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)
jloleysens added a commit to jloleysens/kibana that referenced this pull request Nov 13, 2019
…-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)
jloleysens added a commit to jloleysens/kibana that referenced this pull request Nov 13, 2019
…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)
  ...
maryia-lapata added a commit that referenced this pull request Nov 14, 2019
* Move table-list-view to kibana-react

* Pass ui/* import as props

* Update i18n message ids

* Fix TS

* Fix unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backported release_note:skip Skip the PR/issue when compiling release notes Team:Visualizations Visualization editors, elastic-charts and infrastructure v7.6.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move table_list_view to kibana_react
4 participants