[Rt-commit] rtir branch, 4.2/restore-previous-menu-2, repushed

Blaine Motsinger blaine at bestpractical.com
Fri May 15 17:03:12 EDT 2020


The branch 4.2/restore-previous-menu-2 was deleted and repushed:
       was 15bb25c98cfb1bf12ee547ad6d44c4c93a80ae60
       now 6966576706018752e23f29b4d9abe38930b42098

 1: 9c64af32 =  1: 9c64af32 Restore RTIR menu into single parent
 2: 39a3da54 =  2: 39a3da54 Align menu item with queue name for Incident Reports
 3: 520265b9 =  3: 520265b9 Explain menu change in UPGRADING doc
 4: 56765d4e =  4: 56765d4e Load incident create page without a queue
 5: db1ca1c6 =  5: db1ca1c6 Link directly to create pages in menus
 6: 62f0065f =  6: 62f0065f Update tests to find links after menu updates
 7: d8d63ae7 =  7: d8d63ae7 Link directly to updated create page rather than modal
 8: e8c54449 < --:  ------- Fix form name for creating tickets in tests
11: 578343e7 =  8: 9f6320a2 Remove CreateInQueue modal element and JS
12: 92ae79de !  9: b6fd8238 Add deprecated warning to CreateInQueue.html
    @@ -23,7 +23,7 @@
     +
     +CreateInQueue.html will be removed in a future version of RTIR.
     +Please update any links directly accessing CreateInQueue.html to
    -+instead link to RTIR/Create.html or RTIR/Incident/RTIR/Create.html.
    ++instead link to RTIR/Create.html or RTIR/Incident/Create.html.
     +
      =back
      
