Skip to content

Commit d02fd62

Browse files
author
Oleksii Korshenko
authored
Merge pull request magento#1750 from magento-engcom/2.2-develop-prs
Public Pull Requests magento#12387 Update CAPTCHA labels to reflect the symbols in the CAPTCHA image by @RhodriOwainDavies magento#12048 magento#11528 can't save customizable options by @luismiguelyangehuaman magento#12108 12064: Database Rollback not working with magento 2.1.9? by @RomaKis magento#11965 11792: Can't add customizable options to product by @RomaKis magento#11846 Fixed a js bug where ui_component labels have the wrong sort order. by @deiserh magento#11539 Fix depends field not working for radio elements by @jahvi Fixed Public Issues magento#11528 Validation prevents form closing magento#12064 Database Rollback not working with magento 2.1.9? magento#11792 Can't add customizable options to product magento#9360 field doesn't work in system.xml for "radios" fields
2 parents 08b20b5 + 235737f commit d02fd62

File tree

13 files changed

+133
-26
lines changed

13 files changed

+133
-26
lines changed

app/code/Magento/Captcha/i18n/en_US.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Always,Always
44
"Incorrect CAPTCHA","Incorrect CAPTCHA"
55
"Incorrect CAPTCHA.","Incorrect CAPTCHA."
66
"The account is locked. Please wait and try again or contact %1.","The account is locked. Please wait and try again or contact %1."
7-
"Please enter the letters from the image","Please enter the letters from the image"
7+
"Please enter the letters and numbers from the image","Please enter the letters and numbers from the image"
88
"<strong>Attention</strong>: Captcha is case sensitive.","<strong>Attention</strong>: Captcha is case sensitive."
99
"Reload captcha","Reload captcha"
10-
"Please type the letters below","Please type the letters below"
10+
"Please type the letters and numbers below","Please type the letters and numbers below"
1111
"Attention: Captcha is case sensitive.","Attention: Captcha is case sensitive."
1212
CAPTCHA,CAPTCHA
1313
"Enable CAPTCHA in Admin","Enable CAPTCHA in Admin"

app/code/Magento/Captcha/view/adminhtml/templates/default.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ $captcha = $block->getCaptchaModel();
1313
?>
1414
<div class="admin__field _required">
1515
<label for="captcha" class="admin__field-label">
16-
<span><?= $block->escapeHtml(__('Please enter the letters from the image')) ?></span>
16+
<span><?= $block->escapeHtml(__('Please enter the letters and numbers from the image')) ?></span>
1717
</label>
1818
<div class="admin__field-control">
1919
<input

app/code/Magento/Captcha/view/frontend/templates/default.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
$captcha = $block->getCaptchaModel();
1313
?>
1414
<div class="field captcha required" role="<?= $block->escapeHtmlAttr($block->getFormId()) ?>">
15-
<label for="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" class="label"><span><?= $block->escapeHtml(__('Please type the letters below')) ?></span></label>
15+
<label for="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" class="label"><span><?= $block->escapeHtml(__('Please type the letters and numbers below')) ?></span></label>
1616
<div class="control captcha">
1717
<input name="<?= $block->escapeHtmlAttr(\Magento\Captcha\Helper\Data::INPUT_NAME_FIELD_VALUE) ?>[<?= $block->escapeHtmlAttr($block->getFormId()) ?>]" type="text" class="input-text required-entry" data-validate="{required:true}" id="captcha_<?= $block->escapeHtmlAttr($block->getFormId()) ?>" />
1818
<div class="nested">
@@ -23,7 +23,7 @@ $captcha = $block->getCaptchaModel();
2323
"imageLoader": "<?= $block->escapeUrl($block->getViewFileUrl('images/loader-2.gif')) ?>",
2424
"type": "<?= $block->escapeHtmlAttr($block->getFormId()) ?>"}}'>
2525
<div class="control captcha-image">
26-
<img alt="<?= $block->escapeHtmlAttr(__('Please type the letters below')) ?>" class="captcha-img" height="<?= /* @noEscape */ (float) $block->getImgHeight() ?>" src="<?= $block->escapeUrl($captcha->getImgSrc()) ?>"/>
26+
<img alt="<?= $block->escapeHtmlAttr(__('Please type the letters and numbers below')) ?>" class="captcha-img" height="<?= /* @noEscape */ (float) $block->getImgHeight() ?>" src="<?= $block->escapeUrl($captcha->getImgSrc()) ?>"/>
2727
<button type="button" class="action reload captcha-reload" title="<?= $block->escapeHtmlAttr(__('Reload captcha')) ?>"><span><?= $block->escapeHtml(__('Reload captcha')) ?></span></button>
2828
</div>
2929
</div>

