Skip to content

Commit

Permalink
Merge branch 'release/2.15.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Samir Hajiyev committed Jun 8, 2021
2 parents 7145aac + 2b47988 commit dee7557
Show file tree
Hide file tree
Showing 56 changed files with 1,422 additions and 433 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/backend_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: Backend Coding Standard (PR)
on:
pull_request_target:
types: [labeled]
jobs:
mcs-backend-lint:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'safe to test')
name: MCS Check
container:
image: docker.io/davidalger/php:7.4

steps:
- name: Remove labels
uses: andymckay/labeler@master
with:
remove-labels: "need is safe review"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Add composer repositories
env:
USERNAME: ${{ secrets.COMPOSER_MAGENTO_USERNAME }}
PASSWORD: ${{ secrets.COMPOSER_MAGENTO_PASSWORD }}
run: composer config repositories.magento composer https://$USERNAME:[email protected]/

- name: Initialize config
id: config
run: |
echo "::set-output name=working-directory::${PWD/$GITHUB_WORKSPACE/}"
echo "::set-output name=composer-cache-dir::$(composer config cache-files-dir)"
- name: Retrieve composer cache
uses: actions/cache@v2
with:
path: ${{ steps.config.outputs.composer-cache-dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-

- run: composer global require hirak/prestissimo
- run: composer install --no-interaction --dev

- uses: mediotype/phpcs-action@v2
with:
enable_warnings: true # This is required for magento-coding-standards to function
only_changed_files: false # Required to run checks on push events too
phpcs_bin_path: vendor/bin/phpcs -s --colors --report-full --standard=Magento2 --exclude=Magento2.Security.XssTemplate --ignore=vendor --extensions=php,phtml *
Original file line number Diff line number Diff line change
@@ -1,30 +1,9 @@
---
name: Backend Coding Standard
on: [ push, pull_request_target ]
on:
push:
jobs:
backend-lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: shivammathur/setup-php@v2
with:
php-version: '7.3'

- name: Add composer repositories
env:
USERNAME: ${{ secrets.COMPOSER_MAGENTO_USERNAME }}
PASSWORD: ${{ secrets.COMPOSER_MAGENTO_PASSWORD }}
run: composer config repositories.magento composer https://$USERNAME:[email protected]/

- name: Install dependencies
run: composer install --prefer-dist --no-progress --no-suggest

- name: Run tests
run: composer run-script test

new-backend-lint:
mcs-backend-lint:
runs-on: ubuntu-latest
name: MCS Check
container:
Expand All @@ -34,7 +13,7 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
fetch-depth: 1

- name: Add composer repositories
env:
Expand Down Expand Up @@ -62,4 +41,4 @@ jobs:
with:
enable_warnings: true # This is required for magento-coding-standards to function
only_changed_files: false # Required to run checks on push events too
phpcs_bin_path: vendor/bin/phpcs --standard=Magento2 --exclude=Magento2.Security.XssTemplate --ignore=vendor --extensions=php,phtml *
phpcs_bin_path: vendor/bin/phpcs -s --colors --report-full --standard=Magento2 --exclude=Magento2.Security.XssTemplate --ignore=vendor --extensions=php,phtml *
25 changes: 25 additions & 0 deletions .github/workflows/frontend_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Frontend (PR)
on:
pull_request_target:
types: [labeled]
jobs:
frontend-lint:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'safe to test')
steps:
- name: Remove labels
uses: andymckay/labeler@master
with:
remove-labels: "need is safe review"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- run: yarn
- run: yarn test
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Frontend
on: [push, pull_request]
on:
push:
jobs:
frontend-lint:
runs-on: ubuntu-latest
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/labelbot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Label bot PR
on:
pull_request_target:
jobs:
label_bot_pr:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name != github.repository && github.actor != 'dependabot[bot]'
steps:
- name: Label bot PR
uses: andymckay/labeler@master
with:
remove-labels: "safe to test"
add-labels: "need is safe review"
repo-token: ${{ secrets.GITHUB_TOKEN }}

9 changes: 9 additions & 0 deletions Api/MenuRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,13 @@ public function delete(MenuInterface $page);
* @throws NoSuchEntityException
*/
public function deleteById($id);

/**
* Updates is_active for given menu ids
*
* @param array $ids
* @param int $isActive
* @return bool
*/
public function setIsActiveByIds($ids, $isActive);
}
28 changes: 28 additions & 0 deletions Block/Adminhtml/Button/AbstractButton.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

declare(strict_types=1);

namespace Snowdog\Menu\Block\Adminhtml\Button;

use Magento\Backend\Block\Widget\Context;

class AbstractButton
{
/** @var Context */
protected $context;

public function __construct(Context $context)
{
$this->context = $context;
}

protected function getUrl(string $route, array $params = []): string
{
return $this->context->getUrlBuilder()->getUrl($route, $params);
}

protected function getMenuId()
{
return $this->context->getRequest()->getParam('menu_id');
}
}
18 changes: 18 additions & 0 deletions Block/Adminhtml/Button/Back.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Snowdog\Menu\Block\Adminhtml\Button;

use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

class Back extends AbstractButton implements ButtonProviderInterface
{
public function getButtonData(): array
{
return [
'label' => __('Back'),
'on_click' => sprintf("location.href = '%s';", $this->getUrl('*/*/')),
'class' => 'back',
'sort_order' => 10
];
}
}
24 changes: 24 additions & 0 deletions Block/Adminhtml/Button/Delete.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

namespace Snowdog\Menu\Block\Adminhtml\Button;

use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

class Delete extends AbstractButton implements ButtonProviderInterface
{
public function getButtonData(): array
{
return [
'label' => __('Delete'),
'on_click' => sprintf(
"location.href = '%s';",
$this->getUrl(
'*/*/delete',
['menu_id' => $this->getMenuId()]
)
),
'class' => 'delete',
'sort_order' => 20
];
}
}
18 changes: 18 additions & 0 deletions Block/Adminhtml/Button/Reset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

namespace Snowdog\Menu\Block\Adminhtml\Button;

use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

class Reset extends AbstractButton implements ButtonProviderInterface
{
public function getButtonData(): array
{
return [
'label' => __('Reset'),
'on_click' => 'window.location.reload();',
'class' => 'reset',
'sort_order' => 30
];
}
}
21 changes: 21 additions & 0 deletions Block/Adminhtml/Button/Save.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Snowdog\Menu\Block\Adminhtml\Button;

use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

class Save extends AbstractButton implements ButtonProviderInterface
{
public function getButtonData(): array
{
return [
'label' => __('Save'),
'class' => 'save primary',
'data+attribute' => [
'mage-init' => ['button' => ['event' => 'save']],
'form-role' => 'save'
],
'sort_order' => 50
];
}
}
22 changes: 22 additions & 0 deletions Block/Adminhtml/Button/SaveAndContinue.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?php

namespace Snowdog\Menu\Block\Adminhtml\Button;

use Magento\Framework\View\Element\UiComponent\Control\ButtonProviderInterface;

class SaveAndContinue extends AbstractButton implements ButtonProviderInterface
{
public function getButtonData(): array
{
return [
'label' => __('Save and Continue Edit'),
'class' => 'save',
'data_attribute' => [
'mage-init' => [
'button' => ['event' => 'saveAndContinueEdit']
]
],
'sort_order' => 40
];
}
}
33 changes: 0 additions & 33 deletions Block/Menu/Edit.php

This file was deleted.

37 changes: 0 additions & 37 deletions Block/Menu/Edit/Form.php

This file was deleted.

Loading

0 comments on commit dee7557

Please sign in to comment.