-
Notifications
You must be signed in to change notification settings - Fork 378
feat(tables): adds reactabular and patternfly tables examples #143
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
Conversation
0cd3eb7 to
53bdf31
Compare
|
Nice gift @priley86 🎁 🎄 |
|
Great to see Reactabular in action. Feel free to PR something to my README after merge so people find patternfly. 👍 |
|
@bebraw will definitely reach back soon! many thanks for reactabular and being a terrific open source maintainer in the React community! 💯 🏅 👏 👏 👏 |
ohadlevy
left a comment
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.
first of all - awesome :)
I've left a couple of questions in line. whats the next steps for this pr? (e.g. testsing etc)
|
|
||
| // Point the transform to your rows. React state can work for this purpose | ||
| // but you can use a state manager as well. | ||
| const getSortingColumns = () => this.state.sortingColumns || {}; |
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.
Should be props or state?
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 we can probably provide as props which get converted to state (and tracked in componentWillRecieveProps) in a more abstract implementation. We can probably abstract a lot of this to save the consumer some typing in some use cases. Was thinking the same...
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.e I think some use cases will prefer something quite simple where client sorting is enabled via Boolean “sort” prop, and others more specific where we leave everything open to consumer as we do here. Thoughts?
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 we can probably use Mike T's controlled HOC pattern for this. I will circle back once that's in. This is not super pressing just yet... you will have the option downstream.
| sortingOrder, | ||
| selectedColumn, | ||
| }), | ||
| }); |
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.
Nice, what about server side sorting?
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.
Technically Reactabular should allow that as there's nothing frontend specific in the sorting logic. I assume you would apply sort before hydrating the data.
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.
@ohadlevy good point. We can simply provide click callbacks when server side sorting/paging and ignore client paging/sortabular there. I am guessing we will have a lot of variety here so will keep it flexible.
|
good morning, happy 2018 🍾 I've made a few updates here... and have a few questions.
Some things I am still working on:
Should we start looking at integrating updated storybook is here: |
|
@priley86 I think the toolbar/filter integration should be part of the demo app. We could write advanced storybook stories as well if that is desired. |
|
will rebase Forms + Empty State next and try to finish this one out... |
|
@bkearney i'm going to post some updates here later today... here's what i've done locally:
Just doing some local testing / cleanup at this point... I will push this up shortly for review and we can decide if it's worth merging soon, although I prefer a few more days for review here. I think the main idea here is you will have a lot of flexibility on what you want to do (as server side sorting + paging is almost entirely on the downstream and can be simplified a great deal from client side sorting + paging). I plan to add examples of both of those this week to clarify the usage of Hope this gives some context but my aim is to have something ready to merge this week as to open up the door for downstreams to get started... |
|
i've updated w/ my latest local copy here. Still working on some of the things mentioned above, but this should give the idea. updated storybook: |
| FIRST: 'asc', | ||
| asc: 'desc', | ||
| desc: 'asc' | ||
| }; |
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.
leaving this named constants.js for now... will circle back and update all of them in #159
| }, | ||
| transforms: [sortable], | ||
| formatters: [sortingFormat], | ||
| customFormatters: [sortableHeaderCell] |
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.
customFormatters is only due to the fact that reactabular sortabular formatters do not appear to support wrapped formatters (there is a conflict when using the sort formatter + our own formatter causing sort click / onSort to not fire). I will follow up with @bebraw on this, as ideally, we can just support formatters: [sortingFormat, sortableHeaderCell]. I've mimicked this closely using my own custom formatter in addition to reactabular formatters for now.
|
few more updates today:
|
|
i've added the following in my last commit:
updated storybook: I'd like to merge this one soon as I have some other upcoming work this week (also this PR is growing quickly). I think we can revisit empty states in another story/another PR which integrates filters and toolbar too possibly? |
|
@priley86 nope, that was all I found so far. The "per page" text position is still wrong. Can you check it, please: |
|
Alignment looks fine to me. I don't see the need for the |
|
I'm also not seeing issues with alignment (I checked Chrome, FF, and Safari). And I agree that we don't need the |
* exposes some common datatable formatters in constants * adds i18n support to paginator
|
|
I also checked just now with IE 10 & 11. @tstrachota What browser and version were you using? |
|
It turned out to be issue on my side. My pf-react master apparently wasn't up to date. The alignment is fine when I test the PR on top of the latest master. I'm sorry for the confusion. 👍 to merge from my side. Good job @priley86 ! |
|
thanks very much for the reviews and working through this one with me @tstrachota 👍 |
|
Any further comments @jgiardino or anyone else or is this good to merge? |
|
Missed @jgiardino's LGTM above. Going to go ahead and merge this one. Been a long process, thanks @priley86 for all your work on this! |
|
Good job everybody! |

What:
Ho, ho, ho PatternFly React! How about some Data Tables from Santa this year?? 🎅 🎄 🎁
This PR starts the data table contribution w/ Reactabular.
Reactabular is a very powerful library, one that I've barely scratched the surface of here...
Some initial things i've showcased here:
As one can see, this is an extremely flexible React table...
Some things I'd like to do soon...
hiddenattribute on columns)Link to Storybook
Additional issues:
I am off on PTO until 1/3/2018. Maybe someone can review this in the meantime and provide any feedback?
cc: @jeff-phillips-18 @ohadlevy @jgiardino @yaacov @amirfefer @jtomasek
Merry Christmas!
