Skip to content

feat(docs): restore enum expansion on docs page #1266

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

Merged
merged 1 commit into from
Feb 2, 2017

Conversation

fracmak
Copy link
Member

@fracmak fracmak commented Jan 31, 2017

This restores the enum display in the docs lost by #731

To get it to work I'm now parsing the docgen to get the correct values which has it's limitations. docgen is very literal when it comes to programatic propTypes, so I've tried expanding the easy ones but there's a few occurrences that are more difficult to make work (see last screenshot for an example)
screenshot 2017-01-31 15 32 16
screenshot 2017-01-31 15 32 20
screenshot 2017-01-31 15 32 34

@codecov-io
Copy link

codecov-io commented Jan 31, 2017

Codecov Report

Merging #1266 into master will not impact coverage.

@@           Coverage Diff           @@
##           master    #1266   +/-   ##
=======================================
  Coverage   95.91%   95.91%           
=======================================
  Files         882      882           
  Lines        4917     4917           
=======================================
  Hits         4716     4716           
  Misses        201      201
Impacted Files Coverage Δ
src/elements/Label/LabelGroup.js 100% <ø> (ø)
src/collections/Menu/Menu.js 100% <ø> (ø)
src/collections/Menu/MenuItem.js 100% <ø> (ø)
src/elements/Label/Label.js 100% <ø> (ø)
src/elements/Label/LabelDetail.js 100% <ø> (ø)
src/collections/Menu/MenuHeader.js 100% <ø> (ø)
src/collections/Menu/MenuMenu.js 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 1cdabd2...5171da9. Read the comment docs.

Copy link
Member

@levithomason levithomason left a comment

Choose a reason for hiding this comment

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

Thanks, I'd like to get this support back. There are some reasons it was removed initially. I've left a comment here to address that I think will allow us to add the basic functionality back in.

return SUI[parts[1]]
} else if (parts[1] === '_meta') {
// these look like Sidebar._meta.props.animation
return _.get(this.props, `meta.props.${parts[3]}`, value)
Copy link
Member

Choose a reason for hiding this comment

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

_meta.props is in the process of going away and the values are being inlined into the propTypes checkers, example. You can see progress here. Given this, we're removing all traces of _meta.props from the codebase.

In this case, we should probably just not parse the meta.props here at all, for now. Most the enums will show up automatically because the values can be parsed by react-docgen. Those that cannot will be those that have more complicated checkers, which, we'll have to solve another way.

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed

@levithomason levithomason changed the title feat(docs) restore enum expansion on docs page feat(docs): restore enum expansion on docs page Feb 2, 2017
@levithomason levithomason merged commit ff736ba into Semantic-Org:master Feb 2, 2017
@levithomason
Copy link
Member

Thanks!

harel pushed a commit to harel/Semantic-UI-React that referenced this pull request Feb 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants