Skip to content

Commit

Permalink
Merge pull request #3802 from magento-arcticfoxes/2.3.1-qwerty-pr
Browse files Browse the repository at this point in the history
[2.3.1-qwerty] Sync with 2.3.1-release
  • Loading branch information
joanhe authored Feb 26, 2019
2 parents 3436aed + dd4b57d commit 5bd8493
Show file tree
Hide file tree
Showing 11 changed files with 62 additions and 24 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/Cms/Test/Mftf/Page/CmsPageEditPage.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
-->
<pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="urn:magento:mftf:Page/etc/PageObject.xsd">
<page name="CmsPageEditPage" area="admin" url="admin/cms_page/edit/page_id/{{var}}" parameterized="true">
<page name="CmsPageEditPage" area="admin" url="admin/cms_page/edit/page_id/{{var}}" parameterized="true" module="Magento_Cms">
<section name="CmsNewPagePageActionsSection"/>
<section name="CmsNewPagePageBasicFieldsSection"/>
<section name="CmsNewPagePageContentSection"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<element name="confProductSkuMessage" type="text" selector="//*[@name='configurable-matrix[{{arg}}][sku]']/following-sibling::label" parameterized="true"/>
<element name="variationsSkuInputByRow" selector="[data-index='configurable-matrix'] table > tbody > tr:nth-of-type({{row}}) input[name*='sku']" type="input" parameterized="true"/>
<element name="variationsSkuInputErrorByRow" selector="[data-index='configurable-matrix'] table > tbody > tr:nth-of-type({{row}}) .admin__field-error" type="text" parameterized="true"/>
<element name="variationLabel" type="text" selector="//div[@data-index='configurable-matrix']/label"/>
</section>
<section name="AdminConfigurableProductFormSection">
<element name="productWeight" type="input" selector=".admin__control-text[name='product[weight]']"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
</actionGroup>

<!-- assert color configurations on the admin create product page -->
<dontSee selector="{{AdminProductFormConfigurationsSection.variationLabel}}" stepKey="seeLabelNotVisible"/>
<seeNumberOfElements selector="{{AdminProductFormConfigurationsSection.currentVariationsRows}}" userInput="3" stepKey="seeNumberOfRows"/>
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{colorProductAttribute1.name}}" stepKey="seeAttributeName1InField"/>
<see selector="{{AdminProductFormConfigurationsSection.currentVariationsNameCells}}" userInput="{{colorProductAttribute2.name}}" stepKey="seeAttributeName2InField"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function modifyData(array $data)
{
Expand All @@ -101,7 +101,7 @@ public function modifyData(array $data)
}

/**
* {@inheritdoc}
* @inheritdoc
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function modifyMeta(array $meta)
Expand Down Expand Up @@ -160,6 +160,8 @@ public function modifyMeta(array $meta)
}

/**
* Returns configuration for dynamic rows
*
* @return array
*/
protected function getDynamicRows()
Expand All @@ -180,6 +182,8 @@ protected function getDynamicRows()
}

/**
* Returns Record column configuration
*
* @return array
*/
protected function getRecord()
Expand Down Expand Up @@ -221,6 +225,8 @@ protected function getRecord()
}

/**
* Returns Title column configuration
*
* @return array
*/
protected function getTitleColumn()
Expand All @@ -238,6 +244,7 @@ protected function getTitleColumn()
'componentType' => Form\Field::NAME,
'dataType' => Form\Element\DataType\Text::NAME,
'dataScope' => 'title',
'labelVisible' => false,
'validation' => [
'required-entry' => true,
],
Expand All @@ -247,6 +254,8 @@ protected function getTitleColumn()
}

/**
* Returns Price column configuration
*
* @return array
*/
protected function getPriceColumn()
Expand All @@ -265,6 +274,7 @@ protected function getPriceColumn()
'dataType' => Form\Element\DataType\Number::NAME,
'component' => 'Magento_Downloadable/js/components/price-handler',
'dataScope' => 'price',
'labelVisible' => false,
'addbefore' => $this->locator->getStore()->getBaseCurrency()
->getCurrencySymbol(),
'validation' => [
Expand All @@ -281,6 +291,8 @@ protected function getPriceColumn()
}

