Skip to content

Commit

Permalink
[shopsys] removed unused topMenu article placement (#2776)
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmannmartin authored Sep 11, 2023
1 parent a679d39 commit e64d75e
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 21 deletions.
2 changes: 0 additions & 2 deletions src/Controller/Admin/ArticleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,15 +93,13 @@ public function editAction(Request $request, $id)
*/
public function listAction()
{
$gridTop = $this->getGrid(Article::PLACEMENT_TOP_MENU);
$gridFooter = $this->getGrid(Article::PLACEMENT_FOOTER);
$gridNone = $this->getGrid(Article::PLACEMENT_NONE);
$articlesCountOnSelectedDomain = $this->articleFacade->getAllArticlesCountByDomainId(
$this->adminDomainTabsFacade->getSelectedDomainId(),
);

return $this->render('@ShopsysFramework/Admin/Content/Article/list.html.twig', [
'gridViewTop' => $gridTop->createView(),
'gridViewFooter' => $gridFooter->createView(),
'gridViewNone' => $gridNone->createView(),
'articlesCountOnSelectedDomain' => $articlesCountOnSelectedDomain,
Expand Down
26 changes: 26 additions & 0 deletions src/Migrations/Version20230907132822.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace Shopsys\FrameworkBundle\Migrations;

use Doctrine\DBAL\Schema\Schema;
use Shopsys\MigrationBundle\Component\Doctrine\Migrations\AbstractMigration;

class Version20230907132822 extends AbstractMigration
{
/**
* @param \Doctrine\DBAL\Schema\Schema $schema
*/
public function up(Schema $schema): void
{
$this->sql('UPDATE articles SET placement = \'none\' WHERE placement = \'topMenu\'');
}

/**
* @param \Doctrine\DBAL\Schema\Schema $schema
*/
public function down(Schema $schema): void
{
}
}
1 change: 0 additions & 1 deletion src/Model/Article/Article.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
class Article implements OrderableEntityInterface
{
public const PLACEMENT_TOP_MENU = 'topMenu';
public const PLACEMENT_FOOTER = 'footer';
public const PLACEMENT_NONE = 'none';

Expand Down
1 change: 0 additions & 1 deletion src/Model/Article/ArticleFacade.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ public function getAllByDomainId($domainId)
public function getAvailablePlacementChoices(): array
{
return [
t('in upper menu') => Article::PLACEMENT_TOP_MENU,
t('in footer') => Article::PLACEMENT_FOOTER,
t('without positioning') => Article::PLACEMENT_NONE,
];
Expand Down
6 changes: 0 additions & 6 deletions src/Resources/translations/messages.cs.po
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,6 @@ msgstr "Údaje článku"
msgid "Articles in footer"
msgstr "Články v patičce"

msgid "Articles in upper menu"
msgstr "Články v horním menu"

msgid "Articles overview"
msgstr "Přehled článků"

Expand Down Expand Up @@ -2590,9 +2587,6 @@ msgstr "v kategorii (mezi prvním a druhým řádkem produktů)"
msgid "in footer"
msgstr "v patičce"

msgid "in upper menu"
msgstr "v horním menu"

msgid "include"
msgstr "obsahuje"

Expand Down
6 changes: 0 additions & 6 deletions src/Resources/translations/messages.en.po
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,6 @@ msgstr ""
msgid "Articles in footer"
msgstr ""

msgid "Articles in upper menu"
msgstr ""

msgid "Articles overview"
msgstr ""

Expand Down Expand Up @@ -2590,9 +2587,6 @@ msgstr ""
msgid "in footer"
msgstr ""

msgid "in upper menu"
msgstr ""

msgid "include"
msgstr ""

Expand Down
5 changes: 0 additions & 5 deletions src/Resources/views/Admin/Content/Article/list.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@
{{ render(controller('Shopsys\\FrameworkBundle\\Controller\\Admin\\DomainController::domainTabsAction')) }}

{% if articlesCountOnSelectedDomain > 0 %}
<div class="wrap-divider wrap-divider--no-border">
<h2>{{ 'Articles in upper menu'|trans }}</h2>
{{ gridViewTop.render() }}
</div>

<div class="wrap-divider wrap-divider--no-border">
<h2>{{ 'Articles in footer'|trans }}</h2>
{{ gridViewFooter.render() }}
Expand Down

0 comments on commit e64d75e

Please sign in to comment.