[Rt-commit] rt branch, 5.0-trunk, updated. rt-5.0.0alpha1-69-ga63e7ea575

? sunnavy sunnavy at bestpractical.com
Thu Apr 2 12:54:17 EDT 2020


The branch, 5.0-trunk has been updated
       via  a63e7ea575aa07270602cca87f4ba1961ff48988 (commit)
       via  e1ca246a211ad647d8e8aecc78bb520a91c7b9a2 (commit)
      from  96ccd1dabdb928d14309ae6c9a728172d18d1ceb (commit)

Summary of changes:
 share/html/SelfService/Create.html |  4 ++--
 t/web/compilation_errors.t         | 15 ++++++++++++++-
 2 files changed, 16 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit e1ca246a211ad647d8e8aecc78bb520a91c7b9a2
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Apr 1 03:35:55 2020 +0800

    Test if pages are fully rendered for both privileged and unprivleged users

diff --git a/t/web/compilation_errors.t b/t/web/compilation_errors.t
index eba9b6bbb8..29801f0767 100644
--- a/t/web/compilation_errors.t
+++ b/t/web/compilation_errors.t
@@ -10,7 +10,7 @@ BEGIN {
         -f && /\.html$/ && $_ !~ /Logout.html$/ && $File::Find::dir !~ /RichText/;
     }
     my $tests = 7;
-    find( sub { wanted() and $tests += 3 }, 'share/html/' );
+    find( sub { wanted() and $tests += 4 }, 'share/html/', 'share/html/SelfService/' );
     plan tests => $tests + 1; # plus one for warnings check
 }
 
@@ -41,6 +41,18 @@ $agent->content_contains('Logout', "Found a logout link");
 
 find ( { wanted => sub { wanted() and test_get($agent, $File::Find::name) }, no_chdir => 1 } , 'share/html/');
 
+my $customer = RT::Test->load_or_create_user(
+    Name         => 'user1',
+    Password     => 'password',
+    EmailAddress => 'user1 at example.com',
+    Privileged   => 0,
+);
+# Classic permission settings
+RT::Test->add_rights( { Principal => 'Everyone', Right => [qw(CreateTicket SeeQueue)] } );
+
+$agent->login( user1 => 'password', logout => 1 );
+find( { wanted => sub { wanted() and test_get( $agent, $File::Find::name ) }, no_chdir => 1 }, 'share/html/SelfService' );
+
 # We expect to spew a lot of warnings; toss them away
 $agent->get_warnings;
 
@@ -59,5 +71,6 @@ sub test_get {
                 diag "$file: $error";
             }
         };
+        $agent->content_contains('</html>', "Found HTML end tag");
 }
 

commit a63e7ea575aa07270602cca87f4ba1961ff48988
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Apr 1 03:22:26 2020 +0800

    Respect AllowUserAutocompleteForUnprivileged for email inputs in self service UI
    
    To selectize email inputs, "/Elements/EmailInput" calls
    "/Helpers/Autocomplete/Users" to get default user's info, which aborts
    if current user is not allowed to autocomplete.
    
    Thus when AllowUserAutocompleteForUnprivileged is off, the self service
    ticket create page would not work without this commit for unprivleged
    users.

diff --git a/share/html/SelfService/Create.html b/share/html/SelfService/Create.html
index 6e183380e9..51b18f29d5 100644
--- a/share/html/SelfService/Create.html
+++ b/share/html/SelfService/Create.html
@@ -72,7 +72,7 @@
 <&|/l&>Requestors</&>:
 </div>
 <div class="value col-md-9">
-<& /Elements/EmailInput, Name => 'Requestors', Size => '20', Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress, AutocompleteMultiple => 1 &>
+<& /Elements/EmailInput, Name => 'Requestors', Size => '20', Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress, AutocompleteMultiple => RT->Config->Get('AllowUserAutocompleteForUnprivileged') ? 1 : 0 &>
 </div>
 </div>
 <div class="form-row">
@@ -80,7 +80,7 @@
 <&|/l&>Cc</&>:
 </div>
 <div class="value col-md-9">
-<& /Elements/EmailInput, Name => 'Cc', Size => '20', Default => $ARGS{Cc} || '', AutocompleteMultiple => 1 &>
+<& /Elements/EmailInput, Name => 'Cc', Size => '20', Default => $ARGS{Cc} || '', AutocompleteMultiple => RT->Config->Get('AllowUserAutocompleteForUnprivileged') ? 1 : 0 &>
 </div>
 </div>
 <div class="form-row">

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


More information about the rt-commit mailing list