Skip to content

Commit d086d3a

Browse files
authored
ENGCOM-7237: Fixed 24990: link doesn't redirect to dashboard #26100
2 parents 89bc078 + 2d42bfc commit d086d3a

File tree

7 files changed

+96
-6
lines changed

7 files changed

+96
-6
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminClickLogoActionGroup">
12+
<click selector="{{AdminMenuSection.logo}}" stepKey="clickLogoInAdmin"/>
13+
<waitForPageLoad stepKey="waitForAdminDashboardPageLoaded"/>
14+
</actionGroup>
15+
</actionGroups>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AdminNavigateToSetupWizardPageActionGroup">
12+
<annotations>
13+
<description>Open Setup Wizard Page.</description>
14+
</annotations>
15+
<amOnPage url="{{AdminSetupWizardPage.url}}" stepKey="navigateToSetupWizardPage"/>
16+
<waitForPageLoad stepKey="waitForSetupWizardPageLoaded"/>
17+
</actionGroup>
18+
</actionGroups>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
11+
<page name="AdminSetupWizardPage" url="admin/backendapp/redirect/app/setup/" area="admin" module="Magento_Backend"/>
12+
</pages>

app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<sections xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1010
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/SectionObject.xsd">
1111
<section name="AdminMenuSection">
12+
<element name="logo" type="button" selector=".menu-wrapper a.logo"/>
1213
<element name="catalog" type="button" selector="#menu-magento-catalog-catalog"/>
1314
<element name="catalogProducts" type="button" selector="#nav li[data-ui-id='menu-magento-catalog-catalog-products']"/>
1415
<element name="customers" type="button" selector="#menu-magento-customer-customer"/>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="AdminRedirectToAdminPanelOnLogoClickFromWizardPageTest">
12+
<annotations>
13+
<features value="Backend"/>
14+
<stories value="Navigate to dashboard from Setup Wizard Page"/>
15+
<title value="Navigate to dashboard after click on logo on Setup Wizard Page"/>
16+
<description value="Check navigate to dashboard after click on logo on Setup Wizard Page"/>
17+
</annotations>
18+
<before>
19+
<actionGroup ref="AdminLoginActionGroup" stepKey="loginToAdminPanel"/>
20+
</before>
21+
<after>
22+
<actionGroup ref="AdminLogoutActionGroup" stepKey="logoutFromAdmin"/>
23+
</after>
24+
25+
<actionGroup ref="AdminNavigateToSetupWizardPageActionGroup" stepKey="navigateToSetupWizardPage"/>
26+
<actionGroup ref="AdminClickLogoActionGroup" stepKey="clickOnLogo"/>
27+
<actionGroup ref="AssertAdminDashboardPageIsVisibleActionGroup" stepKey="checkTheDashboardPage"/>
28+
</test>
29+
</tests>

setup/src/Magento/Setup/Controller/Navigation.php

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@
88
use Laminas\Mvc\Controller\AbstractActionController;
99
use Laminas\View\Model\JsonModel;
1010
use Laminas\View\Model\ViewModel;
11+
use Magento\Backend\Model\UrlInterface;
12+
use Magento\Framework\ObjectManagerInterface;
1113
use Magento\Setup\Model\Cron\Status;
1214
use Magento\Setup\Model\Navigation as NavModel;
15+
use Magento\Setup\Model\ObjectManagerProvider;
1316

1417
/**
1518
* Navigation controller
@@ -32,13 +35,20 @@ class Navigation extends AbstractActionController
3235
protected $view;
3336

3437
/**
35-
* @param NavModel $navigation
36-
* @param Status $status
38+
* @var ObjectManagerInterface
3739
*/
38-
public function __construct(NavModel $navigation, Status $status)
40+
private $objectManagerProvider;
41+
42+
/**
43+
* @param NavModel $navigation
44+
* @param Status $status
45+
* @param ObjectManagerProvider $objectManagerProvider
46+
*/
47+
public function __construct(NavModel $navigation, Status $status, ObjectManagerProvider $objectManagerProvider)
3948
{
4049
$this->navigation = $navigation;
4150
$this->status = $status;
51+
$this->objectManagerProvider = $objectManagerProvider->get();
4252
$this->view = new ViewModel();
4353
$this->view->setVariable('menu', $this->navigation->getMenuItems());
4454
$this->view->setVariable('main', $this->navigation->getMainItems());
@@ -80,8 +90,11 @@ public function menuAction()
8090
*/
8191
public function sideMenuAction()
8292
{
93+
/** @var UrlInterface $backendUrl */
94+
$backendUrl = $this->objectManagerProvider->get(UrlInterface::class);
8395
$this->view->setTemplate('/magento/setup/navigation/side-menu.phtml');
8496
$this->view->setVariable('isInstaller', $this->navigation->getType() == NavModel::NAV_INSTALLER);
97+
$this->view->setVariable('backendUrl', $backendUrl->getRouteUrl('adminhtml'));
8598
$this->view->setTerminal(true);
8699
return $this->view;
87100
}

setup/view/magento/setup/navigation/side-menu.phtml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@
2020
ng-show="<?= implode( '&&', $expressions) ?>"
2121
>
2222
<nav class="admin__menu" ng-controller="mainController">
23-
<span class="logo logo-static" data-edition="Community Edition">
24-
<img class="logo-img" src="<?= $this->basePath() ?>/pub/images/logo.svg" alt="Magento Admin Panel">
25-
</span>
23+
<a href="<?= $this->backendUrl ?>" class="logo" data-edition="Community Edition">
24+
<span>
25+
<img class="logo-img" src="<?= $this->basePath() ?>/pub/images/logo.svg" alt="Magento Admin Panel">
26+
</span>
27+
</a>
2628
<ul id="nav" role="menubar">
2729
<li class="item-home level-0" ng-class="{_active: $state.current.name === 'root.home'}">
2830
<a href="" ui-sref="root.home">

0 commit comments

Comments
 (0)