Edit-Flow icon indicating copy to clipboard operation
Edit-Flow copied to clipboard

jQuery - Redundant file common/js/jquery.quicksearch.js

Open htdat opened this issue 4 years ago • 1 comments

Coming from https://github.com/Automattic/Edit-Flow/pull/649/files#r645394254

Expected/Desired Behavior

Remove file common/js/jquery.quicksearch.js and clean up non-relevant code.

(Optional) Additional notes

tl;dr - We can ignore finding test cases for this file common/js/jquery.quicksearch.js as it's not clear how these events are triggered.

I can not find how this file is relevant to the current state of the plugin, therefore I can not find exactly how these events are triggered.

For example, if I comment out this whole file common/js/jquery.quicksearch.js, only post editors (either Classic or Block) are showing an error:

jquery.min.js?ver=3.5.1:2 Uncaught TypeError: jQuery(...).quicksearch is not a function (user-groups.js?ver=0.9.7-dev-1622795075:2)

Relevant line: https://github.com/Automattic/Edit-Flow/blob/8a52203127b483576410558f940097e583d6ef3d/modules/user-groups/lib/user-groups.js#L2

Even so, ef-post_following_users element does not exist on this page as well. I searched on HTML output and used this code in the browser console:

jQuery('#ef-post_following_users').length; // return 0

From @mikeyarce: Looks like the ef-post_following_users element was removed in 2011 here: https://github.com/Automattic/Edit-Flow/commit/69d37af1883016e4d3d1a9f437cefd5e48c23935#diff-b44786d9772fb20b5bac33f34764ac58b1bbaca4ba7755a28655bd81681c0057L738

htdat avatar Jun 09 '21 04:06 htdat

It turns out that there are multiple places in PHP loading this file common/js/jquery.quicksearch.js We may need to remove them too https://github.com/Automattic/Edit-Flow/search?q=quicksearch&type=

htdat avatar Jun 14 '21 09:06 htdat