From 95780626bffdde987f2596545418a06f50c46bee Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 05 2018 19:49:22 +0000 Subject: Fix loading the user list based on the input provided Rather than retrieving the entire list of user which can be fairly large just retrieve the portion corresponding to what the user is looking for. Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/issues.html b/pagure/templates/issues.html index cc7c14c..aa72da1 100644 --- a/pagure/templates/issues.html +++ b/pagure/templates/issues.html @@ -591,7 +591,7 @@ $(document).ready(function() { if (!query.length) return callback(); $.getJSON( "{{ url_for('api_ns.api_users') }}", { - pattern: query.term + pattern: "*"+query+"*" }, function( data ) { callback( data.users.map(function(x) { return { user: x }; }) ); @@ -616,7 +616,7 @@ var $author_selectize = $('#author-selectize').selectize({ if (!query.length) return callback(); $.getJSON( "{{ url_for('api_ns.api_users') }}", { - pattern: query.term + pattern: "*"+query+"*" }, function( data ) { callback( data.users.map(function(x) { return { user: x }; }) ); diff --git a/pagure/templates/requests.html b/pagure/templates/requests.html index 9f38af9..38a014b 100644 --- a/pagure/templates/requests.html +++ b/pagure/templates/requests.html @@ -57,21 +57,21 @@ {% else %} {{open_cnt+closed_cnt+merged_cnt}} All PRs - {% endif %} + {% endif %} @@ -319,12 +319,12 @@ $(document).ready(function() { $("#filters-dropdown").on('click', function(event){ event.stopPropagation(); }) - }, + }, load: function(query, callback) { if (!query.length) return callback(); $.getJSON( "{{ url_for('api_ns.api_users') }}", { - pattern: query.term + pattern: "*"+query+"*" }, function( data ) { callback( data.users.map(function(x) { return { user: x }; }) ); @@ -352,12 +352,12 @@ var $author_selectize = $('#author-selectize').selectize({ $("#filters-dropdown").on('click', function(event){ event.stopPropagation(); }) - }, + }, load: function(query, callback) { if (!query.length) return callback(); $.getJSON( "{{ url_for('api_ns.api_users') }}", { - pattern: query.term + pattern: "*"+query+"*" }, function( data ) { callback( data.users.map(function(x) { return { user: x }; }) ); @@ -385,7 +385,7 @@ $("#author-selectize-reset").on('click', function(e){ if ($('select[name="author"]').val() == ''){ $('select[name="author"]').prop("disabled", true); } - + }); });