Skip to content

Commit

Permalink
Merge branch 'release/2.23.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Ortega committed Jul 26, 2023
2 parents 809cb3f + 922aca8 commit 9fde09c
Show file tree
Hide file tree
Showing 35 changed files with 426 additions and 237 deletions.
52 changes: 0 additions & 52 deletions .github/workflows/backend_pr.yml

This file was deleted.

44 changes: 0 additions & 44 deletions .github/workflows/backend_push.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/backend_static_review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Backend Static Review
on: [push, pull_request]

jobs:
phpcs:
name: M2 Code Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: extdn/github-actions-m2/magento-coding-standard/8.1@master
with:
phpcs_severity: 10
phpcs_report: full
args: "--colors"

phpmd:
name: M2 Mess Detection
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: extdn/github-actions-m2/magento-mess-detector@master

phpstan:
name: M2 PHPStan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: extdn/github-actions-m2/magento-phpstan@master
with:
composer_name: snowdog/module-menu
25 changes: 0 additions & 25 deletions .github/workflows/frontend_pr.yml

This file was deleted.

15 changes: 0 additions & 15 deletions .github/workflows/frontend_push.yml

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/frontend_static_review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Frontend Static Review
on: [push, pull_request]

jobs:
fe_test:
name: Code Lint Analysis
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x
- run: yarn
- run: yarn lint
15 changes: 0 additions & 15 deletions .github/workflows/labelbot.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Api/MenuRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function deleteById($id);
*
* @param array $ids
* @param int $isActive
* @return bool
* @return void
*/
public function setIsActiveByIds($ids, $isActive);
}
1 change: 1 addition & 0 deletions Block/Adminhtml/Edit/Tab/Nodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ private function renderNodeList($level, $parent, $data)
return;
}
$nodes = $data[$level][$parent];
$menu = [];
foreach ($nodes as $node) {
$menu[] = [
'is_active' => $node->getIsActive(),
Expand Down
14 changes: 11 additions & 3 deletions Block/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
use Snowdog\Menu\Model\TemplateResolver;
use Magento\Store\Model\Store;

/**
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Menu extends Template implements DataObject\IdentityInterface
{
/**
Expand Down Expand Up @@ -76,6 +79,14 @@ class Menu extends Template implements DataObject\IdentityInterface
*/
protected $baseSubmenuTemplate = 'Snowdog_Menu::menu/sub_menu.phtml';

/**
* @var Escaper
*/
private $escaper;

/**
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
Template\Context $context,
EventManager $eventManager,
Expand Down Expand Up @@ -180,9 +191,6 @@ private function getNodeCacheKeyInfo()
$request = $this->getRequest();

switch ($request->getRouteName()) {
case 'cms':
$nodeType = 'cms_page';
break;
case 'catalog':
$nodeType = 'category';
break;
Expand Down
9 changes: 1 addition & 8 deletions Block/NodeType/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,19 +78,12 @@ public function getCurrentCategory()
*/
public function getNodeCacheKeyInfo()
{
$info = [
return [
'module_' . $this->getRequest()->getModuleName(),
'controller_' . $this->getRequest()->getControllerName(),
'route_' . $this->getRequest()->getRouteName(),
'action_' . $this->getRequest()->getActionName()
];

$category = $this->getCurrentCategory();
if ($category) {
$info[] = 'category_' . $category->getId();
}

return $info;
}

/**
Expand Down
8 changes: 1 addition & 7 deletions Block/NodeType/CategoryChild.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,12 @@ public function __construct(
*/
public function getNodeCacheKeyInfo()
{
$info = [
return [
'module_' . $this->getRequest()->getModuleName(),
'controller_' . $this->getRequest()->getControllerName(),
'route_' . $this->getRequest()->getRouteName(),
'action_' . $this->getRequest()->getActionName()
];
$category = $this->getCurrentCategory();
if ($category) {
$info[] = 'category-child_' . $category->getId();
}

return $info;
}

/**
Expand Down
9 changes: 8 additions & 1 deletion Block/NodeType/CmsBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Magento\Framework\View\Element\Template\Context;
use Magento\Cms\Model\Template\FilterProvider;
use Magento\Store\Model\StoreManagerInterface;
use Snowdog\Menu\Model\TemplateResolver;
use Snowdog\Menu\Model\NodeType\CmsBlock as CmsBlockModel;

Expand Down Expand Up @@ -40,11 +41,17 @@ class CmsBlock extends AbstractNode
* @var FilterProvider
*/
private $filterProvider;

/**
* @var CmsBlockModel
*/
private $_cmsBlockModel;

/**
* @var StoreManagerInterface
*/
private $storesList;

/**
* CmsBlock constructor.
*
Expand All @@ -59,7 +66,7 @@ public function __construct(
CmsBlockModel $cmsBlockModel,
FilterProvider $filterProvider,
TemplateResolver $templateResolver,
\Magento\Store\Model\StoreManagerInterface $storeManager,
StoreManagerInterface $storeManager,
$data = []
) {
parent::__construct($context, $templateResolver, $data);
Expand Down
23 changes: 7 additions & 16 deletions Block/NodeType/CmsPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Magento\Framework\View\Element\Template\Context;
use Magento\Cms\Api\Data\PageInterface;
use Magento\Store\Model\StoreManagerInterface;
use Snowdog\Menu\Model\TemplateResolver;
use Snowdog\Menu\Model\NodeType\CmsPage as CmsPageModel;

Expand Down Expand Up @@ -45,6 +46,11 @@ class CmsPage extends AbstractNode
*/
private $_cmsPageModel;

/**
* @var StoreManagerInterface
*/
private $storesList;

/**
* CmsPage constructor.
*
Expand All @@ -59,7 +65,7 @@ public function __construct(
PageInterface $page,
CmsPageModel $cmsPageModel,
TemplateResolver $templateResolver,
\Magento\Store\Model\StoreManagerInterface $storeManager,
StoreManagerInterface $storeManager,
$data = []
) {
parent::__construct($context, $templateResolver, $data);
Expand All @@ -68,21 +74,6 @@ public function __construct(
$this->storesList = $storeManager->getStores();
}

/**
* @return array
*/
public function getNodeCacheKeyInfo()
{
$info = [];
$pageId = $this->getRequest()->getParam('page_id');

if ($pageId) {
$info[] = 'cms_page_' . $pageId;
}

return $info;
}

/**
* @inheritDoc
*/
Expand Down
Loading

0 comments on commit 9fde09c

Please sign in to comment.