Skip to content

fix issues related to tutorial - #24445

Closed
sreevani-ship-it wants to merge 1 commit into
angular:masterfrom
sreevani-ship-it:tutorial-fix1
Closed

sreevani-ship-it wants to merge 1 commit into
angular:masterfrom
sreevani-ship-it:tutorial-fix1

Conversation

@sreevani-ship-it

@sreevani-ship-it sreevani-ship-it commented Jun 12, 2018 •

Copy link
Copy Markdown
Contributor

docs(tutorial): fix issues related to tutorial.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[x] Documentation content changes
[ ] angular.io application / infrastructure changes
[ ] Other... Please describe:

What is the current behavior?

Issue Number: #18078
#23747
#22120
#23865
#18869
#19714

What is the new behavior?

Fixed code snippets to reflect the code changes in final review.

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

@mary-poppins

Copy link
Copy Markdown

You can preview e26ba71 at https://pr24445-e26ba71.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview a2e9887 at https://pr24445-a2e9887.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview d0e800f at https://pr24445-d0e800f.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview 7d12e9d at https://pr24445-7d12e9d.ngbuilds.io/.

@sreevani-ship-it sreevani-ship-it changed the title Fix issues related to tutorial fix issues related to tutorial Jun 20, 2018
@mary-poppins

Copy link
Copy Markdown

You can preview aad2f9a at https://pr24445-aad2f9a.ngbuilds.io/.

@sreevani-ship-it sreevani-ship-it added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jun 20, 2018
@jenniferfell

jenniferfell commented Jun 26, 2018 •

Copy link
Copy Markdown
Contributor

@chembu Would you be willing to add one more fix to this PR?

This PR #19715 contains a suggestion that is still relevant, although things have moved around a bit.

Location:
https://angular.io/tutorial/toh-pt2#displaying-heroes

Current doc:
Add a heroes property to the class that exposes these heroes for binding.
heroes = HEROES;

The other PR is about providing more context about where this code goes. The suggestion against an older doc was to add this: "To make it easier to read your code, keep all public properties together. For this tutorial, define the heroes property between the existing title and hero properties."

Will you look at where the example code puts this line of code, and then add a bit more context in the doc. You could also expand the docregion to show more of the code, such as the lines immediately before and/or after this property definition.

If you can include a fix in this PR, then I'll close that other one.

Thanks!

@jenniferfell jenniferfell mentioned this pull request Jun 26, 2018
2 tasks done
@mary-poppins

Copy link
Copy Markdown

You can preview b6af21d at https://pr24445-b6af21d.ngbuilds.io/.

@jenniferfell jenniferfell added the target: patch This PR is targeted for the next patch release label Jun 29, 2018

@jenniferfell jenniferfell left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks pretty good. Some minor requests. Thanks.

Comment thread aio/content/tutorial/toh-pt2.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We're already in that file, because we just did the import, so this

In the HeroesComponent class (in the same file), define a component property called heroes to expose the HEROES array for binding.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would it also work to add text recommended by PR 19715, such as: "It is common practice to keep all public properties together. For this tutorial, define the heroes property between the existing title and hero properties."

Or have we already said something like that earlier in the tutorial?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since we normally isolate properties when displaying how they are added, I don't think its going to make a difference here. In the final code review, the properties should be grouped together.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like that you're trying to include lots of context, but this feels like an odd ending. It's not the end of the class definition, but it also maybe more than needed below the heroes= line. Maybe just these 3 lines. And does the coding style allow for closing up some blank lines?

export class HeroesComponent implements OnInit {
heroes = HEROES;
selectedHero: Hero;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the only thing that needs to be displayed here is the export line, the heroes line and the closing curly braces. The selectedHero isn't mentioned until later in this section.

export class HeroesComponent implements OnInit {
  heroes = HEROES;
}

You will have to remove some of the blank lines in the example file so there isn't so much space in between areas.

Comment thread aio/content/tutorial/toh-pt3.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Add . at end of sentence

Comment thread aio/content/tutorial/toh-pt3.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Initial cap for each bullet

  • A css file...

Comment thread aio/content/tutorial/toh-pt6.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good. Two minor changes.

