[Rt-commit] rtir branch, 5.0/font-awesome-icon-links, created. 4.0.1rc1-160-g1ca969bb

Craig Kaiser craig at bestpractical.com
Thu Jun 4 09:13:55 EDT 2020


The branch, 5.0/font-awesome-icon-links has been created
        at  1ca969bbe61179287491f4fa42b51ccdd7c9f3df (commit)

- Log -----------------------------------------------------------------
commit 9378a6e9a6d4cfbf700add041278772eab2afc69
Author: craig kaiser <craig at bestpractical.com>
Date:   Tue May 26 17:11:42 2020 -0400

    Use font awesome icons for Incident display links

diff --git a/html/Callbacks/RTIR/Ticket/Elements/ShowLinkedQueues/MassageTitleBox b/html/Callbacks/RTIR/Ticket/Elements/ShowLinkedQueues/MassageTitleBox
index 45f74d84..2035d1f7 100644
--- a/html/Callbacks/RTIR/Ticket/Elements/ShowLinkedQueues/MassageTitleBox
+++ b/html/Callbacks/RTIR/Ticket/Elements/ShowLinkedQueues/MassageTitleBox
@@ -25,20 +25,24 @@ foreach my $queue ( @queues ) {
             if ( $QueueObj->Id and $QueueObj->CurrentUserHasRight('CreateTicket') ) {
                 push @titleright_raw, {
                     title => $lifecycle ne RT::IR->lifecycle_investigation? loc('Create') : loc('Launch'),
-                    class => 'create_child' . ($lifecycle ? '_'.$lifecycle : ''),
+                    class => 'fas fa-plus',
                     path => RT::IR->HREFTo("Create.html?Incident=$id&Lifecycle=".$lifecycle),
                 };
             }
             push @titleright_raw, {
                 title => loc('Link'),
                 path  => RT::IR->HREFTo("Link/FromIncident/?id=$id&Lifecycle=".$lifecycle),
+                class => 'fas fa-link',
             };
         }
 
         $$titleright_raw = join ' 'x3,
-            map q{<a href="} . $_->{'path'} . ( $_->{'class'} ? q{" class="} . $_->{'class'} : '' ) . q{">}
-                . $m->interp->apply_escapes( $_->{title}, 'h' ) . q{</a>},
-            @titleright_raw;
+            map q{<a href="}.$_->{'path'}
+                    .q{"><span }.( $_->{'class'} ? q{" class="} . $_->{'class'} : '' )
+                    .q{" data-toggle="tooltip" data-placement="top" data-original-title="}
+                    .$m->interp->apply_escapes( $_->{title}, 'h' )
+                    .q{"></span>
+                </a>}, @titleright_raw;
     }
 }
 </%INIT>

commit 99fecf6cc6d2e7e719b4f0b28d57c33d70ee3588
Author: craig kaiser <craig at bestpractical.com>
Date:   Tue May 26 17:30:13 2020 -0400

    Migrate basics links to font awesome icons

diff --git a/html/RTIR/Elements/ShowIncidents b/html/RTIR/Elements/ShowIncidents
index 2979f6b7..6380fb1b 100644
--- a/html/RTIR/Elements/ShowIncidents
+++ b/html/RTIR/Elements/ShowIncidents
@@ -58,10 +58,15 @@
 &>
 <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('Incident/Create.html?Lifecycle=' . RT::IR->lifecycle_incident . '&Child='. $id ) %>">New</a>
+<a class="button btn-sm btn btn-primary" id="link-incident" href="<% RT::IR->HREFTo('Link/ToIncident/?id='. $id ) %>">
+    <span class="fas fa-link" data-toggle="tooltip" data-placement="top" data-original-title="<% loc( 'Link' ) %>"></span>
+</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 ) %>">
+<span class="fas fa-plus" data-toggle="tooltip" data-placement="top" data-original-title="<% loc( 'New' ) %>"></span></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>
+<a class="button btn-sm btn btn-primary" href="<% RT::IR->HREFTo('Display.html?Action='. $action.'&id='. $id) %>">
+    <span class="fas fa-plus" data-toggle="tooltip" data-placement="top" data-original-title="<% loc( $action ) %>"></span>
+</a>
 % }
 </div>
 </span>

commit fc1b005d52401bc65f0b915dd49db3b985b107f5
Author: craig kaiser <craig at bestpractical.com>
Date:   Wed May 27 09:05:42 2020 -0400

    Use font awesome icon for RTIR at a glance edit button