app/code/Magento/Captcha/view/frontend/web/template/checkout/captcha.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66
-->
77
<!-- ko if: (isRequired() && getIsVisible())-->
88
<div class="field captcha required" data-bind="blockLoader: getIsLoading()">
9-
<label data-bind="attr: {for: 'captcha_' + formId}" class="label"><span data-bind="i18n: 'Please type the letters below'"></span></label>
9+
<label data-bind="attr: {for: 'captcha_' + formId}" class="label"><span data-bind="i18n: 'Please type the letters and numbers below'"></span></label>
1010
<div class="control captcha">
1111
<input name="captcha_string" type="text" class="input-text required-entry" data-bind="value: captchaValue(), attr: {id: 'captcha_' + formId, 'data-scope': dataScope}" />
1212
<input name="captcha_form_id" type="hidden" data-bind="value: formId, attr: {'data-scope': dataScope}" />
1313
<div class="nested">
1414
<div class="field captcha no-label">
1515
<div class="control captcha-image">
1616
<img data-bind="attr: {
17-
alt: $t('Please type the letters below'),
17+
alt: $t('Please type the letters and numbers below'),
1818
height: imageHeight(),
1919
src: getImageSource(),
2020
}"

app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/CustomOptionsTest.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,16 @@ public function testModifyMeta()
154154
->method('getAll')
155155
->willReturn([]);
156156

157-
$this->assertArrayHasKey(CustomOptions::GROUP_CUSTOM_OPTIONS_NAME, $this->getModel()->modifyMeta([]));
157+
$meta = $this->getModel()->modifyMeta([]);
158+
159+
$this->assertArrayHasKey(CustomOptions::GROUP_CUSTOM_OPTIONS_NAME, $meta);
160+
161+
$buttonAdd = $meta['custom_options']['children']['container_header']['children']['button_add'];
162+
$buttonAddTargetName = $buttonAdd['arguments']['data']['config']['actions'][0]['targetName'];
163+
$expectedTargetName = '${ $.ns }.${ $.ns }.' . CustomOptions::GROUP_CUSTOM_OPTIONS_NAME
164+
. '.' . CustomOptions::GRID_OPTIONS_NAME;
165+
166+
$this->assertEquals($expectedTargetName, $buttonAddTargetName);
158167
}
159168