/**
* Returns File column configuration
*
* @return array
*/
protected function getFileColumn()
Expand All @@ -302,6 +314,7 @@ protected function getFileColumn()
'options' => $this->typeUpload->toOptionArray(),
'typeFile' => 'links_file',
'typeUrl' => 'link_url',
'labelVisible' => false,
];
$fileLinkUrl['arguments']['data']['config'] = [
'formElement' => Form\Element\Input::NAME,
Expand Down Expand Up @@ -344,6 +357,8 @@ protected function getFileColumn()
}

/**
* Returns Sample column configuration
*
* @return array
*/
protected function getSampleColumn()
Expand All @@ -363,6 +378,7 @@ protected function getSampleColumn()
'dataType' => Form\Element\DataType\Text::NAME,
'dataScope' => 'sample.type',
'options' => $this->typeUpload->toOptionArray(),
'labelVisible' => false,
'typeFile' => 'sample_file',
'typeUrl' => 'sample_url',
];
Expand All @@ -382,6 +398,7 @@ protected function getSampleColumn()
'component' => 'Magento_Downloadable/js/components/file-uploader',
'elementTmpl' => 'Magento_Downloadable/components/file-uploader',
'fileInputName' => 'link_samples',
'labelVisible' => false,
'uploaderConfig' => [
'url' => $this->urlBuilder->addSessionParam()->getUrl(
'adminhtml/downloadable_file/upload',
Expand All @@ -403,6 +420,8 @@ protected function getSampleColumn()
}

/**
* Returns Sharable columns configuration
*
* @return array
*/
protected function getShareableColumn()
Expand All @@ -420,6 +439,8 @@ protected function getShareableColumn()
}

/**
* Returns max downloads column configuration
*
* @return array
*/
protected function getMaxDownloadsColumn()
Expand All @@ -437,6 +458,7 @@ protected function getMaxDownloadsColumn()
'componentType' => Form\Field::NAME,
'dataType' => Form\Element\DataType\Number::NAME,
'dataScope' => 'number_of_downloads',
'labelVisible' => false,
'value' => 0,
'validation' => [
'validate-zero-or-greater' => true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function modifyData(array $data)
{
Expand All @@ -90,7 +90,7 @@ public function modifyData(array $data)
}

/**
* {@inheritdoc}
* @inheritdoc
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function modifyMeta(array $meta)
Expand Down Expand Up @@ -135,6 +135,8 @@ public function modifyMeta(array $meta)
}

/**
* Returns configuration for dynamic rows
*
* @return array
*/
protected function getDynamicRows()
Expand All @@ -155,6 +157,8 @@ protected function getDynamicRows()
}

/**
* Returns Record column configuration
*
* @return array
*/
protected function getRecord()
Expand Down Expand Up @@ -192,6 +196,8 @@ protected function getRecord()
}

/**
* Returns Title column configuration
*
* @return array
*/
protected function getTitleColumn()
Expand All @@ -209,6 +215,7 @@ protected function getTitleColumn()
'componentType' => Form\Field::NAME,
'dataType' => Form\Element\DataType\Text::NAME,
'dataScope' => 'title',
'labelVisible' => false,
'validation' => [
'required-entry' => true,
],
Expand All @@ -218,6 +225,8 @@ protected function getTitleColumn()
}

