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

feat(Table): support custom components in expandable rows #1520

Merged
merged 1 commit into from
Mar 20, 2019

Conversation

atiratree
Copy link

by using expandable cellFormatter or ExpandableRowContent component directly

  • exposed isRowExpanded function for extensions to use

#1227 is dependent on this PR.

@patternfly-build
Copy link
Contributor

PatternFly-React preview: https://1520-pr-patternfly-react-patternfly.surge.sh

@codecov-io
Copy link

codecov-io commented Mar 7, 2019

Codecov Report

Merging #1520 into master will increase coverage by 0.04%.
The diff coverage is 96.29%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1520      +/-   ##
==========================================
+ Coverage   83.06%   83.11%   +0.04%     
==========================================
  Files         564      566       +2     
  Lines        6101     6119      +18     
  Branches       59       59              
==========================================
+ Hits         5068     5086      +18     
  Misses       1010     1010              
  Partials       23       23
Flag Coverage Δ
#patternfly3 84.89% <ø> (ø) ⬆️
#patternfly4 79.81% <96.29%> (+0.15%) ⬆️
#patternflymisc 95.65% <ø> (ø) ⬆️
Impacted Files Coverage Δ
...t-table/src/components/Table/utils/transformers.js 100% <ø> (ø) ⬆️
...-4/react-table/src/components/Table/utils/utils.js 100% <100%> (ø)
...ernfly-4/react-table/src/components/Table/Table.js 88.46% <100%> (+0.46%) ⬆️
...fly-4/react-table/src/test-helpers/data-helpers.js 100% <100%> (ø)
...c/components/Table/utils/decorators/collapsible.js 100% <100%> (ø) ⬆️
...ternfly-4/react-table/src/components/Table/Body.js 95.65% <83.33%> (-0.51%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5fffb9a...c73891c. Read the comment docs.

? this.parentsExpanded(rows[parentId].parent)
: rows[parentId].isOpen;
}

mapCells = (row, rowKey) => {
const { headerData } = this.props;
let shiftKey = Boolean(headerData[0] && headerData[0].extraParams.onSelect);
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be good to see more comments, for example it looks like the shiftKey can take values of 0 | 1 | 2 here and then I am not sure how it is used

Copy link
Author

Choose a reason for hiding this comment

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

I added the comments, refactored that part and fixed a small bug in the process

Copy link
Author

Choose a reason for hiding this comment

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

I hope it is readable now

@jschuler
Copy link
Collaborator

LGTM but this needs a look by @priley86 @karelhala

@priley86
Copy link
Member

thanks for reviewing @jschuler. I don't have any issue w/ this and it seems a nice addition, however, @karelhala is much more familiar.

@atiratree atiratree force-pushed the pf4-table-expandable-row branch 2 times, most recently from 19b1924 to 1b9158a Compare March 15, 2019 17:45
@atiratree
Copy link
Author

+ enhanced the TS a bit

@atiratree atiratree force-pushed the pf4-table-expandable-row branch 3 times, most recently from 0c2c957 to e315386 Compare March 18, 2019 09:37
by using expandable cellFormatter or ExpandableRowContent component

- exposed isRowExpanded function for extensions to use
@atiratree atiratree force-pushed the pf4-table-expandable-row branch from e315386 to c73891c Compare March 18, 2019 09:45
@priley86
Copy link
Member

@jschuler @karelhala - any additional thoughts here?

Copy link
Contributor

@karelhala karelhala left a comment

Choose a reason for hiding this comment

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

Codewise looks good. I am just a bit concern about breaking current API, can we document that somewhere so consumers will know about that? Also it would be good if we bump the version of table package so everybody knows that this API changed.

@dtaylor113
Copy link
Member

Codewise looks good. I am just a bit concern about breaking current API, can we document that somewhere so consumers will know about that? Also it would be good if we bump the version of table package so everybody knows that this API changed.

Hi, is this a breaking change?

@karelhala
Copy link
Contributor

Hi, is this a breaking change?

Not really if consumers are going to use the old way it's just going to look differently, but the table will still work and expandable actions will work as well.

@dtaylor113
Copy link
Member

great! thanks @karelhala

Copy link
Member

@priley86 priley86 left a comment

Choose a reason for hiding this comment

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

no issues on my side

@atiratree
Copy link
Author

Codewise looks good. I am just a bit concern about breaking current API, can we document that somewhere so consumers will know about that? Also it would be good if we bump the version of table package so everybody knows that this API changed.

Hi, is this a breaking change?

Not really if consumers are going to use the old way it's just going to look differently, but the table will still work and expandable actions will work as well.

Should I update the version? and write something to the CHANGELOG ?

@atiratree
Copy link
Author

I mean, should the version be 1.3.0 ?

@jschuler
Copy link
Collaborator

No need to manually increment the version or update the changelog, this should be handled correctly by the build

@jschuler jschuler merged commit a0e61ab into patternfly:master Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants