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:
 - #16893: [Forwardport] FIX for issue#14869 - Wrong price at backend after update (by @mage2pratik)
 - #17020: [Forwardport] hide cookie notice instead of reloading site (by @torhoehn)
 - #17014: [Forwardport] Fixes white color coding standard. (by @chirag-wagento)
 - #17016: [Forwardport] Avoid undefined index warning when using uppercase reserved word (by @FreekVandeursen)
 - #17017: [Forwardport] Wrong namespace defined in compare.phtml (by @ronak2ram)
 - #16997: [Forwardport] Corrected Magento_Framework's test xml file. (by @ihor-sviziev)
 - #16996: [Forwardport] Updated Magento_Newsletter's block file. (by @ihor-sviziev)
 - #16994: [Forwardport] Responsive Design Footers bottom of screen on mobile devices #15118 (by @ihor-sviziev)
 - #16993: [Forwardport] FIXED - appended payment code to ID field to make it unique (by @ihor-sviziev)
 - #16998: [Forwardport] Added 'title' attribute to 'a' link. (by @ihor-sviziev)
 - #16973: [Forwardport] Removed double occurrence of  keywords in sentences. (by @gelanivishal)
 - magento/graphql-ce#126: 120 implement store configs coverage (by @VitaliyBoyko)
 - magento/graphql-ce#99: #96 Make category query compatible with staging (by @roma-glushko)
 - #16734: [forwardport] #16559 fix icon color variable naming  (by @Karlasa)


Fixed GitHub Issues:
 - #14869: M 2.2.3 price per website - wrong price at backend by a create order after update (reported by @Webroju) has been fixed in #16893 by @mage2pratik in 2.3-develop branch
   Related commits:
     1. 49926d7
     2. 35b968e

 - #15118: Responsive Design, Footers do not snap to bottom of screen on mobile devices (reported by @gwharton) has been fixed in #16994 by @ihor-sviziev in 2.3-develop branch
   Related commits:
     1. f7228d0

 - #13692: In payment step of checkout I cannot unselect #billing-save-in-address-book checkbox in non-first payment method (reported by @NeosKnowledgeBasePluswerk) has been fixed in #16993 by @ihor-sviziev in 2.3-develop branch
   Related commits:
     1. a659f4b

 - #120: Default trigger coupon via URL (reported by @seansan) has been fixed in magento/graphql-ce#126 by @VitaliyBoyko in 2.3-develop branch
   Related commits:
     1. e1f53d4
     2. 5229cd6
     3. af4b258
     4. 3b64955
     5. b5a2a98
     6. e85a6e5
     7. 8f3c6e9
  • Loading branch information
