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

Telephone Widget > Template > Removing this and helper #25533

Conversation

rafaelstz
Copy link
Member

Description (*)

I provided this PR to fix the issue that I had in the PR #25321, to follow the Magento Coding Standards I'm removing the helper and $this from the template file.
I used a method in block class to enable me to do it instead of calling the helper directly in the template file. I created a new method as well to get the telephone validation directly as this class and phtml are dedicated to the telephone widget.

Fixed Issues (if relevant)

  1. helper and $this into the template file

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@rafaelstz rafaelstz requested a review from paliarush as a code owner November 8, 2019 16:42
@m2-assistant
Copy link

m2-assistant bot commented Nov 8, 2019

Hi @rafaelstz. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

Copy link
Contributor

@VladimirZaets VladimirZaets left a comment

Choose a reason for hiding this comment

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

Hi @rafaelstz. Thanks for collaboration. Please take a look at my review comment.

*
* @return string
*/
public function getValidationClass()
Copy link
Contributor

Choose a reason for hiding this comment

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

Why we need this method? We can use directly $this->getAttributeValidationClass('telephone').

@ghost ghost assigned VladimirZaets Nov 8, 2019
@VladimirZaets VladimirZaets added Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests Progress: needs update and removed Progress: needs update labels Nov 8, 2019
@rafaelstz rafaelstz force-pushed the feature/telephoneWidgetRefactoring branch from ced6e3f to 3c05965 Compare November 10, 2019 16:07
@rafaelstz
Copy link
Member Author

Hi @VladimirZaets
I pushed a fix to merge the two similar methods, as we are using this class just for the telephone widget template, I think the validation method can be specific and already set the validation class required to the telephone attribute.
What do you think?

@VladimirZaets
Copy link
Contributor

Hi @VladimirZaets
I pushed a fix to merge the two similar methods, as we are using this class just for the telephone widget template, I think the validation method can be specific and already set the validation class required to the telephone attribute.
What do you think?

Hi @rafaelstz. First of all, we can't change the interface of the public method because it's backward-incompatible changes. You are right, in magento we use this class just for telephone widget template, but our extension developers and customers can use/extend this class in they implementations and your fix can break them.

@rafaelstz rafaelstz force-pushed the feature/telephoneWidgetRefactoring branch from ca0c4f2 to 53515bd Compare November 18, 2019 18:10
@rafaelstz
Copy link
Member Author

Hi @VladimirZaets, I've updated the pull-request to avoid backward-incompatibility.

@VladimirZaets
Copy link
Contributor

This functionality is already covered by integration test.

@VladimirZaets VladimirZaets added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests and removed Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests labels Nov 25, 2019
@magento-engcom-team
Copy link
Contributor

Hi @VladimirZaets, thank you for the review.
ENGCOM-6332 has been created to process this Pull Request

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

@m2-assistant
Copy link

m2-assistant bot commented Nov 27, 2019

Hi @rafaelstz, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants