[Rt-commit] rtir branch, 4.2/restore-previous-menu-2, created. 4.0.1rc1-123-gd8d63ae7

Jim Brandt jbrandt at bestpractical.com
Fri May 8 17:04:42 EDT 2020


The branch, 4.2/restore-previous-menu-2 has been created
        at  d8d63ae75e92d5fcd31299a5fa831e5ce9bf558c (commit)

- Log -----------------------------------------------------------------
commit 9c64af32380f89a98c5e3f5414434bdf828aeedb
Author: Blaine Motsinger <blaine at bestpractical.com>
Date:   Thu Mar 26 18:39:00 2020 -0500

    Restore RTIR menu into single parent
    
    This commit restores the menu structure from RTIR 3.2 where the
    RTIR options all live under a single parent.
    
    In addition to causing issues with other extensions that modify the
    menu, the expanded RTIR menus make accessing RT menu items more
    difficult.  The RTIR items each only contain a single entry to
    create a ticket compared to the RT menu items which contain more
    options and sub menus.

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index c8a2f21f..f932345b 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -47,11 +47,6 @@
 %# END BPS TAGGED BLOCK }}}
 <%INIT>
 
-if ( $m->request_comp->path !~ m{^/RTIR/} ) {
-    Menu()->child( rtir => title => loc('RTIR'), path => RT::IR->HREFTo('', IncludeWebPath => 0) );
-    return;
-}
-
 my $query_string = sub {
     my %args = @_;
     my $u    = URI->new();
@@ -75,22 +70,9 @@ my $search_arguments = sub {
     return %res;
 };
 
+my $root = Menu->child( rtir => title => loc('RTIR'), path => '/RTIR/' );
 
-my $orig_menu = Menu();
-
-$HTML::Mason::Commands::m->notes('menu', RT::Interface::Web::Menu->new());
-
-my $rtmenu = Menu->child(rtkids => menu => $orig_menu);
-$rtmenu->title(loc('RT'));
-$rtmenu->path('/');
-$rtmenu->key('rt-menu');
-
-Menu->child(preferences => menu => $orig_menu->child('preferences'));
-$orig_menu->delete('preferences');
-
-my $root = Menu();
-
-my $search = $root->child( search => title => loc('RTIR'), path => RT::IR->HREFTo('', IncludeWebPath => 0) );
+my $search = $root->child( search => title => loc('Search'), path => RT::IR->HREFTo('', IncludeWebPath => 0) );
 $search->child( new => title => loc('New Search'), path => RT::IR->HREFTo('Search/?NewQuery=1', IncludeWebPath => 0) );
 
 {
diff --git a/html/RTIR/Tools/index.html b/html/RTIR/Tools/index.html
index 3b0f4024..d49861a5 100644
--- a/html/RTIR/Tools/index.html
+++ b/html/RTIR/Tools/index.html
@@ -47,5 +47,5 @@
 %# END BPS TAGGED BLOCK }}}
 <& /RTIR/Elements/Header, Title => loc('RTIR Tools') &>
 <& /Elements/Tabs &>
-<& /Elements/ListMenu, menu => Menu()->child('tools')  &>
+<& /Elements/ListMenu, menu => Menu()->child('rtir')->child('tools')  &>
 

commit 39a3da5449ac0d26edc11862361a21978e4251ad
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Apr 9 11:18:46 2020 -0400

    Align menu item with queue name for Incident Reports

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index f932345b..75211dd2 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -95,7 +95,7 @@ $root->child(
     path => RT::IR->HREFTo('CreateInQueue.html?Lifecycle='.RT::IR->lifecycle_incident, IncludeWebPath => 0),
 );
 $root->child(
-    reports => title => loc('Reports'),
+    reports => title => loc('Incident Reports'),
     path => RT::IR->HREFTo('Search/Results.html?Lifecycle='. RT::IR->lifecycle_report, IncludeWebPath => 0)
 )->child(
     create => title => loc('Create'),

commit 520265b98cf03e6131603f88af5571c7c27fd295
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Apr 9 11:47:28 2020 -0400

    Explain menu change in UPGRADING doc

diff --git a/docs/UPGRADING-5.0 b/docs/UPGRADING-5.0
new file mode 100644
index 00000000..e4e5d081
--- /dev/null
+++ b/docs/UPGRADING-5.0
@@ -0,0 +1,22 @@
+=head1 Upgrading to 5.0
+
+The following describes some of the key components of the upgrade
+to RTIR 5.0 from earlier versions. The other UPGRADING documents contain
+details for previous versions.
+
+=head2 Notable Changes
+
+=over
+
+=item *
+
+In RTIR 4.0, we modified the menu display to move each queue to a
+top level menu item when working inside RTIR. Each menu ended up
+having just a "Create" entry and we haven't found new menu items
+to add for each queue. This change made it harder to access the
+default RT menus, so we have reverted to the previous configuration
+with a single RTIR menu item containing relevant links.
+
+=back
+
+=cut

commit 56765d4e0f9686cc4d0d447f4c13ba1bd86d151b
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Apr 29 17:05:48 2020 -0400

    Load incident create page without a queue
    
    Allow the incident create page to load even when no queue is
    passed by defaulting to the first queue with an incident lifecycle.
    
    Since 7b96b55e6 moved queue selection to the create page, users
    can select a different queue from the page if needed.

diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index 186c9e08..5e587e28 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -130,7 +130,7 @@ if ( $ChildObj && $ChildObj->id && !$ChildObj->CurrentUserHasRight('ModifyTicket
       <&|/l&>Queue</&>:
     </div>
     <div class="value col-md-9">
-      <& /RTIR/Elements/SelectRTIRQueue, Name => "Queue", Default => $ARGS{Queue}, AutoSubmit => 1, ShowNullOption => 0 &>
+      <& /RTIR/Elements/SelectRTIRQueue, Name => "Queue", Default => $queue, AutoSubmit => 1, ShowNullOption => 0 &>
     </div>
   </div>
   <div class="form-row">
@@ -363,12 +363,27 @@ for my $related_ticket ($ChildObj, $SplitObj) {
         last;
 }
 
+# Load the first Incident queue if none is provided
+my $queue = $ARGS{'Queue'};
+unless ( $queue ) {
+    my $queues = RT::Queues->new( RT->SystemUser );
+
+    $queues->Limit(
+        FIELD => 'Lifecycle',
+        OPERATOR => '=',
+        VALUE => RT::IR->lifecycle_incident,
+    );
+
+    if ( my $first_queue = $queues->First ) {
+        $queue = $first_queue->Id;
+    }
+}
 
 my $QueueObj = RT::Queue->new($session{'CurrentUser'});
-$QueueObj->Load( $ARGS{Queue} );
+$QueueObj->Load( $queue );
 
 if (!$QueueObj->Name) {
-Abort( loc("Queue '[_1]' could not be loaded.", $ARGS{Queue}) );
+Abort( loc("Queue '[_1]' could not be loaded.", $queue) );
  }
 
 if( !RT::IR->IsIncidentQueue($QueueObj) ) {

commit db1ca1c638fe3bb2ffdf106a0b46c5a6f032f79f
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Apr 29 17:08:59 2020 -0400

    Link directly to create pages in menus
    
    Queue is now selected on the create page so the queue
    selection modal is no longer needed.

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index 75211dd2..2349d71a 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -92,21 +92,21 @@ $root->child(
     path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_incident, IncludeWebPath => 0)
 )->child(
     create => title => loc('Create'),
-    path => RT::IR->HREFTo('CreateInQueue.html?Lifecycle='.RT::IR->lifecycle_incident, IncludeWebPath => 0),
+    path => RT::IR->HREFTo('Incident/Create.html?Lifecycle='.RT::IR->lifecycle_incident, IncludeWebPath => 0),
 );
 $root->child(
     reports => title => loc('Incident Reports'),
     path => RT::IR->HREFTo('Search/Results.html?Lifecycle='. RT::IR->lifecycle_report, IncludeWebPath => 0)
 )->child(
     create => title => loc('Create'),
-    path => RT::IR->HREFTo('CreateInQueue.html?Lifecycle='. RT::IR->lifecycle_report, IncludeWebPath => 0),
+    path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_report, IncludeWebPath => 0),
 );
 $root->child(
     investigations => title => loc('Investigations'),
     path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_investigation, IncludeWebPath => 0)
 )->child(
     launch => title => loc('Launch'),
-    path => RT::IR->HREFTo('CreateInQueue.html?Lifecycle='.RT::IR->lifecycle_investigation, IncludeWebPath => 0),
+    path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_investigation, IncludeWebPath => 0),
 );
 unless ( RT->Config->Get('RTIR_DisableCountermeasures') ) {
     $root->child(
@@ -114,7 +114,7 @@ unless ( RT->Config->Get('RTIR_DisableCountermeasures') ) {
         path => RT::IR->HREFTo('Search/Results.html?Lifecycle='.RT::IR->lifecycle_countermeasure, IncludeWebPath => 0)
     )->child(
         create => title => loc('Create'),
-        path => RT::IR->HREFTo('CreateInQueue.html?Lifecycle='.RT::IR->lifecycle_countermeasure, IncludeWebPath => 0),
+        path => RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_countermeasure, IncludeWebPath => 0),
     );
 }
 
@@ -330,8 +330,8 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
     PageMenu()->child(
         new => title => loc("New [_1]", RT::IR::TicketType( Lifecycle => $lifecycle || RT::IR->lifecycle_incident ) ),
         path => !$lifecycle
-            ? RT::IR->HREFTo("CreateInQueue.html?Child=$id&Lifecycle=".RT::IR->lifecycle_incident, IncludeWebPath => 0)
-            : RT::IR->HREFTo("CreateInQueue.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle ), IncludeWebPath => 0)
+            ? RT::IR->HREFTo("Incident/Create.html?Child=$id&Lifecycle=".RT::IR->lifecycle_incident, IncludeWebPath => 0)
+            : RT::IR->HREFTo('Create.html' . $query_string->( Incident => $id, Lifecycle => $lifecycle ), IncludeWebPath => 0)
         ,
     );
     PageMenu()->child(
@@ -352,7 +352,7 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
 
     PageMenu()->child(
         new => title => loc("New [_1]",RT::IR::TicketType( Lifecycle => $lifecycle ) ),
-        path => RT::IR->HREFTo("CreateInQueue.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle ), IncludeWebPath => 0),
+        path => RT::IR->HREFTo("Create.html?". $query_string->( Incident => $id, Lifecycle => $lifecycle ), IncludeWebPath => 0),
     );
     PageMenu()->child(
         back => title => loc('Back to [_1] #[_2]', lc RT::IR::TicketType( Lifecycle => $ticket->QueueObj->Lifecycle), $id),
@@ -542,5 +542,5 @@ PageWidgets()->child('simple_search')->raw_html( $m->scomp(
     SendTo => RT::IR->HREFTo('index.html', IncludeWebPath => 0),
     Placeholder => 'Search Incidents'
 ) );
-PageWidgets()->child( create_ticket => raw_html => $m->scomp('/RTIR/Elements/CreateTicketInQueue') );
+PageWidgets()->child( create_ticket => raw_html => $HTML::Mason::Commands::m->scomp('/Elements/CreateTicket', SendTo => '/RTIR/Incident/Create.html?Lifecycle='.RT::IR->lifecycle_incident) );
 </%INIT>

commit 62f0065f7398921ae1c5d64a6aa109598b2d0c25
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Thu Apr 30 17:30:02 2020 -0400

    Update tests to find links after menu updates

diff --git a/t/002-test-reject.t b/t/002-test-reject.t
index 7fc0e932..d6d7648b 100644
--- a/t/002-test-reject.t
+++ b/t/002-test-reject.t
@@ -92,7 +92,7 @@ diag "test that after reject links to incidents are still there" if $ENV{'TEST_V
 
     # go to incident and check that we still can see the child
     $agent->display_ticket( $inc_id);
-    $agent->follow_link_ok({text => "Incident Reports"}, "Followed 'Incident Reports' link");
+    $agent->follow_link_ok({text => "Incident Reports", n => 2}, "Followed 'Incident Reports' link");
     $agent->form_number(3);
     $agent->tick( Statuses => 'rejected' );
     $agent->click('RefineStatus');
@@ -122,7 +122,7 @@ diag "test that after quick reject links to incidents are still there" if $ENV{'
 
     # go to incident and check that we still can see the child
     $agent->display_ticket( $inc_id);
-    $agent->follow_link_ok({text => "Incident Reports"}, "Followed 'Incident Reports' link");
+    $agent->follow_link_ok({text => "Incident Reports", n => 2}, "Followed 'Incident Reports' link");
     $agent->form_number(3);
     $agent->tick( Statuses => 'rejected' );
     $agent->click('RefineStatus');
@@ -141,7 +141,7 @@ diag "test that after bulk reject links to incidents are still there" if $ENV{'T
     }
 
     $agent->display_ticket( $id);
-    $agent->follow_link_ok({text => "Reports", url_regex => qr/RTIR/}, "Followed 'Incident Reports' link");
+    $agent->follow_link_ok({text => "Incident Reports", url_regex => qr/RTIR/}, "Followed 'Incident Reports' link");
     while($agent->content() !~ m{Display.html\?id=$id">$id</a>}) {
         last unless $agent->follow_link(text => 'Next');
     }
@@ -161,7 +161,7 @@ diag "test that after bulk reject links to incidents are still there" if $ENV{'T
 
     # go to incident and check that we still can see the child
     $agent->display_ticket( $inc_id);
-    $agent->follow_link_ok({text => "Incident Reports"}, "Followed 'Incident Reports' link");
+    $agent->follow_link_ok({text => "Incident Reports", n => 2}, "Followed 'Incident Reports' link");
     $agent->form_number(3);
     $agent->tick( Statuses => 'rejected' );
     $agent->click('RefineStatus');

commit d8d63ae75e92d5fcd31299a5fa831e5ce9bf558c
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Fri May 8 17:03:57 2020 -0400

    Link directly to updated create page rather than modal

diff --git a/html/Callbacks/RTIR/Elements/MakeClicky/Default b/html/Callbacks/RTIR/Elements/MakeClicky/Default
index d6fcaed3..af2560f7 100644
--- a/html/Callbacks/RTIR/Elements/MakeClicky/Default
+++ b/html/Callbacks/RTIR/Elements/MakeClicky/Default
@@ -112,7 +112,7 @@ my %actions;
                       .loc('Lookup IP') .q{</a>};
         if ( $args{incident} && !RT->Config->Get('RTIR_DisableCountermeasures') ) {
             $result .= qq{ <a class="button btn-sm btn-primary create_child_} . RT::IR->lifecycle_countermeasure . qq{" href="} .
-            RT::IR->HREFTo("CreateInQueue.html?Incident=".$args{incident}."&Lifecycle=".RT::IR->lifecycle_countermeasure.qq{&IP-Value=$escaped_host})
+            RT::IR->HREFTo("Create.html?Incident=".$args{incident}."&Lifecycle=".RT::IR->lifecycle_countermeasure.qq{&IP-Value=$escaped_host})
             .qq{">Block</a>};
         }
         if ( $args{'object'} && $args{'object'}->id ) {
@@ -162,7 +162,7 @@ my %actions;
                 $result .= qq{<input type="checkbox" name="Requestorbox-$escaped_email" unchecked />};
             }
             $result .= qq{ <a class="button btn-sm btn-primary" href="}.
-                RT::IR->HREFTo( "CreateInQueue.html"
+                RT::IR->HREFTo( "Create.html"
                 . qq{?Incident=$args{'incident'}}
                 . qq{&Lifecycle=}.RT::IR->lifecycle_investigation
                 . "&Requestors=$escaped_email")
diff --git a/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once b/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
index 521f4500..5d677871 100644
--- a/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
+++ b/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
@@ -152,7 +152,7 @@ $COLUMN_MAP->{'LookupToolIncidentActions'} = {
             ;
         }
         push @res, \'<a href="',
-            RT::IR->HREFTo('CreateInQueue.html?Lifecycle='.RT::IR->lifecycle_investigation
+            RT::IR->HREFTo('Create.html?Lifecycle='.RT::IR->lifecycle_investigation
             .'&Incident='. $t->id),
             \('" class="create_child_' . RT::IR->lifecycle_investigation . '">'),
             '[' . $t->loc("Investigate") .']',
diff --git a/html/RTIR/Elements/ShowIncidents b/html/RTIR/Elements/ShowIncidents
index a9c58c59..2979f6b7 100644
--- a/html/RTIR/Elements/ShowIncidents
+++ b/html/RTIR/Elements/ShowIncidents
@@ -59,7 +59,7 @@
 <div class="actions">
 % unless ( $action ) {
 <a class="button btn-sm btn btn-primary" id="link-incident" href="<% RT::IR->HREFTo('Link/ToIncident/?id='. $id ) %>">Link</a>
-<a class="button btn-sm btn btn-primary" id="create-incident" href="<% RT::IR->HREFTo('CreateInQueue.html?Lifecycle=' . RT::IR->lifecycle_incident . '&Child='. $id ) %>">New</a>
+<a class="button btn-sm btn btn-primary" id="create-incident" href="<% RT::IR->HREFTo('Incident/Create.html?Lifecycle=' . RT::IR->lifecycle_incident . '&Child='. $id ) %>">New</a>
 % } elsif ( $action ne 'No' ) {
 <a class="button btn-sm btn btn-primary" href="<% RT::IR->HREFTo('Display.html?Action='. $action.'&id='. $id) %>"><% loc( $action ) %></a>
 % }
diff --git a/html/RTIR/Incident/Elements/ShowChildren b/html/RTIR/Incident/Elements/ShowChildren
index 31584955..64c09765 100644
--- a/html/RTIR/Incident/Elements/ShowChildren
+++ b/html/RTIR/Incident/Elements/ShowChildren
@@ -116,7 +116,7 @@ if ( $IncidentObj->CurrentUserHasRight('ModifyTicket') ) {
         push @box_actions, {
             title => $Lifecycle ne RT::IR->lifecycle_investigation? loc('Create') : loc('Launch'),
             class => 'create_child' . ($Lifecycle ? '_'.$Lifecycle : ''),
-            path => RT::IR->HREFTo("CreateInQueue.html?Incident=$id&Lifecycle=".$Lifecycle),
+            path => RT::IR->HREFTo("Create.html?Incident=$id&Lifecycle=".$Lifecycle),
         };
     }
     push @box_actions, {
diff --git a/html/RTIR/Tools/Elements/LookupSummary b/html/RTIR/Tools/Elements/LookupSummary
index c7495da9..91b936af 100644
--- a/html/RTIR/Tools/Elements/LookupSummary
+++ b/html/RTIR/Tools/Elements/LookupSummary
@@ -109,7 +109,7 @@ if ( $TicketObj && RT::IR->IsIncidentQueue($TicketObj->QueueObj)
         push @box_actions, {
             title => loc('Launch'),
             class => 'create_child' . ($Lifecycle ? '_'.$Lifecycle : ''),
-            path => RT::IR->HREFTo("CreateInQueue.html?". $m->comp('/Elements/QueryString',
+            path => RT::IR->HREFTo("Create.html?". $m->comp('/Elements/QueryString',
                 Incident => $TicketObj->id,
                 Lifecycle => $Lifecycle,
                 Requestors => $q,
@@ -119,7 +119,7 @@ if ( $TicketObj && RT::IR->IsIncidentQueue($TicketObj->QueueObj)
         push @box_actions, {
             title => loc('Create'),
             class => 'create_child' . ($Lifecycle ? '_'.$Lifecycle : ''),
-            path => RT::IR->HREFTo("CreateInQueue.html?". $m->comp('/Elements/QueryString',
+            path => RT::IR->HREFTo("Create.html?". $m->comp('/Elements/QueryString',
                 Incident => $TicketObj->id,
                 Lifecycle => $Lifecycle,
                 'IP-Value' => $q,
@@ -133,7 +133,7 @@ elsif ( $TicketObj && !RT::IR->IsIncidentQueue($TicketObj->QueueObj)
     push @box_actions, {
         title => loc('Create'),
         class => 'create_child' . ($Lifecycle ? '_'.$Lifecycle : ''),
-        path => RT::IR->HREFTo("CreateInQueue.html?". $m->comp('/Elements/QueryString',
+        path => RT::IR->HREFTo("Create.html?". $m->comp('/Elements/QueryString',
             Child => $TicketObj->id,
             Lifecycle => $Lifecycle
         )),

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


More information about the rt-commit mailing list