Skip to content

Commit 9d0f570

Browse files
committed
AC-12481: Add text note when Elasticsearch option is selected in Admin Configuration
1 parent 0451916 commit 9d0f570

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
/**
4+
* Copyright 2024 Adobe
5+
* All Rights Reserved.
6+
*/
7+
-->
8+
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
9+
<body>
10+
<referenceContainer name="js">
11+
<block class="Magento\Backend\Block\Template" name="custom.config.js" template="Magento_CatalogSearch::custom_comment.phtml"/>
12+
</referenceContainer>
13+
</body>
14+
</page>
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
/**
3+
* Copyright 2024 Adobe
4+
* All Rights Reserved.
5+
*/
6+
?>
7+
<script type="text/x-magento-init">
8+
{
9+
"*": {
10+
"Magento_CatalogSearch/js/custom-comment": {}
11+
}
12+
}
13+
</script>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* Copyright 2024 Adobe
3+
* All Rights Reserved.
4+
*/
5+
require([
6+
'jquery',
7+
'domReady!'
8+
], function ($) {
9+
'use strict';
10+
11+
$(function () {
12+
const engineField = $('#catalog_search_engine'),
13+
commentContainer = $('#row_catalog_search_engine p');
14+
15+
engineField.change(() => {
16+
const engineValue = engineField.val();
17+
let commentText = 'If not specified, Default Search Engine will be used.';
18+
19+
if (['elasticsearch7', 'elasticsearch8'].includes(engineValue)) {
20+
commentText = 'This search engine option is no longer supported by Adobe. ' +
21+
'It is recommended to use OpenSearch as a search engine instead.';
22+
}
23+
24+
commentContainer.text(commentText);
25+
});
26+
});
27+
});

0 commit comments

Comments
 (0)