Skip to content

Commit

Permalink
🔃 [EngCom] Public Pull Requests - 2.3-develop
Browse files Browse the repository at this point in the history
Accepted Public Pull Requests:
 - #19198: [2.3] Made logo clickable on home page (by @gwharton)
 - #19696: Add EngCom Slack info to README and formatting (by @lorikrell)
 - #19493: Fix issue 19492 - Catalog Product - Customizable Options label alignment issue  (by @speedy008)
 - #19684: Correct spelling (by @ravi-chandra3197)
 - #19673: fix: immediately return value (by @DanielRuf)
 - #19633: Issue resolved #19607. Page Not Found when deleting Attribute Set #19614 (by @cedcommerce)
 - #19640: Fixed icon alignment: Frontend Component theme sort by arrow icon vertical alignment issue. #19639 (by @suryakant-krish)
 - #18124: Clean code (by @hryvinskyi)
 - #19038: #18990: Shipping address is not validated in checkout… (by @StasKozar)


Fixed GitHub Issues:
 - #19142: Home page store loge should be clickable to reload page (reported by @tomekjordan) has been fixed in #19198 by @gwharton in 2.3-develop branch
   Related commits:
     1. f6a6d11
     2. 99c4d00

 - #19492: Catalog Product - Customizable Options label alignment issue (reported by @speedy008) has been fixed in #19493 by @speedy008 in 2.3-develop branch
   Related commits:
     1. f63ed89

 - #19607: Magento 2.3. Page Not Found when deleting Attribute Set (reported by @Rjgoolsby) has been fixed in #19633 by @cedcommerce in 2.3-develop branch
   Related commits:
     1. 144b028
     2. 21f7afa

 - #19639: Frontend Component theme sort by arrow icon vertical alignment issue. (reported by @suryakant-krish) has been fixed in #19640 by @suryakant-krish in 2.3-develop branch
   Related commits:
     1. e567510

 - #18990: Shipping address is not validated in checkout when proceeding step as logged in user with default shipping address (reported by @DanieliMi) has been fixed in #19038 by @StasKozar in 2.3-develop branch
   Related commits:
     1. 43e2c4d
     2. b545997
     3. 66c1155
  • Loading branch information
magento-engcom-team authored Dec 12, 2018
2 parents 3ff0161 + dcffbd8 commit 1773f41
Show file tree
Hide file tree
Showing 92 changed files with 486 additions and 244 deletions.
24 changes: 17 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ Magento is thankful for any contribution that can improve our code base, documen
<img src="https://raw.githubusercontent.com/wiki/magento/magento2/images/contributors.png"/>
</a>

