X Tutup
The Wayback Machine - https://web.archive.org/web/20250521195718/https://github.com/angular/angular/pull/45527
Skip to content

docs: fix code style #45527

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

Conversation

Piyush132000
Copy link
Contributor

@Piyush132000 Piyush132000 commented Apr 5, 2022

I have removed unnecessary code from the components & I initialize the form in the OnInit function (life cycle). I think initialization of forms and getting data from the service must be done inside ngOnInit.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

Update the code style of Product-list & Shipping component.
Removed Unnecessary code.

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

What is the current behavior?

Same behavior as previous

Issue Number: N/A

What is the new behavior?

NA

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@pullapprove pullapprove bot requested a review from AndrewKushnir April 5, 2022 03:21
@AlirezaEbrahimkhani
Copy link
Contributor

@Piyush132000
Tnx
but can you please update the commit message to more closely follow angular commit message guidelines? 🙏
Somthing like this :

docs: fix code style

Updated Product list & shipping component code style

To update, your last commit message you can use this command git commit --amend and then force push your branch
remember you do not need to add another commit message just edit your last commit message. 👍

@Piyush132000 Piyush132000 force-pushed the code-style-update-and-refactoring branch from 052aa44 to 228febc Compare April 7, 2022 11:33
@Piyush132000 Piyush132000 changed the title Fix: docs code style docs: fix code style Apr 7, 2022
@Piyush132000
Copy link
Contributor Author

@Piyush132000 Tnx but can you please update the commit message to more closely follow angular commit message guidelines? 🙏 Somthing like this :

docs: fix code style
Updated Product list & shipping component code style

To update, your last commit message you can use this command git commit --amend and then force push your branch remember you do not need to add another commit message just edit your last commit message. 👍

@AlirezaEbrahimkhani thanks sir and I updated the commit message.

@ngbot ngbot bot added this to the Backlog milestone Apr 7, 2022
@jessicajaniuk
Copy link
Contributor

@Piyush132000 this has some lint and test failures that should be quick to resolve. If you can get them addressed, this is otherwise green and should be quick to land.

@jessicajaniuk jessicajaniuk added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Apr 11, 2022
@Piyush132000
Copy link
Contributor Author

@Piyush132000 this has some lint and test failures that should be quick to resolve. If you can get them addressed, this is otherwise green and should be quick to land.

Sorry for inconvenience, can you please help me how can I remove these failure?

@jessicajaniuk
Copy link
Contributor

jessicajaniuk commented Apr 13, 2022

@Piyush132000 The test_aio failure looks like a simple linting issue where you need a space after a : in one of your files. The test_docs_examples test looks like an issue with one of the types used in the template. You can always click on "Details" in the failed tests listed below in the PR here to see the details of the failed tests.

@Piyush132000
Copy link
Contributor Author

@Piyush132000 The test_aio failure looks like a simple linting issue where you need a space after a : in one of your files. The test_docs_examples test looks like an issue with one of the types used in the template. You can always click on "Details" in the failed tests listed below in the PR here to see the details of the failed tests.

Thanks @jessicajaniuk

@Piyush132000 Piyush132000 force-pushed the code-style-update-and-refactoring branch from 2068330 to c7fb01d Compare April 13, 2022 16:33
@Piyush132000
Copy link
Contributor Author

Hii @jessicajaniuk, I have fixed lint-related issues.

Please verify.

@jessicajaniuk
Copy link
Contributor

@Piyush132000 Looks like the lint issues are fixed, but you still have some test_docs_examples issues. You can see them here.

@Piyush132000
Copy link
Contributor Author

Piyush132000 commented Apr 20, 2022

@Piyush132000 Looks like the lint issues are fixed, but you still have some test_docs_examples issues. You can see them here.

Sorry for the inconvenience, @jessicajaniuk I tried but was not able to fix the failed tests.

@Piyush132000
Copy link
Contributor Author

@Piyush132000 Looks like the lint issues are fixed, but you still have some test_docs_examples issues. You can see them here.

Sorry for the inconvenience, @jessicajaniuk I tried but was not able to fix the failed tests.

Hii @jessicajaniuk can you please help me more so I can fix these failures.


shippingCosts = this.cartService.getShippingPrices();
shippingCosts: { type: string , price: number}[] = [];
Copy link
Contributor

Choose a reason for hiding this comment

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

This is what's breaking the tests. shippingCosts should be an observable since the cartService getShippingPrices method returns an observable. The error in the tests is this:

error TS2740: Type 'Observable<{ type: string; price: number; }[]>' is missing the following properties from type '{ type: string; price: number; }[]': length, pop, push, concat, and 27 more

This is essentially saying there's a type mismatch between what you've specified here, which is just a simple array of objects, and the actual return value, which is an Observable. This needs to be resolved to fix the tests.

@Piyush132000 Piyush132000 force-pushed the code-style-update-and-refactoring branch from 87195b8 to 225b5cd Compare April 29, 2022 04:15
Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

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

