Skip to content

Commit 94b423b

Browse files
committed
PR changes we applied:
- reduced text info in search results - injection of dependency was changed to optional (backward compatibility) - highlighting of found field - defined vertical size of results list
1 parent 30c1c5d commit 94b423b

File tree

5 files changed

+23
-8
lines changed

5 files changed

+23
-8
lines changed

app/code/Magento/Backend/Model/Search/Config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ public function findInStructure(ElementIterator $structureElementIterator, $need
6969
if (!($structureElement instanceof ElementInterface)) {
7070
continue;
7171
}
72-
$elementPathLabel = $pathLabel . '/' . $structureElement->getLabel();
7372
if (stripos((string)$structureElement->getLabel(), $needle) !== false) {
74-
$this->resultBuilder->add($structureElement, $elementPathLabel);
73+
$this->resultBuilder->add($structureElement, $pathLabel);
7574
}
75+
$elementPathLabel = $pathLabel . '/' . $structureElement->getLabel();
7676
if ($structureElement instanceof AbstractComposite && $structureElement->hasChildren()) {
7777
$this->findInStructure($structureElement->getChildren(), $needle, $elementPathLabel);
7878
}

app/code/Magento/Backend/Model/Search/Config/Result/Builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public function add(ElementInterface $structureElement, $elementPathLabel)
8888

8989
$this->results[] = [
9090
'id' => md5($structureElement->getPath()),
91-
'type' => __('Config'),
91+
'type' => null,
9292
'name' => $structureElement->getLabel(),
9393
'description' => $elementPathLabel,
9494
'url' => $this->urlBuilder->getUrl('*/system_config/edit', $urlParams),

app/code/Magento/Config/Block/System/Config/Edit.php

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
*/
1212
namespace Magento\Config\Block\System\Config;
1313

14+
use \Magento\Framework\App\ObjectManager;
15+
use \Magento\Framework\Serialize\Serializer\Json;
16+
1417
/**
1518
* @api
1619
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
@@ -48,17 +51,17 @@ class Edit extends \Magento\Backend\Block\Widget
4851
/**
4952
* @param \Magento\Backend\Block\Template\Context $context
5053
* @param \Magento\Config\Model\Config\Structure $configStructure
51-
* @param \Magento\Framework\Serialize\Serializer\Json $jsonSerializer
5254
* @param array $data
55+
* @param Json|null $jsonSerializer
5356
*/
5457
public function __construct(
5558
\Magento\Backend\Block\Template\Context $context,
5659
\Magento\Config\Model\Config\Structure $configStructure,
57-
\Magento\Framework\Serialize\Serializer\Json $jsonSerializer,
58-
array $data = []
60+
array $data = [],
61+
Json $jsonSerializer = null
5962
) {
6063
$this->_configStructure = $configStructure;
61-
$this->jsonSerializer = $jsonSerializer;
64+
$this->jsonSerializer = $jsonSerializer ?: ObjectManager::getInstance()->get(Json::class);
6265
parent::__construct($context, $data);
6366
}
6467

app/code/Magento/Config/view/adminhtml/templates/system/config/edit.phtml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
* getConfigSearchParamsJson() - string
1818
*/
1919
?>
20+
<style>
21+
.highlighted {
22+
background-color: rgb(255, 255, 153)!important;
23+
}
24+
</style>
2025
<form action="<?= /* @escapeNotVerified */ $block->getSaveUrl() ?>" method="post" id="config-edit-form" enctype="multipart/form-data">
2126
<?= $block->getBlockHtml('formkey') ?>
2227
<div class="accordion">
@@ -31,7 +36,8 @@ require([
3136
"mage/mage",
3237
"prototype",
3338
"mage/adminhtml/form",
34-
"domReady!"
39+
"domReady!",
40+
"jquery/ui"
3541
], function(jQuery, registry){
3642

3743
var adminSystemConfig = {
@@ -59,6 +65,10 @@ require([
5965
if ((typeof group !== 'undefined') && (typeof field !== 'undefined')) {
6066
var fieldElement = jQuery('#' + section + '_' + group + '_' + field);
6167
fieldElement.focus();
68+
fieldElement.addClass('highlighted');
69+
setTimeout(function() {
70+
fieldElement.removeClass('highlighted', 2000, "easeInBack");
71+
}, 3000);
6272
}
6373
},
6474
getUp: function (element, tag) {

app/design/adminhtml/Magento/backend/Magento_Backend/web/css/source/module/header/actions-group/_search.less

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@
8080
box-shadow: @component__box-shadow__base;
8181
left: 0;
8282
margin-top: -2px;
83+
max-height: 80vh;
84+
overflow: auto;
8385
padding: 0;
8486
position: absolute;
8587
right: 0;

0 commit comments

Comments
 (0)