[Rt-commit] rt branch 5.0/onetimecc-email-lookups created. rt-5.0.3-142-g4ddacf1a86

BPS Git Server git at git.bestpractical.com
Fri Oct 21 19:39:16 UTC 2022


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "rt".

The branch, 5.0/onetimecc-email-lookups has been created
        at  4ddacf1a86d5dd96a88e565cd1e78315df4f3566 (commit)

- Log -----------------------------------------------------------------
commit 4ddacf1a86d5dd96a88e565cd1e78315df4f3566
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Oct 21 15:25:58 2022 -0400

    Specify return value for user autocomplete lookup
    
    The user autocomplete helper current defaults to EmailAddress if
    no return is passed. Set this explicitly for the Cc email input
    to protect against that default being set to a different field.

diff --git a/share/html/Ticket/Elements/UpdateCc b/share/html/Ticket/Elements/UpdateCc
index 83a73272a8..9ddcc8eabd 100644
--- a/share/html/Ticket/Elements/UpdateCc
+++ b/share/html/Ticket/Elements/UpdateCc
@@ -52,7 +52,7 @@
     <&|/l&>One-time Cc</&>:
   </div>
   <div class="value col-9">
-    <& /Elements/EmailInput, Name => 'UpdateCc', Size => undef, Default => $ARGS{UpdateCc}, AutocompleteMultiple => 1, Options => \@one_time_Ccs &>
+    <& /Elements/EmailInput, Name => 'UpdateCc', Size => undef, Default => $ARGS{UpdateCc}, AutocompleteMultiple => 1, Options => \@one_time_Ccs, AutocompleteReturn => 'EmailAddress' &>
     <input type="hidden" id="UpdateIgnoreAddressCheckboxes" name="UpdateIgnoreAddressCheckboxes" value="<% $ARGS{UpdateIgnoreAddressCheckboxes} || 0 %>">
   </div>
 </div>
@@ -106,7 +106,7 @@
     <&|/l&>One-time Bcc</&>:
   </div>
   <div class="value col-9">
-    <& /Elements/EmailInput, Name => 'UpdateBcc', Size => undef, Default => $ARGS{UpdateBcc}, AutocompleteMultiple => 1, Options => \@one_time_Ccs &>
+    <& /Elements/EmailInput, Name => 'UpdateBcc', Size => undef, Default => $ARGS{UpdateBcc}, AutocompleteMultiple => 1, Options => \@one_time_Ccs, AutocompleteReturn => 'EmailAddress' &>
   </div>
 </div>
 

commit 83919ecca0b008cddc88e618a3f65f6fdd678439
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri Oct 21 15:11:02 2022 -0400

    Specify equals comparison for one-time email lookup performance
    
    The current EmailInput code queries the user autocomplete helper
    with no operator, so it uses the default "UserSearchFields" which
    searches on EmailAddress, Name, and RealName, all with LIKE
    searches, which can be slow.
    
    This component is an EmailInput, so values provided as options
    should be emails. Set the operator to = for a faster search.
    The user autocomplete defaults to searching for only EmailAddress.

diff --git a/share/html/Elements/EmailInput b/share/html/Elements/EmailInput
index c3b53b7a91..34ae19eb1d 100644
--- a/share/html/Elements/EmailInput
+++ b/share/html/Elements/EmailInput
@@ -112,6 +112,7 @@ if ($AutocompleteMultiple) {
         my $json = $m->scomp(
             '/Helpers/Autocomplete/Users',
             term => $term,
+            op   => '=',
             max  => 1,
             $AutocompleteReturn ? ( return => $AutocompleteReturn ) : (),
             abort => 0,

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


hooks/post-receive
-- 
rt


More information about the rt-commit mailing list