[ARVADOS] updated: 1.3.0-1749-g13ac0cadc

Git user git at public.curoverse.com
Wed Oct 16 18:04:24 UTC 2019


Summary of changes:
 apps/workbench/app/assets/javascripts/components/search.js   |  5 +----
 apps/workbench/app/assets/javascripts/filterable.js          |  2 +-
 .../assets/javascripts/{to_tsquery.js => ilike_filters.js}   | 12 ++++++------
 3 files changed, 8 insertions(+), 11 deletions(-)
 rename apps/workbench/app/assets/javascripts/{to_tsquery.js => ilike_filters.js} (69%)

       via  13ac0cadc7b65d2ab5ba3b3919dc55d06b85c3d5 (commit)
      from  b936759134f8d2b1a68b19be06de8a3f41f782d8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 13ac0cadc7b65d2ab5ba3b3919dc55d06b85c3d5
Author: Lucas Di Pentima <ldipentima at veritasgenetics.com>
Date:   Wed Oct 16 15:03:01 2019 -0300

    15429: Renames ilike_filters function & file. Fixes comments, tidies up code.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <ldipentima at veritasgenetics.com>

diff --git a/apps/workbench/app/assets/javascripts/components/search.js b/apps/workbench/app/assets/javascripts/components/search.js
index 6af2dcacc..fc6308678 100644
--- a/apps/workbench/app/assets/javascripts/components/search.js
+++ b/apps/workbench/app/assets/javascripts/components/search.js
@@ -142,10 +142,7 @@ window.Search = {
                                 sessionKey: key,
                                 loadFunc: function(filters) {
                                     // Apply additional type dependant filters
-                                    filters = filters.concat(obj_type.filters)
-                                    to_tsquery_filters(q).forEach(function(f) {
-                                        filters.push(f)
-                                    })
+                                    filters = filters.concat(obj_type.filters).concat(ilike_filters(q))
                                     return vnode.state.sessionDB.request(session, obj_type.api_path, {
                                         data: {
                                             filters: JSON.stringify(filters),
diff --git a/apps/workbench/app/assets/javascripts/filterable.js b/apps/workbench/app/assets/javascripts/filterable.js
index 768ff52d9..bf859c350 100644
--- a/apps/workbench/app/assets/javascripts/filterable.js
+++ b/apps/workbench/app/assets/javascripts/filterable.js
@@ -61,7 +61,7 @@
 function updateFilterableQueryNow($target) {
     var newquery = $target.data('filterable-query-new');
     var params = $target.data('infinite-content-params-filterable') || {};
-    params.filters = to_tsquery_filters(newquery);
+    params.filters = ilike_filters(newquery);
     $(".modal-dialog-preview-pane").html("");
     $target.data('infinite-content-params-filterable', params);
     $target.data('filterable-query', newquery);
diff --git a/apps/workbench/app/assets/javascripts/to_tsquery.js b/apps/workbench/app/assets/javascripts/ilike_filters.js
similarity index 69%
rename from apps/workbench/app/assets/javascripts/to_tsquery.js
rename to apps/workbench/app/assets/javascripts/ilike_filters.js
index 6957a5fe8..d2b549a53 100644
--- a/apps/workbench/app/assets/javascripts/to_tsquery.js
+++ b/apps/workbench/app/assets/javascripts/ilike_filters.js
@@ -2,15 +2,15 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-// to_tsquery_filters() converts a user-entered search query to a list of
-// filters using the newly added (as for arvados 1.5) trigram indexes. It returns
-// null if it can't come up with anything valid (e.g., q consists entirely of
-// punctuation).
+// ilike_filters() converts a user-entered search query to a list of
+// filters using the newly added (as of Arvados 1.5) trigram indexes. It returns
+// [] (empty list) if it can't come up with anything valid (e.g., q consists
+// entirely of punctuation).
 //
 // Examples:
 //
 // "foo"     => [["any", "ilike", "%foo%"]]
-// "foo.bar" => [["any", "ilike", "%foo.bar%"]]                         // "." is a word char in FT queries
+// "foo.bar" => [["any", "ilike", "%foo.bar%"]]                         // "." is a word char in ilike queries
 // "foo/b-r" => [["any", "ilike", "%foo/b-r%"]]                         // "/" and "-", too
 // "foo bar" => [["any", "ilike", "%foo%"], ["any", "ilike", "%bar%"]]
 // "foo|bar" => [["any", "ilike", "%foo%"], ["any", "ilike", "%bar%"]]
@@ -18,7 +18,7 @@
 // ""        => []
 // " "       => []
 // null      => []
-window.to_tsquery_filters = function(q) {
+window.ilike_filters = function(q) {
     q = (q || '').replace(/[^-\w\.\/]+/g, ' ').trim()
     if (q == '')
         return []

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list