  • I would move "(such as api/heroes/11)" to be after this second paragraph.
  • Minor editorial: "Here, the base URL is the heroesURL defined in the Heroes and HTTP section (api/heroes), and the id is the id number of the hero that you want to retrieve. For example, api/heroes/11.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I recommend beginning with why this method is here. Then keep description of what it returns.

"Overrides the genId method to ensure that a Hero always has an id."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also add a line break above line 21

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Editorial recommendation:

// If the heroes array is empty, the method below returns the initial number (11).
// If the heroes array is not empty, the method below returns
// the max number of ids plus 1.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would clarify to say it returns the highest hero id plus + 1

Comment thread aio/content/tutorial/toh-pt3.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we show the app.module.ts file here? Or is that too distracting?

Minimally please add app.module.ts to the final code review, so all files changed in this tutorial section are listed, even if they are changed by the CLI and not manually. Thx.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added app.module.ts to the final code review.

@jenniferfell

jenniferfell commented Jun 29, 2018 •

Copy link
Copy Markdown
Contributor

LGTM
#18078
#18869

Minor requests/recommendations
#22120 - request a bit of extra explanation and minor editorial changes
#23865 - request adding file to final review
#19714 and #19715 (same problem) - edit and shrink code range just a little

Not addressed by this PR, so either add or just remove it from the description and fix in separate PR later:
#23747 (toh-pt6 final code review is missing the files changed in the "Search by name" section)

  • The PR has the Dashboard component file added to the final review section.

@jenniferfell

Copy link
Copy Markdown
Contributor

@brandonroberts Hi. Do you feel comfortable giving this a review for technical accuracy? It's a collection of small issues. Most had very good descriptions and recommendations in the original issues. (We need a pull approver, and you're in the right group.)

@brandonroberts

Copy link
Copy Markdown
Contributor

@jenniferfell yes, I'll take care of the review

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think the only thing that needs to be displayed here is the export line, the heroes line and the closing curly braces. The selectedHero isn't mentioned until later in this section.

export class HeroesComponent implements OnInit {
  heroes = HEROES;
}

You will have to remove some of the blank lines in the example file so there isn't so much space in between areas.

Comment thread aio/content/tutorial/toh-pt3.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The description for the test spec file is missing

Comment thread aio/content/tutorial/toh-pt3.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We say four files are generated, but only list three below. The test spec file is the other file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Also add a line break above line 21

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would clarify to say it returns the highest hero id plus + 1

Comment thread aio/content/tutorial/toh-pt6.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Earlier in the file on line 61, it says Add the HttpClientInMemoryWebApiModule to the @NgModule.imports array— after importing the HttpClient

HttpClient should be HttpClientModule

Comment thread aio/content/tutorial/toh-pt2.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Since we normally isolate properties when displaying how they are added, I don't think its going to make a difference here. In the final code review, the properties should be grouped together.

@mary-poppins

Copy link
Copy Markdown

You can preview e4b7707 at https://pr24445-e4b7707.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview f190141 at https://pr24445-f190141.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview 4917d11 at https://pr24445-4917d11.ngbuilds.io/.

@brandonroberts

Copy link
Copy Markdown
Contributor

Changes LGTM. Commit messages need updating though

@jenniferfell

Copy link
Copy Markdown
Contributor

@brandonroberts Thanks for catching the commit message.

@chembu https://github.com/angular/angular/blob/master/CONTRIBUTING.md#commit
and also https://help.github.com/articles/closing-issues-using-keywords/

docs(tutorial): fix minor issues with clarity and example code snippets
closes #18078, closes #18869, closes #22120, closes #23865, closes #19714

@mary-poppins

Copy link
Copy Markdown

You can preview 2f6707d at https://pr24445-2f6707d.ngbuilds.io/.

@brandonroberts brandonroberts added the action: merge The PR is ready for merge by the caretaker label Jul 4, 2018
@jenniferfell jenniferfell removed the action: merge The PR is ready for merge by the caretaker label Jul 9, 2018
@googlebot

Copy link
Copy Markdown

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@mary-poppins

Copy link
Copy Markdown

You can preview ca01b88 at https://pr24445-ca01b88.ngbuilds.io/.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Couple of small fixes to this sentence;

If the heroes array is not empty, the method below returns the highest

if -> If the
heighest -> highest

@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

@mary-poppins

Copy link
Copy Markdown

You can preview 9dd2213 at https://pr24445-9dd2213.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview 14ee7ac at https://pr24445-14ee7ac.ngbuilds.io/.

@mary-poppins

Copy link
Copy Markdown

You can preview eac67a9 at https://pr24445-eac67a9.ngbuilds.io/.

@angular-automatic-lock-bot

Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker cla: yes target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants