Skip to content

Commit 54a39d5

Browse files
Merge branch '2.4-develop' into faster-isTableExists
2 parents 4876d4e + ba25897 commit 54a39d5

File tree

741 files changed

+31239
-5384
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

741 files changed

+31239
-5384
lines changed

.github/ISSUE_TEMPLATE/story.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: GraphQL Story
3+
about: User story for GraphQL project
4+
labels: 'Project: GraphQL'
5+
6+
---
7+
8+
*As a ___ I want to ___ so that ___.*
9+
10+
### AC
11+
* a
12+
* b
13+
### Approved Schema
14+
* a

app/code/Magento/AdminAnalytics/Test/Mftf/Test/TrackingScriptTest.xml

Lines changed: 0 additions & 26 deletions
This file was deleted.

app/code/Magento/Backend/Test/Mftf/Section/AdminMenuSection.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
<element name="widgets" type="button" selector="#nav li[data-ui-id='menu-magento-widget-cms-widget-instance']"/>
1818
<element name="stores" type="button" selector="#menu-magento-backend-stores"/>
1919
<element name="configuration" type="button" selector="#nav li[data-ui-id='menu-magento-config-system-config']"/>
20-
<element name="dashboard" type="button" selector="//li[@id='menu-magento-backend-dashboard']"/>
21-
<element name="sales" type="button" selector="//li[@id='menu-magento-sales-sales']"/>
22-
<element name="marketing" type="button" selector="//li[@id='menu-magento-backend-marketing']"/>
23-
<element name="system" type="button" selector="//li[@id='menu-magento-backend-system']"/>
24-
<element name="findPartners" type="button" selector="//li[@id='menu-magento-marketplace-partners']"/>
20+
<element name="dashboard" type="button" selector="#menu-magento-backend-dashboard"/>
21+
<element name="sales" type="button" selector="#menu-magento-sales-sales"/>
22+
<element name="marketing" type="button" selector="#menu-magento-backend-marketing"/>
23+
<element name="system" type="button" selector="#menu-magento-backend-system"/>
24+
<element name="findPartners" type="button" selector="#menu-magento-marketplace-partners"/>
2525

2626
<!-- Navigate menu selectors -->
2727
<element name="menuItem" type="button" selector="li[data-ui-id='menu-{{dataUiId}}']" parameterized="true" timeout="30"/>

app/code/Magento/Bundle/Model/ResourceModel/Indexer/Price.php

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -377,8 +377,7 @@ private function prepareBundlePriceByType($priceType, array $dimensions, $entity
377377
]
378378
);
379379

380-
$query = $select->insertFromSelect($this->getBundlePriceTable());
381-
$connection->query($query);
380+
$this->tableMaintainer->insertFromSelect($select, $this->getBundlePriceTable(), []);
382381
}
383382

384383
/**
@@ -418,8 +417,7 @@ private function calculateBundleOptionPrice($priceTable, $dimensions)
418417
]
419418
);
420419

421-
$query = $select->insertFromSelect($this->getBundleOptionTable());
422-
$connection->query($query);
420+
$this->tableMaintainer->insertFromSelect($select, $this->getBundleOptionTable(), []);
423421

424422
$this->getConnection()->delete($priceTable->getTableName());
425423
$this->applyBundlePrice($priceTable);
@@ -575,8 +573,7 @@ private function calculateFixedBundleSelectionPrice()
575573
'tier_price' => $tierExpr,
576574
]
577575
);
578-
$query = $select->insertFromSelect($this->getBundleSelectionTable());
579-
$connection->query($query);
576+
$this->tableMaintainer->insertFromSelect($select, $this->getBundleSelectionTable(), []);
580577

581578
$this->applyFixedBundleSelectionPrice();
582579
}
@@ -627,8 +624,7 @@ private function calculateDynamicBundleSelectionPrice($dimensions)
627624
'tier_price' => $tierExpr,
628625
]
629626
);
630-
$query = $select->insertFromSelect($this->getBundleSelectionTable());
631-
$connection->query($query);
627+
$this->tableMaintainer->insertFromSelect($select, $this->getBundleSelectionTable(), []);
632628
}
633629

634630
/**
@@ -697,8 +693,7 @@ private function prepareTierPriceIndex($dimensions, $entityIds)
697693
$select->where($this->dimensionToFieldMapper[$dimension->getName()] . ' = ?', $dimension->getValue());
698694
}
699695

700-
$query = $select->insertFromSelect($this->getTable('catalog_product_index_tier_price'));
701-
$connection->query($query);
696+
$this->tableMaintainer->insertFromSelect($select, $this->getTable('catalog_product_index_tier_price'), []);
702697
}
703698

704699
/**
@@ -725,8 +720,7 @@ private function applyBundlePrice($priceTable): void
725720
]
726721
);
727722

728-
$query = $select->insertFromSelect($priceTable->getTableName());
729-
$this->getConnection()->query($query);
723+
$this->tableMaintainer->insertFromSelect($select, $priceTable->getTableName(), []);
730724
}
731725

732726
/**
@@ -785,7 +779,7 @@ private function getMainTable($dimensions)
785779
if ($this->fullReindexAction) {
786780
return $this->tableMaintainer->getMainReplicaTable($dimensions);
787781
}
788-
return $this->tableMaintainer->getMainTable($dimensions);
782+
return $this->tableMaintainer->getMainTableByDimensions($dimensions);
789783
}
790784

791785
/**
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertStorefrontBundleValidationMessageActionGroup">
12+
<annotations>
13+
<description>Check error message in validation message box</description>
14+
</annotations>
15+
<arguments>
16+
<argument name="message" type="string"/>
17+
</arguments>
18+
19+
<waitForPageLoad stepKey="waitForPageLoad"/>
20+
<see selector="{{StorefrontBundledSection.validationMessageBox}}" userInput="{{message}}" stepKey="seeErrorHoldMessage"/>
21+
</actionGroup>
22+
</actionGroups>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="AssertStorefrontBundleValidationMessagesCountActionGroup">
12+
<annotations>
13+
<description>Check if there's a validation message box on page and asserts the validation messages number</description>
14+
</annotations>
15+
16+
<waitForPageLoad stepKey="waitForPageLoad"/>
17+
<seeElement selector="{{StorefrontBundledSection.validationMessageBox}}" stepKey="seeErrorBox"/>
18+
<seeNumberOfElements selector="{{StorefrontBundledSection.validationMessageBox}}" userInput="1" stepKey="seeOneErrorBox"/>
19+
</actionGroup>
20+
</actionGroups>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<actionGroups xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/actionGroupSchema.xsd">
11+
<actionGroup name="StorefrontAddToTheCartButtonActionGroup">
12+
<annotations>
13+
<description>Clicks 'Add to Cart' on a Storefront Bundled Product page.</description>
14+
</annotations>
15+
16+
<waitForPageLoad stepKey="waitForPageLoad"/>
17+
<waitForElementVisible selector="{{StorefrontBundleProductActionSection.addToCartButton}}" stepKey="waitForAddToCartButton"/>
18+
<click selector="{{StorefrontBundleProductActionSection.addToCartButton}}" stepKey="clickOnAddToCartButton"/>
19+
</actionGroup>
20+
</actionGroups>

app/code/Magento/Bundle/Test/Mftf/Section/BundleStorefrontSection.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
<element name="bundleOptionSelection" type="checkbox" selector="//div[@class='nested options-list']/div[{{optionNumber}}]/label[@class='label']" parameterized="true"/>
1515
<!--Description-->
1616
<!--CE exclusively-->
17-
<element name="longDescriptionText" type="text" selector="//*[@id='description']/div/div" timeout="30"/>
18-
<element name="shortDescriptionText" type="text" selector="//div[@class='product attribute overview']" timeout="30"/>
17+
<element name="longDescriptionText" type="text" selector="#description>div>div" timeout="30"/>
18+
<element name="shortDescriptionText" type="text" selector="div.product.attribute.overview" timeout="30"/>
1919
<!--NameOfProductOnProductPage-->
2020
<element name="bundleProductName" type="text" selector="//*[@id='maincontent']//span[@itemprop='name']"/>
2121
<!--PageNotFoundErrorMessage-->

app/code/Magento/Bundle/Test/Mftf/Section/StorefrontBundledSection.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<element name="updateCart" type="button" selector="#product-updatecart-button" timeout="30"/>
1818
<element name="configuredPrice" type="block" selector=".price-configured_price .price"/>
1919
<element name="fixedPricing" type="text" selector="//div[@class='price-box price-final_price']//span[@id]//..//span[contains(text(),'{{var1}}')]" parameterized="true"/>
20-
<element name="customizeProduct" type="button" selector="//*[@id='bundle-slide']"/>
20+
<element name="customizeProduct" type="button" selector="#bundle-slide"/>
2121
<element name="customizableBundleItemOption" type="text" selector="//div[@class='field choice'][1]//input[@type='checkbox']"/>
2222
<element name="customizableBundleItemOption2" type="text" selector="//div[@class='field choice'][2]//input[@type='checkbox']"/>
2323
<element name="nthOptionDiv" type="block" selector="#product-options-wrapper div.field.option:nth-of-type({{var}})" parameterized="true"/>
@@ -38,5 +38,6 @@
3838
<element name="currencyTrigger" type="select" selector="#switcher-currency-trigger" timeout="30"/>
3939
<element name="currency" type="select" selector="//a[text()='{{arg}}']" parameterized="true"/>
4040
<element name="multiSelectOption" type="select" selector="//div[@class='field option required']//select"/>
41+
<element name="validationMessageBox" type="block" selector="#validation-message-box"/>
4142
</section>
4243
</sections>
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
/**
4+
* Copyright © Magento, Inc. All rights reserved.
5+
* See COPYING.txt for license details.
6+
*/
7+
-->
8+
9+
<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
10+
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
11+
<test name="StorefrontBundleCheckBoxOptionValidationTest">
12+
<annotations>
13+
<features value="Bundle"/>
14+
<stories value="Bundle product validation before add to cart"/>
15+
<title value="Customer should be able to see only one validation message for checkbox option group"/>
16+
<description value="Customer should be able to see only one validation message for checkbox option group"/>
17+
<testCaseId value="MC-35133"/>
18+
<severity value="MINOR"/>
19+
<group value="Bundle"/>
20+
</annotations>
21+
<before>
22+
<createData entity="ApiProductWithDescription" stepKey="simpleProduct1" before="bundleProduct"/>
23+
<createData entity="ApiProductWithDescription" stepKey="simpleProduct2" after="simpleProduct1"/>
24+
<createData entity="ApiBundleProduct" stepKey="bundleProduct"/>
25+
<createData entity="CheckboxOption" stepKey="checkboxBundleOption">
26+
<requiredEntity createDataKey="bundleProduct"/>
27+
</createData>
28+
<createData entity="ApiBundleLink" stepKey="createBundleLink1">
29+
<requiredEntity createDataKey="bundleProduct"/>
30+
<requiredEntity createDataKey="checkboxBundleOption"/>
31+
<requiredEntity createDataKey="simpleProduct1"/>
32+
<field key="qty">2</field>
33+
</createData>
34+
<createData entity="ApiBundleLink" stepKey="createBundleLink2">
35+
<requiredEntity createDataKey="bundleProduct"/>
36+
<requiredEntity createDataKey="checkboxBundleOption"/>
37+
<requiredEntity createDataKey="simpleProduct2"/>
38+
<field key="qty">4</field>
39+
</createData>
40+
<magentoCron stepKey="runCronIndex" groups="index"/>
41+
</before>
42+
<after>
43+
<deleteData createDataKey="bundleProduct" stepKey="deleteBundleProduct"/>
44+
<deleteData createDataKey="simpleProduct1" stepKey="deleteSimpleProduct1"/>
45+
<deleteData createDataKey="simpleProduct2" stepKey="deleteSimpleProduct2"/>
46+
</after>
47+
<actionGroup ref="StorefrontOpenProductPageActionGroup" stepKey="openProductStorefront">
48+
<argument name="productUrl" value="$$bundleProduct.custom_attributes[url_key]$$"/>
49+
</actionGroup>
50+
<actionGroup ref="StorefrontSelectCustomizeAndAddToTheCartButtonActionGroup" stepKey="customizeBundleProduct"/>
51+
<actionGroup ref="StorefrontAddToTheCartButtonActionGroup" stepKey="addToCartBundleProduct"/>
52+
<actionGroup ref="AssertStorefrontBundleValidationMessagesCountActionGroup" stepKey="assertBundleValidationCount"/>
53+
<actionGroup ref="AssertStorefrontBundleValidationMessageActionGroup" stepKey="assertBundleValidationMessage">
54+
<argument name="message" value="Please select one of the options."/>
55+
</actionGroup>
56+
</test>
57+
</tests>

