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

BPS Git Server git at git.bestpractical.com
Mon Nov 28 13:33:54 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  f59c723bb8f4aecd68bc2f02fcc56676cfbe6a62 (commit)

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

    Set EmailAddress default return value for EmailInput
    
    The user autocomplete helper current defaults to EmailAddress if
    no return is passed. Set this explicitly as the default for EmailInput
    to protect against the autocomplete being changed to a different field.

diff --git a/share/html/Elements/EmailInput b/share/html/Elements/EmailInput
index 34ae19eb1d..fcbc79f766 100644
--- a/share/html/Elements/EmailInput
+++ b/share/html/Elements/EmailInput
@@ -147,7 +147,7 @@ $Default => ''
 $Autocomplete => 1
 $AutocompleteType => 'Users'
 $AutocompleteMultiple => 0
-$AutocompleteReturn => ''
+$AutocompleteReturn => 'EmailAddress'
 $AutocompleteNobody => 0
 $AutocompleteSystem => 0
 $EntryHint => ''

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