160169
/**

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/AdvancedPricing.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@
77

88
use Magento\Catalog\Api\Data\ProductAttributeInterface;
99
use Magento\Catalog\Model\Locator\LocatorInterface;
10-
use Magento\Customer\Model\Customer\Source\GroupSourceInterface;
11-
use Magento\Directory\Helper\Data;
12-
use Magento\Framework\App\ObjectManager;
13-
use Magento\Store\Model\StoreManagerInterface;
1410
use Magento\Customer\Api\GroupManagementInterface;
1511
use Magento\Customer\Api\GroupRepositoryInterface;
12+
use Magento\Customer\Model\Customer\Source\GroupSourceInterface;
13+
use Magento\Directory\Helper\Data;
1614
use Magento\Framework\Api\SearchCriteriaBuilder;
15+
use Magento\Framework\App\ObjectManager;
1716
use Magento\Framework\Module\Manager as ModuleManager;
17+
use Magento\Framework\Stdlib\ArrayManager;
18+
use Magento\Store\Model\StoreManagerInterface;
1819
use Magento\Ui\Component\Container;
1920
use Magento\Ui\Component\Form\Element\DataType\Number;
2021
use Magento\Ui\Component\Form\Element\DataType\Price;
@@ -23,7 +24,6 @@
2324
use Magento\Ui\Component\Form\Element\Select;
2425
use Magento\Ui\Component\Form\Field;
2526
use Magento\Ui\Component\Modal;
26-
use Magento\Framework\Stdlib\ArrayManager;
2727

2828
/**
2929
* Class AdvancedPricing
@@ -622,7 +622,7 @@ private function customizeAdvancedPricing()
622622
'componentType' => Modal::NAME,
623623
'dataScope' => '',
624624
'provider' => 'product_form.product_form_data_source',
625-
'onCancel' => 'actionDone',
625+
'onCancel' => 'closeModal',
626626
'options' => [
627627
'title' => __('Advanced Pricing'),
628628
'buttons' => [

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/CustomOptions.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,8 @@ protected function getHeaderContainerConfig($sortOrder)
348348
'sortOrder' => 20,
349349
'actions' => [
350350
[
351-
'targetName' => 'ns = ${ $.ns }, index = ' . static::GRID_OPTIONS_NAME,
351+
'targetName' => '${ $.ns }.${ $.ns }.' . static::GROUP_CUSTOM_OPTIONS_NAME
352+
. '.' . static::GRID_OPTIONS_NAME,
352353
'actionName' => 'processingAddChild',
353354
]
354355
]

app/code/Magento/Catalog/view/adminhtml/web/js/components/dynamic-rows-tier-price.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ define([
99
], function (_, DynamicRows) {
1010
'use strict';
1111

12+
/**
13+
* @deprecated Parent method contains labels sorting.
14+
* @see Magento_Ui/js/dynamic-rows/dynamic-rows
15+
*/
1216
return DynamicRows.extend({
1317

1418
/**

app/code/Magento/Ui/view/base/web/js/dynamic-rows/dynamic-rows.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,8 @@ define([
533533
* Init header elements
534534
*/
535535
initHeader: function () {
536-
var data;
536+
var labels = [],
537+
data;
537538

538539
if (!this.labels().length) {
539540
_.each(this.childTemplate.children, function (cell) {
@@ -547,8 +548,9 @@ define([
547548
sortOrder: cell.config.sortOrder
548549
});
549550

550-
this.labels.push(data);
551+
labels.push(data);
551552
}, this);
553+
this.labels(_.sortBy(labels, 'sortOrder'));
552554
}
553555
},
554556

dev/tests/js/jasmine/tests/app/code/Magento/Ui/base/js/dynamic-rows/dynamic-rows.test.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,43 @@ define([
131131
model.deleteRecord(1, 1);
132132
expect(model.recordData()).toEqual([]);
133133
});
134+
135+
it('"initHeader" sortOrder', function () {
136+
var labels = [{
137+
name: 'Name 1',
138+
config: {
139+
label: 'Label 1',
140+
validation: false,
141+
columnsHeaderClasses: '',
142+
sortOrder: 10
143+
}
144+
}, {
145+
name: 'Name 2',
146+
config: {
147+
label: 'Label 2',
148+
validation: false,
149+
columnsHeaderClasses: '',
150+
sortOrder: 5
151+
}
152+
}],
153+
result = [{
154+
label: 'Label 2',
155+
name: 'Name 2',
156+
required: false,
157+
columnsHeaderClasses: '',
158+
sortOrder: 5
159+
}, {
160+
label: 'Label 1',
161+
name: 'Name 1',
162+
required: false,
163+
columnsHeaderClasses: '',
164+
sortOrder: 10
165+
}];
166+
167+
model.childTemplate = {
168+
children: labels
169+
};
170+
expect(JSON.stringify(model.labels())).toEqual(JSON.stringify(result));
171+
});
134172
});
135173
});

0 commit comments

Comments
 (0)