[Rt-commit] rt branch, 5.0-trunk, updated. rt-5.0.0alpha1-412-gdf0ec7ebd7

Jim Brandt jbrandt at bestpractical.com
Fri May 8 17:15:29 EDT 2020


The branch, 5.0-trunk has been updated
       via  df0ec7ebd77a83c899e0ca1708d927b694f04d3a (commit)
       via  fe707a00265eed0ef6ff183a11bfeb7c66decdcd (commit)
       via  21e4b5662a289b0f6e90accb2e89204267a969a4 (commit)
       via  dcca8130163b4802e01268cbb123801da69f91ef (commit)
       via  eab5cffd3ea8e346ebf7c44bf4a49c63f8838ab1 (commit)
      from  bc0f3acaa39ba4232444a915c8058dd6237dc659 (commit)

Summary of changes:
 share/html/Elements/SelectOwnerAutocomplete | 32 +----------------------------
 share/html/Elements/SelectOwnerDropdown     |  2 +-
 share/html/Elements/SelectSLA               |  2 +-
 share/html/Elements/SelectTimeUnits         |  2 +-
 share/static/js/autocomplete.js             |  9 ++++++++
 5 files changed, 13 insertions(+), 34 deletions(-)

- Log -----------------------------------------------------------------
commit eab5cffd3ea8e346ebf7c44bf4a49c63f8838ab1
Author: michel <michel at bestpractical.com>
Date:   Fri May 1 16:35:04 2020 +0200

    Remove duplicate "Owner" select id introduced by inline edit in search results
    
    Add it to the class to give some easy selector to access.

diff --git a/share/html/Elements/SelectOwnerDropdown b/share/html/Elements/SelectOwnerDropdown
index b685df8bd3..202b9d7c88 100644
--- a/share/html/Elements/SelectOwnerDropdown
+++ b/share/html/Elements/SelectOwnerDropdown
@@ -45,7 +45,7 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-<select name="<%$Name%>" id="<%$Name%>" class="selectpicker form-control">
+<select name="<%$Name%>" class="selectpicker form-control <%$Name%>">
 %if ($DefaultValue) {
 <option value=""<% !$Default ? qq[ selected="selected"] : '' |n %>><%$DefaultLabel |n%></option>
 %}

commit dcca8130163b4802e01268cbb123801da69f91ef
Author: michel <michel at bestpractical.com>
Date:   Fri May 1 16:36:03 2020 +0200

    Remove duplicate SLA id introduced by inline edit in search results

diff --git a/share/html/Elements/SelectSLA b/share/html/Elements/SelectSLA
index e4759901df..ca58d5dbca 100644
--- a/share/html/Elements/SelectSLA
+++ b/share/html/Elements/SelectSLA
@@ -45,7 +45,7 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-<select name="<%$Name%>" id="<%$Name%>" class="form-control selectpicker">
+<select name="<%$Name%>" class="form-control selectpicker <%$Name%>">
 % if ($DefaultValue) {
 <option value=""<% !$Default ? qq[ selected="selected"] : '' |n %>><%$DefaultLabel |n%></option>
 % }

commit 21e4b5662a289b0f6e90accb2e89204267a969a4
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu May 7 15:13:18 2020 +0800

    Remove duplicate TimeUnit id introduced by inline edit in search results

diff --git a/share/html/Elements/SelectTimeUnits b/share/html/Elements/SelectTimeUnits
index bbda067ad7..e33085d447 100644
--- a/share/html/Elements/SelectTimeUnits
+++ b/share/html/Elements/SelectTimeUnits
@@ -45,7 +45,7 @@
 %# those contributions and any derivatives thereof.
 %#
 %# END BPS TAGGED BLOCK }}}
-<select class="selectpicker form-control TimeUnits" id="<% $Name %>" name="<% $Name %>">
+<select class="selectpicker form-control TimeUnits" name="<% $Name %>">
 <option value="minutes" <% $Default eq 'minutes' ? 'selected="selected"' : '' |n%>>
     <% loc('Minutes') %>
 </option>