Thx for making these improvements, @Piyush132000 👍
I left a couple of suggestions.

@Piyush132000 Piyush132000 force-pushed the code-style-update-and-refactoring branch 2 times, most recently from 8e061a1 to cc445b9 Compare May 5, 2022 03:31
@Piyush132000
Copy link
Contributor Author

Hii @jessicajaniuk @gkalpak please check my PR again.

Thanks

@mary-poppins
Copy link

You can preview 052aa44 at https://pr45527-052aa44.ngbuilds.io/.
You can preview 228febc at https://pr45527-228febc.ngbuilds.io/.
You can preview 2068330 at https://pr45527-2068330.ngbuilds.io/.
You can preview c7fb01d at https://pr45527-c7fb01d.ngbuilds.io/.
You can preview 96281dc at https://pr45527-96281dc.ngbuilds.io/.
You can preview cc445b9 at https://pr45527-cc445b9.ngbuilds.io/.

Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

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

Just a couple of formatting suggestions. Otherwise lgtm 👍

@mary-poppins
Copy link

You can preview 0da8181 at https://pr45527-0da8181.ngbuilds.io/.

@mary-poppins
Copy link

You can preview 16c31df at https://pr45527-16c31df.ngbuilds.io/.

@Piyush132000 Piyush132000 force-pushed the code-style-update-and-refactoring branch from 1f871ef to 4cb7ec8 Compare May 22, 2022 16:09
@mary-poppins
Copy link

You can preview 4cb7ec8 at https://pr45527-4cb7ec8.ngbuilds.io/.

@Piyush132000
Copy link
Contributor Author

Hi @jessicajaniuk, @gkalpak Please review my PR.

Thanks

Copy link
Member

@gkalpak gkalpak left a comment

Choose a reason for hiding this comment

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

LGTM 🚀
Thx, @Piyush132000 👍

Reviewed-for: global-docs-approvers

Comment on lines +269 to +270
1. Define a `shippingCosts` property that sets the `shippingCosts` property using the `getShippingPrices()` method from the `CartService`.
Initialize the `shippingCosts` property inside `ngOnInit()` method.
Copy link
Member

Choose a reason for hiding this comment

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

Nit: The indentation does not match the other items here, but not worth blocking this PR over that.

@gkalpak gkalpak dismissed jessicajaniuk’s stale review May 23, 2022 11:23

Comments have been addressed (i.e. CI is green).

@gkalpak gkalpak added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews action: review The PR is still awaiting reviews from at least one requested reviewer labels May 23, 2022
Copy link
Contributor

@jessicajaniuk jessicajaniuk left a comment

Choose a reason for hiding this comment

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

LGTM 🍪

Thanks for your work and persistence in getting this green, @Piyush132000! 🎉

@alxhub alxhub added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: merge The PR is ready for merge by the caretaker labels May 23, 2022
Copy link
Member

@alxhub alxhub left a comment

Choose a reason for hiding this comment

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

Hello @Piyush132000

Sorry to kick this back, but when I was going to merge this I noticed this PR is composed of 4 commits, all of which have the same generic title and no description.

Please squash these commits into one, and add a short description describing why we're making these changes.

@Piyush132000 Piyush132000 force-pushed the code-style-update-and-refactoring branch from 4cb7ec8 to 77979d9 Compare May 24, 2022 05:09
@mary-poppins
Copy link

You can preview 77979d9 at https://pr45527-77979d9.ngbuilds.io/.

@Piyush132000 Piyush132000 requested a review from alxhub May 27, 2022 02:09
I have removed unnecessary code from the components & i initialize the
form in OnInit function (life cycle). I think initilization of forms and
getting data from service must be done inside ngOnInit.
@Piyush132000 Piyush132000 force-pushed the code-style-update-and-refactoring branch from 77979d9 to 425a619 Compare May 27, 2022 02:11
@mary-poppins
Copy link

You can preview 425a619 at https://pr45527-425a619.ngbuilds.io/.

@Piyush132000
Copy link
Contributor Author

Piyush132000 commented Jun 4, 2022

Hii @jessicajaniuk, @gkalpak, and @alxhub any changes required to merge this PR to main? I already squashed the commits.

Thanks

@jessicajaniuk jessicajaniuk added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Jun 14, 2022
@jessicajaniuk
Copy link
Contributor

This PR was merged into the repository by commit 9ce733a.

jessicajaniuk pushed a commit that referenced this pull request Jun 14, 2022
I have removed unnecessary code from the components & i initialize the
form in OnInit function (life cycle). I think initilization of forms and
getting data from service must be done inside ngOnInit.

PR Close #45527
@Piyush132000
Copy link
Contributor Author

Thanks, @jessicajaniuk @gkalpak @alxhub

@angular-automatic-lock-bot
Copy link

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 Jul 16, 2022
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 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
X Tutup