13: 1eca5131 ! 10: 5badd7c8 Fix default queue on create pages
    @@ -46,31 +46,17 @@
      );
      
     -# Use default queue from config site or user prefs if none provided
    --unless ($Queue) {
    ++# If the Queue is not passed in as an ARG, go get and set queue from the queues the user can CreateTicket.
    ++# For constituency users without access to the default RTIR queues we need to specifically check and limit
    ++# else we Abort below when we attempt to load the default queue as the user.
    + unless ($Queue) {
     -    $Queue = GetDefaultQueue();
    --}
    --
    --# pick first in list in normal order unless queue provided from form/url/defaults
    -+# If the Queue is not passed in as an ARG go get and set the default queue from the queues the user can CreateTicket.
    -+# For constituency users without access to the default RTIR queues we need to specifically check and limit else we
    -+# Abort below when we attempt to load the default queue as the user.
    -+# For creating tickets through the main navigation links, no Queue ARG is passed because we don't come from a context
    -+# where it would be known.
    - unless ($Queue) {
    -     my $cache_key = SetObjectSessionCache(
    -         ObjectType       => 'Queue',
    -@@
    -     $Queue = $session{$cache_key}{objects}[0]->{Id};
    - }
    - 
    --$session{DefaultQueue} = $Queue;
    -+unless ($Queue) {
     +    my $collection = RT::Queues->new($session{'CurrentUser'});
     +
     +    # RT::Queues::AddRecord verifies the user has 'SeeQueue', so we don't
     +    # need to specifically test for that in the while loop below.
     +    if ($Lifecycle) {
    -+        $collection->Limit(FIELD => 'Lifecycle', VALUE => $Lifecycle);
    ++        $collection->Limit(FIELD => 'Lifecycle', OPERATOR => '=', VALUE => $Lifecycle);
     +    }
     +    else {
     +        $collection->Limit(
    @@ -82,20 +68,23 @@
     +
     +    while (my $object = $collection->Next) {
     +        # Ensure the user can CreateTicket in the queue.
    -+        if ($session{CurrentUser}->HasRight( Object => $object, Right => 'CreateTicket' )) {
    -+            # We only need the first one here, no need to parse them all.
    -+            if ($object->Id) {
    -+                $Queue = $object->Id;
    -+                last;
    -+            }
    -+        }
    ++        next unless $session{CurrentUser}->HasRight( Object => $object, Right => 'CreateTicket' );
    ++
    ++        $Queue = $object->Id;
    ++        last;
     +    }
    -+}
    -+
    -+#$session{DefaultQueue} = $Queue;
    - 
    + }
    + 
    + # pick first in list in normal order unless queue provided from form/url/defaults
    +@@
    +     $Queue = $session{$cache_key}{objects}[0]->{Id};
    + }
    + 
    +-$session{DefaultQueue} = $Queue;
    +-
      my $QueueObj = RT::Queue->new( $session{'CurrentUser'} );
      $QueueObj->Load( $Queue );
    + 
     @@
       Abort( loc("Queue '[_1]' could not be loaded.",$Queue) );
       }
--:  ------- > 11: 675f332a small logic change
--:  ------- > 12: 22c0fd9b Fix available statuses on create pages
 9: 737e6174 ! 13: 0896f40a Update test library to create tickets directly
    @@ -1,14 +1,23 @@
     Author: Blaine Motsinger <blaine at bestpractical.com>
     
    -    Remove unneeded method call to fix tests
    +    Update test library to create tickets directly
         
    -    The additional steps performed by click_through_createinqueue are
    -    no longer needed since tickets are now created directly through
    -    the ticket create page.
    +    This commit updates the test library to create tickets through
    +    the Create.html pages instead of the deprecated CreateInQueue.html.
     
     diff --git a/lib/RT/IR/Test/Web.pm b/lib/RT/IR/Test/Web.pm
     --- a/lib/RT/IR/Test/Web.pm
     +++ b/lib/RT/IR/Test/Web.pm
    +@@
    +         warn "Failed to load queue: $queue";
    +     }
    + 
    +-    $self->get_ok("/RTIR/CreateInQueue.html?Lifecycle=$lifecycle");
    +-    $self->click_through_createinqueue( $queue );
    ++    $self->get_ok("/RTIR/" . ($lifecycle eq 'incidents' ? 'Incident/' : '') . "Create.html?Lifecycle=$lifecycle&Queue=" . $queue_obj->id);
    + 
    +     # set the form
    +     return $self->form_number(3);
     @@
          # Select the "New" link from the Display page
          $self->follow_link_ok({id => 'create-incident'}, "Followed 'New (Incident)' link")
    @@ -17,6 +26,26 @@
      
          $self->form_number(3);
      
    +@@
    +     return;
    + }
    + 
    +-
    +-sub click_through_createinqueue
    +-{
    +-    my $self = shift;
    +-    my $queue = shift || undef;
    +-
    +-    my %args;
    +-    $args{fields} = { Queue => $queue } if $queue;
    +-
    +-    $self->submit_form(
    +-        form_id => 'CreateInQueue',
    +-        %args,
    +-    );
    +-}
    +-
    + 1;
     
     diff --git a/t/020-incident-and-investigation.t b/t/020-incident-and-investigation.t
     --- a/t/020-incident-and-investigation.t
15: 15bb25c9 ! 14: 6f2221aa Update test for modal removal
    @@ -339,3 +339,4 @@
     +
     +undef $m;
     +done_testing;
    +
10: 3d0fbecb ! 15: 69665767 Fix test regexes for file link names
    @@ -1,6 +1,6 @@
     Author: Blaine Motsinger <blaine at bestpractical.com>
     
    -    Fix test regex for file link names
    +    Fix test regexes for file link names
     
     diff --git a/t/009-attachments-processing.t b/t/009-attachments-processing.t
     --- a/t/009-attachments-processing.t
    @@ -50,4 +50,3 @@
              );
              ok($attachment_link, "has link to attachment");
          }
    -
14: a3660775 < --:  ------- Update test library to create tickets directly



More information about the rt-commit mailing list