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

refactor(DataList): Refactor DataList based on changes in core #1755

Merged
merged 3 commits into from Apr 12, 2019

Conversation

tlabaj
Copy link
Contributor

@tlabaj tlabaj commented Apr 11, 2019

#1747

What:

Additional issues:

@tlabaj tlabaj added enhancement 🚀 PF4 React issues for the PF4 core effort labels Apr 11, 2019
@patternfly-build
Copy link
Contributor

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

@codecov-io
Copy link

codecov-io commented Apr 11, 2019

Codecov Report

Merging #1755 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1755      +/-   ##
==========================================
+ Coverage   82.72%   82.77%   +0.04%     
==========================================
  Files         598      601       +3     
  Lines        6629     6642      +13     
  Branches       72       72              
==========================================
+ Hits         5484     5498      +14     
+ Misses       1118     1117       -1     
  Partials       27       27
Flag Coverage Δ
#patternfly3 84.87% <ø> (ø) ⬆️
#patternfly4 79.47% <100%> (+0.13%) ⬆️
#patternflymisc 95.68% <ø> (ø) ⬆️
Impacted Files Coverage Δ
...react-core/src/components/DataList/DataListCell.js 100% <100%> (ø) ⬆️
...react-core/src/components/DataList/DataListItem.js 100% <100%> (+20%) ⬆️
...-core/src/components/DataList/DataListItemCells.js 100% <100%> (ø)
...ct-core/src/components/DataList/DataListContent.js 100% <100%> (ø)
...ct-core/src/components/DataList/DataListItemRow.js 100% <100%> (ø)
...act-core/src/components/DataList/DataListToggle.js 100% <100%> (ø) ⬆️
...act-core/src/components/DataList/DataListAction.js 75% <100%> (ø) ⬆️

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 88b3b70...ca6c8fe. Read the comment docs.

@patternfly-build
Copy link
Contributor

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

Copy link
Contributor

@dlabaj dlabaj left a comment

Choose a reason for hiding this comment

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

A couple of changes to some typescript files. Other then that this looks good.

@@ -1,10 +1,11 @@
import { FunctionComponent, HTMLProps, ReactNode } from 'react';

export interface DataListActionProps extends HTMLProps<HTMLDivElement> {
children: any;
Copy link
Contributor

Choose a reason for hiding this comment

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

This is required now.

'aria-labelledby': string;
'aria-label': string;
id: string;
actions: ReactNode[];
actions?: ReactNode[];
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be removed.

redallen
redallen previously approved these changes Apr 12, 2019
disabled={isDisabled}
checked={isChecked || checked}
/>
<div className={css(styles.dataListItemControl, className)} {...props}>
Copy link
Collaborator

Choose a reason for hiding this comment

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

props are spread twice here and in input

@@ -1,7 +1,8 @@
export { default as DataList } from './DataList';
export { default as DataListItem } from './DataListItem';
export { default as DataListAction } from './DataListAction';
Copy link
Collaborator

Choose a reason for hiding this comment

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

We usually also export out the *Props, e.g. DataListActionProps

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So add it for all of t hem correct? even the ones that were not updated?

/** Additional classes added to the DataList item Content Wrapper. Children should be one ore more <DataListCell> nodes */
className: PropTypes.string,
/** Array of <DataListCell> nodes that are rendered one after the other. */
dataListCells: PropTypes.arrayOf(PropTypes.node).isRequired,
Copy link
Collaborator

Choose a reason for hiding this comment

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

We already compose

<DataList>
  <DataListItem>
      <DataListItemCells />
  </DataListItem>
</DataList>

Then why not also <DataListCell> into DataListItemCells?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I want to enforce the consumer using DataListItemsCell wrapper around the DataListItems. That is why I have the prop. Does that answer you question? I am not sure I understand it.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Consumer could still pass anything they want into the dataListCells prop... why not

<DataListItemCells>
  <DataListCell>...</DataListCell>
</DataListItemCells>

Copy link
Member

@christiemolloy christiemolloy left a comment

Choose a reason for hiding this comment

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

pf-c-data-list__expandable-content needs to be outside of pf-c-data-list__item-row thats why this is happening:
Screen Shot 2019-04-12 at 9 35 00 AM

@christiemolloy
Copy link
Member

Also looks like you included the third data list item within the second data list, thats why they're appearing side by side like this:

Screen Shot 2019-04-12 at 9 36 27 AM

Copy link
Member

@christiemolloy christiemolloy left a comment

Choose a reason for hiding this comment

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

LGTM!

@dlabaj dlabaj merged commit 6f3d878 into patternfly:master Apr 12, 2019
@tlabaj tlabaj mentioned this pull request Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🚀 PF4 React issues for the PF4 core effort
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants