Skip to content

Commit

Permalink
💯 Make block search case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
ZafarKamal123 committed Sep 25, 2023
1 parent 1db5167 commit 0a00afa
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 45 deletions.
2 changes: 1 addition & 1 deletion build/admin.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '3325fa0e31c8d56f849cff4cc5cb1f8a');
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '8a111d7e6103544a4b92b4d831e8e636');
2 changes: 1 addition & 1 deletion build/editor.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '826b1a7f75ffcee6417c3bea7442eb3b');
<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'b18f44b145c6705da98f72c96c3b4861');
2 changes: 1 addition & 1 deletion build/style.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-polyfill'), 'version' => 'f02afffefdcd14a37884d25410b0be1d');
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '315602804433712a9d480f29ec95226c');
2 changes: 1 addition & 1 deletion build/styles-manager-addon-style.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '75df66909d8e14b922ee4ee023ca871b');
<?php return array('dependencies' => array('wp-polyfill'), 'version' => '3209b8b8b4e7bd37fd5acda1a96c379b');
2 changes: 1 addition & 1 deletion build/styles-manager-addon.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-polyfill', 'wp-url'), 'version' => 'a076bffbaea56bc0cd2845ef77cb47fd');
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-polyfill', 'wp-url'), 'version' => '2c278acac2a03a00d246751d1f3d4965');
2 changes: 1 addition & 1 deletion build/styles-manager-addon.js
Original file line number Diff line number Diff line change
Expand Up @@ -14768,7 +14768,7 @@ function Sidebar() {
className: "gsm-menu-inner-wrapper"
}, namespacedTerms.map(function (term) {
var isActive = term.slug === (activeTerm === null || activeTerm === void 0 ? void 0 : activeTerm.slug);
var isFiltered = Object(lodash__WEBPACK_IMPORTED_MODULE_5__["isEmpty"])(searchQuery) ? true : (term === null || term === void 0 ? void 0 : term.name.indexOf(searchQuery)) !== -1;
var isFiltered = Object(lodash__WEBPACK_IMPORTED_MODULE_5__["isEmpty"])(searchQuery) ? true : (term === null || term === void 0 ? void 0 : term.name.toLowerCase().indexOf(searchQuery.toLowerCase())) !== -1;
return isFiltered && Object(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["createElement"])(_wordpress_components__WEBPACK_IMPORTED_MODULE_4__["MenuItem"], {
key: term.id,
isPressed: isActive,
Expand Down
44 changes: 6 additions & 38 deletions languages/editorskit.pot
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,14 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"X-Generator: babel-plugin-makepot\n"

#: src/addons/styles-manager/admin/components/content/post.js:112
msgid "Untitled Style"
#: src/addons/styles-manager/admin/components/sidebar/index.js:100
msgid "Search Block"
msgstr ""

#: src/addons/styles-manager/admin/components/content/post.js:124
msgid "Edit"
#: src/addons/styles-manager/admin/components/sidebar/index.js:75
msgid "Namespace"
msgstr ""

#: src/addons/styles-manager/admin/components/content/post.js:131
msgid "Fullscreen"
msgstr ""

#: src/addons/styles-manager/admin/components/content/post.js:139
msgid "More Actions"
msgstr ""

#: src/addons/styles-manager/admin/components/content/post.js:174
msgid "Delete Style"
msgstr ""

#: src/addons/styles-manager/admin/components/content/post.js:177
msgid "You wont be able to recover this style, are you sure?"
msgstr ""

#: src/addons/styles-manager/admin/components/content/post.js:193
msgid "Cancel"
msgstr ""

#: src/addons/styles-manager/admin/components/content/post.js:203
msgid "Deleting"
msgstr ""

#: src/addons/styles-manager/admin/components/content/post.js:204
msgid "Delete"
msgstr ""

#: src/addons/styles-manager/admin/components/content/post.js:53
msgid "Something went wrong when deleting the style."
msgstr ""

#: src/addons/styles-manager/admin/components/content/post.js:77
msgid "Something went wrong when deactivate the style."
#: src/addons/styles-manager/admin/components/sidebar/index.js:87
msgid "Block"
msgstr ""
6 changes: 5 additions & 1 deletion src/addons/styles-manager/admin/components/sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ function Sidebar() {
const isActive = term.slug === activeTerm?.slug;
const isFiltered = isEmpty(searchQuery)
? true
: term?.name.indexOf(searchQuery) !== -1;
: term?.name
.toLowerCase()
.indexOf(
searchQuery.toLowerCase()
) !== -1;

return (
isFiltered && (
Expand Down

0 comments on commit 0a00afa

Please sign in to comment.