Skip to content

Conversation

@tiagosampaio
Copy link
Member

@tiagosampaio tiagosampaio commented Jun 15, 2018

  • Created a method to reorder the tabs which is less complex and works better.

Description

When you add 2 or more tabs to admin area, like order view page, by using the method addTabAfter and the second new tab is placed after the first new tab the sort order does not work as expected.

More details in the issue.

Fixed Issues

  1. Admin tabs order not working properly #16174: Issue title

Manual testing scenarios

Described in the issue.

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 on Travis CI are green)

- Created a method to reorder the tabs which is less complex and works better.
@magento-engcom-team
Copy link
Contributor

Hi @tiagosampaio. 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-engcom-team give me test instance - deploy test instance based on Pull Request changes
  • @magento-engcom-team give me new test instance - deploy NEW test instance based on Pull Request changes
  • @magento-engcom-team give me {$VERSION} instance - deploy Vanilla Magento instance for Issue or Pull Request

For more details, please, review the Magento Contributor Assistant documentation

@tiagosampaio tiagosampaio changed the title Hotfix to Issue #16174 Admin tabs order not working properly Jun 15, 2018
@magento-engcom-team
Copy link
Contributor

@tiagosampaio thank you for contributing. Please accept Community Contributors team invitation here to gain extended permissions for this repository.


if ($this->_activeTab === null) {
/** @var TabInterface $tab */
foreach ($this->_tabs as $tab) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @tiagosampaio. You can select first array tab uses reset() and current() methods, please use theirs.

/**
* @return array
*/
protected function reorderTabs()
Copy link
Contributor

Choose a reason for hiding this comment

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

Due to Magento backward-compatible guide we can't create new protected methods.

* @return array
*/
protected function reorderTabs()
{
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, divide code in this function to few separate private functions.

@VladimirZaets
Copy link
Contributor

Hi @tiagosampaio, thank for fixes. Please, fix fails of the static tests

@tiagosampaio
Copy link
Member Author

@VladimirZaets I removed the multiple lines and committed again.

@VladimirZaets
Copy link
Contributor

Hi @tiagosampaio. Thanks for changes

@magento-engcom-team
Copy link
Contributor

Hi @tiagosampaio. Thank you for your contribution.
We will aim to release these changes as part of 2.2.6.
Please check the release notes for final confirmation.

Please, consider to port this solution to 2.3 release line.
You may use Porting tool to port commits automatically.

@tiagosampaio tiagosampaio deleted the hotfix/16174 branch July 13, 2018 16:44
@tiagosampaio tiagosampaio restored the hotfix/16174 branch July 28, 2018 14:12
@tiagosampaio tiagosampaio deleted the hotfix/16174 branch August 7, 2018 12:58
@tiagosampaio tiagosampaio restored the hotfix/16174 branch November 20, 2018 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants