This repository has been archived by the owner on Dec 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 156
Fixed #176 - Show only active CMS Blocks #221
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
bf0030f
Update blocks
ronak2ram 4eac0fc
Added warning log
ronak2ram 60f91ee
Merge remote-tracking branch 'origin/2.3-develop' into Fixed-218
5c6f20f
Merge branch 'Fixed-218' of github.com:ronak2ram/graphql-ce into Fixe…
922d398
GraphQL-176: Show only active CMS Blocks
6d984eb
GraphQL-176: Show only active CMS Blocks
d3a22e9
GraphQL-176: Show only active CMS Blocks
772d4da
GraphQL-176: Show only active CMS Blocks
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
...onal/framework/Magento/TestFramework/TestCase/GraphQl/ResponseContainsErrorsException.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
namespace Magento\TestFramework\TestCase\GraphQl; | ||
|
||
/** | ||
* Response contains errors exception | ||
*/ | ||
class ResponseContainsErrorsException extends \Exception | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
private $responseData; | ||
|
||
/** | ||
* @param string $message | ||
* @param array $responseData | ||
* @param \Exception|null $cause | ||
* @param int $code | ||
*/ | ||
public function __construct(string $message, array $responseData, \Exception $cause = null, int $code = 0) | ||
{ | ||
parent::__construct($message, $code, $cause); | ||
$this->responseData = $responseData; | ||
} | ||
|
||
/** | ||
* Get response data | ||
* | ||
* @return array | ||
*/ | ||
public function getResponseData(): array | ||
{ | ||
return $this->responseData; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
dev/tests/integration/testsuite/Magento/Cms/_files/blocks.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
/** | ||
* Copyright © Magento, Inc. All rights reserved. | ||
* See COPYING.txt for license details. | ||
*/ | ||
declare(strict_types=1); | ||
|
||
use Magento\Cms\Api\BlockRepositoryInterface; | ||
use Magento\Cms\Api\Data\BlockInterface; | ||
use Magento\Cms\Api\Data\BlockInterfaceFactory; | ||
use Magento\Store\Model\StoreManagerInterface; | ||
use Magento\TestFramework\Helper\Bootstrap; | ||
|
||
/** @var BlockRepositoryInterface $blockRepository */ | ||
$blockRepository = Bootstrap::getObjectManager()->get(BlockRepositoryInterface::class); | ||
/** @var BlockInterfaceFactory $blockFactory */ | ||
$blockFactory = Bootstrap::getObjectManager()->get(BlockInterfaceFactory::class); | ||
$storeId = Bootstrap::getObjectManager()->get(StoreManagerInterface::class)->getStore()->getId(); | ||
|
||
/** @var BlockInterface $block */ | ||
$block = $blockFactory->create([ | ||
'data' => [ | ||
BlockInterface::IDENTIFIER => 'enabled_block', | ||
BlockInterface::TITLE => 'Enabled CMS Block Title', | ||
BlockInterface::CONTENT => ' | ||
<h1>Enabled Block</h1> | ||
<a href="{{store url=""}}">store url</a> | ||
<p>Config value: "{{config path="web/unsecure/base_url"}}".</p> | ||
<p>Custom variable: "{{customvar code="variable_code"}}".</p> | ||
', | ||
BlockInterface::IS_ACTIVE => 1, | ||
'store_id' => [$storeId], | ||
] | ||
]); | ||
$blockRepository->save($block); | ||
|
||
/** @var BlockInterface $block */ | ||
$block = $blockFactory->create([ | ||
'data' => [ | ||
BlockInterface::IDENTIFIER => 'disabled_block', | ||
BlockInterface::TITLE => 'Disabled CMS Block Title', | ||
BlockInterface::CONTENT => ' | ||
<h1>Disabled Block</h1> | ||
<a href="{{store url=""}}">store url</a> | ||
<p>Config value: "{{config path="web/unsecure/base_url"}}".</p> | ||
<p>Custom variable: "{{customvar code="variable_code"}}".</p> | ||
', | ||
BlockInterface::IS_ACTIVE => 0, | ||
'store_id' => [$storeId], | ||
] | ||
]); | ||
$blockRepository->save($block); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not swap the original arguments order to comply with Liskov substitution principle.