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

Statistic: enhance shorthand props and propTypes #390

Merged
merged 4 commits into from
Aug 14, 2016
Merged

Conversation

layershifter
Copy link
Member

1. Update README.md

I forget mark <Step> as implemented.

2. Update usage of Message

<Message> was updated to v1 API, I've updated its usage in docs.

3. Update Statistic's docs

I've updated naming of docs to the most recent pattern.

4. Update prop handling

  1. Allow only string for shorthands.
  2. Shorthands on StatisticLabel and StatisticLabel.
  3. StatisticGroup:
    • Update key handling for children (antipattern with index usage);
    • Extend prop validation of items with Proptypes.shape.

@codecov-io
Copy link

codecov-io commented Aug 13, 2016

Current coverage is 94.86% (diff: 100%)

Merging #390 into master will decrease coverage by <.01%

@@             master       #390   diff @@
==========================================
  Files            85         85          
  Lines          1111       1110     -1   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
- Hits           1054       1053     -1   
  Misses           57         57          
  Partials          0          0          

Powered by Codecov. Last update e1bbafd...b43d353

{ label: 'Views', value: '31,200' },
{ label: 'Members', value: 22 },
{ label: 'Members', value: '22' },
Copy link
Member

@levithomason levithomason Aug 13, 2016

Choose a reason for hiding this comment

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

FYI I think these would work as numbers as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope 😄 22 is number, while '22' is string.

Ideas?

Copy link
Member

Choose a reason for hiding this comment

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

I think we should just change the propType validation to string/number. Since technically it could support node as it ends up here:

<div {...rest} className={classes}>{children || value}</div>

Copy link
Member Author

Choose a reason for hiding this comment

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

It cannot be node, as it's used for key on StepGroup.


Proptypes.oneOf([Proptypes.number, Proptypes.string])

I think that it's not good solution. This raises the question of the behavior of other properties.

Copy link
Member

Choose a reason for hiding this comment

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

Good call. OK, perhaps we only stick with string/number then.

Copy link
Member Author

Choose a reason for hiding this comment

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

If we use string/number, we need allow it to all shorthand props.

Copy link
Member

Choose a reason for hiding this comment

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

Hm, I suppose you are right about this. Feel free to update here or we can merge this and make that update next.

Copy link
Member

Choose a reason for hiding this comment

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

I'll make a separate PR for this actually. The PR will resolve #391.

@levithomason
Copy link
Member

Thanks much for this! A few comments and we can merge.

@levithomason
Copy link
Member

levithomason commented Aug 13, 2016

Anything else on this guy or is it ready for merging?

Replied on shorthand string/number types.

@layershifter
Copy link
Member Author

layershifter commented Aug 14, 2016

I'll update it now with oneOf, so we will can merge it.

@levithomason
Copy link
Member

Great, I'll merge this tomorrow. It's getting late here! 🌔

@levithomason levithomason changed the title Update Statistic Statistic: enhance shorthand props and propTypes Aug 14, 2016
@levithomason levithomason removed the docs label Aug 14, 2016
@levithomason levithomason merged commit a15d37c into master Aug 14, 2016
@levithomason levithomason deleted the fix/statistic branch August 14, 2016 20:19
@levithomason
Copy link
Member

Released in v0.34.2

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