commit fe707a00265eed0ef6ff183a11bfeb7c66decdcd
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Thu May 7 15:00:26 2020 +0800

    Migrate owner autocomplete to the general autocomplete
    
    The initial reason is to remove the duplicate "Owner" id in search
    results when InlineEdit is enabled.
    
    Previous owner autocomplete had a simple client cache mechanism, but the
    general autcomplete feature doesn't have that yet. We can come back to
    this if there is a performance issue in the future.

diff --git a/share/html/Elements/SelectOwnerAutocomplete b/share/html/Elements/SelectOwnerAutocomplete
index b47b5c750f..2861c755ba 100644
--- a/share/html/Elements/SelectOwnerAutocomplete
+++ b/share/html/Elements/SelectOwnerAutocomplete
@@ -67,36 +67,6 @@ if ( $Default and not $Default =~ /\D/ ) {
 
 # Map to a string of RT::Ticket-1|RT::Queue-5|...
 my $limit = join '|', map { join '-', ref($_), ($_->id || '') } @$Objects;
-
-my $query = $m->comp('/Elements/QueryString',
-    return  => $ValueAttribute,
-    limit   => $limit,
-);
 </%INIT>
 
-<input type="text" name="<%$Name%>" id="<%$Name%>" value="<% $value %>" class="form-control" />
-<script type="text/javascript">
-    jQuery(function() {
-        var cache = {};
-        jQuery("#"+<% $Name |n,j%>).autocomplete({
-            minLength: 2,
-            source: function(request, response) {
-                if ( request.term in cache ) {
-                    response( cache[ request.term ] );
-                }
-                else {
-                    jQuery.ajax({
-                        url: RT.Config.WebPath + "/Helpers/Autocomplete/Owners?"+<% $query|n,j %>,
-                        dataType: "json",
-                        data: request,
-                        success: function( data ) {
-                            cache[ request.term ] = data;
-                            response( data );
-                        }
-                    });
-                }
-            }
-        });
-    });
-</script>
-
+<input type="text" name="<%$Name%>" value="<% $value %>" data-autocomplete="Owners" data-autocomplete-return="<% $ValueAttribute %>" data-autocomplete-limit="<% $limit %>" class="form-control" />
diff --git a/share/static/js/autocomplete.js b/share/static/js/autocomplete.js
index dae90ba9eb..c56ea33218 100644
--- a/share/static/js/autocomplete.js
+++ b/share/static/js/autocomplete.js
@@ -3,6 +3,7 @@ if (!window.RT.Autocomplete) window.RT.Autocomplete = {}
 
 window.RT.Autocomplete.Classes = {
     Users: 'user',
+    Owners: 'owner',
     Groups: 'group',
     Tickets: 'tickets',
     Queues: 'queues',
@@ -129,6 +130,9 @@ window.RT.Autocomplete.bind = function(from) {
             options.minLength = 2;
             options.delay = 2;
         }
+        else if (what == 'Owners') {
+            options.minLength = 2;
+        }
 
         if (input.is('[data-autocomplete-privileged]')) {
             queryargs.push("privileged=1");
@@ -197,6 +201,11 @@ window.RT.Autocomplete.bind = function(from) {
             queryargs.push("exclude="+exclude);
         }
 
+        var limit = input.attr("data-autocomplete-limit");
+        if (limit) {
+            queryargs.push("limit="+limit);
+        }
+
         if (queryargs.length)
             options.source += "?" + queryargs.join("&");
 

commit df0ec7ebd77a83c899e0ca1708d927b694f04d3a
Merge: bc0f3acaa3 fe707a0026
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri May 8 17:01:19 2020 -0400

    Merge branch '5.0/fix-inline-edit-duplicate-ids' into 5.0-trunk


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


More information about the rt-commit mailing list