[Rt-commit] rt branch, 4.4/role-group-input, repushed

Shawn Moore shawn at bestpractical.com
Thu May 18 12:01:46 EDT 2017


The branch 4.4/role-group-input was deleted and repushed:
       was 82dd14dd6c5723d14da24616507e882f2382d9c8
       now a74de15605f7a71751289bcfe502f492a862d854

1:  5df72a7 < -:  ------- Use CanonicalizePrincipal in DeleteWatcher
-:  ------- > 1:  1938011 Reuse CanonicalizePrincipal in DeleteRoleMember
2:  cd17741 ! 2:  cff80a9 Handle Group:Name and Group:ID in role input fields
    @@ -1,6 +1,16 @@
     Author: Shawn M Moore <shawn at bestpractical.com>
     
         Handle Group:Name and Group:ID in role input fields
    +    
    +    This was already implicitly available by providing a numeric id in the
    +    role input field, but this capability makes it easier for end users.
    +    
    +    This reuses _ResolveRoles in /Ticket/Create.html to scan for RT
    +    addresses; without this change, anything other than email addresses
    +    (specifically Group:Foo) will be stripped from the builtin role input
    +    fields. (This check must be done on /Ticket/Create.html, not later, so
    +    that we can cancel the form submission and let the user fix their
    +    error.)
     
     diff --git a/lib/RT/Record/Role/Roles.pm b/lib/RT/Record/Role/Roles.pm
     --- a/lib/RT/Record/Role/Roles.pm
3:  d45dc7c ! 3:  3e0bced Autocompleter for Principals (users and groups)
    @@ -1,6 +1,17 @@
     Author: Shawn M Moore <shawn at bestpractical.com>
     
    -    Add principals (user and group) autocompleter
    +    Autocompleter for Principals (users and groups)
    +    
    +    This is a combination of the autocompleter for users and groups. Both
    +    object types will be searched, and their results will be displayed
    +    alongside eachother. The return value is hardcoded: for users, return
    +    their email address, for groups, return "Group:Name" (or if "Name"
    +    matches any autocomplete delimiter, "Group:ID"). This corresponds with
    +    what RT::Record::Role::Roles::_ResolveRoles accepts.
    +    
    +    Autocompleters can now display an extra line of information (called
    +    "detail"); for Principals it's used to display whether the record is a
    +    user or group.
     
     diff --git a/share/html/Elements/EmailInput b/share/html/Elements/EmailInput
     --- a/share/html/Elements/EmailInput
    @@ -32,7 +43,7 @@
     +%#
     +%# COPYRIGHT:
     +%#
    -+%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
    ++%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC
     +%#                                          <sales at bestpractical.com>
     +%#
     +%# (Except where explicitly superseded by other copyright notices)
    @@ -151,7 +162,7 @@
     +my @suggestions;
     +
     +while ( my $user = $users->Next ) {
    -+    my $suggestion = { id => $user->id, label => $user->Format, value => $user->$return, type => loc('User') };
    ++    my $suggestion = { id => $user->id, label => $user->Format, value => $user->$return, detail => loc('User') };
     +    $m->callback( CallbackName => "ModifySuggestion", suggestion => $suggestion, user => $user );
     +    push @suggestions, $suggestion;
     +}
    @@ -163,7 +174,7 @@
     +    # parsing problems
     +    $value = 'Group:' . $group->id if $delim && $value =~ $delim;
     +
    -+    my $suggestion = { id => $group->Id, label => $group->Label, value => $value, type => loc('Group') };
    ++    my $suggestion = { id => $group->Id, label => $group->Label, value => $value, detail => loc('Group') };
     +    $m->callback( CallbackName => "ModifySuggestion", suggestion => $suggestion, group => $group );
     +    push @suggestions, $suggestion;
     +
    @@ -178,7 +189,7 @@
          font-size: .8em;
      }
      
    -+.ui-autocomplete .recordtype {
    ++.ui-autocomplete .detail {
     +    display: block;
     +    font-size: .8em;
     +    font-style: italic;
    @@ -206,10 +217,10 @@
                      else
                          rendered.html( item.html );
      
    -+                if (item.type) {
    -+                    var type = jQuery('<span class="recordtype">');
    -+                    type.text(item.type);
    -+                    rendered.append(type);
    ++                if (item.detail) {
    ++                    var detail = jQuery('<span class="detail">');
    ++                    detail.text(item.detail);
    ++                    rendered.append(detail);
     +                }
     +
                      return jQuery("<li/>")
4:  82dd14d ! 4:  a74de15 Switch to Principals autocompleter for role input fields
    @@ -1,6 +1,18 @@
     Author: Shawn M Moore <shawn at bestpractical.com>
     
    -    Use principals autocompleter for role input fields
    +    Switch to Principals autocompleter for role input fields
    +    
    +    This lets users easily specify groups for watchers and custom roles,
    +    even on the ticket create page.
    +    
    +    The capability was previously there by specifying a group by ID, but
    +    that was a largely-unknown hidden feature.
    +    
    +    This fixes an inconsistency where managing custom role members on bulk
    +    update would accept multiple users; now it is consistent with core role
    +    fields that accept only a single member.
    +    
    +    Fixes: #32311
     
     diff --git a/share/html/Asset/Elements/EditPeople b/share/html/Asset/Elements/EditPeople
     --- a/share/html/Asset/Elements/EditPeople
    @@ -24,7 +36,7 @@
     +%#
     +%# COPYRIGHT:
     +%#
    -+%# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
    ++%# This software is Copyright (c) 1996-2017 Best Practical Solutions, LLC
     +%#                                          <sales at bestpractical.com>
     +%#
     +%# (Except where explicitly superseded by other copyright notices)



More information about the rt-commit mailing list