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 6e8ec79 commit da40701
Show file tree
Hide file tree
Showing 15 changed files with 15 additions and 148 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ ArticlePlacementTypeEnum:
footer4:
value: '@=constant("App\\Model\\Article\\Article::PLACEMENT_FOOTER_4")'
description: "Articles in 4th footer column"
topMenu:
value: '@=constant("Shopsys\\FrameworkBundle\\Model\\Article\\Article::PLACEMENT_TOP_MENU")'
description: "Articles in top menu"
none:
value: '@=constant("Shopsys\\FrameworkBundle\\Model\\Article\\Article::PLACEMENT_NONE")'
description: "Articles without specific placement"
2 changes: 0 additions & 2 deletions app/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,6 @@ enum ArticlePlacementTypeEnum {
footer3
"""Articles in 4th footer column"""
footer4
"""Articles in top menu"""
topMenu
"""Articles without specific placement"""
none
}
Expand Down
2 changes: 0 additions & 2 deletions app/src/Controller/Admin/ArticleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ public function __construct(
*/
public function listAction(): Response
{
$gridTop = $this->getGrid(Article::PLACEMENT_TOP_MENU);
$gridFooter1 = $this->getGrid(Article::PLACEMENT_FOOTER_1);
$gridFooter2 = $this->getGrid(Article::PLACEMENT_FOOTER_2);
$gridFooter3 = $this->getGrid(Article::PLACEMENT_FOOTER_3);
Expand All @@ -75,7 +74,6 @@ public function listAction(): Response
$articlesCountOnSelectedDomain = $this->articleFacade->getAllArticlesCountByDomainId($this->adminDomainTabsFacade->getSelectedDomainId());

return $this->render('@ShopsysFramework/Admin/Content/Article/list.html.twig', [
'gridViewTop' => $gridTop->createView(),
'gridViewFooter1' => $gridFooter1->createView(),
'gridViewFooter2' => $gridFooter2->createView(),
'gridViewFooter3' => $gridFooter3->createView(),
Expand Down
31 changes: 0 additions & 31 deletions app/src/DataFixtures/Demo/ArticleDataFixture.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,37 +97,6 @@ private function getDataForArticles(string $locale): array
{
return [
[
self::ATTRIBUTE_NAME_KEY => t('News', [], Translator::DATA_FIXTURES_TRANSLATION_DOMAIN, $locale),
self::ATTRIBUTE_TEXT_KEY => t(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus felis nisi, tincidunt sollicitudin augue eu, laoreet blandit sem. Donec rutrum augue a elit imperdiet, eu vehicula tortor porta. Vivamus pulvinar sem non auctor dictum. Morbi eleifend semper enim, eu faucibus tortor posuere vitae. Donec tincidunt ipsum ullamcorper nisi accumsan tincidunt. Aenean sed velit massa. Nullam interdum eget est ut convallis. Vestibulum et mauris condimentum, rutrum sem congue, suscipit arcu.\nSed tristique vehicula ipsum, ut vulputate tortor feugiat eu. Vivamus convallis quam vulputate faucibus facilisis. Curabitur tincidunt pulvinar leo, eu dapibus augue lacinia a. Fusce sed tincidunt nunc. Morbi a nisi a odio pharetra laoreet nec eget quam. In in nisl tortor. Ut fringilla vitae lectus eu venenatis. Nullam interdum sed odio a posuere. Fusce pellentesque dui vel tortor blandit, a dictum nunc congue.',
[],
Translator::DATA_FIXTURES_TRANSLATION_DOMAIN,
$locale,
),
self::ATTRIBUTE_PLACEMENT_KEY => Article::PLACEMENT_TOP_MENU,
], [
self::ATTRIBUTE_NAME_KEY => t('Shopping guide', [], Translator::DATA_FIXTURES_TRANSLATION_DOMAIN, $locale),
self::ATTRIBUTE_TEXT_KEY => t(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus felis nisi, tincidunt sollicitudin augue eu, laoreet blandit sem. Donec rutrum augue a elit imperdiet, eu vehicula tortor porta. Vivamus pulvinar sem non auctor dictum. Morbi eleifend semper enim, eu faucibus tortor posuere vitae. Donec tincidunt ipsum ullamcorper nisi accumsan tincidunt. Aenean sed velit massa. Nullam interdum eget est ut convallis. Vestibulum et mauris condimentum, rutrum sem congue, suscipit arcu.\nSed tristique vehicula ipsum, ut vulputate tortor feugiat eu. Vivamus convallis quam vulputate faucibus facilisis. Curabitur tincidunt pulvinar leo, eu dapibus augue lacinia a. Fusce sed tincidunt nunc. Morbi a nisi a odio pharetra laoreet nec eget quam. In in nisl tortor. Ut fringilla vitae lectus eu venenatis. Nullam interdum sed odio a posuere. Fusce pellentesque dui vel tortor blandit, a dictum nunc congue.',
[],
Translator::DATA_FIXTURES_TRANSLATION_DOMAIN,
$locale,
),
self::ATTRIBUTE_PLACEMENT_KEY => Article::PLACEMENT_TOP_MENU,
self::ATTRIBUTE_SEO_H1_KEY => t(
'Shopping guide to improve your shopping experience',
[],
Translator::DATA_FIXTURES_TRANSLATION_DOMAIN,
$locale,
),
self::ATTRIBUTE_SEO_TITLE_KEY => t('Shopping guide for quick shopping', [], Translator::DATA_FIXTURES_TRANSLATION_DOMAIN, $locale),
self::ATTRIBUTE_SEO_META_DESCRIPTION_KEY => t(
'Shopping guide - Tips and tricks how to quickly find what you are looking for',
[],
Translator::DATA_FIXTURES_TRANSLATION_DOMAIN,
$locale,
),
], [
self::ATTRIBUTE_NAME_KEY => t('About us', [], Translator::DATA_FIXTURES_TRANSLATION_DOMAIN, $locale),
self::ATTRIBUTE_TEXT_KEY => t('Morbi posuere mauris dolor, quis accumsan dolor ullamcorper eget. Phasellus at elementum magna, et pretium neque. Praesent tristique lorem mi, eget varius quam aliquam eget. Vivamus ultrices interdum nisi, sed placerat lectus fermentum non. Phasellus ac quam vitae nisi aliquam vestibulum. Sed rhoncus tortor a arcu sagittis placerat. Nulla lectus nunc, ultrices ac faucibus sed, accumsan nec diam. Nam auctor neque quis tincidunt tempus. Nunc eget risus tristique, lobortis metus vitae, pellentesque leo. Vivamus placerat turpis ac dolor vehicula tincidunt. Sed venenatis, ante id ultrices convallis, lacus elit porttitor dolor, non porta risus ipsum ac justo. Integer id pretium quam, id placerat nulla.', [], Translator::DATA_FIXTURES_TRANSLATION_DOMAIN, $locale),
self::ATTRIBUTE_PLACEMENT_KEY => Article::PLACEMENT_FOOTER_1,
Expand Down
1 change: 0 additions & 1 deletion app/src/Form/Admin/ArticleFormTypeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ private function changeOptionsOfPlacementField($builderArticleDataGroup)
$builderArticleDataGroup->add('placement', ChoiceType::class, [
'required' => true,
'choices' => [
t('in upper menu') => Article::PLACEMENT_TOP_MENU,
t('Articles in footer') . ' 1' => Article::PLACEMENT_FOOTER_1,
t('Articles in footer') . ' 2' => Article::PLACEMENT_FOOTER_2,
t('Articles in footer') . ' 3' => Article::PLACEMENT_FOOTER_3,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,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 }} 1</h2>
{{ gridViewFooter1.render() }}
Expand Down
4 changes: 2 additions & 2 deletions app/tests/App/Functional/Model/Article/ArticleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testArticleIsCorrectlyRestoredFromDatabase()
$articleData = $this->articleDataFactory->create();

$articleData->name = 'Demonstrative name';
$articleData->placement = 'topMenu';
$articleData->placement = Article::PLACEMENT_FOOTER_1;
$articleData->seoTitle = 'Demonstrative seo title';
$articleData->seoMetaDescription = 'Demonstrative seo description';
$articleData->seoH1 = 'Demonstrative seo H1';
Expand All @@ -47,7 +47,7 @@ public function testArticleIsCorrectlyRestoredFromDatabase()
$refreshedArticle = $this->em->getRepository(Article::class)->find($articleId);

$this->assertSame('Demonstrative name', $refreshedArticle->getName());
$this->assertSame('topMenu', $refreshedArticle->getPlacement());
$this->assertSame(Article::PLACEMENT_FOOTER_1, $refreshedArticle->getPlacement());
$this->assertSame('Demonstrative seo title', $refreshedArticle->getSeoTitle());
$this->assertSame('Demonstrative seo description', $refreshedArticle->getSeoMetaDescription());
$this->assertSame('Demonstrative seo H1', $refreshedArticle->getSeoH1());
Expand Down
53 changes: 11 additions & 42 deletions app/tests/FrontendApiBundle/Functional/Article/GetArticlesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class GetArticlesTest extends GraphQlTestCase

public function testGetArticles(): void
{
foreach ($this->getArticlesDataProvider() as $dataSet) {
foreach ($this->getArticlesDataProvider() as $index => $dataSet) {
[$response, $expectedArticlesData] = $dataSet;

$graphQlType = 'articles';
Expand Down Expand Up @@ -81,29 +81,29 @@ private function getArticlesDataProvider(): array
],
[
$this->getLastCountOfArticlesResponse(1),
array_slice($this->getExpectedArticles(), 20, 1),
array_slice($this->getExpectedArticles(), 18, 1),
],
[
$this->getLastCountOfArticlesResponse(2),
array_slice($this->getExpectedArticles(), 19, 2),
array_slice($this->getExpectedArticles(), 17, 2),
],
[
$this->getFirstArticlesCountResponse(1, [Article::PLACEMENT_TOP_MENU]),
array_slice($this->getExpectedArticles(), 19, 1),
$this->getFirstArticlesCountResponse(1, [Article::PLACEMENT_FOOTER_4]),
array_slice($this->getExpectedArticles(), 13, 1),
],
[
$this->getLastCountOfArticlesResponse(1, [Article::PLACEMENT_TOP_MENU]),
array_slice($this->getExpectedArticles(), 20, 1),
$this->getLastCountOfArticlesResponse(1, [Article::PLACEMENT_FOOTER_4]),
array_slice($this->getExpectedArticles(), 15, 1),
],
[
$this->getFirstArticlesCountResponse(self::ARTICLES_TOTAL_COUNT, [Article::PLACEMENT_TOP_MENU]),
array_slice($this->getExpectedArticles(), 19, 2),
$this->getFirstArticlesCountResponse(self::ARTICLES_TOTAL_COUNT, [Article::PLACEMENT_FOOTER_4]),
array_slice($this->getExpectedArticles(), 13, 3),
],
[
$this->getFirstArticlesCountResponse(self::ARTICLES_TOTAL_COUNT, [Article::PLACEMENT_FOOTER_1, Article::PLACEMENT_TOP_MENU]),
$this->getFirstArticlesCountResponse(self::ARTICLES_TOTAL_COUNT, [Article::PLACEMENT_FOOTER_1, Article::PLACEMENT_FOOTER_4]),
[
...array_slice($this->getExpectedArticles(), 0, 5),
...array_slice($this->getExpectedArticles(), 19, 2),
...array_slice($this->getExpectedArticles(), 13, 3),
],
],
];
Expand Down Expand Up @@ -387,37 +387,6 @@ private function getExpectedArticles(): array
'seoTitle' => null,
'seoMetaDescription' => null,
],
[
'name' => t('News', [], Translator::DATA_FIXTURES_TRANSLATION_DOMAIN, $firstDomainLocale),
'placement' => Article::PLACEMENT_TOP_MENU,
'text' => '<div class="gjs-text-ckeditor">' . t(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus felis nisi, tincidunt sollicitudin augue eu, laoreet blandit sem. Donec rutrum augue a elit imperdiet, eu vehicula tortor porta. Vivamus pulvinar sem non auctor dictum. Morbi eleifend semper enim, eu faucibus tortor posuere vitae. Donec tincidunt ipsum ullamcorper nisi accumsan tincidunt. Aenean sed velit massa. Nullam interdum eget est ut convallis. Vestibulum et mauris condimentum, rutrum sem congue, suscipit arcu.\\nSed tristique vehicula ipsum, ut vulputate tortor feugiat eu. Vivamus convallis quam vulputate faucibus facilisis. Curabitur tincidunt pulvinar leo, eu dapibus augue lacinia a. Fusce sed tincidunt nunc. Morbi a nisi a odio pharetra laoreet nec eget quam. In in nisl tortor. Ut fringilla vitae lectus eu venenatis. Nullam interdum sed odio a posuere. Fusce pellentesque dui vel tortor blandit, a dictum nunc congue.',
[],
Translator::DATA_FIXTURES_TRANSLATION_DOMAIN,
$firstDomainLocale,
) . '</div>',
'seoH1' => null,
'seoTitle' => null,
'seoMetaDescription' => null,
],
[
'name' => t('Shopping guide', [], Translator::DATA_FIXTURES_TRANSLATION_DOMAIN, $firstDomainLocale),
'placement' => Article::PLACEMENT_TOP_MENU,
'text' => '<div class="gjs-text-ckeditor">' . t(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus felis nisi, tincidunt sollicitudin augue eu, laoreet blandit sem. Donec rutrum augue a elit imperdiet, eu vehicula tortor porta. Vivamus pulvinar sem non auctor dictum. Morbi eleifend semper enim, eu faucibus tortor posuere vitae. Donec tincidunt ipsum ullamcorper nisi accumsan tincidunt. Aenean sed velit massa. Nullam interdum eget est ut convallis. Vestibulum et mauris condimentum, rutrum sem congue, suscipit arcu.\\nSed tristique vehicula ipsum, ut vulputate tortor feugiat eu. Vivamus convallis quam vulputate faucibus facilisis. Curabitur tincidunt pulvinar leo, eu dapibus augue lacinia a. Fusce sed tincidunt nunc. Morbi a nisi a odio pharetra laoreet nec eget quam. In in nisl tortor. Ut fringilla vitae lectus eu venenatis. Nullam interdum sed odio a posuere. Fusce pellentesque dui vel tortor blandit, a dictum nunc congue.',
[],
Translator::DATA_FIXTURES_TRANSLATION_DOMAIN,
$firstDomainLocale,
) . '</div>',
'seoH1' => t('Shopping guide to improve your shopping experience', [], Translator::DATA_FIXTURES_TRANSLATION_DOMAIN, $firstDomainLocale),
'seoTitle' => t('Shopping guide for quick shopping', [], Translator::DATA_FIXTURES_TRANSLATION_DOMAIN, $firstDomainLocale),
'seoMetaDescription' => t(
'Shopping guide - Tips and tricks how to quickly find what you are looking for',
[],
Translator::DATA_FIXTURES_TRANSLATION_DOMAIN,
$firstDomainLocale,
),
],
];
}
}
18 changes: 0 additions & 18 deletions app/translations/dataFixtures.cs.po
Original file line number Diff line number Diff line change
Expand Up @@ -1096,9 +1096,6 @@ msgstr "Lokalizace"
msgid "Logitech S120 black"
msgstr "Logitech S120 black"

msgid "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus felis nisi, tincidunt sollicitudin augue eu, laoreet blandit sem. Donec rutrum augue a elit imperdiet, eu vehicula tortor porta. Vivamus pulvinar sem non auctor dictum. Morbi eleifend semper enim, eu faucibus tortor posuere vitae. Donec tincidunt ipsum ullamcorper nisi accumsan tincidunt. Aenean sed velit massa. Nullam interdum eget est ut convallis. Vestibulum et mauris condimentum, rutrum sem congue, suscipit arcu.\\nSed tristique vehicula ipsum, ut vulputate tortor feugiat eu. Vivamus convallis quam vulputate faucibus facilisis. Curabitur tincidunt pulvinar leo, eu dapibus augue lacinia a. Fusce sed tincidunt nunc. Morbi a nisi a odio pharetra laoreet nec eget quam. In in nisl tortor. Ut fringilla vitae lectus eu venenatis. Nullam interdum sed odio a posuere. Fusce pellentesque dui vel tortor blandit, a dictum nunc congue."
msgstr "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus felis nisi, tincidunt sollicitudin augue eu, laoreet blandit sem. Donec rutrum augue a elit imperdiet, eu vehicula tortor porta. Vivamus pulvinar sem non auctor dictum. Morbi eleifend semper enim, eu faucibus tortor posuere vitae. Donec tincidunt ipsum ullamcorper nisi accumsan tincidunt. Aenean sed velit massa. Nullam interdum eget est ut convallis. Vestibulum et mauris condimentum, rutrum sem congue, suscipit arcu.\\nSed tristique vehicula ipsum, ut vulputate tortor feugiat eu. Vivamus convallis quam vulputate faucibus facilisis. Curabitur tincidunt pulvinar leo, eu dapibus augue lacinia a. Fusce sed tincidunt nunc. Morbi a nisi a odio pharetra laoreet nec eget quam. In in nisl tortor. Ut fringilla vitae lectus eu venenatis. Nullam interdum sed odio a posuere. Fusce pellentesque dui vel tortor blandit, a dictum nunc congue."

msgid "Luxury automatic coffee machine Jura Impressa Z9 One Touch packed with Swiss precision and elegance, which sets new standards. This machine brings you jeich on several levels, such as coffee quality, easy to use and attractive design."
msgstr "JURA Impressa J9 TFT Carbon Automatický kávovar/espresso,barevný LCD"

Expand Down Expand Up @@ -1222,9 +1219,6 @@ msgstr "Nové počítače s USB"
msgid "New driving rules and tips just for you!"
msgstr "Prostudujte si nová pravidla silničního provozu platná od 1. července 2006!"

msgid "News"
msgstr "Novinky"

msgid "Nikon COS 700D"
msgstr "Nikon COS 700D"

Expand Down Expand Up @@ -1546,18 +1540,6 @@ msgstr "Sennheiser HD 700"
msgid "Sensitivity (ISO)"
msgstr "Citlivost (ISO)"

msgid "Shopping guide"
msgstr "Jak nakupovat"

msgid "Shopping guide - Tips and tricks how to quickly find what you are looking for"
msgstr "Jak nakupovat - Tipy a triky jak rychle najít co potřebujete"

msgid "Shopping guide for quick shopping"
msgstr "Nákupní rádce pro rychlý nákup"

msgid "Shopping guide to improve your shopping experience"
msgstr "Zlepšení zážitku z nakupovaní"

msgid "Shopsys Platform - Title page"
msgstr "Shopsys Platform - Titulní strana"

Expand Down
18 changes: 0 additions & 18 deletions app/translations/dataFixtures.en.po
Original file line number Diff line number Diff line change
Expand Up @@ -1096,9 +1096,6 @@ msgstr ""
msgid "Logitech S120 black"
msgstr ""

msgid "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus felis nisi, tincidunt sollicitudin augue eu, laoreet blandit sem. Donec rutrum augue a elit imperdiet, eu vehicula tortor porta. Vivamus pulvinar sem non auctor dictum. Morbi eleifend semper enim, eu faucibus tortor posuere vitae. Donec tincidunt ipsum ullamcorper nisi accumsan tincidunt. Aenean sed velit massa. Nullam interdum eget est ut convallis. Vestibulum et mauris condimentum, rutrum sem congue, suscipit arcu.\\nSed tristique vehicula ipsum, ut vulputate tortor feugiat eu. Vivamus convallis quam vulputate faucibus facilisis. Curabitur tincidunt pulvinar leo, eu dapibus augue lacinia a. Fusce sed tincidunt nunc. Morbi a nisi a odio pharetra laoreet nec eget quam. In in nisl tortor. Ut fringilla vitae lectus eu venenatis. Nullam interdum sed odio a posuere. Fusce pellentesque dui vel tortor blandit, a dictum nunc congue."
msgstr ""

msgid "Luxury automatic coffee machine Jura Impressa Z9 One Touch packed with Swiss precision and elegance, which sets new standards. This machine brings you jeich on several levels, such as coffee quality, easy to use and attractive design."
msgstr ""

Expand Down Expand Up @@ -1222,9 +1219,6 @@ msgstr ""
msgid "New driving rules and tips just for you!"
msgstr ""

msgid "News"
msgstr ""

msgid "Nikon COS 700D"
msgstr ""

Expand Down Expand Up @@ -1546,18 +1540,6 @@ msgstr ""
msgid "Sensitivity (ISO)"
msgstr ""

msgid "Shopping guide"
msgstr ""

msgid "Shopping guide - Tips and tricks how to quickly find what you are looking for"
msgstr ""

msgid "Shopping guide for quick shopping"
msgstr ""

msgid "Shopping guide to improve your shopping experience"
msgstr ""

msgid "Shopsys Platform - Title page"
msgstr ""

Expand Down
6 changes: 0 additions & 6 deletions app/translations/messages.cs.po
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ msgstr "Články - zobrazení"
msgid "Articles in footer"
msgstr "Články v patičce"

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

msgid "Articles without positioning"
msgstr "Články bez umístění"

Expand Down Expand Up @@ -2296,9 +2293,6 @@ msgstr "od nejdražšího"
msgid "from the cheapest"
msgstr "od nejlevnějšího"

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

msgid "new customers"
msgstr "noví zákazníci"

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

msgid "Articles in upper menu"
msgstr ""

msgid "Articles without positioning"
msgstr ""

Expand Down Expand Up @@ -2296,9 +2293,6 @@ msgstr ""
msgid "from the cheapest"
msgstr ""

msgid "in upper menu"
msgstr ""

msgid "new customers"
msgstr ""

Expand Down
Loading

0 comments on commit da40701

Please sign in to comment.