diff --git a/html/Callbacks/RTIR/Elements/Tabs/Privileged b/html/Callbacks/RTIR/Elements/Tabs/Privileged
index 94c4054d..39cf2c05 100644
--- a/html/Callbacks/RTIR/Elements/Tabs/Privileged
+++ b/html/Callbacks/RTIR/Elements/Tabs/Privileged
@@ -590,7 +590,7 @@ if ( $request_path =~ m{(?:$re_rtir_path)(?:$re_rtir_types/)?(Display|Edit|Updat
 
 if ( $session{'CurrentUser'}->HasRight(Right => 'ModifySelf', Object => $RT::System) ) {
     if ( $request_path =~ m{(?:$re_rtir_path)(?:index\.html|)$} ) {
-        PageMenu()->child( edit => title => loc('Edit'), path => RT::IR->HREFTo('Prefs/Home.html', IncludeWebPath => 0 ))
+        PageMenu()->child( edit => raw_html => q[<a id="page-edit" class="menu-item" href="] . RT::IR->HREFTo("Prefs/Home.html", IncludeWebPath => 0) . qq["><span class="fas fa-cog" alt="].loc('Edit').q[" data-toggle="tooltip" data-placement="top" data-original-title="].loc('Edit').q["></span></a>]);
     }
     Menu->child('preferences')->child('settings')->child(
         rtir_home_page => title => loc('RTIR at a glance'),

commit 1ca969bbe61179287491f4fa42b51ccdd7c9f3df
Author: craig kaiser <craig at bestpractical.com>
Date:   Wed Jun 3 17:43:57 2020 -0400

    Update tests for font awesome icons

diff --git a/lib/RT/IR/Test/Web.pm b/lib/RT/IR/Test/Web.pm
index 21e588f4..72459c50 100644
--- a/lib/RT/IR/Test/Web.pm
+++ b/lib/RT/IR/Test/Web.pm
@@ -229,7 +229,7 @@ sub LinkChildToIncident {
     $self->display_ticket( $id);
 
     # Select the "Link" link from the Display page
-    $self->follow_link_ok({text => "Link", n => "1"}, "Followed 'Link(to Incident)' link");
+    $self->follow_link_ok({id => "link-incident", n => "1"}, "Followed 'Link(to Incident)' link");
 
     
     # Check that the desired incident occurs in the list of available incidents; if not, keep
diff --git a/t/020-incident-and-investigation.t b/t/020-incident-and-investigation.t
index 95a64d54..9e08761c 100755
--- a/t/020-incident-and-investigation.t
+++ b/t/020-incident-and-investigation.t
@@ -71,7 +71,7 @@ my $incident_bar = $agent->create_incident(
 );
 $agent->display_ticket($incident_foo);
 
-$agent->follow_link_ok({text => 'Launch', n => 2}, "Followed 'Launch' link");
+$agent->follow_link_ok({url_regex => qr(/RTIR/Create\.html\?Incident=\d+&Lifecycle=investigations)i}, "Followed 'Launch' link");
 $agent->form_name('TicketCreate');
 is($agent->value('Incident'), $incident_foo, 'Incident foo is checked');
 $agent->field('Incident', $incident_bar);
diff --git a/t/custom-fields/defaults-on-linking.t b/t/custom-fields/defaults-on-linking.t
index 5392643d..3bd670dd 100644
--- a/t/custom-fields/defaults-on-linking.t
+++ b/t/custom-fields/defaults-on-linking.t
@@ -53,7 +53,7 @@ my $agent = default_agent();
 
     {
         $agent->display_ticket( $ir_id );
-        $agent->follow_link_ok({text => "New"}, "Followed 'New (Incident)' link")
+        $agent->follow_link_ok({id => "create-incident"}, "Followed 'New (Incident)' link")
             or diag $agent->content;
         $agent->form_number(3);
 
diff --git a/t/incident/split.t b/t/incident/split.t
index bd1b6a53..0db3ad66 100644
--- a/t/incident/split.t
+++ b/t/incident/split.t
@@ -25,7 +25,7 @@ my $rtir_user = rtir_user();
     my $new_id = ($agent->content =~ /.*Ticket (\d+) created.*/i )[0];
     ok ($new_id, "Ticket created successfully: #$new_id.");
 
-    $agent->follow_link_ok({text => "Launch", n => 2 }, "Followed link");
+    $agent->follow_link_ok({url_regex => qr(/RTIR/Create\.html\?Incident=\d+&Lifecycle=investigations)i }, "Followed link");
     $agent->form_number(3);
     $agent->field('Requestors', $rtir_user->EmailAddress);
     $agent->click('Create');
diff --git a/t/searches/menu.t b/t/searches/menu.t
index 8402d62d..00960b4c 100644
--- a/t/searches/menu.t
+++ b/t/searches/menu.t
@@ -67,7 +67,7 @@ for my $type ( 'incident', 'ir', 'investigation', 'countermeasure' ) {
 {
 
     $m->display_ticket( $ticket{ir}[0] );
-    $m->follow_link_ok( { text => 'Link' } );
+    $m->follow_link_ok( { id => 'link-incident' } );
     $m->title_is("Link Report #$ticket{ir}[0] to selected Incident");
 
     ok( !$m->find_link( url_regex => qr{/RTIR/Incident/Display.html\?id=$ticket{incident}[0]$} ),
@@ -97,7 +97,7 @@ for my $type ( 'incident', 'ir', 'investigation', 'countermeasure' ) {
 # Link FromIncident
 {
     $m->display_ticket( $ticket{incident}[0] );
-    $m->follow_link_ok( { text => 'Link', url_regex => qr{Link/FromIncident} } );
+    $m->follow_link_ok( { url_regex => qr{Link/FromIncident} } );
     $m->title_is("Link selected Report to Incident #$ticket{incident}[0]");
 
     ok(

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


More information about the rt-commit mailing list