-
Notifications
You must be signed in to change notification settings - Fork 6.8k
docs(stepper): Improves documentation for stepper component #10537
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
docs(stepper): Improves documentation for stepper component #10537
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed (or fixed any issues), please reply here (e.g. What to do if you already signed the CLAIndividual signers
Corporate signers
|
I signed it!
On Mar 22, 2018, at 8:42 PM, googlebot <notifications@github.com<mailto:notifications@github.com>> wrote:
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
📝 Please visit https://cla.developers.google.com/ to sign.
Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.
…________________________________
What to do if you already signed the CLA
Individual signers
* It's possible we don't have your GitHub username or you're using a different email address on your commit. Check your existing CLA data<https://cla.developers.google.com/clas> and verify that your email is set on your git commits<https://help.github.com/articles/setting-your-email-in-git/>.
Corporate signers
* Your company has a Point of Contact who decides which employees are authorized to participate. Ask your POC to be added to the group of authorized contributors. If you don't know who your Point of Contact is, direct the project maintainer to go/cla#troubleshoot.
* The email used to register you as an authorized contributor must be the email used for the Git commit. Check your existing CLA data<https://cla.developers.google.com/clas> and verify that your email is set on your git commits<https://help.github.com/articles/setting-your-email-in-git/>.
* The email used to register you as an authorized contributor must also be attached to your GitHub account<https://github.com/settings/emails>.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#10537 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ANmr-VIcf0JXAx3Zyo_WJn-EOiFJU201ks5thEUOgaJpZM4S4ARQ>.
|
CLAs look good, thanks! |
<button mat-raised-button (click)="isLinear = true" id="toggle-linear">Enable linear mode</button> | ||
|
||
<button mat-raised-button (click)="isLinear = !isLinear" id="toggle-linear"> | ||
{{!isLinear?'Enable linear mode':'Disable linear mode' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: spaces around ?
, spaces around :
, no space before: }}
@@ -1,5 +1,6 @@ | |||
<button mat-raised-button (click)="isLinear = true" id="toggle-linear">Enable linear mode</button> | |||
|
|||
<button mat-raised-button (click)="isLinear = !isLinear" id="toggle-linear"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why this had an ID in the first place, but we can remove it
@@ -0,0 +1,37 @@ | |||
<button mat-raised-button (click)="isEditable = !isEditable" id="toggle-linear"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove ID
@@ -0,0 +1,37 @@ | |||
<button mat-raised-button (click)="isEditable = !isEditable" id="toggle-linear"> | |||
{{!isEditable?'Enable edit mode':'Disable edit mode' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same spacing comment as above
@@ -0,0 +1,37 @@ | |||
<button mat-raised-button (click)="isEditable = !isEditable" id="toggle-linear"> | |||
{{!isEditable?'Enable edit mode':'Disable edit mode' }} | |||
</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
match indentation with open <button>
tag
* @title Stepper type - editable | ||
*/ | ||
@Component({ | ||
selector: 'stepper-overview-example', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update selector, templateUrl, and styleUrls
@@ -0,0 +1,37 @@ | |||
<button mat-raised-button (click)="isOptional = !isOptional" id="toggle-linear"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same nit comments as previous files
import {FormBuilder, FormGroup, Validators} from '@angular/forms'; | ||
|
||
/** | ||
* @title Stepper type - optional |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@title Stepper with optional steps
firstCtrl: ['', Validators.required] | ||
}); | ||
this.secondFormGroup = this._formBuilder.group({ | ||
secondCtrl: ['',] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can just do ''
templateUrl: 'stepper-type-optional-example.html', | ||
styleUrls: ['stepper-type-optional-example.css'] | ||
}) | ||
export class StepperTypeOptionalExample { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stepper-optional/
, stepper-optional-example.*
, and StepperOptionalExample
I fixed the issues which you had found @mmalerba, and also thought of another two example which perhaps we'd want documented: |
@raygervais Yep those sound like good things to add. The current batch of examples looks good to me, so I can either approve this one and you do the other examples in a separate PR or you can just add them to this PR and I'll wait until you're done. Let me know, thanks for your work on this! |
I'll do an add-on PR after this one is merged since I won't be able to do any work today. I can have it for you by tomorrow estimating. Glad to hear you're in agreement with the extra examples I thought of 😄 |
@raygervais One thing I realized we forgot, can you replace the inline examples in the markdown file with comments that embed these? The overview example shows how to do this: https://github.com/angular/material2/blame/master/src/lib/stepper/stepper.md#L3 |
Doing so now @mmalerba :) |
src/lib/stepper/stepper.md
Outdated
@@ -112,10 +112,52 @@ are completed. | |||
If completion of a step in linear stepper is not required, then the `optional` attribute can be set | |||
on `mat-step`. | |||
|
|||
```html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually you can remove these and put magic comments like for the overview example above:
<!-- example(stepper-overview) -->
Just replace stepper-overview
with the name of the example folder and we have a script to embed it when we suck the markdown files into the docs site. (It comes out looking like this: https://material.angular.io/components/stepper/overview)
Corrected @mmalerba, glad to know there is magic syntax which makes importing example components a breeze! 👍 |
@raygervais can you rebase and push your PR again? |
6d12402
to
aad9b12
Compare
Corrected @josephperrott, I hope the commit message style is as expected, I was unsure if footer was necessary in this case. Either or, happy to fix if need be 👍 |
The commit message looks fine, thanks! It looks like however there are lint and e2e failures, can you take look at those? |
58cb56f
to
b0c7a2a
Compare
Updates button logic setting button from true to !isLinear, including text indicator of current state. Creates editable and optional documentation examples Imports into .MD file using special syntax docs(stepper): Created stepper edit example docs(stepper): Created stepper optional example docs(stepper): Fixed button toggle docs(stepper): Updated editable example docs(stepper): Updated optional example docs(stepper): Fixed overview example docs(stepper): Updated Stepper Markdown docs(stepper): Fixes stepper documentation
b0c7a2a
to
1bd9938
Compare
Corrected E2E issues, should I add tests for the new examples? |
@raygervais Our e2e coverage for most components is pretty lacking, but that's a separate issue. Not required for this PR. |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fixes #10381 by adding documentation examples for edit and option steps.
StackBlitz Demo: https://angular-material2-issue-gebvgu.stackblitz.io