-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Fixed 24990: link doesn't redirect to dashboard #26100
Merged
magento-engcom-team
merged 10 commits into
magento:2.4-develop
from
Usik2203:24990-logo-link-is-not-directing-to-admin-dashboard
Apr 2, 2020
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
5a5091c
Fixed 24990 link not to redirect to dashboard
Usik2203 1818eaf
Fixed codeStyle issues
Usik2203 c98e03f
fixed classes with new keyword
Usik2203 8c672eb
Fixed Code style issues
Usik2203 b90f20c
Fix issue with UnitTests
Usik2203 531a22f
Merge branch '2.4-develop' into 24990-logo-link-is-not-directing-to-a…
Usik2203 4336cf1
Small fix
eduard13 f39a494
Changes covered by MFTF
Usik2203 31bbf07
Refactored MFTF
Usik2203 e1b0ff0
Minor fixes
eduard13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminClickLogoActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminClickLogoActionGroup"> | ||
<click selector="{{AdminMenuSection.logo}}" stepKey="clickLogoInAdmin"/> | ||
<waitForPageLoad stepKey="waitForAdminDashboardPageLoaded"/> | ||
</actionGroup> | ||
</actionGroups> |
18 changes: 18 additions & 0 deletions
18
app/code/Magento/Backend/Test/Mftf/ActionGroup/AdminNavigateToSetupWizardPageActionGroup.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd"> | ||
<actionGroup name="AdminNavigateToSetupWizardPageActionGroup"> | ||
<annotations> | ||
<description>Open Setup Wizard Page.</description> | ||
</annotations> | ||
<amOnPage url="{{AdminSetupWizardPage.url}}" stepKey="navigateToSetupWizardPage"/> | ||
<waitForPageLoad stepKey="waitForSetupWizardPageLoaded"/> | ||
</actionGroup> | ||
</actionGroups> |
12 changes: 12 additions & 0 deletions
12
app/code/Magento/Backend/Test/Mftf/Page/AdminSetupWizardPage.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd"> | ||
<page name="AdminSetupWizardPage" url="admin/backendapp/redirect/app/setup/" area="admin" module="Magento_Backend"/> | ||
</pages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...Magento/Backend/Test/Mftf/Test/AdminRedirectToAdminPanelOnLogoClickFromWizardPageTest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
--> | ||
|
||
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd"> | ||
<test name="AdminRedirectToAdminPanelOnLogoClickFromWizardPageTest"> | ||
<annotations> | ||
<features value="Backend"/> | ||
<stories value="Navigate to dashboard from Setup Wizard Page"/> | ||
<title value="Navigate to dashboard after click on logo on Setup Wizard Page"/> | ||
<description value="Check navigate to dashboard after click on logo on Setup Wizard Page"/> | ||
</annotations> | ||
<before> | ||
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/> | ||
</before> | ||
<after> | ||
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/> | ||
</after> | ||
|
||
<actionGroup ref="AdminNavigateToSetupWizardPageActionGroup" stepKey="navigateToSetupWizardPage"/> | ||
<actionGroup ref="AdminClickLogoActionGroup" stepKey="clickOnLogo"/> | ||
<actionGroup ref="AssertAdminDashboardPageIsVisibleActionGroup" stepKey="checkTheDashboardPage"/> | ||
</test> | ||
</tests> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,11 @@ | |
use Laminas\Mvc\Controller\AbstractActionController; | ||
use Laminas\View\Model\JsonModel; | ||
use Laminas\View\Model\ViewModel; | ||
use Magento\Backend\Model\UrlInterface; | ||
use Magento\Framework\ObjectManagerInterface; | ||
use Magento\Setup\Model\Cron\Status; | ||
use Magento\Setup\Model\Navigation as NavModel; | ||
use Magento\Setup\Model\ObjectManagerProvider; | ||
|
||
/** | ||
* Navigation controller | ||
|
@@ -32,13 +35,20 @@ class Navigation extends AbstractActionController | |
protected $view; | ||
|
||
/** | ||
* @param NavModel $navigation | ||
* @param Status $status | ||
* @var ObjectManagerInterface | ||
*/ | ||
public function __construct(NavModel $navigation, Status $status) | ||
private $objectManagerProvider; | ||
|
||
/** | ||
* @param NavModel $navigation | ||
* @param Status $status | ||
* @param ObjectManagerProvider $objectManagerProvider | ||
*/ | ||
public function __construct(NavModel $navigation, Status $status, ObjectManagerProvider $objectManagerProvider) | ||
{ | ||
$this->navigation = $navigation; | ||
$this->status = $status; | ||
$this->objectManagerProvider = $objectManagerProvider->get(); | ||
$this->view = new ViewModel(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you instantiating classes with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
$this->view->setVariable('menu', $this->navigation->getMenuItems()); | ||
$this->view->setVariable('main', $this->navigation->getMainItems()); | ||
|
@@ -80,8 +90,11 @@ public function menuAction() | |
*/ | ||
public function sideMenuAction() | ||
{ | ||
/** @var UrlInterface $backendUrl */ | ||
$backendUrl = $this->objectManagerProvider->get(UrlInterface::class); | ||
$this->view->setTemplate('/magento/setup/navigation/side-menu.phtml'); | ||
$this->view->setVariable('isInstaller', $this->navigation->getType() == NavModel::NAV_INSTALLER); | ||
$this->view->setVariable('backendUrl', $backendUrl->getRouteUrl('adminhtml')); | ||
$this->view->setTerminal(true); | ||
return $this->view; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why do you use
ObjectManagerProvider
instead of injecting justUrlInterface
?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.
I am getting such error "An error occurred during execution; please try again later" and status 500 while injecting
UrlInterface
directly in constructor of controller