/**
* Returns Sample column configuration
*
* @return array
*/
protected function getSampleColumn()
Expand All @@ -236,6 +245,7 @@ protected function getSampleColumn()
'component' => 'Magento_Downloadable/js/components/upload-type-handler',
'dataType' => Form\Element\DataType\Text::NAME,
'dataScope' => 'type',
'labelVisible' => false,
'options' => $this->typeUpload->toOptionArray(),
'typeFile' => 'sample_file',
'typeUrl' => 'sample_url',
Expand All @@ -246,6 +256,7 @@ protected function getSampleColumn()
'dataType' => Form\Element\DataType\Text::NAME,
'dataScope' => 'sample_url',
'placeholder' => 'URL',
'labelVisible' => false,
'validation' => [
'required-entry' => true,
'validate-url' => true,
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Sales/Model/Order/Email/SenderBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ protected function configureEmailTemplate()
$this->transportBuilder->setTemplateIdentifier($this->templateContainer->getTemplateId());
$this->transportBuilder->setTemplateOptions($this->templateContainer->getTemplateOptions());
$this->transportBuilder->setTemplateVars($this->templateContainer->getTemplateVars());
$this->transportBuilder->setFromByStore(
$this->transportBuilder->setFromByScope(
$this->identityContainer->getEmailIdentity(),
$this->identityContainer->getStore()->getId()
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected function setUp()
'setTemplateIdentifier',
'setTemplateOptions',
'setTemplateVars',
'setFromByStore',
'setFromByScope',
]
);

Expand All @@ -103,7 +103,7 @@ protected function setUp()
->method('getEmailIdentity')
->will($this->returnValue($emailIdentity));
$this->transportBuilder->expects($this->once())
->method('setFromByStore')
->method('setFromByScope')
->with($this->equalTo($emailIdentity), 1);

$this->identityContainerMock->expects($this->once())
Expand Down Expand Up @@ -146,7 +146,7 @@ public function testSend()
->method('getId')
->willReturn(1);
$this->transportBuilder->expects($this->once())
->method('setFromByStore')
->method('setFromByScope')
->with($identity, 1);
$this->transportBuilder->expects($this->once())
->method('addTo')
Expand Down Expand Up @@ -176,7 +176,7 @@ public function testSendCopyTo()
->method('addTo')
->with($this->equalTo('example@mail.com'));
$this->transportBuilder->expects($this->once())
->method('setFromByStore')
->method('setFromByScope')
->with($identity, 1);
$this->identityContainerMock->expects($this->once())
->method('getStore')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
-->

<div class="admin__field" visible="visible" css="$data.additionalClasses">
<label class="admin__field-label" if="$data.label" attr="for: uid">
<label class="admin__field-label" if="$data.label" attr="for: uid" visible="$data.labelVisible">
<span translate="label" attr="'data-config-scope': $data.scopeLabel"/>
</label>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,7 @@
& > .admin__field-label {
#mix-grid .column(@field-label-grid__column, @field-grid__columns);
cursor: pointer;
background: @color-white;
left: 0;
position: absolute;
top: 0;
Expand Down
20 changes: 11 additions & 9 deletions lib/internal/Magento/Framework/Mail/Template/TransportBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,29 +177,30 @@ public function setReplyTo($email, $name = null)
/**
* Set mail from address
*
* @deprecated This function sets the from address for the first store only.
* new function setFromByStore introduced to allow setting of from address
* based on store.
* @see setFromByStore()
* @deprecated This function sets the from address but does not provide
* a way of setting the correct from addresses based on the scope.
* @see setFromByScope()
*
* @param string|array $from
* @return $this
* @throws \Magento\Framework\Exception\MailException
*/
public function setFrom($from)
{
return $this->setFromByStore($from, null);
return $this->setFromByScope($from, null);
}

/**
* Set mail from address by store
* Set mail from address by scopeId
*
* @param string|array $from
* @param string|int $store
* @param string|int $scopeId
* @return $this
* @throws \Magento\Framework\Exception\MailException
*/
public function setFromByStore($from, $store = null)
public function setFromByScope($from, $scopeId = null)
{
$result = $this->_senderResolver->resolve($from, $store);
$result = $this->_senderResolver->resolve($from, $scopeId);
$this->message->setFromAddress($result['email'], $result['name']);
return $this;
}
Expand Down Expand Up @@ -256,6 +257,7 @@ public function setTemplateOptions($templateOptions)
* Get mail transport
*
* @return \Magento\Framework\Mail\TransportInterface
* @throws LocalizedException
*/
public function getTransport()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,20 +167,20 @@ public function getTransportDataProvider()
/**
* @return void
*/
public function testSetFromByStore()
public function testSetFromByScope()
{
$sender = ['email' => 'from@example.com', 'name' => 'name'];
$store = 1;
$scopeId = 1;
$this->senderResolverMock->expects($this->once())
->method('resolve')
->with($sender, $store)
->with($sender, $scopeId)
->willReturn($sender);
$this->messageMock->expects($this->once())
->method('setFromAddress')
->with($sender['email'], $sender['name'])
->willReturnSelf();

$this->builder->setFromByStore($sender, $store);
$this->builder->setFromByScope($sender, $scopeId);
}

/**
Expand Down

0 comments on commit 5bd8493

Please sign in to comment.