-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Admin panel navigation improvement #33824
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
base: 2.4-develop
Are you sure you want to change the base?
Admin panel navigation improvement #33824
Conversation
Hi @marcin-dykas. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@marcin-dykas thank you for your contribution! However, before we can proceed with reviewing the code and prioritizing the PR, you need to sign the Adobe Contributor License agreement. Can you do that please? You can find it here: https://opensource.adobe.com/cla.html |
Hello @bgorski I've just signed CLA. Thanks. |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
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.
Good submission!
However there are a lot of failed tests in the areas this PR covers. Please check and fix the failed tests.
There are quite a few new classes and new methods on existing classes yet there are no Unit Tests or MFTF tests. Please look into how your new functionality can be covered by testing.
AddUrlToName.php
Outdated
@@ -0,0 +1,105 @@ | |||
<?php | |||
|
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.
Missing copyright notice
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.
Fixed by adding copyright notice
ConfigurableDataProvider.php
Outdated
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\ConfigurableProduct\Ui\DataProvider\Product; |
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.
Missing - declare(strict_types=1);
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.
Fixed by adding declare(strict_types=1);
ConfigurableDataProvider.php
Outdated
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; | ||
use Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider; | ||
use Magento\Ui\DataProvider\Modifier\PoolInterface; | ||
|
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.
Missing class DOCBLOCK
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.
Fixed by adding DOCBLOCK
/** | ||
* @var NameHelper | ||
*/ | ||
protected $nameHelper; |
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.
should be private
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.
Fixed by changing to private
/** | ||
* @var LocatorInterface | ||
*/ | ||
protected $locator; |
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.
class variables should be private
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.
Fixed by changing to private
* | ||
* @return array | ||
*/ | ||
public function getData() |
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.
missing return type on prototype
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.
Fixed by adding return type
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
namespace Magento\ConfigurableProduct\Ui\DataProvider\Product; |
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.
missing declare(strict_types=1);
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.
Fixed by adding declare(strict_types=1);
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; | ||
use Magento\Catalog\Ui\DataProvider\Product\ProductDataProvider; | ||
use Magento\Ui\DataProvider\Modifier\PoolInterface; | ||
|
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.
Missing class DOCBLOCK
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.
Fixed by adding DOCBLOCK
/** | ||
* @var NameHelper | ||
*/ | ||
protected $nameHelper; |
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.
private
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.
Fixed by changing to private
* @param int $sortOrder | ||
* @return array | ||
*/ | ||
protected function getHtmlColumn($dataScope, $fit, Phrase $label, $sortOrder) |
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.
missing return type
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.
Fixed by adding return type
Hello @BarnyShergold Thank you for CR I resolved all issues and now I'll focus on tests. Thank you |
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.
Great test coverage from what I can see.
Just a few tidy ups
/** | ||
* @var ObjectManager | ||
*/ | ||
protected $objectManager; |
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.
All protected should be private
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.
Fixed by changing all protected to private
/** | ||
* @return object | ||
*/ | ||
protected function getModel() |
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.
missing return type
should be private
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.
Fixed by adding return type and changed to private
/** | ||
* Test checks ConfigurableDataProvider type | ||
*/ | ||
public function testCheckType() |
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.
missing return type
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.
Fixed by adding return type
/** | ||
* Test checks collection type | ||
*/ | ||
public function testGetCollection() |
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.
missing return type
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.
Usually it's good practice to put all the public methods first and then the private ones
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.
Fixed by moving public functions first. Then protected then private ones at the end ....
@marcin-dykas - It's been 2 weeks since changes were requested on this PR for the tests and there is also a conflict to resolve. Can you please give us an update on progress and when you are likely to be able to complete this PR? Otherwise we may have to look at closing it. And we don't want to do that! |
Hello @BarnyShergold I've just added last missing unit tests. Now I'll tidy up things to run tests again here. |
…o feature/improve-admin-panel-navigation
@magento run Unit Tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
I've run unit tests here and there are two same errors from Jsunit (B2B) and Jsunit (EE) Interception cache generation... 6/9 [========>----] 66% 54 secs 400.0 MiBErrors during compilation: This is because EE version has Magento_PricePermissions which is not present in CE. In this module there are classes like app/code/Magento/PricePermissions/Ui/DataProvider/Product/Form/Modifier/Grouped.php and app/code/Magento/PricePermissions/Ui/DataProvider/Product/Form/Modifier/Related.php. They extend \Magento\GroupedProduct\Ui\DataProvider\Product\Form\Modifier\Grouped and \Magento\Catalog\Ui\DataProvider\Product\Form\Modifier\Related where I added one new parameter to constructor. It should be easy to fix these errors. We just have to add new parameters in parent::_construct calls. I don't have access to EE repository and I wonder now how to solve it. @BarnyShergold what is procedure in such case ? Is there any ? Will we leave it as is or are we going to create PR to EE repo ? Could you please advise ? Thank you |
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
…ove-admin-panel-navigation
…rm\Modifier\Data\AssociatedProductsTest::testAddManuallyConfigurationsWithNotFilterableInGridAttribute
app/code/Magento/Catalog/Ui/DataProvider/Product/Related/AbstractDataProvider.php app/code/Magento/GroupedProduct/Ui/DataProvider/Product/GroupedProductDataProvider.php
@magento run all tests |
The requested builds are added to the queue. You should be able to see them here within a few minutes. Please re-request them if they don't show in a reasonable amount of time. |
Still 9 checks are not successful but most of them fails because EE PricePermission module. Error says:
Since I don't have access to EE repository I can't fix it. I decided to provided patch to this module which solves this issue. |
…ove-admin-panel-navigation
Hello Magento Team
This is new kind of feature for admin panel. It adds additional links for products in several grids following [Customizable Options] grid.
Description (*)
Functionality for Magento 2 adds missing links in the admin panel for product edit pages. Code follows an idea from the [Customizable Options] section where is [Import options] product grid. [Import options] product grid contains URLs to product's edit page. Unfortunately, in other grids, there is no way to navigate to product edit pages easily. It adds edit URL links to all grids where navigation is needed to open product edit page in new tab.
Benefits
The administrator saves precious time while working with a large number of products. While adding options to products each time, there is a need to open grid with additional product items. There is no way to go to their edit pages without opening additional browser tabs and searching in other grids. It's complicated and time-consuming. So it adds edit links to the admin panel grids. After clicking in additional link product edit page is opened in a new tab.
Related Pull Requests
Fixed Issues (if relevant)
Manual testing scenarios (*)
Questions or comments
Contribution checklist (*)