Skip to content

Commit

Permalink
Merge branch 'develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
engcom-Hotel authored Sep 13, 2024
2 parents d241525 + 23ef146 commit cbbca7b
Show file tree
Hide file tree
Showing 1,103 changed files with 6,146 additions and 654 deletions.
10 changes: 5 additions & 5 deletions .github/.metadata.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"templateVersion": "0.1",
"templateVersion": "0.2",
"product": {
"name": "Magento 2 Page Builder",
"description": "Page Builder introduces an intuitive, drag-and-drop interface for creating digital content, powered by content types like images, videos, banners, etc. with instant preview capabilities that enable non-technical users to take control of their content."
},
"contacts": {
"team": {
"name": "Amigos",
"DL": "Grp-amigos",
"slackChannel": "team-amigos"
"name": "Bluetooth",
"DL": "Grp-RQ-BLUETOOTH",
"slackChannel": ""
}
},
"ticketTracker": {
"functionalJiraQueue": {
"projectKey": "PB",
"projectKey": "AC",
"component": ""
},
"securityJiraQueue": {
Expand Down
8 changes: 4 additions & 4 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Contributions to the Magento 2 Page Builder codebase are done using the fork & pull model.
This contribution model has contributors maintaining their own fork of the Magento 2 Page Builder repository.
The forked repository is then used to submit a request to the base repository to pull a set of changes.
The forked repository is then used to submit a request to the base repository to "pull" a set of changes.
For more information on pull requests please refer to [GitHub Help](https://help.github.com/articles/about-pull-requests/).

Contributions can take the form of new components or features, changes to existing features, tests, documentation (such as developer guides, user guides, examples, or specifications), bug fixes or optimizations.
Expand All @@ -15,13 +15,13 @@ For more detailed information on contribution please read our [beginners guide](

## Contribution requirements

1. Contributions must adhere to the [Magento coding standards](https://devdocs.magento.com/guides/v2.4/coding-standards/bk-coding-standards.html).
1. Contributions must adhere to the [Magento coding standards](https://developer.adobe.com/commerce/php/coding-standards/).
1. Pull requests (PRs) must be accompanied by a meaningful description of their purpose. Comprehensive descriptions increase the chances of a pull request being merged quickly and without additional clarification requests.
1. Commits must be accompanied by meaningful commit messages. Please see the [Magento 2 Page Builder Pull Request Template](PULL_REQUEST_TEMPLATE.md) for more information.
1. PRs which include bug fixes must be accompanied with a step-by-step description of how to reproduce the bug.
1. PRs which include new logic or new features must be submitted along with:
* Unit/integration test coverage
* Proposed [documentation](https://devdocs.magento.com) updates. Documentation contributions can be submitted via the [devdocs GitHub](https://github.com/magento/devdocs).
* Proposed [documentation](https://developer.adobe.com/commerce) updates. Use feedback buttons __Edit in GitHub__ and __Log an issue__ at the top of a relevant topic.
1. For larger features or changes, please [open an issue](https://github.com/magento/magento2-page-builder/issues) to discuss the proposed changes prior to development. This may prevent duplicate or unnecessary effort and allow other contributors to provide input.

## Contribution process
Expand All @@ -33,7 +33,7 @@ This will allow you to collaborate with the Magento 2 Page Builder development t
1. Search current [listed issues](https://github.com/magento/magento2-page-builder/issues) (open or closed) for similar proposals of intended contribution before starting work on a new contribution.
2. Review the [Contributor License Agreement](https://opensource.adobe.com/cla.html) if this is your first time contributing.
3. Create and test your work.
4. Fork the Magento 2 Page Builder repository according to the [Fork A Repository instructions](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#fork) and when you are ready to send us a pull request – follow the [Create A Pull Request instructions](https://devdocs.magento.com/guides/v2.4/contributor-guide/contributing.html#pull_request).
4. Fork the Magento 2 Page Builder repository according to the [Fork A Repository instructions](https://developer.adobe.com/commerce/contributor/guides/code-contributions/) and when you are ready to send us a pull request – follow the [Create A Pull Request instructions](https://developer.adobe.com/commerce/contributor/guides/code-contributions/).
5. Once your contribution is received the Magento 2 Page Builder development team will review the contribution and collaborate with you as needed.

## Code of Conduct
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ The wiki provides more information on the Page Builder project, such as:
- [MFTF best practices](https://github.com/magento/magento2-page-builder-docs/wiki/%5BRough-Draft%5D-MFTF-Best-Practices)

## Documentation
Complete documentation located on the [Magento DevDocs](https://devdocs.magento.com/page-builder/docs/), including what you need to know to start local development as described in the [installation guide](https://github.com/magento/magento2-page-builder-docs/wiki/Installation-Guide).

Complete documentation located on the [Magento DevDocs](https://developer.adobe.com/commerce/frontend-core/page-builder/), including what you need to know to start local development as described in the [installation guide](https://github.com/magento/magento2-page-builder-docs/wiki/Installation-Guide).

## Community Engineering Slack

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
<magentoCLI command="config:set web/default_layouts/default_cms_layout cms-full-width" stepKey="setPageBuilderDefaultCmsLayout"/>
<magentoCLI command="config:set web/default_layouts/default_category_layout category-full-width" stepKey="setPageBuilderDefaultCategoryLayout"/>
<magentoCLI command="config:set web/default_layouts/default_product_layout product-full-width" stepKey="setPageBuilderDefaultProductLayout"/>
<magentoCLI command="cache:clean config" stepKey="flushCache"/>
<actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCache">
<argument name="tags" value="config"/>
</actionGroup>
</before>
<after>
<magentoCLI command="setup:config:set {{RemoteStorageAwsS3ConfigData.disable_options}}" stepKey="disableRemoteStorage"/>
Expand All @@ -28,7 +30,9 @@
</actionGroup>
<magentoCLI command="config:set cms/wysiwyg/enabled disabled" stepKey="disableWYSIWYG"/>
<magentoCLI command="config:set cms/pagebuilder/google_maps_api_key ''" stepKey="setEmptyGoogleMapsAPIKey"/>
<magentoCLI command="cache:clean config" stepKey="flushCache"/>
<actionGroup ref="CliCacheCleanActionGroup" stepKey="flushCache">
<argument name="tags" value="config"/>
</actionGroup>
</after>
<include>
<group name="remote_storage_aws_s3_pagebuilder"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ImageAddImageContentTypeToCMSPageTest
ImageAddImageIntoPageBuilderStageTest
ImageInvalidFileTypeValidationTest
ImageRemoveImageFromStageTest
PageBuilderCreateTemplateOnCMSBlockForPageAndApplyTemplateToCatalogCategory
PageBuilderDeleteTemplate
PageBuilderVerifySaveContentAsTemplateModalAndApplyTemplateSlideOut
CanAddVideoToColumnTest
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@

File "/var/www/html/app/code/Magento/AwsS3PageBuilder/Test/Mftf/Test/AdminPageBuilderImageTest/AwsS3ImageAddImageContentTypeToCMSPageTest.xml"
contains entity references that violate dependency constraints:

ImageAddImageContentTypeToCMSPageTest from module(s): magento/module-page-builder

File "/var/www/html/app/code/Magento/AwsS3PageBuilder/Test/Mftf/Test/AdminPageBuilderImageTest/AwsS3ImageAddImageIntoPageBuilderStageTest.xml"
contains entity references that violate dependency constraints:

ImageAddImageIntoPageBuilderStageTest from module(s): magento/module-page-builder

File "/var/www/html/app/code/Magento/AwsS3PageBuilder/Test/Mftf/Test/AdminPageBuilderImageTest/AwsS3ImageInvalidFileTypeValidationTest.xml"
contains entity references that violate dependency constraints:

ImageInvalidFileTypeValidationTest from module(s): magento/module-page-builder

File "/var/www/html/app/code/Magento/AwsS3PageBuilder/Test/Mftf/Test/AdminPageBuilderImageTest/AwsS3ImageRemoveImageFromStageTest.xml"
contains entity references that violate dependency constraints:

ImageRemoveImageFromStageTest from module(s): magento/module-page-builder

File "/var/www/html/app/code/Magento/AwsS3PageBuilder/Test/Mftf/Test/AdminPageBuilderTemplateTests/AwsS3PageBuilderCreateTemplateOnCMSBlockForPageAndApplyTemplateToCatalogCategory.xml"
contains entity references that violate dependency constraints:

PageBuilderCreateTemplateOnCMSBlockForPageAndApplyTemplateToCatalogCategory from module(s): magento/module-page-builder

File "/var/www/html/app/code/Magento/AwsS3PageBuilder/Test/Mftf/Test/AdminPageBuilderTemplateTests/AwsS3PageBuilderDeleteTemplate.xml"
contains entity references that violate dependency constraints:

PageBuilderDeleteTemplate from module(s): magento/module-page-builder

File "/var/www/html/app/code/Magento/AwsS3PageBuilder/Test/Mftf/Test/AdminPageBuilderTemplateTests/AwsS3PageBuilderVerifySaveContentAsTemplateModalAndApplyTemplateSlideOut.xml"
contains entity references that violate dependency constraints:

PageBuilderVerifySaveContentAsTemplateModalAndApplyTemplateSlideOut from module(s): magento/module-banner-page-builder, magento/module-page-builder

File "/var/www/html/app/code/Magento/AwsS3PageBuilder/Test/Mftf/Test/AdminPageBuilderVideoTest/AwsS3CanAddVideoToColumnTest.xml"
contains entity references that violate dependency constraints:

CanAddVideoToColumnTest from module(s): magento/module-page-builder
2 changes: 1 addition & 1 deletion app/code/Magento/AwsS3PageBuilder/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"description": "Aws S3 Page Builder module",
"require": {
"magento/framework": "*",
"php": "~7.4.0||~8.1.0"
"php": "~8.1.0||~8.2.0||~8.3.0"
},
"suggest": {
"magento/module-page-builder": "*",
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogPageBuilderAnalytics/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Magento_CatalogPageBuilderAnalytics module

The Magento_CatalogPageBuilderAnalytics module configures data definitions for a data collection related to the PageBuilder module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html).
The Magento_CatalogPageBuilderAnalytics module configures data definitions for a data collection related to the PageBuilder module entities to be used in [Advanced Reporting](https://developer.adobe.com/commerce/php/development/advanced-reporting/modules/).
2 changes: 1 addition & 1 deletion app/code/Magento/CatalogPageBuilderAnalytics/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"magento/module-page-builder-analytics": "*",
"magento/module-catalog": "*",
"magento/framework": "*",
"php": "~7.4.0||~8.1.0"
"php": "~8.1.0||~8.2.0||~8.3.0"
},
"type": "magento2-module",
"license": [
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/CmsPageBuilderAnalytics/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Magento_CmsPageBuilderAnalytics module

The Magento_CmsPageBuilderAnalytics module configures data definitions for a data collection related to the PageBuilder module entities to be used in [Advanced Reporting](https://devdocs.magento.com/guides/v2.4/advanced-reporting/modules.html).
The Magento_CmsPageBuilderAnalytics module configures data definitions for a data collection related to the PageBuilder module entities to be used in [Advanced Reporting](https://developer.adobe.com/commerce/php/development/advanced-reporting/modules/).
2 changes: 1 addition & 1 deletion app/code/Magento/CmsPageBuilderAnalytics/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"magento/module-page-builder-analytics": "*",
"magento/module-cms": "*",
"magento/framework": "*",
"php": "~7.4.0||~8.1.0"
"php": "~8.1.0||~8.2.0||~8.3.0"
},
"type": "magento2-module",
"license": [
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/PageBuilder/Block/GoogleMapsApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
class GoogleMapsApi extends \Magento\Framework\View\Element\Template
{
const GOOGLE_MAPS_API_KEY_PATH = 'cms/pagebuilder/google_maps_api_key';
const GOOGLE_MAPS_LIBRARY_URL = 'https://maps.googleapis.com/maps/api/js?v=3&key=%s';
const GOOGLE_MAPS_STYLE_PATH = 'cms/pagebuilder/google_maps_style';
public const GOOGLE_MAPS_API_KEY_PATH = 'cms/pagebuilder/google_maps_api_key';
public const GOOGLE_MAPS_LIBRARY_URL = 'https://maps.googleapis.com/maps/api/js?v=3.56&key=%s';
public const GOOGLE_MAPS_STYLE_PATH = 'cms/pagebuilder/google_maps_style';

/**
* Retrieve the Google Maps API key
Expand Down
18 changes: 15 additions & 3 deletions app/code/Magento/PageBuilder/Component/Form/Element/Wysiwyg.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Magento\PageBuilder\Model\Config as PageBuilderConfig;
use Magento\PageBuilder\Model\State as PageBuilderState;
use Magento\PageBuilder\Model\Stage\Config as Config;
use Magento\Framework\AuthorizationInterface;

/**
* Updates wysiwyg element with Page Builder specific config
Expand All @@ -26,11 +27,19 @@
*/
class Wysiwyg extends \Magento\Ui\Component\Form\Element\Wysiwyg
{

private const ADMIN_RESOURCE = 'Magento_Backend::content';

/**
* @var Repository
*/
private $assetRepo;

/**
* @var AuthorizationInterface
*/
private $authorization;

/**
* WYSIWYG Constructor
*
Expand All @@ -46,6 +55,7 @@ class Wysiwyg extends \Magento\Ui\Component\Form\Element\Wysiwyg
* @param PageBuilderConfig|null $pageBuilderConfig
* @param bool $overrideSnapshot
* @param Repository|null $assetRepo
* @param AuthorizationInterface|null $authorization
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
* @SuppressWarnings(PHPMD.NPathComplexity)
Expand All @@ -62,9 +72,11 @@ public function __construct(
array $config = [],
PageBuilderConfig $pageBuilderConfig = null,
bool $overrideSnapshot = false,
Repository $assetRepo = null
Repository $assetRepo = null,
AuthorizationInterface $authorization = null
) {
$this->assetRepo = $assetRepo ?: ObjectManager::getInstance()->get(Repository::class);
$this->authorization = $authorization ?: ObjectManager::getInstance()->get(AuthorizationInterface::class);
$wysiwygConfigData = $config['wysiwygConfigData'] ?? [];

// If a dataType is present we're dealing with an attribute
Expand All @@ -79,11 +91,11 @@ public function __construct(
$config['wysiwyg'] = true;
}
}

$isAllowed = $this->authorization->isAllowed(self::ADMIN_RESOURCE);
$isEnablePageBuilder = isset($wysiwygConfigData['is_pagebuilder_enabled'])
&& !$wysiwygConfigData['is_pagebuilder_enabled']
|| false;
if (!$pageBuilderState->isPageBuilderInUse($isEnablePageBuilder)) {
if (!$pageBuilderState->isPageBuilderInUse($isEnablePageBuilder) && $isAllowed) {
// This is not done using definition.xml due to https://github.com/magento/magento2/issues/5647
$data['config']['component'] = 'Magento_PageBuilder/js/form/element/wysiwyg';

Expand Down
Loading

0 comments on commit cbbca7b

Please sign in to comment.