diff --git a/doc/faq_cms.png b/doc/faq_cms.png deleted file mode 100644 index 3df5d48f1..000000000 Binary files a/doc/faq_cms.png and /dev/null differ diff --git a/doc/faq_cms_result.png b/doc/faq_cms_result.png deleted file mode 100644 index bce828b55..000000000 Binary files a/doc/faq_cms_result.png and /dev/null differ diff --git a/doc/faq_create_cms.png b/doc/faq_create_cms.png deleted file mode 100644 index 3dc4dd109..000000000 Binary files a/doc/faq_create_cms.png and /dev/null differ diff --git a/doc/faqs.md b/doc/faqs.md deleted file mode 100644 index 2b27b1279..000000000 --- a/doc/faqs.md +++ /dev/null @@ -1,20 +0,0 @@ -# FAQs - -Frequently asked question is a common part of each eCommerce website. You can add the in your admin -panel configuring question, answer and position. All results will be paginated in the store front. - -## General usage - -To render FAQs list, use the `bitbag_sylius_cms_plugin_shop_frequently_asked_question_index` route. - -```twig -{{ 'app.ui.faqs'|trans }} -``` - -## Customization - -If you don't know how to override templates yet, -read [Sylius template customization guide](http://docs.sylius.org/en/latest/customization/template.html). - -You can create a template under `app/Resources/BitBagSyliusCmsPlugin/views/Shop/FrequentlyAskedQuestion` location. -Available templates you can override can be found under [this location](../src/Resources/views/Shop/FrequentlyAskedQuestion). diff --git a/doc/use_case.md b/doc/use_case.md index a1c912296..34969b332 100644 --- a/doc/use_case.md +++ b/doc/use_case.md @@ -13,7 +13,7 @@ This empowers businesses to easily adapt their store's content to meet current n ## What Sylius CMS Plugin provides us with When using the BitBag Sylius CMS Plugin, administrators gain access to various tiles within the admin panel, each serving a specific purpose. -These tiles include Blocks, Media, Pages, FAQs, and Sections. +These tiles include Blocks, Media, Pages, and Sections. ## Brief overview of what each tile offers @@ -27,7 +27,6 @@ Our CMS Plugin allows you to manage: * Blocks - separate parts for the content * Media - files, that can be attached to the page * Pages - whole pages, obtainable by the link -* FAQ - the simple mechanism for Frequently Asked Questions function --- @@ -68,20 +67,11 @@ It enables the creation of various types of pages, such as the homepage, informa More information about Pages you can get [here](use_case_pages.md). -### FAQ -The FAQ tile is specifically designed to manage frequently asked questions. - -Administrators can create question-and-answer pairs, categorize them, and make them available to customers on relevant pages. This helps provide clear information and addresses common queries for a seamless customer experience. - -![Screenshot showing content management config in admin](faq_cms.png) - -More information about the FAQ you can get [here](use_case_faq.md). - ## Summary In summary, the BitBag Sylius CMS Plugin provides administrators with a range of tiles in the admin panel, including [Sections](use_case_sections.md), [Blocks](use_case_blocks.md), -[Media](use_case_media.md), [Pages](use_case_pages.md) and [FAQ](use_case_faq.md). +[Media](use_case_media.md), [Pages](use_case_pages.md). -These tiles offer functionalities for managing reusable content blocks, media assets, CMS pages, frequently asked questions, -and page sections. Together, they enable administrators to efficiently create, edit, and organize content within the Sylius e-commerce system, +These tiles offer functionalities for managing reusable content blocks, media assets, CMS pages and page sections. +Together, they enable administrators to efficiently create, edit, and organize content within the Sylius e-commerce system, resulting in a more engaging and personalized user experience. diff --git a/doc/use_case_faq.md b/doc/use_case_faq.md deleted file mode 100644 index 4b81dbe81..000000000 --- a/doc/use_case_faq.md +++ /dev/null @@ -1,30 +0,0 @@ -# Frequently Asked Questions - -FAQ is a common part of each eCommerce website. You can add them in your admin panel by configuring question, answer, and position. All results will be paginated in the storefront. - -The BitBag SyliusCmsPlugin allows administrators to add and display questions and answers within the FAQ section on various pages, including the product page. - -This feature enables the easy management and presentation of frequently asked questions, providing valuable information to customers within a dedicated FAQ section. - -**Note.** If you haven't implemented the FAQ properly in your code yet, please visit [FAQ](faqs.md) tech doc. - -## The process of creating an FAQ - -1. Please access the administrator panel of the Sylius e-commerce system. -2. Navigate to the CMS section or the specific area designated for managing FAQs. -3. Locate the option to add a new FAQ entry or question. -4. Enter the question in the provided field. -5. Add the corresponding answer to the question in the designated space. -6. Save the newly created FAQ entry. -7. Repeat the process for additional questions and answers as needed. -8. After refreshing the store page, the newly implemented changes should now be visible. - -The mentioned form: - -![Screenshot showing content management config in admin](faq_create_cms.png) - -## Result on the front of the store: - -The image below displays a rendered FAQ on your Sylius Store: - -![Screenshot showing content management config in admin](faq_cms_result.png) diff --git a/features/admin/adding_frequently_asked_question.feature b/features/admin/adding_frequently_asked_question.feature deleted file mode 100644 index 8dc1d4adc..000000000 --- a/features/admin/adding_frequently_asked_question.feature +++ /dev/null @@ -1,57 +0,0 @@ -@managing_frequently_asked_questions -Feature: Adding frequently asked question - In order to present frequently asked questions and answers in my store - As an Administrator - I want to be able to add new frequently asked question with answer - - Background: - Given I am logged in as an administrator - And the store operates on a single channel in "United States" - - @ui - Scenario: Adding frequently asked question - When I go to the create frequently asked question page - And I fill the code with "each_order_payment" - And I set the position to 1 - And I fill the question with "Should I pay for each order?" - And I set the answer to "Yes" - And I add it - Then I should be notified that a new frequently asked question has been created - - @ui @unstable - Scenario: Adding new frequently asked question with long data - When I go to the create frequently asked question page - And I fill the code with "whats_the_js_framework_of_the_week" - And I set the position to 1 - And I fill "Question, Answer" fields with 1500 characters - And I add it - Then I should be notified that a new frequently asked question has been created - - @ui - Scenario: Trying to add frequently asked question with existing code - Given there is an existing frequently asked question with "stupid_question" code - When I go to the create frequently asked question page - And I fill the code with "stupid_question" - And I try to add it - Then I should be notified that there is already an existing frequently asked question with provided code - - @ui - Scenario: Trying to add new frequently asked question with blank data - When I go to the create frequently asked question page - And I add it - Then I should be notified that "Code, Position, Question, Answer" fields cannot be blank - - @ui - Scenario: Trying to add new frequently asked question with too short data - When I go to the create frequently asked question page - And I fill "Question, Answer" fields with 1 character - And I add it - Then I should be notified that "Question, Answer" fields are too short - - @ui - Scenario: Trying to add new frequently asked question with existing position - Given there is an existing frequently asked question with 1 position - When I go to the create frequently asked question page - And I set the position to 1 - And I try to add it - Then I should be notified that there is already an existing frequently asked question with selected position diff --git a/features/admin/managing_frequently_asked_questions.feature b/features/admin/managing_frequently_asked_questions.feature deleted file mode 100644 index 393be7045..000000000 --- a/features/admin/managing_frequently_asked_questions.feature +++ /dev/null @@ -1,23 +0,0 @@ -@managing_frequently_asked_questions -Feature: Managing frequently asked questions - In order to present frequently asked questions and answers in my store - As an Administrator - I want to be able update and remove existing frequently asked questions - - Background: - Given I am logged in as an administrator - And the store operates on a single channel in "United States" - - @ui - Scenario: Removing frequently asked question - Given the store has a frequently asked question - When I go to the frequently asked questions page - And I delete this frequently asked question - Then I should be notified that the frequently asked question has been deleted - And I should see empty list of frequently asked questions - - @ui - Scenario: Seeing disabled code field while editing frequently asked question - Given the store has a frequently asked question - When I want to edit this frequently asked question - Then the code field should be disabled diff --git a/features/api/viewing_frequently_asked_questions.feature b/features/api/viewing_frequently_asked_questions.feature deleted file mode 100644 index 6a7ab7c7c..000000000 --- a/features/api/viewing_frequently_asked_questions.feature +++ /dev/null @@ -1,23 +0,0 @@ -@shop_frequently_asked_questions -Feature: Getting data from cms faq - In order to present dynamic content in my store - As an API user - I want to be able to display FAQ - - Background: - Given the store operates on a single channel in "United States" - And there are 10 FAQs in the store - And there is an existing frequently asked question with "faq-1" code - - @api - Scenario: Browsing FAQs - Given I want to browse FAQs - Then I should see 11 questions in the list - And I should see the "faq-1" question - - @api - Scenario: Displaying question - Given I view faq with code "faq-1" - Then I should see question with random text - And I should see answer with random text - diff --git a/features/shop/browsing_frequently_asked_questions.feature b/features/shop/browsing_frequently_asked_questions.feature deleted file mode 100644 index c1fcb4ed0..000000000 --- a/features/shop/browsing_frequently_asked_questions.feature +++ /dev/null @@ -1,14 +0,0 @@ -@shop_frequently_asked_questions -Feature: Browsing FAQs - In order to get answer to the my questions ASAP - As a Customer - I want to browse through all FAQs - - Background: - Given the store operates on a single channel in "United States" - - @ui - Scenario: Browsing FAQs - Given there are 10 FAQs in the store - When I go to the frequently asked questions list page - Then I should see 10 FAQs ordered by position diff --git a/spec/Entity/FrequentlyAskedQuestionSpec.php b/spec/Entity/FrequentlyAskedQuestionSpec.php deleted file mode 100755 index ceee3b218..000000000 --- a/spec/Entity/FrequentlyAskedQuestionSpec.php +++ /dev/null @@ -1,68 +0,0 @@ -shouldHaveType(FrequentlyAskedQuestion::class); - } - - public function it_is_a_resource(): void - { - $this->shouldHaveType(ResourceInterface::class); - } - - public function it_implements_frequently_asked_question_interface(): void - { - $this->shouldHaveType(FrequentlyAskedQuestionInterface::class); - } - - public function it_allows_access_via_properties(): void - { - $this->setCode('delivery_charges_for_orders'); - $this->getCode()->shouldReturn('delivery_charges_for_orders'); - - $this->setPosition(2); - $this->getPosition()->shouldReturn(2); - - $this->setEnabled(true); - $this->isEnabled()->shouldReturn(true); - } - - public function it_toggles(): void - { - $this->enable(); - $this->isEnabled()->shouldReturn(true); - - $this->disable(); - $this->isEnabled()->shouldReturn(false); - } - - public function it_associates_channels(ChannelInterface $firstChannel, ChannelInterface $secondChannel): void - { - $this->addChannel($firstChannel); - $this->hasChannel($firstChannel)->shouldReturn(true); - - $this->hasChannel($secondChannel)->shouldReturn(false); - - $this->removeChannel($firstChannel); - - $this->hasChannel($firstChannel)->shouldReturn(false); - } -} diff --git a/spec/Entity/FrequentlyAskedQuestionTranslationSpec.php b/spec/Entity/FrequentlyAskedQuestionTranslationSpec.php deleted file mode 100755 index 5f7ad21e4..000000000 --- a/spec/Entity/FrequentlyAskedQuestionTranslationSpec.php +++ /dev/null @@ -1,45 +0,0 @@ -shouldHaveType(FrequentlyAskedQuestionTranslation::class); - } - - public function it_is_a_resource() - { - $this->shouldHaveType(ResourceInterface::class); - } - - public function it_implements_frequently_asked_question_translation_interface() - { - $this->shouldHaveType(FrequentlyAskedQuestionTranslationInterface::class); - $this->shouldHaveType(TranslationInterface::class); - } - - public function it_allows_access_via_properties() - { - $this->setQuestion('What are the delivery charges for orders from the Online Shop?'); - $this->getQuestion()->shouldReturn('What are the delivery charges for orders from the Online Shop?'); - - $this->setAnswer('$20'); - $this->getAnswer()->shouldReturn('$20'); - } -} diff --git a/spec/Menu/ContentManagementMenuBuilderSpec.php b/spec/Menu/ContentManagementMenuBuilderSpec.php index da1bf76e8..6fbdff458 100755 --- a/spec/Menu/ContentManagementMenuBuilderSpec.php +++ b/spec/Menu/ContentManagementMenuBuilderSpec.php @@ -44,13 +44,6 @@ public function it_build_menu( $cmsRootMenuItem->setLabel('bitbag_sylius_cms_plugin.ui.pages')->willReturn($cmsRootMenuItem); $cmsRootMenuItem->setLabelAttribute('icon', 'sticky note')->shouldBeCalled(); - $cmsRootMenuItem - ->addChild('faq', ['route' => 'bitbag_sylius_cms_plugin_admin_frequently_asked_question_index']) - ->willReturn($cmsRootMenuItem) - ; - $cmsRootMenuItem->setLabel('bitbag_sylius_cms_plugin.ui.faq')->willReturn($cmsRootMenuItem); - $cmsRootMenuItem->setLabelAttribute('icon', 'help')->shouldBeCalled(); - $cmsRootMenuItem ->addChild('collections', ['route' => 'bitbag_sylius_cms_plugin_admin_collection_index']) ->willReturn($cmsRootMenuItem) diff --git a/src/Entity/FrequentlyAskedQuestion.php b/src/Entity/FrequentlyAskedQuestion.php deleted file mode 100755 index f8365e1ed..000000000 --- a/src/Entity/FrequentlyAskedQuestion.php +++ /dev/null @@ -1,108 +0,0 @@ -initializeTranslationsCollection(); - $this->initializeChannelsCollection(); - } - - public function getId(): ?int - { - return $this->id; - } - - public function getCode(): ?string - { - return $this->code; - } - - public function setCode(?string $code): void - { - $this->code = $code; - } - - public function getPosition(): ?int - { - return $this->position; - } - - public function setPosition(?int $position): void - { - $this->position = $position; - } - - public function getQuestion(): ?string - { - /** @var FrequentlyAskedQuestionInterface $frequentlyAskedQuestionInterface */ - $frequentlyAskedQuestionInterface = $this->getFrequentlyAskedQuestionTranslation(); - - return $frequentlyAskedQuestionInterface->getQuestion(); - } - - public function setQuestion(?string $question): void - { - /** @var FrequentlyAskedQuestionInterface $frequentlyAskedQuestionInterface */ - $frequentlyAskedQuestionInterface = $this->getFrequentlyAskedQuestionTranslation(); - $frequentlyAskedQuestionInterface->setQuestion($question); - } - - public function getAnswer(): ?string - { - /** @var FrequentlyAskedQuestionInterface $frequentlyAskedQuestionInterface */ - $frequentlyAskedQuestionInterface = $this->getFrequentlyAskedQuestionTranslation(); - - return $frequentlyAskedQuestionInterface->getAnswer(); - } - - public function setAnswer(?string $answer): void - { - /** @var FrequentlyAskedQuestionInterface $frequentlyAskedQuestionInterface */ - $frequentlyAskedQuestionInterface = $this->getFrequentlyAskedQuestionTranslation(); - $frequentlyAskedQuestionInterface->setAnswer($answer); - } - - /** - * @return TranslationInterface|FrequentlyAskedQuestionTranslationInterface - */ - protected function getFrequentlyAskedQuestionTranslation(): TranslationInterface - { - return $this->getTranslation(); - } - - protected function createTranslation(): TranslationInterface - { - return new FrequentlyAskedQuestionTranslation(); - } -} diff --git a/src/Entity/FrequentlyAskedQuestionInterface.php b/src/Entity/FrequentlyAskedQuestionInterface.php deleted file mode 100755 index 6c7abfd6a..000000000 --- a/src/Entity/FrequentlyAskedQuestionInterface.php +++ /dev/null @@ -1,39 +0,0 @@ -id; - } - - public function getQuestion(): ?string - { - return $this->question; - } - - public function setQuestion(string $question): void - { - $this->question = $question; - } - - public function getAnswer(): ?string - { - return $this->answer; - } - - public function setAnswer(string $answer): void - { - $this->answer = $answer; - } -} diff --git a/src/Entity/FrequentlyAskedQuestionTranslationInterface.php b/src/Entity/FrequentlyAskedQuestionTranslationInterface.php deleted file mode 100755 index 147327483..000000000 --- a/src/Entity/FrequentlyAskedQuestionTranslationInterface.php +++ /dev/null @@ -1,25 +0,0 @@ - $fields) { - /** @var ?FrequentlyAskedQuestionInterface $frequentlyAskedQuestion */ - $frequentlyAskedQuestion = $this->frequentlyAskedQuestionRepository->findOneBy(['code' => $code]); - if ( - true === $fields['remove_existing'] && - null !== $frequentlyAskedQuestion - ) { - $this->frequentlyAskedQuestionRepository->remove($frequentlyAskedQuestion); - } - - if (null !== $fields['number']) { - for ($i = 1; $i <= $fields['number']; ++$i) { - $this->createFrequentlyAskedQuestion(md5(uniqid()), $fields, $i); - } - } else { - $this->createFrequentlyAskedQuestion($code, $fields, $fields['position']); - } - } - } - - private function createFrequentlyAskedQuestion( - string $code, - array $frequentlyAskedQuestionData, - int $position, - ): void { - /** @var FrequentlyAskedQuestionInterface $frequentlyAskedQuestion */ - $frequentlyAskedQuestion = $this->frequentlyAskedQuestionFactory->createNew(); - - $frequentlyAskedQuestion->setCode($code); - $frequentlyAskedQuestion->setEnabled($frequentlyAskedQuestionData['enabled']); - $frequentlyAskedQuestion->setPosition($position); - - $this->channelAssigner->assign($frequentlyAskedQuestion, $frequentlyAskedQuestionData['channels']); - - foreach ($frequentlyAskedQuestionData['translations'] as $localeCode => $translation) { - /** @var FrequentlyAskedQuestionTranslationInterface $frequentlyAskedQuestionTranslation */ - $frequentlyAskedQuestionTranslation = $this->frequentlyAskedQuestionTranslationFactory->createNew(); - - $frequentlyAskedQuestionTranslation->setLocale($localeCode); - $frequentlyAskedQuestionTranslation->setQuestion($translation['question']); - $frequentlyAskedQuestionTranslation->setAnswer($translation['answer']); - - $frequentlyAskedQuestion->addTranslation($frequentlyAskedQuestionTranslation); - } - - $this->frequentlyAskedQuestionRepository->add($frequentlyAskedQuestion); - } -} diff --git a/src/Fixture/FrequentlyAskedQuestionFixture.php b/src/Fixture/FrequentlyAskedQuestionFixture.php deleted file mode 100755 index 1daabc69f..000000000 --- a/src/Fixture/FrequentlyAskedQuestionFixture.php +++ /dev/null @@ -1,59 +0,0 @@ -frequentlyAskedQuestionFixtureFactory->load($options['custom']); - } - - public function getName(): string - { - return 'frequently_asked_question'; - } - - protected function configureOptionsNode(ArrayNodeDefinition $optionsNode): void - { - $optionsNode - ->children() - ->arrayNode('custom') - ->arrayPrototype() - ->children() - ->booleanNode('remove_existing')->defaultTrue()->end() - ->integerNode('number')->defaultNull()->end() - ->booleanNode('enabled')->defaultTrue()->end() - ->integerNode('position')->defaultNull()->end() - ->arrayNode('channels')->scalarPrototype()->end()->end() - ->arrayNode('translations') - ->arrayPrototype() - ->children() - ->scalarNode('question')->defaultNull()->end() - ->scalarNode('answer')->defaultNull()->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ->end() - ; - } -} diff --git a/src/Form/Type/FrequentlyAskedQuestionType.php b/src/Form/Type/FrequentlyAskedQuestionType.php deleted file mode 100755 index 28f24ea3d..000000000 --- a/src/Form/Type/FrequentlyAskedQuestionType.php +++ /dev/null @@ -1,49 +0,0 @@ -add('code', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.code', - 'disabled' => null !== $builder->getData()->getCode(), - ]) - ->add('position', IntegerType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.position', - ]) - ->add('enabled', CheckboxType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.enabled', - ]) - ->add('translations', ResourceTranslationsType::class, [ - 'label' => false, - 'entry_type' => FrequentlyAskedQuestionTranslationType::class, - ]) - ->add('channels', ChannelChoiceType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.channels', - 'required' => false, - 'multiple' => true, - 'expanded' => true, - ]) - ; - } -} diff --git a/src/Form/Type/Translation/FrequentlyAskedQuestionTranslationType.php b/src/Form/Type/Translation/FrequentlyAskedQuestionTranslationType.php deleted file mode 100755 index c992620e1..000000000 --- a/src/Form/Type/Translation/FrequentlyAskedQuestionTranslationType.php +++ /dev/null @@ -1,31 +0,0 @@ -add('question', TextType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.question', - ]) - ->add('answer', TextareaType::class, [ - 'label' => 'bitbag_sylius_cms_plugin.ui.answer', - ]) - ; - } -} diff --git a/src/Menu/ContentManagementMenuBuilder.php b/src/Menu/ContentManagementMenuBuilder.php index 555d7118b..a67d28ac0 100755 --- a/src/Menu/ContentManagementMenuBuilder.php +++ b/src/Menu/ContentManagementMenuBuilder.php @@ -47,14 +47,6 @@ public function buildMenu(MenuBuilderEvent $menuBuilderEvent): void ->setLabelAttribute('icon', 'sticky note') ; - $cmsRootMenuItem - ->addChild('faq', [ - 'route' => 'bitbag_sylius_cms_plugin_admin_frequently_asked_question_index', - ]) - ->setLabel('bitbag_sylius_cms_plugin.ui.faq') - ->setLabelAttribute('icon', 'help') - ; - $cmsRootMenuItem ->addChild('collections', [ 'route' => 'bitbag_sylius_cms_plugin_admin_collection_index', diff --git a/src/Repository/FrequentlyAskedQuestionRepository.php b/src/Repository/FrequentlyAskedQuestionRepository.php deleted file mode 100755 index 0ea456dee..000000000 --- a/src/Repository/FrequentlyAskedQuestionRepository.php +++ /dev/null @@ -1,54 +0,0 @@ -createQueryBuilder('o') - ->addSelect('translation') - ->leftJoin('o.translations', 'translation', 'WITH', 'translation.locale = :localeCode') - ->setParameter('localeCode', $localeCode) - ; - } - - public function findEnabledOrderedByPosition(string $localeCode, string $channelCode): array - { - return $this->createQueryBuilder('o') - ->leftJoin('o.translations', 'translation') - ->innerJoin('o.channels', 'channels') - ->where('translation.locale = :localeCode') - ->andWhere('o.enabled = true') - ->andWhere('channels.code = :channelCode') - ->orderBy('o.position', 'ASC') - ->setParameter('localeCode', $localeCode) - ->setParameter('channelCode', $channelCode) - ->getQuery() - ->getResult() - ; - } - - public function findOneEnabledByCode(string $code): ?FrequentlyAskedQuestionInterface - { - return $this->createQueryBuilder('o') - ->where('o.code = :code') - ->andWhere('o.enabled = true') - ->setParameter('code', $code) - ->getQuery() - ->getOneOrNullResult() - ; - } -} diff --git a/src/Repository/FrequentlyAskedQuestionRepositoryInterface.php b/src/Repository/FrequentlyAskedQuestionRepositoryInterface.php deleted file mode 100755 index bc3c19298..000000000 --- a/src/Repository/FrequentlyAskedQuestionRepositoryInterface.php +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - shop:cms:read - - - - - - shop:cms:write - - - - sylius - - - - GET - /shop/cms-plugin/faq - - - - - - - GET - /shop/cms-plugin/faq/{id} - - - - - - - - - - diff --git a/src/Resources/config/config.yml b/src/Resources/config/config.yml index ee2c137ea..cd35c3b30 100755 --- a/src/Resources/config/config.yml +++ b/src/Resources/config/config.yml @@ -12,8 +12,6 @@ parameters: bitbag_sylius_cms_plugin.form.type.block_image.validation_groups: "%bitbag_validation_group%" bitbag_sylius_cms_plugin.form.type.page.validation_groups: "%bitbag_validation_group%" bitbag_sylius_cms_plugin.form.type.translation.page.validation_groups: "%bitbag_validation_group%" - bitbag_sylius_cms_plugin.form.type.frequently_asked_question.validation_groups: "%bitbag_validation_group%" - bitbag_sylius_cms_plugin.form.type.translation.frequently_asked_question.validation_groups: "%bitbag_validation_group%" bitbag_sylius_cms_plugin.form.type.collection.validation_groups: "%bitbag_validation_group%" bitbag_sylius_cms_plugin.form.type.translation.media.validation_groups: "%bitbag_validation_group%" bitbag_sylius_cms_plugin.form.type.media.validation_groups: "%bitbag_validation_group%" diff --git a/src/Resources/config/doctrine/FrequentlyAskedQuestion.orm.xml b/src/Resources/config/doctrine/FrequentlyAskedQuestion.orm.xml deleted file mode 100644 index 77bdfb725..000000000 --- a/src/Resources/config/doctrine/FrequentlyAskedQuestion.orm.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Resources/config/doctrine/FrequentlyAskedQuestionTranslation.orm.xml b/src/Resources/config/doctrine/FrequentlyAskedQuestionTranslation.orm.xml deleted file mode 100644 index 6502ef579..000000000 --- a/src/Resources/config/doctrine/FrequentlyAskedQuestionTranslation.orm.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Resources/config/grids/admin.yml b/src/Resources/config/grids/admin.yml index 85b7a3868..46638d996 100755 --- a/src/Resources/config/grids/admin.yml +++ b/src/Resources/config/grids/admin.yml @@ -1,6 +1,5 @@ imports: - { resource: "@BitBagSyliusCmsPlugin/Resources/config/grids/admin/block.yml" } - { resource: "@BitBagSyliusCmsPlugin/Resources/config/grids/admin/page.yml" } - - { resource: "@BitBagSyliusCmsPlugin/Resources/config/grids/admin/frequently_asked_question.yml" } - { resource: "@BitBagSyliusCmsPlugin/Resources/config/grids/admin/collection.yml" } - { resource: "@BitBagSyliusCmsPlugin/Resources/config/grids/admin/media.yml" } diff --git a/src/Resources/config/grids/admin/frequently_asked_question.yml b/src/Resources/config/grids/admin/frequently_asked_question.yml deleted file mode 100755 index b024a4f69..000000000 --- a/src/Resources/config/grids/admin/frequently_asked_question.yml +++ /dev/null @@ -1,48 +0,0 @@ -sylius_grid: - grids: - bitbag_sylius_cms_plugin_admin_frequently_asked_question: - driver: - name: doctrine/orm - options: - class: "%bitbag_sylius_cms_plugin.model.frequently_asked_question.class%" - repository: - method: createListQueryBuilder - arguments: ["%locale%"] - sorting: - position: asc - limits: [10, 25, 50] - fields: - position: - type: string - label: sylius.ui.position - sortable: ~ - code: - type: string - label: sylius.ui.code - sortable: ~ - question: - type: string - label: bitbag_sylius_cms_plugin.ui.question - sortable: translation.question - answer: - type: string - label: bitbag_sylius_cms_plugin.ui.answer - sortable: translation.answer - filters: - search: - type: string - label: sylius.ui.search - options: - fields: [code] - actions: - main: - create: - type: create - item: - update: - type: update - delete: - type: delete - bulk: - delete: - type: delete diff --git a/src/Resources/config/resources.yml b/src/Resources/config/resources.yml index 28f4695e9..798e31ec9 100755 --- a/src/Resources/config/resources.yml +++ b/src/Resources/config/resources.yml @@ -2,6 +2,5 @@ imports: - { resource: resources/block.yml } - { resource: resources/content_configuration.yml } - { resource: resources/page.yml } - - { resource: resources/frequently_asked_question.yml } - { resource: resources/collection.yml } - { resource: resources/media.yml } diff --git a/src/Resources/config/resources/frequently_asked_question.yml b/src/Resources/config/resources/frequently_asked_question.yml deleted file mode 100755 index 55f5b8dcc..000000000 --- a/src/Resources/config/resources/frequently_asked_question.yml +++ /dev/null @@ -1,14 +0,0 @@ -sylius_resource: - resources: - bitbag_sylius_cms_plugin.frequently_asked_question: - driver: doctrine/orm - classes: - model: BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestion - interface: BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestionInterface - form: BitBag\SyliusCmsPlugin\Form\Type\FrequentlyAskedQuestionType - repository: BitBag\SyliusCmsPlugin\Repository\FrequentlyAskedQuestionRepository - factory: Sylius\Component\Resource\Factory\TranslatableFactory - translation: - classes: - model: BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestionTranslation - interface: BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestionTranslationInterface diff --git a/src/Resources/config/routing/admin.yml b/src/Resources/config/routing/admin.yml index ce010fc3c..c7533f397 100755 --- a/src/Resources/config/routing/admin.yml +++ b/src/Resources/config/routing/admin.yml @@ -4,9 +4,6 @@ bitbag_sylius_cms_plugin_admin_block: bitbag_sylius_cms_plugin_admin_page: resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/admin/page.yml" -bitbag_sylius_cms_plugin_admin_frequently_asked_question: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/admin/frequently_asked_question.yml" - bitbag_sylius_cms_plugin_admin_collection: resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/admin/collection.yml" diff --git a/src/Resources/config/routing/admin/frequently_asked_question.yml b/src/Resources/config/routing/admin/frequently_asked_question.yml deleted file mode 100755 index 4d8112282..000000000 --- a/src/Resources/config/routing/admin/frequently_asked_question.yml +++ /dev/null @@ -1,18 +0,0 @@ -bitbag_sylius_cms_plugin_admin_frequently_asked_question: - resource: | - alias: bitbag_sylius_cms_plugin.frequently_asked_question - section: admin - templates: '@BitBagSyliusCmsPlugin/CrudUi' - redirect: update - grid: bitbag_sylius_cms_plugin_admin_frequently_asked_question - except: ['show'] - permission: true - vars: - all: - header: bitbag_sylius_cms_plugin.ui.faq_header - subheader: bitbag_sylius_cms_plugin.ui.faq_subheader - templates: - form: "@BitBagSyliusCmsPlugin/FrequentlyAskedQuestion/Crud/_form.html.twig" - index: - icon: help - type: sylius.resource diff --git a/src/Resources/config/routing/shop.yml b/src/Resources/config/routing/shop.yml index 68f2b3b7a..14ad3e9c5 100755 --- a/src/Resources/config/routing/shop.yml +++ b/src/Resources/config/routing/shop.yml @@ -4,9 +4,6 @@ bitbag_sylius_cms_plugin_shop_block: bitbag_sylius_cms_plugin_shop_page: resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/shop/page.yml" -bitbag_sylius_cms_plugin_shop_frequently_asked_question: - resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/shop/frequently_asked_question.yml" - bitbag_sylius_cms_plugin_shop_collection: resource: "@BitBagSyliusCmsPlugin/Resources/config/routing/shop/collection.yml" diff --git a/src/Resources/config/routing/shop/frequently_asked_question.yml b/src/Resources/config/routing/shop/frequently_asked_question.yml deleted file mode 100755 index a9927601a..000000000 --- a/src/Resources/config/routing/shop/frequently_asked_question.yml +++ /dev/null @@ -1,11 +0,0 @@ -bitbag_sylius_cms_plugin_shop_frequently_asked_question_index: - path: /faq - defaults: - _controller: bitbag_sylius_cms_plugin.controller.frequently_asked_question::indexAction - _sylius: - template: "@BitBagSyliusCmsPlugin/Shop/FrequentlyAskedQuestion/index.html.twig" - repository: - method: findEnabledOrderedByPosition - arguments: - - "expr:service('sylius.context.locale').getLocaleCode()" - - "expr:service('sylius.context.channel').getChannel().getCode()" diff --git a/src/Resources/config/serialization/Faq.xml b/src/Resources/config/serialization/Faq.xml deleted file mode 100644 index 89e1154db..000000000 --- a/src/Resources/config/serialization/Faq.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - shop:cms:read - - - shop:cms:read - - - shop:cms:read - - - shop:cms:read - - - shop:cms:read - - - shop:cms:read - - - diff --git a/src/Resources/config/serialization/FaqTranslation.xml b/src/Resources/config/serialization/FaqTranslation.xml deleted file mode 100644 index 235bfcfe1..000000000 --- a/src/Resources/config/serialization/FaqTranslation.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - shop:cms:read - - - shop:cms:read - - - diff --git a/src/Resources/config/services/fixture.xml b/src/Resources/config/services/fixture.xml index 41b677ebb..c65e24c69 100644 --- a/src/Resources/config/services/fixture.xml +++ b/src/Resources/config/services/fixture.xml @@ -14,11 +14,6 @@ - - - - - @@ -44,13 +39,6 @@ - - - - - - - diff --git a/src/Resources/config/services/form.xml b/src/Resources/config/services/form.xml index a4cf678fc..a763d76a4 100644 --- a/src/Resources/config/services/form.xml +++ b/src/Resources/config/services/form.xml @@ -39,18 +39,6 @@ - - %bitbag_sylius_cms_plugin.model.frequently_asked_question.class% - %bitbag_sylius_cms_plugin.form.type.frequently_asked_question.validation_groups% - - - - - %bitbag_sylius_cms_plugin.model.frequently_asked_question_translation.class% - %bitbag_sylius_cms_plugin.form.type.translation.frequently_asked_question.validation_groups% - - - %bitbag_sylius_cms_plugin.model.collection.class% %bitbag_sylius_cms_plugin.form.type.collection.validation_groups% diff --git a/src/Resources/config/validation/FrequentlyAskedQuestion.xml b/src/Resources/config/validation/FrequentlyAskedQuestion.xml deleted file mode 100644 index ead67ad2c..000000000 --- a/src/Resources/config/validation/FrequentlyAskedQuestion.xml +++ /dev/null @@ -1,62 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Resources/config/validation/FrequentlyAskedQuestionTranslation.xml b/src/Resources/config/validation/FrequentlyAskedQuestionTranslation.xml deleted file mode 100644 index 8bc83fdcf..000000000 --- a/src/Resources/config/validation/FrequentlyAskedQuestionTranslation.xml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Resources/translations/messages.de.yml b/src/Resources/translations/messages.de.yml index 0cc146f7d..28c62ddf6 100755 --- a/src/Resources/translations/messages.de.yml +++ b/src/Resources/translations/messages.de.yml @@ -37,8 +37,6 @@ bitbag_sylius_cms_plugin: collections: Sammlungen collections_header: Sammlungen collections_subheader: Verwalten Sie Ihre Sammlungen - faq_subheader: Verwalte häufig gestellte Fragen - frequently_asked_questions: Häufig gestellte Fragen question: Frage answer: Antwort channels: Ausgabekanäle diff --git a/src/Resources/translations/messages.en.yml b/src/Resources/translations/messages.en.yml index 1b7a1b43e..41125e56a 100755 --- a/src/Resources/translations/messages.en.yml +++ b/src/Resources/translations/messages.en.yml @@ -21,16 +21,12 @@ bitbag_sylius_cms_plugin: meta_keywords: Meta keywords meta_description: Meta description content: Content - faq: FAQ code: Code contents: Contents images: Images image: Image link: Link link_content: Link content - faq_header: FAQ - faq_subheader: Manage frequently asked questions - frequently_asked_questions: Frequently asked questions question: Question answer: Answer collections: Collections diff --git a/src/Resources/translations/messages.es.yml b/src/Resources/translations/messages.es.yml index 023df298e..ca15132f6 100755 --- a/src/Resources/translations/messages.es.yml +++ b/src/Resources/translations/messages.es.yml @@ -22,16 +22,12 @@ bitbag_sylius_cms_plugin: meta_keywords: Meta keywords meta_description: Meta descripción content: Contenido - faq: Preguntas frecuentes code: Código contents: Contenido images: Imágenes image: Imagen link: Enlace link_content: Contenido del enlace - faq_header: Preguntas frecuentes - faq_subheader: Gestiona tus preguntas frecuentes - frequently_asked_questions: Preguntas frecuentes question: Pregunta answer: Respuesta collections: Colecciones diff --git a/src/Resources/translations/messages.fr.yml b/src/Resources/translations/messages.fr.yml index eb09db1df..11ef3078b 100755 --- a/src/Resources/translations/messages.fr.yml +++ b/src/Resources/translations/messages.fr.yml @@ -19,16 +19,12 @@ bitbag_sylius_cms_plugin: meta_keywords: Meta Mots-clés meta_description: Meta Description content: Contenu - faq: FAQ code: Code contents: Contenu images: Images image: Image link: Link link_content: Contenu du lien - faq_header: FAQ - faq_subheader: Gérer votre FAQ - frequently_asked_questions: Questions fréquentes (FAQ) question: Question answer: Réponse collections: Collections diff --git a/src/Resources/translations/messages.hr.yml b/src/Resources/translations/messages.hr.yml index c54e36769..89d7688e2 100755 --- a/src/Resources/translations/messages.hr.yml +++ b/src/Resources/translations/messages.hr.yml @@ -22,16 +22,12 @@ bitbag_sylius_cms_plugin: meta_keywords: Meta ključne riječi meta_description: Meta opis content: Sadržaj - faq: FAQ code: Kod contents: Sadržaj images: Slike image: Slika link: Poveznica (link) link_content: Sadržaj poveznice (linka) - faq_header: FAQ - faq_subheader: Uredi često postavljena pitanja - frequently_asked_questions: Često postavljena pitanja question: Pitanje answer: Odgovor collections: Kolekcije diff --git a/src/Resources/translations/messages.lt.yml b/src/Resources/translations/messages.lt.yml index 470f8be25..61e7d1323 100644 --- a/src/Resources/translations/messages.lt.yml +++ b/src/Resources/translations/messages.lt.yml @@ -19,16 +19,12 @@ bitbag_sylius_cms_plugin: meta_keywords: Meta raktiniai žodžiai meta_description: Meta aprašymas content: Turinys - faq: DUK code: Kodas contents: Turinys images: Paveikslai image: Paveikslas link: Nuoroda link_content: Nuorodos turinys - faq_header: DUK - faq_subheader: Dažniausiai užduodamų klausimų tvarkymas - frequently_asked_questions: Dažniausiai užduodami klausimai question: Klausimas answer: Atsakymas collections: Kolekcijos diff --git a/src/Resources/translations/messages.nl.yml b/src/Resources/translations/messages.nl.yml index 4ac2cd007..16e8b7fe2 100755 --- a/src/Resources/translations/messages.nl.yml +++ b/src/Resources/translations/messages.nl.yml @@ -22,15 +22,11 @@ bitbag_sylius_cms_plugin: meta_keywords: Meta sleutelwoorden meta_description: Meta omschrijving content: Inhoud - faq: Veelgestelde vragen code: Code contents: Inhoud images: Afbeeldingen link: Link link_content: Link inhoud - faq_header: Veelgestelde vragen - faq_subheader: Beheer veelgestelde vragen - frequently_asked_questions: Veelgestelde vragen question: Vraag answer: Antwoord collections: Collecties diff --git a/src/Resources/translations/messages.pl.yml b/src/Resources/translations/messages.pl.yml index e021b71c9..c4982f06f 100755 --- a/src/Resources/translations/messages.pl.yml +++ b/src/Resources/translations/messages.pl.yml @@ -22,16 +22,12 @@ bitbag_sylius_cms_plugin: meta_keywords: Słowa kluczowe meta_description: Opis sekcji meta content: Treść - faq: FAQ code: Kod contents: Treść images: Zdjęcia image: Zdjęcie link: Link link_content: Treść linka - faq_header: FAQ - faq_subheader: Zarządzaj najczęściej zadawanymi pytaniami - frequently_asked_questions: Najczęściej zadawane pytania question: Pytanie answer: Odpowiedź collections: Kolekcje diff --git a/src/Resources/translations/messages.ru.yml b/src/Resources/translations/messages.ru.yml index 7a03cfd74..0fa2f1f30 100755 --- a/src/Resources/translations/messages.ru.yml +++ b/src/Resources/translations/messages.ru.yml @@ -19,16 +19,12 @@ bitbag_sylius_cms_plugin: meta_keywords: Ключевые слова (мета) meta_description: Описание (мета) content: Содержимое - faq: FAQ code: Код contents: Содержит images: Изображения image: Изображение link: Ссылка link_content: Содержимое ссылки - faq_header: FAQ - faq_subheader: Управление часто задаваемыми вопросами - frequently_asked_questions: Часто задаваемые вопросы question: Вопрос answer: Ответ collections: Коллекции diff --git a/src/Resources/translations/messages.sk.yml b/src/Resources/translations/messages.sk.yml index a949b90ed..a9664ea88 100644 --- a/src/Resources/translations/messages.sk.yml +++ b/src/Resources/translations/messages.sk.yml @@ -19,16 +19,12 @@ bitbag_sylius_cms_plugin: meta_keywords: Meta keywords meta_description: Meta description content: Obsah - faq: FAQ code: Kód contents: Obsah images: Obrázky image: Obrázok link: Odkaz link_content: Obsah odkazu - faq_header: FAQ - faq_subheader: Spravujte vaše časté otázky - frequently_asked_questions: Časté otázky question: Otázka answer: Odpoveď collections: Kolekcie diff --git a/src/Resources/translations/messages.uk.yml b/src/Resources/translations/messages.uk.yml index 1f6825c8d..3346a3d1a 100755 --- a/src/Resources/translations/messages.uk.yml +++ b/src/Resources/translations/messages.uk.yml @@ -19,16 +19,12 @@ bitbag_sylius_cms_plugin: meta_keywords: Ключові слова (мета) meta_description: Опис (мета) content: Вміст - faq: FAQ code: Код contents: Містить images: Зображення image: Зображення link: Посилання link_content: Вміст посилання - faq_header: FAQ - faq_subheader: Управління FAQ - frequently_asked_questions: FAQ question: Питання answer: Відповідь collections: Колекції diff --git a/src/Resources/translations/validators.cs.yml b/src/Resources/translations/validators.cs.yml index 6f2e129e4..6ffefa93a 100644 --- a/src/Resources/translations/validators.cs.yml +++ b/src/Resources/translations/validators.cs.yml @@ -43,22 +43,6 @@ bitbag_sylius_cms_plugin: content: not_blank: Obsah nemůže být prázdný. min_length: Obsah musí mít alespoň {{ limit }} znaků. - frequently_asked_question: - code: - unique: S tímto kódem již existují často kladené dotazy. - not_blank: Kód nesmí být prázdný. - min_length: Kód musí mít alespoň {{ limit }} znaků. - max_length: Kód nemůže být delší než {{ limit }} znaků. - regex: Kód se může skládat pouze z písmen, číslic, pomlček a podtržítek. - position: - unique: Na této pozici již existují často kladené dotazy. - not_blank: Pozice nemůže být prázdná. - question: - not_blank: Otázka nemůže být prázdná. - min_length: Otázka musí mít alespoň {{ limit }} znaků. - answer: - not_blank: Odpověď nemůže být prázdná. - min_length: Odpověď musí obsahovat alespoň {{ limit }} znaků. collection: code: unique: Existuje již kolekce s tímto kódem. diff --git a/src/Resources/translations/validators.en.yml b/src/Resources/translations/validators.en.yml index cd797a83e..7d206164b 100755 --- a/src/Resources/translations/validators.en.yml +++ b/src/Resources/translations/validators.en.yml @@ -43,22 +43,6 @@ bitbag_sylius_cms_plugin: content: not_blank: Content cannot be blank. min_length: Content must be at least {{ limit }} characters long. - frequently_asked_question: - code: - unique: There is an existing FAQ with this code. - not_blank: Code cannot be blank. - min_length: Code must be at least {{ limit }} characters long. - max_length: Code can not be longer than {{ limit }} characters. - regex: Code can only be comprised of letters, numbers, dashes and underscores. - position: - unique: There is an existing FAQ with this position. - not_blank: Position cannot be blank. - question: - not_blank: Question cannot be blank. - min_length: Question must be at least {{ limit }} characters long. - answer: - not_blank: Answer cannot be blank. - min_length: Answer must be at least {{ limit }} characters long. collection: code: unique: There is an existing collection with this code. diff --git a/src/Resources/translations/validators.es.yml b/src/Resources/translations/validators.es.yml index 3e889b30c..7799fcd5b 100755 --- a/src/Resources/translations/validators.es.yml +++ b/src/Resources/translations/validators.es.yml @@ -37,21 +37,6 @@ bitbag_sylius_cms_plugin: content: not_blank: El contenido no puede ir vacío. min_length: El contenido debe tener al menos {{ limit }} caracteres. - frequently_asked_question: - code: - unique: Ya existe una pregunta con este código. - not_blank: El código no puede ir vacío. - min_length: El código debe tener al menos {{ limit }} caracteres. - max_length: El código no puede tener más de {{ limit }} caracteres. - position: - unique: Ya existe una pregunta con esta posición. - not_blank: La posición no puede ir vacía. - question: - not_blank: La pregunta no puede ir vacía. - min_length: La pregunta debe tener al menos {{ limit }} caracteres. - answer: - not_blank: La respuesta no puede ir vacía. - min_length: La respuesta debe tener al menos {{ limit }} caracteres. collection: code: unique: Ya existe una coleccion con este código. diff --git a/src/Resources/translations/validators.fr.yml b/src/Resources/translations/validators.fr.yml index 9c34147e0..d0f1b6e61 100755 --- a/src/Resources/translations/validators.fr.yml +++ b/src/Resources/translations/validators.fr.yml @@ -41,21 +41,6 @@ bitbag_sylius_cms_plugin: content: not_blank: Le contenu ne peut pas être vide. min_length: Le contenu doit faire au moins {{ limit }} caractères. - frequently_asked_question: - code: - unique: Il existe déjà une FAQ avec ce code. - not_blank: Le code ne peut pas être vide. - min_length: Le code doit faire au moins {{ limit }} caractères. - max_length: Le code ne peut pas dépasser {{ limit }} caractères. - position: - unique: Il existe déjà une FAQ avec ce code. - not_blank: La position ne peut pas être vide. - question: - not_blank: La question ne peut pas être vide. - min_length: La question doit faire au moins {{ limit }} caractères. - answer: - not_blank: La réponse ne peut pas être vide. - min_length: La réponse doit faire au moins {{ limit }} caractères. collection: code: unique: Il existe déjà une collection avec ce code. diff --git a/src/Resources/translations/validators.hr.yml b/src/Resources/translations/validators.hr.yml index 34197f151..bc63a1b03 100755 --- a/src/Resources/translations/validators.hr.yml +++ b/src/Resources/translations/validators.hr.yml @@ -37,21 +37,6 @@ bitbag_sylius_cms_plugin: content: not_blank: Sadržaj ne može biti prazan. min_length: Sadržaj mora sadržavati minimlano {{ limit }} znakova. - frequently_asked_question: - code: - unique: Postoji FAQ sa istim kodom. - not_blank: Kod ne može biti prazan. - min_length: Kod mora sadržavati minimalno {{ limit }} znaka. - max_length: Kod ne može biti duži od {{ limit }} znakova. - position: - unique: Postoji FAQ sa istom pozicijom. - not_blank: Pozicija ne može biti prazna. - question: - not_blank: Pitanje ne može biti prazno. - min_length: Pitanje mora sadržavati minimalno {{ limit }} znaka. - answer: - not_blank: Odgovor ne može biti prazan. - min_length: Odgovor mora sadržavati minimalno {{ limit }} znaka. collection: code: unique: Postoji kolekcija sa istim kodom. diff --git a/src/Resources/translations/validators.lt.yml b/src/Resources/translations/validators.lt.yml index a0bfc9a4a..7f21b14fe 100644 --- a/src/Resources/translations/validators.lt.yml +++ b/src/Resources/translations/validators.lt.yml @@ -41,21 +41,6 @@ bitbag_sylius_cms_plugin: content: not_blank: Turinį įvesti privaloma. min_length: Turinio ilgis turi būti bent {{ limit }} simb. - frequently_asked_question: - code: - unique: DUK įrašas su tokiu kodu jau egzistuoja. - not_blank: Kodą įvesti privaloma. - min_length: Kodo ilgis turi būti bent {{ limit }} simb. - max_length: Kodas negali būti ilgesnis nei {{ limit }} simb. - position: - unique: DUK įrašas su tokia pozicija jau egzistuoja. - not_blank: Poziciją įvesti privaloma. - question: - not_blank: Klausimą įvesti privaloma. - min_length: Klausimo ilgis turi būti bent {{ limit }} simb. - answer: - not_blank: Atsakymą įvesti privaloma. - min_length: Atsakymo ilgis turi būti bent {{ limit }} simb. collection: code: unique: Yra kolekcija su šiuo kodu. diff --git a/src/Resources/translations/validators.nl.yml b/src/Resources/translations/validators.nl.yml index cc7a415d0..efd2309ff 100755 --- a/src/Resources/translations/validators.nl.yml +++ b/src/Resources/translations/validators.nl.yml @@ -37,21 +37,6 @@ bitbag_sylius_cms_plugin: content: not_blank: Inhoud is verplicht en mag niet leeg zijn. min_length: Inhoud moet minstens {{ limit }} tekens lang zijn. - frequently_asked_question: - code: - unique: Er bestaat al een veelgestelde vraag met deze code. - not_blank: Code is verplicht en mag niet leeg zijn. - min_length: Code moet minstens {{ limit }} tekens lang zijn. - max_length: Code mag niet langer zijn dan {{ limit }} tekens. - position: - unique: Er bestaat al een veelgestelde vraag met deze positie. - not_blank: Positie is verplicht en mag niet leeg zijn. - question: - not_blank: Vraag is verplicht en mag niet leeg zijn. - min_length: Vraag oet minstens {{ limit }} tekens lang zijn. - answer: - not_blank: Antwoord is verplicht en mag niet leeg zijn. - min_length: Antwoord moet minstens {{ limit }} tekens lang zijn. collection: code: unique: Er bestaat al een collectie met deze code. diff --git a/src/Resources/translations/validators.pl.yml b/src/Resources/translations/validators.pl.yml index f84036487..95538d25a 100755 --- a/src/Resources/translations/validators.pl.yml +++ b/src/Resources/translations/validators.pl.yml @@ -37,21 +37,6 @@ bitbag_sylius_cms_plugin: content: not_blank: Content cannot be blank. min_length: Content must be at least {{ limit }} characters long. - frequently_asked_question: - code: - unique: There is an existing FAQ with this code. - not_blank: Code cannot be blank. - min_length: Code must be at least {{ limit }} characters long. - max_length: Code can not be longer than {{ limit }} characters. - position: - unique: There is an existing FAQ with this position. - not_blank: Position cannot be blank. - question: - not_blank: Question cannot be blank. - min_length: Question must be at least {{ limit }} characters long. - answer: - not_blank: Answer cannot be blank. - min_length: Answer must be at least {{ limit }} characters long. collection: code: unique: There is an existing section with this code. diff --git a/src/Resources/translations/validators.ru.yml b/src/Resources/translations/validators.ru.yml index 2f1507bb2..cb29655ab 100755 --- a/src/Resources/translations/validators.ru.yml +++ b/src/Resources/translations/validators.ru.yml @@ -37,21 +37,6 @@ bitbag_sylius_cms_plugin: content: not_blank: Содержимое не может быть пустым. min_length: Содержимое должно быть длиной хотя бы {{ limit }} знаков. - frequently_asked_question: - code: - unique: FAQ с таким кодом уже существует. - not_blank: Код не может быть пустым. - min_length: Код должен быть длиной хотя бы {{ limit }} знаков. - max_length: Код не может быть длиннее {{ limit }} знаков. - position: - unique: FAQ с такой позицией уже существет. - not_blank: Позиция не может быть пустой. - question: - not_blank: Вопрос не может быть пустым. - min_length: Вопрос должен быть длиной хотя бы {{ limit }} знаков. - answer: - not_blank: Ответ не может быть пустым. - min_length: Ответ должен быть длиной хотя бы {{ limit }} знаков. collection: code: unique: Существует существующая коллекция с этим кодом. diff --git a/src/Resources/translations/validators.sk.yml b/src/Resources/translations/validators.sk.yml index 8239c59d0..8268de85e 100755 --- a/src/Resources/translations/validators.sk.yml +++ b/src/Resources/translations/validators.sk.yml @@ -41,21 +41,6 @@ bitbag_sylius_cms_plugin: content: not_blank: Obsah nesmie byť prázdny. min_length: Obsah musí mať najmenej {{ limit }} znakov. - frequently_asked_question: - code: - unique: FAQ s týmto kódom už existuje. - not_blank: Kód nesmie byť prázdny. - min_length: Kód musí mať najmenej {{ limit }} znakov. - max_length: Kód nesmie mať viac ako {{ limit }} znakov. - position: - unique: FAQ s touto pozíciou už existuje. - not_blank: Pozícia nesmie byť prázdna. - question: - not_blank: Otázka nesmie byť prázdna. - min_length: Otázka musí mať najmenej {{ limit }} znakov. - answer: - not_blank: Odpoveď nesmie byť prázdna. - min_length: Odpoveď musí mať najmenej {{ limit }} znakov. collection: code: unique: Kolekce s týmto kódom už existuje. diff --git a/src/Resources/translations/validators.uk.yml b/src/Resources/translations/validators.uk.yml index 9e7e901f4..297bda7de 100755 --- a/src/Resources/translations/validators.uk.yml +++ b/src/Resources/translations/validators.uk.yml @@ -37,21 +37,6 @@ bitbag_sylius_cms_plugin: content: not_blank: Вміст не може бути порожнім. min_length: Вміст має бути довжиною хоча б {{ limit }} знаків. - frequently_asked_question: - code: - unique: FAQ з таким кодом уже існує. - not_blank: Код не може бути порожнім. - min_length: Код має бути довжиною хоча б {{ limit }} знаків. - max_length: Код не може бути довшим за {{ limit }} знаків. - position: - unique: FAQ з такою позицією уже існує. - not_blank: Позиція не може бути порожньою. - question: - not_blank: Питання не може бути порожнім. - min_length: Питання має бути довжиною хоча б {{ limit }} знаків. - answer: - not_blank: Відповідь не може бути порожньою. - min_length: Відповідь має бути довжиною хоча б {{ limit }} знаків. collection: code: unique: Існує колекція з цим кодом. diff --git a/src/Resources/views/FrequentlyAskedQuestion/Crud/_form.html.twig b/src/Resources/views/FrequentlyAskedQuestion/Crud/_form.html.twig deleted file mode 100755 index 08bf71abc..000000000 --- a/src/Resources/views/FrequentlyAskedQuestion/Crud/_form.html.twig +++ /dev/null @@ -1,15 +0,0 @@ -{% from '@SyliusAdmin/Macro/translationForm.html.twig' import translationForm %} -{% form_theme form '@BitBagSyliusCmsPlugin/Form/theme.html.twig' %} - -{{ form_errors(form) }} - -
-
- {{ form_row(form.code) }} - {{ form_row(form.position) }} -
- {{ form_row(form.enabled) }} - {{ form_row(form.channels) }} -
- -{{ translationForm(form.translations) }} diff --git a/src/Resources/views/Shop/FrequentlyAskedQuestion/Index/_show.html.twig b/src/Resources/views/Shop/FrequentlyAskedQuestion/Index/_show.html.twig deleted file mode 100755 index 5195867b2..000000000 --- a/src/Resources/views/Shop/FrequentlyAskedQuestion/Index/_show.html.twig +++ /dev/null @@ -1,6 +0,0 @@ -