<h3>Labels applied by the Magento team</h3>
We apply labels to public Pull Requests and Issues to help other participants retrieve additional information about current progress, component assignments, Magento release lines, and much more.
Please review the <a href="https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#labels">Code Contributions guide</a> for detailed information on labels used in Magento 2 repositories.
### Labels applied by the Magento team
We apply labels to public Pull Requests and Issues to help other participants retrieve additional information about current progress, component assignments, Magento release lines, and much more.
Please review the [Code Contributions guide](https://devdocs.magento.com/guides/v2.3/contributor-guide/contributing.html#labels) for detailed information on labels used in Magento 2 repositories.

<h2>Reporting security issues</h2>
## Reporting security issues

To report security vulnerabilities in Magento software or web sites, please create a Bugcrowd researcher account <a href="https://bugcrowd.com/magento">there</a> to submit and follow-up your issue. Learn more about reporting security issues <a href="https://magento.com/security/reporting-magento-security-issue">here</a>.
To report security vulnerabilities in Magento software or web sites, please create a Bugcrowd researcher account [there](https://bugcrowd.com/magento) to submit and follow-up your issue. Learn more about reporting security issues [here](https://magento.com/security/reporting-magento-security-issue).

Stay up-to-date on the latest security news and patches for Magento by signing up for <a href="https://magento.com/security/sign-up">Security Alert Notifications</a>.
Stay up-to-date on the latest security news and patches for Magento by signing up for [Security Alert Notifications](https://magento.com/security/sign-up).

<h2>License</h2>
## License

Each Magento source file included in this distribution is licensed under OSL 3.0 or the Magento Enterprise Edition (MEE) license.

Expand All @@ -59,3 +59,13 @@ Please see [LICENSE.txt](https://github.com/magento/magento2/blob/2.3-develop/LI
Subject to Licensee's payment of fees and compliance with the terms and conditions of the MEE License, the MEE License supersedes the OSL 3.0 license for each source file.
Please see LICENSE_EE.txt for the full text of the MEE License or visit https://magento.com/legal/terms/enterprise.

## Community Engineering Slack

To connect with Magento and the Community, join us on the [Magento Community Engineering Slack](https://magentocommeng.slack.com). If you are interested in joining Slack, or a specific channel, send us request at [engcom@adobe.com](mailto:engcom@adobe.com) or [self signup](https://tinyurl.com/engcom-slack).


We have channels for each project. These channels are recommended for new members:

- [general](https://magentocommeng.slack.com/messages/C4YS78WE6): Open chat for introductions and Magento 2 questions
- [github](https://magentocommeng.slack.com/messages/C7KB93M32): Support for GitHub issues, pull requests, and processes
- [public-backlog](https://magentocommeng.slack.com/messages/CCV3J3RV5): Discussions of the Magento 2 backlog
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
namespace Magento\AdminNotification\Model\ResourceModel;

/**
* Inbox resource model
*
* @api
* @since 100.0.2
*/
Expand Down Expand Up @@ -77,8 +79,7 @@ public function getNoticeStatus(\Magento\AdminNotification\Model\Inbox $object)
'is_read=?',
0
);
$return = $connection->fetchPairs($select);
return $return;
return $connection->fetchPairs($select);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
namespace Magento\Catalog\Block\Adminhtml\Product\Attribute\Set;

/**
* Adminhtml Catalog Attribute Set Main Block
*
* @author Magento Core Team <core@magentocommerce.com>
*/
use Magento\Catalog\Model\Entity\Product\Attribute\Group\AttributeMapperInterface;

/**
* Adminhtml Catalog Attribute Set Main Block.
*
* @api
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @since 100.0.2
Expand Down Expand Up @@ -140,7 +140,7 @@ protected function _prepareLayout()
) . '\', \'' . $this->getUrl(
'catalog/*/delete',
['id' => $setId]
) . '\')',
) . '\',{data: {}})',
'class' => 'delete'
]
);
Expand Down
4 changes: 3 additions & 1 deletion app/code/Magento/Catalog/Cron/DeleteOutdatedPriceValues.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
use Magento\Store\Model\Store;

/**
* Cron job for removing outdated prices.
*
* Cron operation is responsible for deleting all product prices on WEBSITE level
* in case 'Catalog Price Scope' configuration parameter is set to GLOBAL.
*/
Expand Down Expand Up @@ -76,7 +78,7 @@ public function execute()
/**
* Checks if price scope config option explicitly equal to global value.
*
* Such strict comparision is required to prevent price deleting when
* Such strict comparison is required to prevent price deleting when
* price scope config option is null for some reason.
*
* @return bool
Expand Down
18 changes: 14 additions & 4 deletions app/code/Magento/Catalog/Ui/Component/ColumnFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
namespace Magento\Catalog\Ui\Component;

/**
* Column Factory
*
* @api
* @since 100.0.2
*/
Expand Down Expand Up @@ -47,10 +49,14 @@ public function __construct(\Magento\Framework\View\Element\UiComponentFactory $
}

/**
* Create Factory
*
* @param \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute
* @param \Magento\Framework\View\Element\UiComponent\ContextInterface $context
* @param array $config
*
* @return \Magento\Ui\Component\Listing\Columns\ColumnInterface
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function create($attribute, $context, array $config = [])
{
Expand Down Expand Up @@ -82,7 +88,10 @@ public function create($attribute, $context, array $config = [])
}

/**
* Get Js Component
*
* @param string $dataType
*
* @return string
*/
protected function getJsComponent($dataType)
Expand All @@ -91,14 +100,15 @@ protected function getJsComponent($dataType)
}

/**
* Get Data Type
*
* @param \Magento\Catalog\Api\Data\ProductAttributeInterface $attribute
*
* @return string
*/
protected function getDataType($attribute)
{
return isset($this->dataTypeMap[$attribute->getFrontendInput()])
? $this->dataTypeMap[$attribute->getFrontendInput()]
: $this->dataTypeMap['default'];
return $this->dataTypeMap[$attribute->getFrontendInput()] ?? $this->dataTypeMap['default'];
}

/**
Expand All @@ -111,6 +121,6 @@ protected function getFilterType($frontendInput)
{
$filtersMap = ['date' => 'dateRange'];
$result = array_replace_recursive($this->dataTypeMap, $filtersMap);
return isset($result[$frontendInput]) ? $result[$frontendInput] : $result['default'];
return $result[$frontendInput] ?? $result['default'];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
use Magento\Framework\View\Element\UiComponent\ContextInterface;

/**
* Class Thumbnail
*
* @api
* @since 100.0.2
*/
Expand Down Expand Up @@ -67,13 +69,15 @@ public function prepareDataSource(array $dataSource)
}

/**
* Get Alt
*
* @param array $row
*
* @return null|string
*/
protected function getAlt($row)
{
$altField = $this->getData('config/altField') ?: self::ALT_FIELD;
return isset($row[$altField]) ? $row[$altField] : null;
return $row[$altField] ?? null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
try {
response = JSON.parse(transport.responseText);
} catch (e) {
console.warn('An error occured while parsing response');
console.warn('An error occurred while parsing response');
}

if (!response || !response['parameters']) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ if ($('is_required')) {

jQuery(function($) {
bindAttributeInputType();
// @todo: refactor collapsable component
// @todo: refactor collapsible component
$('.attribute-popup .collapse, [data-role="advanced_fieldset-content"]')
.collapsable()
.collapse('hide');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class FullTextSearchCheck
* to join catalog_eav_attribute table to search query or not
*
* In case when the $query does not requires full text search
* - we can skipp joining catalog_eav_attribute table because it becomes excessive
* - we can skip joining catalog_eav_attribute table because it becomes excessive
*
* @param QueryInterface $query
* @return bool
Expand All @@ -37,6 +37,8 @@ public function isRequiredForQuery(QueryInterface $query)
}

/**
* Process query
*
* @param QueryInterface $query
* @return bool
* @throws \InvalidArgumentException
Expand All @@ -62,6 +64,8 @@ private function processQuery(QueryInterface $query)
}

/**
* Process boolean query
*
* @param BoolExpression $query
* @return bool
* @throws \InvalidArgumentException
Expand Down Expand Up @@ -90,6 +94,8 @@ private function processBoolQuery(BoolExpression $query)
}

/**
* Process filter query
*
* @param Filter $query
* @return bool
* @throws \InvalidArgumentException
Expand Down
9 changes: 8 additions & 1 deletion app/code/Magento/CatalogUrlRewrite/Model/ObjectRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
*/
namespace Magento\CatalogUrlRewrite\Model;

/**
* Class ObjectRegistry
*/
class ObjectRegistry
{
/**
Expand All @@ -26,15 +29,19 @@ public function __construct($entities)
}

/**
* Get Entity
*
* @param int $entityId
* @return \Magento\Framework\DataObject|null
*/
public function get($entityId)
{
return isset($this->entitiesMap[$entityId]) ? $this->entitiesMap[$entityId] : null;
return $this->entitiesMap[$entityId] ?? null;
}

/**
* List Entities
*
* @return \Magento\Framework\DataObject[]
*/
public function getList()
Expand Down
22 changes: 22 additions & 0 deletions app/code/Magento/Checkout/Test/Mftf/Data/CountryData.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,26 @@
<item>Bahamas</item>
</array>
</entity>
<entity name="DefaultCountriesWithRequiredRegions" type="countryArray">
<array key="country">
<item>Australia</item>
<item>Brazil</item>
<item>Canada</item>
<item>Croatia</item>
<item>Estonia</item>
<item>India</item>
<item>Latvia</item>
<item>Lithuania</item>
<item>Romania</item>
<item>Spain</item>
<item>Switzerland</item>
<item>United States</item>
<item>Australia</item>
</array>
</entity>
<entity name="CustomCountryWithRequiredRegion" type="countryArray">
<array key="country">
<item>United Kingdom</item>
</array>
</entity>
</entities>
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->

<tests xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Test/etc/testSchema.xsd">
<test name="StorefrontCustomerCheckoutWithoutRegionTest">
<annotations>
<features value="Checkout"/>
<stories value="Checkout via the Admin"/>
<title value="Shipping address is not validated in checkout when proceeding step as logged in user with default shipping address"/>
<description value="Shouldn't be able to place an order as a customer without state if it's required."/>
<severity value="CRITICAL"/>
<testCaseId value="#"/>
<group value="checkout"/>
</annotations>
<before>
<createData entity="SimpleSubCategory" stepKey="createCategory"/>
<createData entity="SimpleProduct" stepKey="createProduct">
<requiredEntity createDataKey="createCategory"/>
</createData>
<createData entity="Simple_GB_Customer" stepKey="createCustomer"/>
<actionGroup stepKey="loginToAdminPanel" ref="LoginAsAdmin"/>
<actionGroup ref="SelectCountriesWithRequiredRegion" stepKey="setCustomCountryWithRequiredRegion">
<argument name="countries" value="CustomCountryWithRequiredRegion"/>
</actionGroup>
</before>
<after>
<actionGroup ref="SelectCountriesWithRequiredRegion" stepKey="setDefaultCountriesWithRequiredRegion">
<argument name="countries" value="DefaultCountriesWithRequiredRegions"/>
</actionGroup>
<actionGroup ref="logout" stepKey="logout"/>
<deleteData createDataKey="createProduct" stepKey="deleteProduct"/>
<deleteData createDataKey="createCategory" stepKey="deleteCategory"/>
<deleteData createDataKey="createCustomer" stepKey="deleteCustomer"/>
</after>

<actionGroup ref="LoginToStorefrontActionGroup" stepKey="customerLogin">
<argument name="Customer" value="$$createCustomer$$" />
</actionGroup>

<actionGroup ref="AddSimpleProductToCart" stepKey="addProductToCart">
<argument name="product" value="$$createProduct$$"/>
</actionGroup>

<actionGroup ref="GoToCheckoutFromMinicartActionGroup" stepKey="navigateToCheckoutPage"/>

<click selector="{{CheckoutShippingSection.next}}" stepKey="clickNextButton"/>
<see selector="{{StorefrontMessagesSection.error}}" userInput='Please specify a regionId in shipping address.' stepKey="seeErrorMessages"/>
</test>
</tests>
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ define([
},

/**
* Resolves an initial sate of a login form.
* Resolves an initial state of a login form.
*
* @returns {Boolean} - initial visibility state.
*/
Expand Down
16 changes: 15 additions & 1 deletion app/code/Magento/Checkout/view/frontend/web/js/view/shipping.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,11 @@ define([
addressData,
loginFormSelector = 'form[data-role=email-with-possible-login]',
emailValidationResult = customer.isLoggedIn(),
field;
field,
country = registry.get(this.parentName + '.shippingAddress.shipping-address-fieldset.country_id'),
countryIndexedOptions = country.indexedOptions,
option = countryIndexedOptions[quote.shippingAddress().countryId],
messageContainer = registry.get('checkout.errors').messageContainer;

if (!quote.shippingMethod()) {
this.errorValidationMessage(
Expand Down Expand Up @@ -318,6 +322,16 @@ define([
shippingAddress['save_in_address_book'] = 1;
}
selectShippingAddress(shippingAddress);
} else if (customer.isLoggedIn() &&
option &&
option['is_region_required'] &&
!quote.shippingAddress().region
) {
messageContainer.addErrorMessage({
message: $t('Please specify a regionId in shipping address.')
});

return false;
}

if (!emailValidationResult) {
Expand Down
Loading

0 comments on commit 1773f41

Please sign in to comment.