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

updated docs for date picker to new format #2622

Merged
merged 3 commits into from
Dec 28, 2015

Conversation

Zadielerick
Copy link
Contributor

Need feedback. Description for value and value Link. ShowYearSelector seems to be misnamed from disableYearSelection that is passed down to Calendar. Thoughts? Also on the description of the Date Picker.

import Toggle from 'material-ui/lib/toggle';


const DatePickerExamples = React.createClass({
Copy link
Member

Choose a reason for hiding this comment

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

The name is not consistent with docs/src/app/components/DatePicker/ExampleDatePickers.jsx
Can we call this class DatePickerExampleSimple and the file ExampleSimple.jsx?

Copy link
Member

Choose a reason for hiding this comment

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

Can we use the ES6 class syntax too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@oliviertassinari Is there somewhere else with an example of ES6 class in material-ui?

Copy link
Member

Choose a reason for hiding this comment

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

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Dec 21, 2015
import Toggle from 'material-ui/lib/toggle';

const optionsStyle = {
width: '300px',
Copy link
Member

Choose a reason for hiding this comment

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

That's better here 👍.
Since it's for documentation, I would say that

  width: 300,

is better.

@Zadielerick Zadielerick force-pushed the datePickerDocsUpdate branch 2 times, most recently from 46a59f3 to 4e5161e Compare December 21, 2015 20:43
@alitaheri
Copy link
Member

@Zadielerick Could you please break the example down to small examples? Also, move the folders to make a structure like this:

docs\src\app\components\pages\components\DatePicker
   README.md
   Example1...
   Example2...
   ...
   Page.jsx    

Where Page.jsx is the main component of the DatePicker Page.

Then update the docs\src\app\app-routes.jsx to require this Page.jsx and rename the variable to DatePickerPage. Just as discussed here. You can take a look at #2628 too.

@oliviertassinari It's ok to work on other things now. I'll rebase if needed ^_^

@Zadielerick Zadielerick force-pushed the datePickerDocsUpdate branch 3 times, most recently from 328f421 to 8cbc85c Compare December 22, 2015 16:11
shouldDisableDate: React.PropTypes.func,

/**
*
Copy link
Member

Choose a reason for hiding this comment

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

Missing documentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@oliviertassinari Yeah, it looks like the prop name changes to disableYearSelector as it is passed down to Calendar. Not sure though, wanted to check with yall before changing this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@oliviertassinari If you follow the prop, it is passed down to date picker dialog. Here it is passed down to calendar, but calendar has no such prop, but it has disableYearSelection which isn't called anywhere else. Thought it might be misnamed.

Copy link
Member

Choose a reason for hiding this comment

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

I see now, thanks for the explaination! 😳

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should I rename?

Copy link
Member

Choose a reason for hiding this comment

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

That's definitely broken. I think that the best thing to do is to use disableYearSelection and to remove showYearSelector.
Nice finding 👍.

@Zadielerick
Copy link
Contributor Author

@oliviertassinari Actually, there seems to be a bug with the toggles on the date picker component. Makes the datepicker become uncloseable, and with my pull request toggles dont do anything... Don't know whether thats good or bad...

this.setState(state);
}

_handleChange = (nill, date) => {
Copy link
Member

Choose a reason for hiding this comment

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

nill -> event?

@oliviertassinari
Copy link
Member

Makes the datepicker become uncloseable

How can I reproduce this?

});
}

_handleToggle = (e, toggled) => {
Copy link
Member

Choose a reason for hiding this comment

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

I would say that event is more explicit than e.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

@Zadielerick
Copy link
Contributor Author

To reproduce the bug:

  1. Go to date picker component on docs site and toggle the disable year selection toggle
  2. Select the Inline Date Picker, click on the Year Selection at the top and change the Year
  3. Date Picker Dialog will not close after that

import React from 'react';
import DatePicker from 'material-ui/lib/date-picker/date-picker';

export default class DatePickerExampleSimple extends React.Component {
Copy link
Member

Choose a reason for hiding this comment

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

DatePickerExampleInline

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍

}

_handleToggle = (event, toggled) => {
let state = {};
Copy link
Member

Choose a reason for hiding this comment

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

const or you can write instead 👍

this.setState({
  [event.target.name]: toggled,
});


/**
* Creates a ValueLink with the value of date picker.
*/
valueLink: React.PropTypes.object,
Copy link
Member

Choose a reason for hiding this comment

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

@oliviertassinari Should we start deprecating this all over the place?

Copy link
Member

Choose a reason for hiding this comment

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

I was wondering. I don't think that we should do it in this PR.

Copy link
Member

Choose a reason for hiding this comment

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

you beat me to it 😆

@alitaheri
Copy link
Member

@Zadielerick Such fine job 👍 👍 Thanks a lot 😁

@oliviertassinari Lets merge this for now. we should make a big PR deprecating valuLinks

@Zadielerick
Copy link
Contributor Author

@alitaheri @oliviertassinari Thanks! And thanks for checking my stuff, learning a lot from yall :)

/**
* Enables the year selection in the date picker.
*/
showYearSelector: deprecated(React.PropTypes.element,
Copy link
Member

Choose a reason for hiding this comment

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

bool?

@alitaheri
Copy link
Member

While you're at it. can that controlled DatePicker be somewhere else (it's own example would be good too) because it's like we have two perfectly related inline pickers and then a dialog picker. it feels inconsistent. Sorry my last one I swear 😁 😁

@Zadielerick
Copy link
Contributor Author

Yeah, I wanted to incorporate the controlled date picker into an existing example or else we have 5 examples. Should I put it in another existing or make a new example for it?

@alitaheri
Copy link
Member

@Zadielerick I don't think having a lot of examples is a bad thing. In fact I would like a library with a lot of examples, it will surely have something for any of my needs. I'd like to hear @oliviertassinari's thoughts on this one.

@alitaheri
Copy link
Member

I'm all green 👍 👍

@oliviertassinari merge if you're good too 😁

oliviertassinari added a commit that referenced this pull request Dec 28, 2015
[Docs] Update docs for date picker to new format
@oliviertassinari oliviertassinari merged commit 23158d9 into mui:master Dec 28, 2015
@Zadielerick Zadielerick deleted the datePickerDocsUpdate branch December 28, 2015 21:26
@alitaheri
Copy link
Member

Thank you @Zadielerick, This was some hard work 👍 👍 👍 🎉 🎈

@Zadielerick
Copy link
Contributor Author

:) No problem!

@oliviertassinari
Copy link
Member

@Zadielerick Thanks 😄!
For the next commits, I suggest you to follow this rule Use the imperative mood in the subject line http://chris.beams.io/posts/git-commit/. IMHO This is a great material.

@Zadielerick
Copy link
Contributor Author

@oliviertassinari I see, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants