@@ -11,18 +11,21 @@ require([
1111
1212 $ ( function ( ) {
1313 const engineField = $ ( '#catalog_search_engine' ) ,
14- commentContainer = $ ( '#row_catalog_search_engine p' ) ;
14+ commentContainer = $ ( '#row_catalog_search_engine p' ) ,
15+ defaultText = $ . mage . __ ( 'If not specified, Default Search Engine will be used.' ) ,
16+ unsupportedText = $ . mage . __ ( 'This search engine option is no longer supported by Adobe. ' +
17+ 'It is recommended to use OpenSearch as a search engine instead.' ) ,
18+ updateCommentText = ( ) => {
19+ const engineValue = engineField . val ( ) ,
20+ newCommentText = [ 'elasticsearch7' , 'elasticsearch8' ] . includes ( engineValue ) ?
21+ unsupportedText : defaultText ;
1522
16- engineField . change ( ( ) => {
17- const engineValue = engineField . val ( ) ;
18- let commentText = $ . mage . __ ( 'If not specified, Default Search Engine will be used.' ) ;
23+ if ( commentContainer . text ( ) !== newCommentText ) {
24+ commentContainer . text ( newCommentText ) ;
25+ }
26+ } ;
1927
20- if ( [ 'elasticsearch7' , 'elasticsearch8' ] . includes ( engineValue ) ) {
21- commentText = $ . mage . __ ( 'This search engine option is no longer supported by Adobe. ' +
22- 'It is recommended to use OpenSearch as a search engine instead.' ) ;
23- }
24-
25- commentContainer . text ( commentText ) ;
26- } ) ;
28+ engineField . change ( updateCommentText ) ;
29+ updateCommentText ( ) ;
2730 } ) ;
2831} ) ;
0 commit comments