- {{ frequentlyAskedQuestion.question }} -

-

- {{ frequentlyAskedQuestion.answer }} -

diff --git a/src/Resources/views/Shop/FrequentlyAskedQuestion/index.html.twig b/src/Resources/views/Shop/FrequentlyAskedQuestion/index.html.twig deleted file mode 100755 index 0ac069b16..000000000 --- a/src/Resources/views/Shop/FrequentlyAskedQuestion/index.html.twig +++ /dev/null @@ -1,42 +0,0 @@ -{% extends '@SyliusShop/layout.html.twig' %} - -{% import '@SyliusUi/Macro/messages.html.twig' as messages %} - -{% block content %} -
-
- {% if resources|length > 0 %} -
- {% for frequentlyAskedQuestion in resources %} -
- {% include '@BitBagSyliusCmsPlugin/Shop/FrequentlyAskedQuestion/Index/_show.html.twig' %} -
- {% endfor %} -
- {% else %} - {{ messages.info('sylius.ui.no_results_to_display') }} - {% endif %} -
-
- - {% if resources|length > 0 %} - - {% endif %} -{% endblock %} diff --git a/tests/Application/config/packages/bitbag_sylius_cms_plugin.yaml b/tests/Application/config/packages/bitbag_sylius_cms_plugin.yaml index 87e4badb7..96ddd2675 100644 --- a/tests/Application/config/packages/bitbag_sylius_cms_plugin.yaml +++ b/tests/Application/config/packages/bitbag_sylius_cms_plugin.yaml @@ -201,16 +201,3 @@ sylius_fixtures:
  • Pellentesque fermentum dolor. Aliquam quam lectus, facilisis auctor, ultrices ut, elementum vulputate, nunc.
  • Pellentesque habitant morbi tristique sene

    - frequently_asked_question: - options: - custom: - lorem_ipsum: - channels: - - "FASHION_WEB" - number: 10 - translations: - en_US: - question: | - Estne, quaeso, inquam, sitienti in bibendo voluptas? - answer: | - Nam his libris eum malo quam reliquo ornatu villae delectari. Quid est, quod ab ea absolvi et perfici debeat? Ex quo, id quod omnes expetunt, beate vivendi ratio inveniri et comparari potest. Stoici scilicet. diff --git a/tests/Application/templates/bundles/SyliusShopBundle/_footer.html.twig b/tests/Application/templates/bundles/SyliusShopBundle/_footer.html.twig index da1dec634..b8a9bd657 100755 --- a/tests/Application/templates/bundles/SyliusShopBundle/_footer.html.twig +++ b/tests/Application/templates/bundles/SyliusShopBundle/_footer.html.twig @@ -16,7 +16,6 @@

    {{ 'sylius.ui.customer_care'|trans }}

    diff --git a/tests/Application/templates/bundles/SyliusShopBundle/layout.html.twig b/tests/Application/templates/bundles/SyliusShopBundle/layout.html.twig index a01d3ced3..ea0782be5 100755 --- a/tests/Application/templates/bundles/SyliusShopBundle/layout.html.twig +++ b/tests/Application/templates/bundles/SyliusShopBundle/layout.html.twig @@ -110,10 +110,6 @@ Blog NEW - - FAQs - NEW - Admin panel Login: sylius, password: sylius diff --git a/tests/Behat/Context/Api/FrequentlyAskedQuestionContext.php b/tests/Behat/Context/Api/FrequentlyAskedQuestionContext.php deleted file mode 100644 index c431078e1..000000000 --- a/tests/Behat/Context/Api/FrequentlyAskedQuestionContext.php +++ /dev/null @@ -1,103 +0,0 @@ -apiClient->index(Resources::FAQ); - } - - /** - * @Then /^I should see (\d+) question(?:s)? in the list$/ - */ - public function iShouldSeeQuestionsInTheList(string $count): void - { - Assert::count( - $this->responseChecker->getCollection( - $this->apiClient->getLastResponse(), - ), - (int) $count, - ); - } - - /** - * @Given /^I should see the "([^"]*)" question$/ - */ - public function iShouldSeeTheQuestion(string $code): void - { - Assert::true( - $this->responseChecker->hasItemWithValue( - $this->apiClient->index(Resources::FAQ), - 'code', - $code, - ), - sprintf('There is no question with code "%s"', $code), - ); - } - - /** - * @When I view faq with code :faq - */ - public function iViewFaqWithCode(FrequentlyAskedQuestionInterface $faq): void - { - $this->apiClient->show(Resources::FAQ, (string) $faq->getId()); - } - - /** - * @Then I should see question with random text - */ - public function iShouldSeeQuestionWithRandomText(): void - { - Assert::false( - $this->responseChecker->hasTranslation( - $this->apiClient->getLastResponse(), - 'en_US', - 'question', - "That shouldn't exist", - ), - 'Missing question', - ); - } - - /** - * @Given /^I should see answer with random text$/ - */ - public function iShouldSeeAnswerWithRandomText(): void - { - Assert::false( - $this->responseChecker->hasTranslation( - $this->apiClient->getLastResponse(), - 'en_US', - 'answer', - "That shouldn't exist", - ), - 'Missing answer', - ); - } -} diff --git a/tests/Behat/Context/Setup/FrequentlyAskedQuestionContext.php b/tests/Behat/Context/Setup/FrequentlyAskedQuestionContext.php deleted file mode 100755 index 46cd7b725..000000000 --- a/tests/Behat/Context/Setup/FrequentlyAskedQuestionContext.php +++ /dev/null @@ -1,118 +0,0 @@ -createFrequentlyAskedQuestion(); - - $this->saveFrequentlyAskedQuestion($frequentlyAskedQuestion); - } - - /** - * @Given there is an existing frequently asked question with :position position - */ - public function thereIsAnExistingFrequentlyAskedQuestionWithPosition(int $position): void - { - $frequentlyAskedQuestion = $this->createFrequentlyAskedQuestion(null, $position); - - $this->saveFrequentlyAskedQuestion($frequentlyAskedQuestion); - } - - /** - * @Given there is an existing frequently asked question with :code code - */ - public function thereIsAnExistingFrequentlyAskedQuestionWithCode(string $code): void - { - $frequentlyAskedQuestion = $this->createFrequentlyAskedQuestion($code); - - $this->saveFrequentlyAskedQuestion($frequentlyAskedQuestion); - } - - /** - * @Given there are :number FAQs in the store - */ - public function thereAreFaqsInTheStore(int $number): void - { - for ($i = 1; $i <= $number; ++$i) { - $frequentlyAskedQuestion = $this->createFrequentlyAskedQuestion(null, $i, true); - - $this->saveFrequentlyAskedQuestion($frequentlyAskedQuestion); - } - } - - /** - * @param ChannelInterface $channel - */ - private function createFrequentlyAskedQuestion( - ?string $code = null, - int $position = null, - bool $prefixQuestionWithPosition = false, - ChannelInterface $channel = null, - ): FrequentlyAskedQuestionInterface { - /** @var FrequentlyAskedQuestionInterface $frequentlyAskedQuestion */ - $frequentlyAskedQuestion = $this->frequentlyAskedQuestionFactory->createNew(); - - if (null === $channel && $this->sharedStorage->has('channel')) { - $channel = $this->sharedStorage->get('channel'); - } - - if (null === $code) { - $code = $this->randomStringGenerator->generate(); - } - - if (null === $position) { - $position = 1; - } - - $question = $this->randomStringGenerator->generate(); - - if (true === $prefixQuestionWithPosition) { - $question = $position . '. ' . $question; - } - - $frequentlyAskedQuestion->setCode($code); - $frequentlyAskedQuestion->setPosition($position); - $frequentlyAskedQuestion->setCurrentLocale('en_US'); - $frequentlyAskedQuestion->setQuestion($question); - $frequentlyAskedQuestion->setAnswer($this->randomStringGenerator->generate()); - $frequentlyAskedQuestion->addChannel($channel); - - return $frequentlyAskedQuestion; - } - - private function saveFrequentlyAskedQuestion(FrequentlyAskedQuestionInterface $frequentlyAskedQuestion): void - { - $this->frequentlyAskedQuestionRepository->add($frequentlyAskedQuestion); - $this->sharedStorage->set('frequently_asked_question', $frequentlyAskedQuestion); - } -} diff --git a/tests/Behat/Context/Transform/FrequentlyAskedQuestionContext.php b/tests/Behat/Context/Transform/FrequentlyAskedQuestionContext.php deleted file mode 100644 index 6c836d251..000000000 --- a/tests/Behat/Context/Transform/FrequentlyAskedQuestionContext.php +++ /dev/null @@ -1,42 +0,0 @@ -frequentlyAskedQuestionRepository->findOneEnabledByCode($faqCode); - - Assert::notNull( - $faq, - sprintf('No FAQs has been found with code "%s".', $faqCode), - ); - - return $faq; - } -} diff --git a/tests/Behat/Context/Ui/Admin/FrequentlyAskedQuestionContext.php b/tests/Behat/Context/Ui/Admin/FrequentlyAskedQuestionContext.php deleted file mode 100755 index defc5b025..000000000 --- a/tests/Behat/Context/Ui/Admin/FrequentlyAskedQuestionContext.php +++ /dev/null @@ -1,229 +0,0 @@ -indexPage->open(); - } - - /** - * @When I go to the create frequently asked question page - */ - public function iGoToTheCreateFrequentlyAskedQuestionPage(): void - { - $this->createPage->open(); - } - - /** - * @When I want to edit this frequently asked question - */ - public function iWantToEditThisFrequentlyAskedQuestion(): void - { - $frequentlyAskedQuestion = $this->sharedStorage->get('frequently_asked_question'); - - $this->updatePage->open(['id' => $frequentlyAskedQuestion->getId()]); - } - - /** - * @When I delete this frequently asked question - */ - public function iDeleteThisFrequentlyAskedQuestion() - { - $frequentlyAskedQuestion = $this->sharedStorage->get('frequently_asked_question'); - - $this->indexPage->deleteFrequentlyAskedQuestion($frequentlyAskedQuestion->getCode()); - } - - /** - * @When I fill the code with :code - */ - public function iFillTheCodeWith(string $code): void - { - $this->createPage->fillCode($code); - } - - /** - * @When I set the position to :position - */ - public function iSetThePositionTo(int $position): void - { - $this->createPage->setPosition($position); - } - - /** - * @When I fill the question with :question - */ - public function iFillTheQuestionWith(string $question): void - { - $this->createPage->fillQuestion($question); - } - - /** - * @When I set the answer to :answer - */ - public function iSetTheAnswerTo(string $answer): void - { - $this->createPage->fillAnswer($answer); - } - - /** - * @When /^I fill "([^"]*)" fields with (\d+) (?:character|characters)$/ - */ - public function iFillFieldsWithCharacters(string $fields, int $length): void - { - $fields = explode(',', $fields); - - foreach ($fields as $field) { - $this->resolveCurrentPage()->fillField(trim($field), $this->randomStringGenerator->generate($length)); - } - } - - /** - * @When I add it - * @When I try to add it - */ - public function iAddIt(): void - { - $this->createPage->create(); - } - - /** - * @Then I should be notified that a new frequently asked question has been created - */ - public function iShouldBeNotifiedThatANewFrequentlyAskedQuestionHasBeenCreated(): void - { - $this->notificationChecker->checkNotification( - 'Success Frequently asked question has been successfully created.', - NotificationType::success(), - ); - } - - /** - * @Then I should be notified that the frequently asked question has been deleted - */ - public function iShouldBeNotifiedThatTheFrequentlyAskedQuestionHasBeenDeleted(): void - { - $this->notificationChecker->checkNotification( - 'Frequently asked question has been successfully deleted.', - NotificationType::success(), - ); - } - - /** - * @Then I should be notified that :fields fields cannot be blank - */ - public function iShouldBeNotifiedThatFieldsCannotBeBlank(string $fields): void - { - $fields = explode(',', $fields); - - foreach ($fields as $field) { - Assert::true($this->resolveCurrentPage()->containsErrorWithMessage(sprintf( - '%s cannot be blank.', - trim($field), - ))); - } - } - - /** - * @Then I should be notified that :fields fields are too short - */ - public function iShouldBeNotifiedThatFieldsAreTooShort(string $fields): void - { - $fields = explode(',', $fields); - - foreach ($fields as $field) { - Assert::true($this->resolveCurrentPage()->containsErrorWithMessage(sprintf( - '%s must be at least %d characters long.', - trim($field), - 2, - ))); - } - } - - /** - * @Then I should be notified that there is already an existing frequently asked question with provided code - */ - public function iShouldBeNotifiedThatThereIsAlreadyAnExistingFrequentlyAskedQuestionWithProvidedCode(): void - { - Assert::true($this->resolveCurrentPage()->containsErrorWithMessage( - 'There is an existing FAQ with this code.', - false, - )); - } - - /** - * @Then I should be notified that there is already an existing frequently asked question with selected position - */ - public function iShouldBeNotifiedThatThereIsAlreadyAnExistingFrequentlyAskedQuestionWithSelectedPosition(): void - { - Assert::true($this->resolveCurrentPage()->containsErrorWithMessage( - 'There is an existing FAQ with this position.', - false, - )); - } - - /** - * @Then the code field should be disabled - */ - public function theCodeFieldShouldBeDisabled() - { - Assert::true($this->resolveCurrentPage()->isCodeDisabled()); - } - - /** - * @Then I should see empty list of frequently asked questions - */ - public function iShouldSeeEmptyListOfFrequentlyAskedQuestions(): void - { - $this->resolveCurrentPage()->isEmpty(); - } - - /** - * @return IndexPageInterface|CreatePageInterface|UpdatePageInterface|SymfonyPageInterface - */ - private function resolveCurrentPage(): SymfonyPageInterface - { - return $this->currentPageResolver->getCurrentPageWithForm([ - $this->indexPage, - $this->createPage, - $this->updatePage, - ]); - } -} diff --git a/tests/Behat/Context/Ui/Shop/FrequentlyAskedQuestionContext.php b/tests/Behat/Context/Ui/Shop/FrequentlyAskedQuestionContext.php deleted file mode 100755 index 201344a53..000000000 --- a/tests/Behat/Context/Ui/Shop/FrequentlyAskedQuestionContext.php +++ /dev/null @@ -1,42 +0,0 @@ -indexPage->open(); - } - - /** - * @Then I should see :number FAQs ordered by position - */ - public function iShouldSeeFaqsOrderedByPosition(int $number): void - { - Assert::true($this->indexPage->hasFrequentlyAskedQuestionsNumber($number)); - - for ($i = 1; $i < $number; ++$i) { - Assert::true($this->indexPage->hasQuestionWithPositionPrefixAtValidIndex($i)); - } - } -} diff --git a/tests/Behat/Page/Admin/FrequentlyAskedQuestion/CreatePage.php b/tests/Behat/Page/Admin/FrequentlyAskedQuestion/CreatePage.php deleted file mode 100755 index e92395df5..000000000 --- a/tests/Behat/Page/Admin/FrequentlyAskedQuestion/CreatePage.php +++ /dev/null @@ -1,44 +0,0 @@ -getDocument()->fillField($field, $value); - } - - public function fillCode(string $code): void - { - $this->getDocument()->fillField('Code', $code); - } - - public function setPosition(int $position): void - { - $this->getDocument()->fillField('Position', (string) $position); - } - - public function fillQuestion(string $question): void - { - $this->getDocument()->fillField('Question', $question); - } - - public function fillAnswer(string $answer): void - { - $this->getDocument()->fillField('Answer', $answer); - } -} diff --git a/tests/Behat/Page/Admin/FrequentlyAskedQuestion/CreatePageInterface.php b/tests/Behat/Page/Admin/FrequentlyAskedQuestion/CreatePageInterface.php deleted file mode 100755 index 6474d1f32..000000000 --- a/tests/Behat/Page/Admin/FrequentlyAskedQuestion/CreatePageInterface.php +++ /dev/null @@ -1,27 +0,0 @@ -deleteResourceOnPage(['code' => $code]); - } -} diff --git a/tests/Behat/Page/Admin/FrequentlyAskedQuestion/IndexPageInterface.php b/tests/Behat/Page/Admin/FrequentlyAskedQuestion/IndexPageInterface.php deleted file mode 100755 index e38ad3376..000000000 --- a/tests/Behat/Page/Admin/FrequentlyAskedQuestion/IndexPageInterface.php +++ /dev/null @@ -1,19 +0,0 @@ -getElement('faqs')->findAll('css', '.bitbag-question'); - - return $number === count($frequentlyAskedQuestionsOnPage); - } - - public function hasQuestionWithPositionPrefixAtValidIndex(int $position): bool - { - $frequentlyAskedQuestionsOnPage = $this->getElement('faqs')->findAll('css', '.bitbag-question'); - $index = $position - 1; - - if (false === array_key_exists($index, $frequentlyAskedQuestionsOnPage)) { - return false; - } - - $frequentlyAskedQuestionOnPage = $frequentlyAskedQuestionsOnPage[$index]; - $question = $frequentlyAskedQuestionOnPage->getText(); - - $questionParts = explode('. ', $question); - $positionInQuestion = (int) str_replace('. ', '', $questionParts[0]); - - if ($position === $positionInQuestion) { - return true; - } - - return false; - } - - protected function getDefinedElements(): array - { - return array_merge(parent::getDefinedElements(), [ - 'faqs' => '#bitbag-faqs', - ]); - } -} diff --git a/tests/Behat/Page/Shop/FrequentlyAskedQuestion/IndexPageInterface.php b/tests/Behat/Page/Shop/FrequentlyAskedQuestion/IndexPageInterface.php deleted file mode 100755 index 1fb58632e..000000000 --- a/tests/Behat/Page/Shop/FrequentlyAskedQuestion/IndexPageInterface.php +++ /dev/null @@ -1,20 +0,0 @@ -shop/cms-plugin
    - - shop/cms-plugin - - shop/cms-plugin diff --git a/tests/Behat/Resources/services/contexts/api.xml b/tests/Behat/Resources/services/contexts/api.xml index 33868af8d..44fe07923 100644 --- a/tests/Behat/Resources/services/contexts/api.xml +++ b/tests/Behat/Resources/services/contexts/api.xml @@ -9,11 +9,6 @@ - - - - - diff --git a/tests/Behat/Resources/services/contexts/setup.xml b/tests/Behat/Resources/services/contexts/setup.xml index 87af1d70e..627852716 100644 --- a/tests/Behat/Resources/services/contexts/setup.xml +++ b/tests/Behat/Resources/services/contexts/setup.xml @@ -22,13 +22,6 @@ - - - - - - - diff --git a/tests/Behat/Resources/services/contexts/transform.xml b/tests/Behat/Resources/services/contexts/transform.xml index 6480d616c..0e3c1c8bb 100644 --- a/tests/Behat/Resources/services/contexts/transform.xml +++ b/tests/Behat/Resources/services/contexts/transform.xml @@ -9,10 +9,6 @@ %locale% - - - - diff --git a/tests/Behat/Resources/services/contexts/ui.xml b/tests/Behat/Resources/services/contexts/ui.xml index a6fdfe9f1..805535d31 100644 --- a/tests/Behat/Resources/services/contexts/ui.xml +++ b/tests/Behat/Resources/services/contexts/ui.xml @@ -26,16 +26,6 @@ - - - - - - - - - - @@ -56,10 +46,6 @@ - - - - diff --git a/tests/Behat/Resources/services/pages/admin.xml b/tests/Behat/Resources/services/pages/admin.xml index 96078ff23..389012414 100644 --- a/tests/Behat/Resources/services/pages/admin.xml +++ b/tests/Behat/Resources/services/pages/admin.xml @@ -4,7 +4,6 @@ - diff --git a/tests/Behat/Resources/services/pages/admin/frequently_asked_question.xml b/tests/Behat/Resources/services/pages/admin/frequently_asked_question.xml deleted file mode 100644 index d12b00f9e..000000000 --- a/tests/Behat/Resources/services/pages/admin/frequently_asked_question.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - bitbag_sylius_cms_plugin_admin_frequently_asked_question_index - - - - bitbag_sylius_cms_plugin_admin_frequently_asked_question_create - - - - bitbag_sylius_cms_plugin_admin_frequently_asked_question_update - - - diff --git a/tests/Behat/Resources/services/pages/shop.xml b/tests/Behat/Resources/services/pages/shop.xml index 8b7f5f2f0..f0e5aac5c 100644 --- a/tests/Behat/Resources/services/pages/shop.xml +++ b/tests/Behat/Resources/services/pages/shop.xml @@ -12,6 +12,5 @@ - diff --git a/tests/Behat/Resources/suites.yml b/tests/Behat/Resources/suites.yml index 6ef678e58..678cca934 100644 --- a/tests/Behat/Resources/suites.yml +++ b/tests/Behat/Resources/suites.yml @@ -1,16 +1,13 @@ imports: - suites/ui/managing_blocks.yml - suites/ui/managing_pages.yml - - suites/ui/managing_frequently_asked_questions.yml - suites/ui/managing_collections.yml - suites/ui/managing_media.yml - suites/ui/shop_blocks.yml - suites/ui/shop_media.yml - suites/ui/shop_pages.yml - - suites/ui/shop_frequently_asked_questions.yml - suites/api/shop_pages.yml - - suites/api/shop_frequently_asked_questions.yml - suites/api/shop_blocks.yml - suites/api/shop_collections.yml - suites/api/shop_media.yml diff --git a/tests/Behat/Resources/suites/api/shop_frequently_asked_questions.yml b/tests/Behat/Resources/suites/api/shop_frequently_asked_questions.yml deleted file mode 100755 index 539b2d08e..000000000 --- a/tests/Behat/Resources/suites/api/shop_frequently_asked_questions.yml +++ /dev/null @@ -1,14 +0,0 @@ -default: - suites: - api_shop_frequently_asked_questions: - contexts: - - sylius.behat.context.hook.doctrine_orm - - - sylius.behat.context.setup.channel - - bitbag_sylius_cms_plugin.behat.context.setup.frequently_asked_question - - - bitbag_sylius_cms_plugin.behat.context.transform.frequently_asked_question - - - bitbag_sylius_cms_plugin.behat.context.api.frequently_asked_question - filters: - tags: "@shop_frequently_asked_questions&&@api" diff --git a/tests/Behat/Resources/suites/ui/managing_frequently_asked_questions.yml b/tests/Behat/Resources/suites/ui/managing_frequently_asked_questions.yml deleted file mode 100755 index 8d30935b8..000000000 --- a/tests/Behat/Resources/suites/ui/managing_frequently_asked_questions.yml +++ /dev/null @@ -1,13 +0,0 @@ -default: - suites: - ui_managing_frequently_asked_questions: - contexts: - - sylius.behat.context.hook.doctrine_orm - - - sylius.behat.context.setup.channel - - sylius.behat.context.setup.admin_security - - bitbag_sylius_cms_plugin.behat.context.setup.frequently_asked_question - - - bitbag_sylius_cms_plugin.behat.context.ui.admin.frequently_asked_question - filters: - tags: "@managing_frequently_asked_questions&&@ui" diff --git a/tests/Behat/Resources/suites/ui/shop_frequently_asked_questions.yml b/tests/Behat/Resources/suites/ui/shop_frequently_asked_questions.yml deleted file mode 100755 index 14830bcb3..000000000 --- a/tests/Behat/Resources/suites/ui/shop_frequently_asked_questions.yml +++ /dev/null @@ -1,12 +0,0 @@ -default: - suites: - ui_shop_frequently_asked_questions: - contexts: - - sylius.behat.context.hook.doctrine_orm - - - sylius.behat.context.setup.channel - - bitbag_sylius_cms_plugin.behat.context.setup.frequently_asked_question - - - bitbag_sylius_cms_plugin.behat.context.ui.shop.frequently_asked_question - filters: - tags: "@shop_frequently_asked_questions&&@ui" diff --git a/tests/Functional/Api/FrequentlyAskedQuestionTest.php b/tests/Functional/Api/FrequentlyAskedQuestionTest.php deleted file mode 100644 index 6bff6ca3f..000000000 --- a/tests/Functional/Api/FrequentlyAskedQuestionTest.php +++ /dev/null @@ -1,53 +0,0 @@ - 'application/ld+json', 'HTTP_ACCEPT' => 'application/ld+json']; - - public function setUp(): void - { - $this->loadFixturesFromFile('Api/FrequentlyAskedQuestionTest/frequently_asked_question.yml'); - } - - public function test_faq_response(): void - { - /** @var FrequentlyAskedQuestionInterface $faq */ - $faq = $this->getRepository()->findOneEnabledByCode('faq1-code'); - $this->client->request('GET', '/api/v2/shop/cms-plugin/faq/' . $faq->getId(), [], [], self::CONTENT_TYPE_HEADER); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'Api/FrequentlyAskedQuestionTest/test_it_get_frequently_asked_question_by_id', Response::HTTP_OK); - } - - public function test_faqs_response(): void - { - $this->client->request('GET', '/api/v2/shop/cms-plugin/faq', [], [], self::CONTENT_TYPE_HEADER); - $response = $this->client->getResponse(); - - $this->assertResponse($response, 'Api/FrequentlyAskedQuestionTest/test_it_get_frequently_asked_questions', Response::HTTP_OK); - } - - private function getRepository(): FrequentlyAskedQuestionRepositoryInterface - { - /** @var FrequentlyAskedQuestionRepositoryInterface $repository */ - $repository = $this->getEntityManager()->getRepository(FrequentlyAskedQuestionInterface::class); - - return $repository; - } -} diff --git a/tests/Functional/DataFixtures/ORM/Api/FrequentlyAskedQuestionTest/frequently_asked_question.yml b/tests/Functional/DataFixtures/ORM/Api/FrequentlyAskedQuestionTest/frequently_asked_question.yml deleted file mode 100644 index 8394f9189..000000000 --- a/tests/Functional/DataFixtures/ORM/Api/FrequentlyAskedQuestionTest/frequently_asked_question.yml +++ /dev/null @@ -1,57 +0,0 @@ -Sylius\Component\Addressing\Model\Country: - USA: - code: 'US' -Sylius\Component\Currency\Model\Currency: - dollar: - code: 'USD' -Sylius\Component\Locale\Model\Locale: - locale: - createdAt: '' - code: 'en_US' -Sylius\Component\Core\Model\Channel: - channel: - code: "code" - name: "name" - locales: - - '@locale' - default_locale: '@locale' - tax_calculation_strategy: 'order_items_based' - base_currency: '@dollar' -BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestionTranslation: - frequently_asked_question1_translation: - question: "How many days there are in one year?" - answer: "It may vary depending on whether you are working on a new question" - locale: 'en_US' - frequently_asked_question2_translation: - question: "Who is responsible for the translation" - answer: "Translators are" - locale: 'en_US' - frequently_asked_question3_translation: - question: "What is the date?" - answer: "Dunno" - locale: 'en_US' -BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestion: - frequently_asked_question1: - code: 'faq1-code' - enabled: true - position: 10 - channels: - - '@channel' - translations: - - '@frequently_asked_question1_translation' - frequently_asked_question2: - code: 'faq2-code' - enabled: true - position: 20 - channels: - - '@channel' - translations: - - '@frequently_asked_question2_translation' - frequently_asked_question3: - code: 'faq3-code' - enabled: false - position: 30 - channels: - - '@channel' - translations: - - '@frequently_asked_question3_translation' diff --git a/tests/Functional/Fixture/FrequentlyAskedQuestionFixtureTest.php b/tests/Functional/Fixture/FrequentlyAskedQuestionFixtureTest.php deleted file mode 100644 index 485d29bd8..000000000 --- a/tests/Functional/Fixture/FrequentlyAskedQuestionFixtureTest.php +++ /dev/null @@ -1,235 +0,0 @@ -assertConfigurationIsValid([[]], 'custom'); - } - - /** - * @test - */ - public function custom_enabled_is_optional_but_must_be_boolean(): void - { - $this->assertConfigurationIsValid([ - [ - 'custom' => [ - 'faq_1' => [ - 'enabled' => true, - ], - ], - ], - ], 'custom.*.enabled'); - - $this->assertPartialConfigurationIsInvalid([ - [ - 'custom' => [ - 'faq_1' => [ - 'enabled' => 'boolean', - ], - ], - ], - ], 'custom.*.enabled'); - } - - /** - * @test - */ - public function custom_remove_existing_is_optional_but_must_be_boolean(): void - { - $this->assertConfigurationIsValid([ - [ - 'custom' => [ - 'faq_1' => [ - 'remove_existing' => true, - ], - ], - ], - ], 'custom.*.remove_existing'); - - $this->assertPartialConfigurationIsInvalid([ - [ - 'custom' => [ - 'faq_1' => [ - 'remove_existing' => 'boolean', - ], - ], - ], - ], 'custom.*.remove_existing'); - } - - /** - * @test - */ - public function custom_number_is_optional_but_must_be_integer(): void - { - $this->assertConfigurationIsValid([ - [ - 'custom' => [ - 'homepage_banner' => [ - 'number' => 1, - ], - ], - ], - ], 'custom.*.number'); - - $this->assertPartialConfigurationIsInvalid([ - [ - 'custom' => [ - 'homepage_banner' => [ - 'number' => '1', - ], - ], - ], - ], 'custom.*.number'); - } - - /** - * @test - */ - public function custom_position_is_optional_but_must_be_integer(): void - { - $this->assertConfigurationIsValid([ - [ - 'custom' => [ - 'faq_1' => [ - 'position' => 1, - ], - ], - ], - ], 'custom.*.position'); - - $this->assertPartialConfigurationIsInvalid([ - [ - 'custom' => [ - 'faq_1' => [ - 'position' => '1', - ], - ], - ], - ], 'custom.*.position'); - } - - /** - * @test - */ - public function custom_translations_is_optional_but_must_be_array(): void - { - $this->assertConfigurationIsValid([ - [ - 'custom' => [ - 'faq_1' => [ - 'translations' => [], - ], - ], - ], - ], 'custom.*.translations'); - - $this->assertPartialConfigurationIsInvalid([ - [ - 'custom' => [ - 'faq_1' => [ - 'translations' => 'array', - ], - ], - ], - ], 'custom.*.translations'); - } - - /** - * @test - */ - public function custom_may_contain_question(): void - { - $this->assertConfigurationIsValid([ - [ - 'custom' => [ - 'faq_1' => [ - 'translations' => [ - 'en_US' => [ - 'question' => 'Example question ?', - ], - ], - ], - ], - ], - ], 'custom.*.translations.*.question'); - - $this->assertConfigurationIsValid([ - [ - 'custom' => [ - 'faq_1' => [ - 'translations' => [ - 'en_US' => [ - 'question' => '', - ], - ], - ], - ], - ], - ], 'custom.*.translations.*.question'); - } - - /** - * @test - */ - public function custom_may_contain_answer(): void - { - $this->assertConfigurationIsValid([ - [ - 'custom' => [ - 'faq_1' => [ - 'translations' => [ - 'en_US' => [ - 'answer' => 'Example answer', - ], - ], - ], - ], - ], - ], 'custom.*.translations.*.answer'); - - $this->assertConfigurationIsValid([ - [ - 'custom' => [ - 'faq_1' => [ - 'translations' => [ - 'en_US' => [ - 'answer' => '', - ], - ], - ], - ], - ], - ], 'custom.*.translations.*.answer'); - } - - protected function getConfiguration(): FrequentlyAskedQuestionFixture - { - /** @var FixtureFactoryInterface $faqFixtureFactory */ - $faqFixtureFactory = $this->getMockBuilder(FixtureFactoryInterface::class)->getMock(); - - return new FrequentlyAskedQuestionFixture($faqFixtureFactory); - } -} diff --git a/tests/Functional/Responses/Expected/Api/FrequentlyAskedQuestionTest/test_it_get_frequently_asked_question_by_id.json b/tests/Functional/Responses/Expected/Api/FrequentlyAskedQuestionTest/test_it_get_frequently_asked_question_by_id.json deleted file mode 100644 index 9f732eff1..000000000 --- a/tests/Functional/Responses/Expected/Api/FrequentlyAskedQuestionTest/test_it_get_frequently_asked_question_by_id.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "@context": "/api/v2/contexts/FrequentlyAskedQuestion", - "@id": "/api/v2/shop/cms-plugin/faq/@integer@", - "@type": "FrequentlyAskedQuestion", - "id": "@integer@", - "code": "faq1-code", - "position": 10, - "channels": [ - "/api/v2/shop/channels/code" - ], - "enabled": true, - "translations": { - "en_US": { - "@type": "FrequentlyAskedQuestionTranslation", - "question": "How many days there are in one year?", - "answer": "It may vary depending on whether you are working on a new question" - } - } -} diff --git a/tests/Functional/Responses/Expected/Api/FrequentlyAskedQuestionTest/test_it_get_frequently_asked_questions.json b/tests/Functional/Responses/Expected/Api/FrequentlyAskedQuestionTest/test_it_get_frequently_asked_questions.json deleted file mode 100644 index 65fab508c..000000000 --- a/tests/Functional/Responses/Expected/Api/FrequentlyAskedQuestionTest/test_it_get_frequently_asked_questions.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "@context": "/api/v2/contexts/FrequentlyAskedQuestion", - "@id": "/api/v2/shop/cms-plugin/faq", - "@type": "hydra:Collection", - "hydra:member": [ - { - "@id": "/api/v2/shop/cms-plugin/faq/@integer@", - "@type": "FrequentlyAskedQuestion", - "id": "@integer@", - "code": "faq1-code", - "position": 10, - "channels": [ - "/api/v2/shop/channels/code" - ], - "enabled": true, - "translations": { - "en_US": { - "@type": "FrequentlyAskedQuestionTranslation", - "question": "How many days there are in one year?", - "answer": "It may vary depending on whether you are working on a new question" - } - } - }, - { - "@id": "/api/v2/shop/cms-plugin/faq/@integer@", - "@type": "FrequentlyAskedQuestion", - "id": "@integer@", - "code": "faq2-code", - "position": 20, - "channels": [ - "/api/v2/shop/channels/code" - ], - "enabled": true, - "translations": { - "en_US": { - "@type": "FrequentlyAskedQuestionTranslation", - "question": "Who is responsible for the translation", - "answer": "Translators are" - } - } - }, - { - "@id": "/api/v2/shop/cms-plugin/faq/@integer@", - "@type": "FrequentlyAskedQuestion", - "id": "@integer@", - "code": "faq3-code", - "position": 30, - "channels": [ - "/api/v2/shop/channels/code" - ], - "enabled": false, - "translations": { - "en_US": { - "@type": "FrequentlyAskedQuestionTranslation", - "question": "What is the date?", - "answer": "Dunno" - } - } - } - ], - "hydra:totalItems": 3 -} diff --git a/tests/Integration/DataFixtures/ORM/FrequentlyAskedQuestionRepositoryTest/test_it_finds_faq_by_code.yml b/tests/Integration/DataFixtures/ORM/FrequentlyAskedQuestionRepositoryTest/test_it_finds_faq_by_code.yml deleted file mode 100644 index 8394f9189..000000000 --- a/tests/Integration/DataFixtures/ORM/FrequentlyAskedQuestionRepositoryTest/test_it_finds_faq_by_code.yml +++ /dev/null @@ -1,57 +0,0 @@ -Sylius\Component\Addressing\Model\Country: - USA: - code: 'US' -Sylius\Component\Currency\Model\Currency: - dollar: - code: 'USD' -Sylius\Component\Locale\Model\Locale: - locale: - createdAt: '' - code: 'en_US' -Sylius\Component\Core\Model\Channel: - channel: - code: "code" - name: "name" - locales: - - '@locale' - default_locale: '@locale' - tax_calculation_strategy: 'order_items_based' - base_currency: '@dollar' -BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestionTranslation: - frequently_asked_question1_translation: - question: "How many days there are in one year?" - answer: "It may vary depending on whether you are working on a new question" - locale: 'en_US' - frequently_asked_question2_translation: - question: "Who is responsible for the translation" - answer: "Translators are" - locale: 'en_US' - frequently_asked_question3_translation: - question: "What is the date?" - answer: "Dunno" - locale: 'en_US' -BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestion: - frequently_asked_question1: - code: 'faq1-code' - enabled: true - position: 10 - channels: - - '@channel' - translations: - - '@frequently_asked_question1_translation' - frequently_asked_question2: - code: 'faq2-code' - enabled: true - position: 20 - channels: - - '@channel' - translations: - - '@frequently_asked_question2_translation' - frequently_asked_question3: - code: 'faq3-code' - enabled: false - position: 30 - channels: - - '@channel' - translations: - - '@frequently_asked_question3_translation' diff --git a/tests/Integration/DataFixtures/ORM/FrequentlyAskedQuestionRepositoryTest/test_it_finds_faq_by_position.yml b/tests/Integration/DataFixtures/ORM/FrequentlyAskedQuestionRepositoryTest/test_it_finds_faq_by_position.yml deleted file mode 100644 index 8394f9189..000000000 --- a/tests/Integration/DataFixtures/ORM/FrequentlyAskedQuestionRepositoryTest/test_it_finds_faq_by_position.yml +++ /dev/null @@ -1,57 +0,0 @@ -Sylius\Component\Addressing\Model\Country: - USA: - code: 'US' -Sylius\Component\Currency\Model\Currency: - dollar: - code: 'USD' -Sylius\Component\Locale\Model\Locale: - locale: - createdAt: '' - code: 'en_US' -Sylius\Component\Core\Model\Channel: - channel: - code: "code" - name: "name" - locales: - - '@locale' - default_locale: '@locale' - tax_calculation_strategy: 'order_items_based' - base_currency: '@dollar' -BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestionTranslation: - frequently_asked_question1_translation: - question: "How many days there are in one year?" - answer: "It may vary depending on whether you are working on a new question" - locale: 'en_US' - frequently_asked_question2_translation: - question: "Who is responsible for the translation" - answer: "Translators are" - locale: 'en_US' - frequently_asked_question3_translation: - question: "What is the date?" - answer: "Dunno" - locale: 'en_US' -BitBag\SyliusCmsPlugin\Entity\FrequentlyAskedQuestion: - frequently_asked_question1: - code: 'faq1-code' - enabled: true - position: 10 - channels: - - '@channel' - translations: - - '@frequently_asked_question1_translation' - frequently_asked_question2: - code: 'faq2-code' - enabled: true - position: 20 - channels: - - '@channel' - translations: - - '@frequently_asked_question2_translation' - frequently_asked_question3: - code: 'faq3-code' - enabled: false - position: 30 - channels: - - '@channel' - translations: - - '@frequently_asked_question3_translation' diff --git a/tests/Integration/Repository/FrequentlyAskedQuestionRepositoryTest.php b/tests/Integration/Repository/FrequentlyAskedQuestionRepositoryTest.php deleted file mode 100644 index 0d5510187..000000000 --- a/tests/Integration/Repository/FrequentlyAskedQuestionRepositoryTest.php +++ /dev/null @@ -1,73 +0,0 @@ -loadFixturesFromFile('FrequentlyAskedQuestionRepositoryTest//test_it_finds_faq_by_position.yml'); - - $localeCode = 'en_US'; - $channelCode = 'code'; - - $faqRepository = $this->getRepository(); - - $faqs = $faqRepository->findEnabledOrderedByPosition($localeCode, $channelCode); - - self::assertNotEmpty($faqs); - self::assertCount(2, $faqs); - - $previousPosition = null; - foreach ($faqs as $faq) { - if (null !== $previousPosition) { - self::assertGreaterThanOrEqual($previousPosition, $faq->getPosition()); - self::assertTrue($faq->isEnabled()); - } - $previousPosition = $faq->getPosition(); - } - } - - public function test_it_finds_enabled_frequently_asked_question_by_code(): void - { - $this->loadFixturesFromFile('FrequentlyAskedQuestionRepositoryTest/test_it_finds_faq_by_code.yml'); - - $faq1Code = 'faq1-code'; - $faq3Code = 'faq3-code'; - - $faqRepository = $this->getRepository(); - - $faq1 = $faqRepository->findOneEnabledByCode($faq1Code); - $faq3 = $faqRepository->findOneEnabledByCode($faq3Code); - - self::assertNotNull($faq1); - self::assertEquals($faq1Code, $faq1->getCode()); - self::assertTrue($faq1->isEnabled()); - self::assertNull($faq3); - } - - private function getRepository(): FrequentlyAskedQuestionRepositoryInterface - { - /** @var FrequentlyAskedQuestionRepositoryInterface $repository */ - $repository = $this->getEntityManager()->getRepository(FrequentlyAskedQuestionInterface::class); - - return $repository; - } -}