Skip to content

Conversation

@jenny-s51
Copy link
Contributor

What: Closes #7139

Additional issues:

@patternfly-build
Copy link
Collaborator

patternfly-build commented Mar 30, 2022

@jenny-s51 jenny-s51 changed the title chore(data list): convert to TS chore(DataList): convert examples to TypeScript Mar 30, 2022
Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

Only a few comments below, a couple of requested changes and one nitpick. Also the comment I left on the DatePicker conversion PR applies here, so depending on your response to that (regarding the export names from each example) that may apply here, too.

Comment on lines +31 to +37
if (allExpanded) {
setExpanded(['ex-toggle1', 'ex-toggle2', 'ex-toggle3']);
} else {
setExpanded([]);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This if...else block would work better in a useEffect I believe. Currently the arrow icon for the expand/collapse all toggle doesn't really match the actual allExpanded state; if all items are expanded the expand/collapse all toggle has a right arrow when it should have a down arrow, for example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice catch! Great idea.

return (
<>
<div key="example-1">
<h2>Default fitting - example 1</h2>
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 it'd be worth updating this (and the other sub-examples in this section) to an <h4> element

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 Updated! Definitely looks better - thanks!

Comment on lines 22 to 24
Array.from({ length: count }, (v, k) => k).map(k => ({
id: `item-${k}`,
content: `item ${k} `.repeat(k === 4 ? 20 : 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: may be something worth fixing in another issue, but I think it'd be worth giving these v and k params more meaningful names

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

Updates look great!

Copy link
Contributor

@nicolethoen nicolethoen left a comment

Choose a reason for hiding this comment

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

Looks great!

Could you rebase your PR? I think there is a new Data List example that we should be sure we don't leave out of the typescript conversions :)

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

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

You are just missing one file in your MD file. Looks good otherwise.

Copy link
Contributor

@tlabaj tlabaj left a comment

Choose a reason for hiding this comment

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

LGTM

@jenny-s51 jenny-s51 requested a review from nicolethoen April 12, 2022 15:47
@nicolethoen nicolethoen merged commit 18817c8 into patternfly:main Apr 12, 2022
@patternfly-build
Copy link
Collaborator

Your changes have been released in:

  • eslint-plugin-patternfly-react@4.41.27
  • @patternfly/react-catalog-view-extension@4.53.27
  • @patternfly/react-charts@6.55.27
  • @patternfly/react-code-editor@4.43.27
  • @patternfly/react-console@4.53.27
  • @patternfly/react-core@4.202.27
  • @patternfly/react-docs@5.63.27
  • @patternfly/react-icons@4.53.27
  • @patternfly/react-inline-edit-extension@4.47.27
  • demo-app-ts@4.162.27
  • @patternfly/react-integration@4.164.27
  • @patternfly/react-log-viewer@4.47.27
  • @patternfly/react-styles@4.52.27
  • @patternfly/react-table@4.71.27
  • @patternfly/react-tokens@4.54.27
  • @patternfly/react-topology@4.49.27
  • @patternfly/react-virtualized-extension@4.49.27
  • transformer-cjs-imports@4.40.27

Thanks for your contribution! 🎉

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.

Data list: convert examples to TypeScript

5 participants