app/code/Magento/Bundle/view/frontend/templates/catalog/product/view/type/bundle/option/checkbox.phtml

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,55 @@
88
<?php /* @var $block \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle\Option\Checkbox */ ?>
99
<?php $_option = $block->getOption() ?>
1010
<?php $_selections = $_option->getSelections() ?>
11+
<?php $inputClass = 'checkbox product bundle option bundle-option-' . $block->escapeHtmlAttr($_option->getId()) ?>
12+
<?php $inputId = 'bundle-option-' . $block->escapeHtmlAttr($_option->getId()) ?>
13+
<?php $inputName = 'bundle_option[' . $block->escapeHtmlAttr($_option->getId()) . ']' ?>
14+
<?php $dataValidation = 'data-validate="{\'validate-one-required-by-name\':\'input[name^=&quot;bundle_option[' .
15+
$block->escapeHtmlAttr($_option->getId()) . ']&quot;]:checked\'}"' ?>
16+
1117
<div class="field option <?= ($_option->getRequired()) ? ' required': '' ?>">
1218
<label class="label">
1319
<span><?= $block->escapeHtml($_option->getTitle()) ?></span>
1420
</label>
1521
<div class="control">
1622
<div class="nested options-list">
17-
<?php if ($block->showSingle()) : ?>
23+
<?php if ($block->showSingle()): ?>
1824
<?= /* @noEscape */ $block->getSelectionQtyTitlePrice($_selections[0]) ?>
1925
<?= /* @noEscape */ $block->getTierPriceRenderer()->renderTierPrice($_selections[0]) ?>
2026
<input type="hidden"
2127
class="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?> product bundle option"
2228
name="bundle_option[<?= $block->escapeHtml($_option->getId()) ?>]"
2329
value="<?= $block->escapeHtmlAttr($_selections[0]->getSelectionId()) ?>"/>
24-
<?php else :?>
25-
<?php foreach ($_selections as $_selection) : ?>
30+
<?php else: ?>
31+
<?php foreach ($_selections as $selection): ?>
32+
<?php $sectionId = $selection->getSelectionId() ?>
2633
<div class="field choice">
27-
<input class="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?> checkbox product bundle option change-container-classname"
28-
id="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>"
34+
<input class="<?=/* @noEscape */ $inputClass ?> change-container-classname"
35+
id="<?=/* @noEscape */ $inputId . '-' . $block->escapeHtmlAttr($sectionId)?>"
2936
type="checkbox"
30-
<?php if ($_option->getRequired()) { echo 'data-validate="{\'validate-one-required-by-name\':\'input[name^=&quot;bundle_option[' . $block->escapeHtmlAttr($_option->getId()) . ']&quot;]:checked\'}"'; } ?>
31-
name="bundle_option[<?= $block->escapeHtmlAttr($_option->getId()) ?>][<?= $block->escapeHtmlAttr($_selection->getId()) ?>]"
32-
data-selector="bundle_option[<?= $block->escapeHtmlAttr($_option->getId()) ?>][<?= $block->escapeHtmlAttr($_selection->getId()) ?>]"
33-
<?php if ($block->isSelected($_selection)) { echo ' checked="checked"'; } ?>
34-
<?php if (!$_selection->isSaleable()) { echo ' disabled="disabled"'; } ?>
35-
value="<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>"/>
37+
<?php if ($_option->getRequired()): ?>
38+
<?= /* @noEscape */ $dataValidation ?>
39+
<?php endif;?>
40+
name="<?=/* @noEscape */ $inputName .'['. $block->escapeHtmlAttr($sectionId)?>]"
41+
data-selector="<?= /* @noEscape */ $inputName.'['.$block->escapeHtmlAttr($sectionId)?>]"
42+
<?php if ($block->isSelected($selection)): ?>
43+
<?= ' checked="checked"' ?>
44+
<?php endif; ?>
45+
<?php if (!$selection->isSaleable()): ?>
46+
<?= ' disabled="disabled"' ?>
47+
<?php endif; ?>
48+
value="<?= $block->escapeHtmlAttr($sectionId) ?>"
49+
data-errors-message-box="#validation-message-box"/>
3650
<label class="label"
37-
for="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-<?= $block->escapeHtmlAttr($_selection->getSelectionId()) ?>">
38-
<span><?= /* @noEscape */ $block->getSelectionQtyTitlePrice($_selection) ?></span>
51+
for="<?= /* @noEscape */ $inputId . '-' . $block->escapeHtmlAttr($sectionId) ?>">
52+
<span><?= /* @noEscape */ $block->getSelectionQtyTitlePrice($selection) ?></span>
3953
<br/>
40-
<?= /* @noEscape */ $block->getTierPriceRenderer()->renderTierPrice($_selection) ?>
54+
<?= /* @noEscape */ $block->getTierPriceRenderer()->renderTierPrice($selection) ?>
4155
</label>
4256
</div>
4357
<?php endforeach; ?>
4458
<div id="bundle-option-<?= $block->escapeHtmlAttr($_option->getId()) ?>-container"></div>
59+
<div id="validation-message-box"></div>
4560
<?php endif; ?>
4661
</div>
4762
</div>

0 commit comments

Comments
 (0)