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

De-angularize discover doc_table pager #40999

Merged
merged 13 commits into from
Jul 16, 2019

Conversation

kertal
Copy link
Member

@kertal kertal commented Jul 12, 2019

Summary

Rewrite doc_table pager in React

Bildschirmfoto 2019-07-15 um 10 34 07

Part of #38646

Checklist

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

For maintainers

- [ ] This was checked for breaking API changes and was labeled appropriately

@kertal kertal self-assigned this Jul 12, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@kertal kertal marked this pull request as ready for review July 15, 2019 09:03
@kertal kertal requested review from cjcenizal and flash1293 July 15, 2019 09:04
@kertal kertal added Feature:Discover Discover Application Team:Visualizations Visualization editors, elastic-charts and infrastructure labels Jul 15, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@kertal kertal added release_note:skip Skip the PR/issue when compiling release notes v8.0.0 v7.4.0 review labels Jul 15, 2019
@kertal kertal requested a review from TinaHeiligers July 15, 2019 10:00
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, tested and works

Copy link
Contributor

@cjcenizal cjcenizal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code LGTM! Just had some suggestions on ways to use EUI instead of KUI. Didn't test locally.

onPagePrevious: jest.fn(),
};
const wrapper = mountWithIntl(<ToolBarPagerButtons {...props} />);
wrapper.find('[data-test-subj="btnPrevPage"]').simulate('click');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, EUI publishes a helper that can make this a little terser:

import { findTestSubject } from '@elastic/eui/lib/test';
findTestSubject(wrapper, 'btnPrevPage').simulate('click');

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good to know :)
Screenshot 2019-07-15 at 17 11 12

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very good hint, I've adapted the test


export function ToolBarPagerButtons(props: Props) {
return (
<div className="kuiButtonGroup">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this is possible, but have you considered using the EuiPagination component instead? https://elastic.github.io/eui/#/navigation/pagination

It looks like it will substitute well from a UI-perspective, which would reduce the dependency upon the deprecated KUI library.

image

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider this in a future PR, my current target is to remove angular of discover, I'm aware there is more technical debt here, but I would remove it step by step

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will definitly use the EuiPagination after saying goodbye to angular. thank you for the hint


export function ToolBarPagerText({ startItem, endItem, totalItems }: Props) {
return (
<div className="kuiToolBarText" data-test-subj="toolBarPagerText">
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 we should be able to use EuiText to format this text.

Copy link
Member Author

@kertal kertal Jul 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx, I will address this in the EUIFication of the whole doc_table PR

@elasticmachine
Copy link
Contributor

💔 Build Failed

@kertal kertal force-pushed the kertal-pr-doc_table_pager branch from 99b2428 to 8bd0dcc Compare July 16, 2019 07:11
@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@elasticmachine
Copy link
Contributor

💔 Build Failed

@kertal
Copy link
Member Author

kertal commented Jul 16, 2019

retest - so much unrelated Jenkins error today, should have merged it yesterday :)

@kertal
Copy link
Member Author

kertal commented Jul 16, 2019

jenkins test this

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@kertal kertal merged commit 6a0c40c into elastic:master Jul 16, 2019
kertal added a commit to kertal/kibana that referenced this pull request Jul 17, 2019
* Convert pager buttons to react 

* Convert pager text to react

* Move pager factory to lib folder

* Adapt directives to use react component

* Add jest tests
kertal added a commit that referenced this pull request Jul 17, 2019
* Convert pager buttons to react 

* Convert pager text to react

* Move pager factory to lib folder

* Adapt directives to use react component

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

Successfully merging this pull request may close these issues.

4 participants