Stanislav Idolov authored Jul 24, 2018
2 parents 9909d00 + 4934052 commit d120ac1
Show file tree
Hide file tree
Showing 45 changed files with 383 additions and 90 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@ Tests:
* [#686](https://github.com/magento/magento2/issues/686) -- Product save validation errors in the admin don't hide the overlay
* [#702](https://github.com/magento/magento2/issues/702) -- Base table or view not found
* [#652](https://github.com/magento/magento2/issues/652) -- Multishipping checkout not to change the Billing address js issue
* [#648](https://github.com/magento/magento2/issues/648) -- An equal (=) sign in the hash of the product page to to break the tabs functionality
* [#648](https://github.com/magento/magento2/issues/648) -- An equal (=) sign in the hash of the product page to break the tabs functionality
* Service Contracts:
* Refactored usage of new API of the Customer module
* Implemented Service Contracts for the Sales module
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<?= /* @escapeNotVerified */ $edition ?>
class="logo">
<img class="logo-img" src="<?= /* @escapeNotVerified */ $block->getViewFileUrl($logoSrc) ?>"
alt="<?= $block->escapeHtml(__('Magento Admin Panel')) ?>"/>
alt="<?= $block->escapeHtml(__('Magento Admin Panel')) ?>" title="<?= $block->escapeHtml(__('Magento Admin Panel')) ?>"/>
</a>
<?php break; ?>
<?php case 'user': ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<?php foreach ($block->getValues()->getAttributeBackend()->getImageTypes() as $type): ?>
<td class="gallery" align="center" style="vertical-align:bottom;">
<a href="<?= /* @escapeNotVerified */ $image->setType($type)->getSourceUrl() ?>" target="_blank" onclick="imagePreview('<?= $block->getElement()->getHtmlId() ?>_image_<?= /* @escapeNotVerified */ $type ?>_<?= /* @escapeNotVerified */ $image->getValueId() ?>');return false;">
<img id="<?= $block->getElement()->getHtmlId() ?>_image_<?= /* @escapeNotVerified */ $type ?>_<?= /* @escapeNotVerified */ $image->getValueId() ?>" src="<?= /* @escapeNotVerified */ $image->setType($type)->getSourceUrl() ?>?<?= /* @escapeNotVerified */ time() ?>" alt="<?= /* @escapeNotVerified */ $image->getValue() ?>" height="25" class="small-image-preview v-middle"/></a><br/>
<img id="<?= $block->getElement()->getHtmlId() ?>_image_<?= /* @escapeNotVerified */ $type ?>_<?= /* @escapeNotVerified */ $image->getValueId() ?>" src="<?= /* @escapeNotVerified */ $image->setType($type)->getSourceUrl() ?>?<?= /* @escapeNotVerified */ time() ?>" alt="<?= /* @escapeNotVerified */ $image->getValue() ?>" title="<?= /* @escapeNotVerified */ $image->getValue() ?>" height="25" class="small-image-preview v-middle"/></a><br/>
<input type="file" name="<?= /* @escapeNotVerified */ $block->getElement()->getName() ?>_<?= /* @escapeNotVerified */ $type ?>[<?= /* @escapeNotVerified */ $image->getValueId() ?>]" size="1"></td>
<?php endforeach; ?>
<td class="gallery" align="center" style="vertical-align:bottom;"><input type="input" name="<?= /* @escapeNotVerified */ $block->getElement()->getParentName() ?>[position][<?= /* @escapeNotVerified */ $image->getValueId() ?>]" value="<?= /* @escapeNotVerified */ $image->getPosition() ?>" id="<?= $block->getElement()->getHtmlId() ?>_position_<?= /* @escapeNotVerified */ $image->getValueId() ?>" size="3"/></td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

// @codingStandardsIgnoreFile

/** @var $block \Magento\Catalog\Block\Catalog\Product\View\Addto\Compare */
/** @var $block \Magento\Catalog\Block\Product\View\Addto\Compare */
?>

<a href="#" data-post='<?= /* @escapeNotVerified */ $block->getPostDataParams() ?>'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function getTree(ResolveInfo $resolveInfo, int $rootCategoryId) : array
$collection->addFieldToFilter('level', ['lteq' => $level + $depth - self::DEPTH_OFFSET]);
$collection->setOrder('level');
$collection->getSelect()->orWhere(
$this->metadata->getMetadata(CategoryInterface::class)->getLinkField() . ' = ?',
$this->metadata->getMetadata(CategoryInterface::class)->getIdentifierField() . ' = ?',
$rootCategoryId
);
return $this->processTree($collection->getIterator());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<!--/ko-->
<!-- ko if: (isCustomerLoggedIn && customerHasAddresses) -->
<div class="choice field">
<input type="checkbox" class="checkbox" id="billing-save-in-address-book" data-bind="checked: saveInAddressBook" />
<label class="label" for="billing-save-in-address-book">
<input type="checkbox" class="checkbox" data-bind="checked: saveInAddressBook, attr: {id: 'billing-save-in-address-book-' + getCode($parent)}" />
<label class="label" data-bind="attr: {for: 'billing-save-in-address-book-' + getCode($parent)}" >
<span data-bind="i18n: 'Save in address book'"></span>
</label>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Cookie/view/frontend/web/js/notices.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ define([
});

if ($.mage.cookies.get(this.options.cookieName)) {
window.location.reload();
this.element.hide();
} else {
window.location.href = this.options.noCookiesUrl;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ define([
this.options.cache.label = $(this.options.passwordStrengthMeterLabelSelector, this.element);

// We need to look outside the module for backward compatibility, since someone can already use the module.
// @todo Narrow this selector in 2.3 so it doesn't accidentally finds the the email field from the
// @todo Narrow this selector in 2.3 so it doesn't accidentally finds the email field from the
// newsletter email field or any other "email" field.
this.options.cache.email = $(this.options.formSelector).find(this.options.emailSelector);
this._bind();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ define([
if (IdentityLogin.win.closed ||
IdentityLogin.win.location.href == IdentityLogin.successCallbackUrl //eslint-disable-line eqeqeq
) {
//Stop the the polling
//Stop the polling
clearInterval(IdentityLogin.checker);
$('body').trigger('processStart');
//Check for window closed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ public function getForm()
}

/**
* Return return template name for JS
* Return template name for JS
*
* @return string
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ class Collection extends \Magento\Framework\Model\ResourceModel\Db\VersionContro
*/
protected $_quoteConfig;

/**
* @var \Magento\Store\Model\StoreManagerInterface|null
*/
private $storeManager;

/**
* @param \Magento\Framework\Data\Collection\EntityFactory $entityFactory
* @param \Psr\Log\LoggerInterface $logger
Expand All @@ -56,6 +61,7 @@ class Collection extends \Magento\Framework\Model\ResourceModel\Db\VersionContro
* @param \Magento\Quote\Model\Quote\Config $quoteConfig
* @param \Magento\Framework\DB\Adapter\AdapterInterface $connection
* @param \Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource
* @param \Magento\Store\Model\StoreManagerInterface|null $storeManager
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
*/
public function __construct(
Expand All @@ -68,7 +74,8 @@ public function __construct(
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
\Magento\Quote\Model\Quote\Config $quoteConfig,
\Magento\Framework\DB\Adapter\AdapterInterface $connection = null,
\Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null
\Magento\Framework\Model\ResourceModel\Db\AbstractDb $resource = null,
\Magento\Store\Model\StoreManagerInterface $storeManager = null
) {
parent::__construct(
$entityFactory,
Expand All @@ -82,6 +89,10 @@ public function __construct(
$this->_itemOptionCollectionFactory = $itemOptionCollectionFactory;
$this->_productCollectionFactory = $productCollectionFactory;
$this->_quoteConfig = $quoteConfig;

// Backward compatibility constructor parameters
$this->storeManager = $storeManager ?:
\Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Store\Model\StoreManagerInterface::class);
}

/**
Expand All @@ -101,7 +112,10 @@ protected function _construct()
*/
public function getStoreId()
{
return (int)$this->_productCollectionFactory->create()->getStoreId();
// Fallback to current storeId if no quote is provided
// (see https://github.com/magento/magento2/commit/9d3be732a88884a66d667b443b3dc1655ddd0721)
return $this->_quote === null ?
(int) $this->storeManager->getStore()->getId() : (int) $this->_quote->getStoreId();
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\StoreGraphQl\Model\Resolver\Store;

use Magento\Store\Api\Data\StoreConfigInterface;
use Magento\Store\Api\StoreConfigManagerInterface;
use Magento\Store\Api\StoreRepositoryInterface;
use Magento\Store\Api\StoreResolverInterface;

/**
* StoreConfig field data provider, used for GraphQL request processing.
*/
class StoreConfigDataProvider
{
/**
* @var StoreConfigManagerInterface
*/
private $storeConfigManager;

/**
* @var StoreResolverInterface
*/
private $storeResolver;

/**
* @var StoreRepositoryInterface
*/
private $storeRepository;

/**
* @param StoreConfigManagerInterface $storeConfigManager
* @param StoreResolverInterface $storeResolver
* @param StoreRepositoryInterface $storeRepository
*/
public function __construct(
StoreConfigManagerInterface $storeConfigManager,
StoreResolverInterface $storeResolver,
StoreRepositoryInterface $storeRepository
) {
$this->storeConfigManager = $storeConfigManager;
$this->storeResolver = $storeResolver;
$this->storeRepository = $storeRepository;
}

/**
* Get store config for current store
*
* @return array
*/
public function getStoreConfig() : array
{
$storeId = $this->storeResolver->getCurrentStoreId();
$store = $this->storeRepository->getById($storeId);
$storeConfig = current($this->storeConfigManager->getStoreConfigs([$store->getCode()]));

return $this->hidrateStoreConfig($storeConfig);
}

/**
* Transform StoreConfig object to in array format
*
* @param StoreConfigInterface $storeConfig
* @return array
*/
private function hidrateStoreConfig($storeConfig): array
{
/** @var StoreConfigInterface $storeConfig */
$storeConfigData = [
'id' => $storeConfig->getId(),
'code' => $storeConfig->getCode(),
'website_id' => $storeConfig->getWebsiteId(),
'locale' => $storeConfig->getLocale(),
'base_currency_code' => $storeConfig->getBaseCurrencyCode(),
'default_display_currency_code' => $storeConfig->getDefaultDisplayCurrencyCode(),
'timezone' => $storeConfig->getTimezone(),
'weight_unit' => $storeConfig->getWeightUnit(),
'base_url' => $storeConfig->getBaseUrl(),
'base_link_url' => $storeConfig->getBaseLinkUrl(),
'base_static_url' => $storeConfig->getSecureBaseStaticUrl(),
'base_media_url' => $storeConfig->getBaseMediaUrl(),
'secure_base_url' => $storeConfig->getSecureBaseUrl(),
'secure_base_link_url' => $storeConfig->getSecureBaseLinkUrl(),
'secure_base_static_url' => $storeConfig->getSecureBaseStaticUrl(),
'secure_base_media_url' => $storeConfig->getSecureBaseMediaUrl()
];

return $storeConfigData;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Magento\StoreGraphQl\Model\Resolver;

use Magento\Framework\GraphQl\Config\Element\Field;
use Magento\Framework\GraphQl\Query\Resolver\Value;
use Magento\Framework\GraphQl\Query\Resolver\ValueFactory;
use Magento\Framework\GraphQl\Query\ResolverInterface;
use Magento\Framework\GraphQl\Schema\Type\ResolveInfo;
use Magento\StoreGraphQl\Model\Resolver\Store\StoreConfigDataProvider;

/**
* StoreConfig page field resolver, used for GraphQL request processing.
*/
class StoreConfigResolver implements ResolverInterface
{
/**
* @var StoreConfigDataProvider
*/
private $storeConfigDataProvider;

/**
* @var ValueFactory
*/
private $valueFactory;

/**
* @param StoreConfigDataProvider $storeConfigsDataProvider
* @param ValueFactory $valueFactory
*/
public function __construct(
StoreConfigDataProvider $storeConfigsDataProvider,
ValueFactory $valueFactory
) {
$this->valueFactory = $valueFactory;
$this->storeConfigDataProvider = $storeConfigsDataProvider;
}

/**
* {@inheritdoc}
*/
public function resolve(
Field $field,
$context,
ResolveInfo $info,
array $value = null,
array $args = null
) : Value {

$storeConfigData = $this->storeConfigDataProvider->getStoreConfig();

$result = function () use ($storeConfigData) {
return !empty($storeConfigData) ? $storeConfigData : [];
};

return $this->valueFactory->create($result);
}
}
3 changes: 2 additions & 1 deletion app/code/Magento/StoreGraphQl/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"type": "magento2-module",
"require": {
"php": "~7.1.3||~7.2.0",
"magento/framework": "*"
"magento/framework": "*",
"magento/module-store": "*"
},
"suggest": {
"magento/module-graph-ql": "*",
Expand Down
22 changes: 22 additions & 0 deletions app/code/Magento/StoreGraphQl/etc/schema.graphqls
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Copyright © Magento, Inc. All rights reserved.
# See COPYING.txt for license details.
type Query {
storeConfig : StoreConfig @resolver(class: "Magento\\StoreGraphQl\\Model\\Resolver\\StoreConfigResolver") @doc(description: "The store config query")
}

type Website @doc(description: "The type contains information about a website") {
id : Int @doc(description: "The ID number assigned to the website")
Expand All @@ -9,3 +12,22 @@ type Website @doc(description: "The type contains information about a website")
default_group_id : String @doc(description: "The default group id that the website has")
is_default : Boolean @doc(description: "Specifies if this is the default website")
}

type StoreConfig @doc(description: "The type contains information about a store config") {
id : Int @doc(description: "The ID number assigned to the store")
code : String @doc(description: "A code assigned to the store to identify it")
website_id : Int @doc(description: "The ID number assigned to the website store belongs")
locale : String @doc(description: "Store locale")
base_currency_code : String @doc(description: "Base currency code")
default_display_currency_code : String @doc(description: "Default display currency code")
timezone : String @doc(description: "Timezone of the store")
weight_unit : String @doc(description: "The unit of weight")
base_url : String @doc(description: "Base URL for the store")
base_link_url : String @doc(description: "Base link URL for the store")
base_static_url : String @doc(description: "Base static URL for the store")
base_media_url : String @doc(description: "Base media URL for the store")
secure_base_url : String @doc(description: "Secure base URL for the store")
secure_base_link_url : String @doc(description: "Secure base link URL for the store")
secure_base_static_url : String @doc(description: "Secure base static URL for the store")
secure_base_media_url : String @doc(description: "Secure base media URL for the store")
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<small class="bugs">
<span><?= /* @escapeNotVerified */ __('Help Us Keep Magento Healthy') ?></span>
<a href="http://www.magentocommerce.com/bug-tracking"
target="_blank">
target="_blank" title="<?= /* @escapeNotVerified */ __('Report All Bugs') ?>">
<?= /* @escapeNotVerified */ __('Report All Bugs') ?>
</a>
</small>
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<a class="logo" href="<?= $block->getUrl('') ?>" title="<?= /* @escapeNotVerified */ $storeName ?>">
<?php endif ?>
<img src="<?= /* @escapeNotVerified */ $block->getLogoSrc() ?>"
title="<?= /* @escapeNotVerified */ $block->getLogoAlt() ?>"
alt="<?= /* @escapeNotVerified */ $block->getLogoAlt() ?>"
<?= $block->getLogoWidth() ? 'width="' . $block->getLogoWidth() . '"' : '' ?>
<?= $block->getLogoHeight() ? 'height="' . $block->getLogoHeight() . '"' : '' ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* 1. localStorage - A new feature of HTML 5, localStorage can store megabytes of data per domain
* on the client computer. Data stored in the localStorage area has no expiration date, so we must
* manage expiring the data ourselves. localStorage is fully supported by IE8, and it is supposed
* to be working in Firefox 3 and Safari 3.2, but in reality is is flaky in those browsers. As
* to be working in Firefox 3 and Safari 3.2, but in reality is flaky in those browsers. As
* HTML 5 gets wider support, the AutoSave plugin will use it automatically. In Windows Vista/7,
* localStorage is stored in the following folder:
* C:\Users\[username]\AppData\Local\Microsoft\Internet Explorer\DOMStore\[tempFolder]
Expand Down Expand Up @@ -297,7 +297,7 @@
},

/**
* This method will store the current contents in the the storage engine.
* This method will store the current contents in the storage engine.
*
* @method storeDraft
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
sel.setRng(oldRng);
sel.setContent('');

// For some odd reason we need to detach the the mceInsertContent call from the paste event
// For some odd reason we need to detach the mceInsertContent call from the paste event
// It's like IE has a reference to the parent element that you paste in and the selection gets messed up
// when it tries to restore the selection
setTimeout(function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
-->
<div data-role="loader" class="loading-mask" style="position: absolute;">
<div class="loader">
<img src="<%= loaderImageHref %>" alt="Loading..." style="position: absolute;">
<img src="<%= loaderImageHref %>" alt="Loading..." title="Loading..." style="position: absolute;">
</div>
</div>
Loading

0 comments on commit d120ac1

Please sign in to comment.