[Rt-commit] rt branch, 4.6/core-rightinspector, updated. rt-4.4.4-380-gdf2818573

Michel Rodriguez michel at bestpractical.com
Fri Sep 6 12:04:49 EDT 2019


The branch, 4.6/core-rightinspector has been updated
       via  df28185732e0c42640ac040aa98f86ae88e7e8c0 (commit)
       via  3002b6253ad520ba136f61b283bff6f4404e4471 (commit)
       via  16e549b266340ac353befc0dbc8fb7badab155d5 (commit)
       via  e9b6246cf5be7af6df6dc5d6f7a975707c3653ed (commit)
       via  e8254b9a761c6046897028d774cb6b6af62bd3b9 (commit)
       via  3601524a6cd51d1690983e7a69ebbe4e0f48d7d7 (commit)
       via  7b42639f9c95b9513cc02fe7fba74a2ab2750250 (commit)
      from  df08351090b621372d0858cdd17886c5462fa364 (commit)

Summary of changes:
 lib/RT/Interface/Web/MenuBuilder.pm         |  4 +-
 lib/RT/RightsInspector.pm                   |  3 +-
 share/html/Admin/Tools/RightsInspector.html | 64 ++++++++++++++++++++++++-----
 share/html/Helpers/RightsInspector/Revoke   | 47 +++++++++++++++++++++
 share/html/Helpers/RightsInspector/Search   | 48 +++++++++++++++++++++-
 share/html/Widgets/{TitleBoxEnd => Spinner} | 13 ++----
 share/static/css/elevator-dark/main.css     |  9 ++++
 share/static/css/elevator-light/admin.css   | 50 +++++++---------------
 share/static/js/rights-inspector.js         | 24 ++++++-----
 share/static/js/util.js                     | 13 ------
 10 files changed, 192 insertions(+), 83 deletions(-)
 copy share/html/Widgets/{TitleBoxEnd => Spinner} (92%)

- Log -----------------------------------------------------------------
commit 7b42639f9c95b9513cc02fe7fba74a2ab2750250
Author: michel <michel at bestpractical.com>
Date:   Thu Sep 5 19:29:57 2019 +0200

    Change wording of the RightsInspector description

diff --git a/lib/RT/Interface/Web/MenuBuilder.pm b/lib/RT/Interface/Web/MenuBuilder.pm
index 35b68aef0..fae57c0c4 100644
--- a/lib/RT/Interface/Web/MenuBuilder.pm
+++ b/lib/RT/Interface/Web/MenuBuilder.pm
@@ -2,7 +2,7 @@
 #
 # COPYRIGHT:
 #
-# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
 #                                          <sales at bestpractical.com>
 #
 # (Except where explicitly superseded by other copyright notices)
@@ -974,7 +974,7 @@ sub _BuildAdminMenu {
     }
     $admin_tools->child( rights_inspector =>
         title => loc('Rights Inspector'),
-        description => loc('Search your configured permissions'),
+        description => loc('Search your configured rights'),
         path  => '/Admin/Tools/RightsInspector.html',
     );
     $admin_tools->child( shredder =>

commit 3601524a6cd51d1690983e7a69ebbe4e0f48d7d7
Author: michel <michel at bestpractical.com>
Date:   Thu Sep 5 19:31:22 2019 +0200

    Add licensing boilerplate

diff --git a/lib/RT/RightsInspector.pm b/lib/RT/RightsInspector.pm
index 91a338162..3c287a5e4 100644
--- a/lib/RT/RightsInspector.pm
+++ b/lib/RT/RightsInspector.pm
@@ -16,7 +16,7 @@ use warnings;
 #     record     - generalization of principal and object since rendering
 #                  and whatnot can share code
 
-my $PageLimit = 100;
+my $PageLimit = 10;
 
 $RT::Interface::Web::WHITELISTED_COMPONENT_ARGS{'/Admin/RightsInspector/index.html'} = ['Principal', 'Object', 'Right'];
 
@@ -582,6 +582,7 @@ sub SerializeACE {
 # should the "Revoke" button be disabled? by default it is for the two required
 # system privileges; if such privileges needed to be revoked they can be done
 # through the ordinary ACL management UI
+# it is also disabled for SuperUser, otherwise it is too easy to completely hose the system
 sub DisableRevoke {
     my $self = shift;
     my $ACE = shift;
@@ -591,7 +592,7 @@ sub DisableRevoke {
 
     if ($Principal->Object->Domain eq 'ACLEquivalence') {
         my $User = $Principal->Object->InstanceObj;
-        if ($User->Id == RT->SystemUser->Id && $Object->isa('RT::System') && $Right eq 'SuperUser') {
+        if ($Object->isa('RT::System') && $Right eq 'SuperUser') {
             return 1;
         }
         if ($User->Id == RT->Nobody->Id && $Object->isa('RT::System') && $Right eq 'OwnTicket') {
diff --git a/share/html/Admin/Tools/RightsInspector.html b/share/html/Admin/Tools/RightsInspector.html
index a6725107b..c75b2c156 100644
--- a/share/html/Admin/Tools/RightsInspector.html
+++ b/share/html/Admin/Tools/RightsInspector.html
@@ -1,3 +1,50 @@
+# BEGIN BPS TAGGED BLOCK {{{
+#
+# COPYRIGHT:
+#
+# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
+#                                          <sales at bestpractical.com>
+#
+# (Except where explicitly superseded by other copyright notices)
+#
+#
+# LICENSE:
+#
+# This work is made available to you under the terms of Version 2 of
+# the GNU General Public License. A copy of that license should have
+# been provided with this software, but in any event can be snarfed
+# from www.gnu.org.
+#
+# This work is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 or visit their web page on the internet at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+#
+#
+# CONTRIBUTION SUBMISSION POLICY:
+#
+# (The following paragraph is not intended to limit the rights granted
+# to you to modify and distribute this software under the terms of
+# the GNU General Public License and is only of importance to you if
+# you choose to contribute your changes and enhancements to the
+# community by submitting them to Best Practical Solutions, LLC.)
+#
+# By intentionally submitting any modifications, corrections or
+# derivatives to this work, or any other work intended for use with
+# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+# you are the copyright holder for those contributions and you grant
+# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+# royalty-free, perpetual, license to use, copy, create derivative
+# works based on those contributions, and sublicense and distribute
+# those contributions and any derivatives thereof.
+#
+# END BPS TAGGED BLOCK }}}
 <& /Admin/Elements/Header, Title => loc("Rights Inspector") &>
 <& /Elements/Tabs &>
 
diff --git a/share/html/Helpers/RightsInspector/Revoke b/share/html/Helpers/RightsInspector/Revoke
index 21f36c1a9..c218c00d4 100644
--- a/share/html/Helpers/RightsInspector/Revoke
+++ b/share/html/Helpers/RightsInspector/Revoke
@@ -1,3 +1,50 @@
+# BEGIN BPS TAGGED BLOCK {{{
+#
+# COPYRIGHT:
+#
+# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
+#                                          <sales at bestpractical.com>
+#
+# (Except where explicitly superseded by other copyright notices)
+#
+#
+# LICENSE:
+#
+# This work is made available to you under the terms of Version 2 of
+# the GNU General Public License. A copy of that license should have
+# been provided with this software, but in any event can be snarfed
+# from www.gnu.org.
+#
+# This work is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 or visit their web page on the internet at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+#
+#
+# CONTRIBUTION SUBMISSION POLICY:
+#
+# (The following paragraph is not intended to limit the rights granted
+# to you to modify and distribute this software under the terms of
+# the GNU General Public License and is only of importance to you if
+# you choose to contribute your changes and enhancements to the
+# community by submitting them to Best Practical Solutions, LLC.)
+#
+# By intentionally submitting any modifications, corrections or
+# derivatives to this work, or any other work intended for use with
+# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+# you are the copyright holder for those contributions and you grant
+# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+# royalty-free, perpetual, license to use, copy, create derivative
+# works based on those contributions, and sublicense and distribute
+# those contributions and any derivatives thereof.
+#
+# END BPS TAGGED BLOCK }}}
 <%ARGS>
 $id => undef
 </%ARGS>
diff --git a/share/html/Helpers/RightsInspector/Search b/share/html/Helpers/RightsInspector/Search
index 6affc7d95..d6cafd1b3 100644
--- a/share/html/Helpers/RightsInspector/Search
+++ b/share/html/Helpers/RightsInspector/Search
@@ -1,3 +1,50 @@
+# BEGIN BPS TAGGED BLOCK {{{
+#
+# COPYRIGHT:
+#
+# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
+#                                          <sales at bestpractical.com>
+#
+# (Except where explicitly superseded by other copyright notices)
+#
+#
+# LICENSE:
+#
+# This work is made available to you under the terms of Version 2 of
+# the GNU General Public License. A copy of that license should have
+# been provided with this software, but in any event can be snarfed
+# from www.gnu.org.
+#
+# This work is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301 or visit their web page on the internet at
+# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+#
+#
+# CONTRIBUTION SUBMISSION POLICY:
+#
+# (The following paragraph is not intended to limit the rights granted
+# to you to modify and distribute this software under the terms of
+# the GNU General Public License and is only of importance to you if
+# you choose to contribute your changes and enhancements to the
+# community by submitting them to Best Practical Solutions, LLC.)
+#
+# By intentionally submitting any modifications, corrections or
+# derivatives to this work, or any other work intended for use with
+# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+# you are the copyright holder for those contributions and you grant
+# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+# royalty-free, perpetual, license to use, copy, create derivative
+# works based on those contributions, and sublicense and distribute
+# those contributions and any derivatives thereof.
+#
+# END BPS TAGGED BLOCK }}}
 <%INIT>
 use RT::RightsInspector;
 

commit e8254b9a761c6046897028d774cb6b6af62bd3b9
Author: michel <michel at bestpractical.com>
Date:   Thu Sep 5 19:32:42 2019 +0200

    Change the help text id (and associated CSS rule)

diff --git a/share/html/Admin/Tools/RightsInspector.html b/share/html/Admin/Tools/RightsInspector.html
index c75b2c156..176cbbcad 100644
--- a/share/html/Admin/Tools/RightsInspector.html
+++ b/share/html/Admin/Tools/RightsInspector.html
@@ -48,7 +48,7 @@
 <& /Admin/Elements/Header, Title => loc("Rights Inspector") &>
 <& /Elements/Tabs &>
 
-<div class="help" id="rights-inspector-help">
+<div class="help" id="rt-help-text">
 <&| /Widgets/TitleBox, title => loc('Usage Help') &>
 <p>The Rights Inspector lets you search your configured permissions based
 on several different criteria. Each permission consists of a "Principal"
diff --git a/share/static/css/elevator-light/admin.css b/share/static/css/elevator-light/admin.css
index 3f1a5c8b7..46cb98e14 100644
--- a/share/static/css/elevator-light/admin.css
+++ b/share/static/css/elevator-light/admin.css
@@ -23,21 +23,6 @@
 }
 
 
-#rights-inspector .search input, 
-#rights-inspector .results .result .cell {
-    display: inline-block;
-    width: 15em;
-}
-
-#rights-inspector .results .result .cell {
-    text-overflow: ellipsis;
-    overflow: hidden;
-}
-
-#rights-inspector .results .result .cell.revoke {
-    display: inline-block;
-    width: auto;
-}
 
 #rights-inspector .search .loading,
 #rights-inspector > .loading {
@@ -69,10 +54,6 @@
     opacity: 0.5;
 }
 
-#rights-inspector .results .result .cell {
-    //vertical-align: top;
-}
-
 #rights-inspector .results .result:nth-child(even) {
     background-color: rgb(236, 246, 252);
 }
@@ -111,7 +92,7 @@
     display: none;
 }
 
-#rights-inspector-help kbd {
+#rt-help-text kbd {
     color: #111;
     border: 1px dashed #AAA;
     background-color: #F6F6F6;

commit e9b6246cf5be7af6df6dc5d6f7a975707c3653ed
Author: michel <michel at bestpractical.com>
Date:   Thu Sep 5 19:33:40 2019 +0200

    Use the RT provided RT.Config.WebPath to get the Web Path

diff --git a/share/static/js/rights-inspector.js b/share/static/js/rights-inspector.js
index 6ddcf9d6a..67b10fc28 100644
--- a/share/static/js/rights-inspector.js
+++ b/share/static/js/rights-inspector.js
@@ -193,13 +193,14 @@ function link_or_text (text, url) {
 }
 
 function render_inspector_result (item) {
-    var revoke = item.disable_revoke ? 'class="ui-state-disabled" disabled="disabled"' : '';
+    var disabled_state = item.disable_revoke ? 'class="ui-state-disabled" disabled="disabled"' : '';
+
     return '<div class="result row">'
         +  '  <div class="principal cell col-md-3">' + render_inspector_record( item.principal) + '</div>'
         +  '  <div class="object cell col-md-3">' + render_inspector_record( item.object) + '</div>'
         +  '  <div class="right cell col-md-3">' + item.right_highlighted + '</div>'
         +  '  <div class="revoke cell col-md-2">'
-        +  '      <button type="button" data-action="' + rt_home() + 'Helpers/RightsInspector/Revoke?id=' + item.ace.id + '" ' + revoke + '>Revoke</button>'
+        +  '      <button type="button" data-action="' + RT.Config.WebPath + '/Helpers/RightsInspector/Revoke?id=' + item.ace.id + '" ' + disabled_state + '>Revoke</button>'
         + '  </div>'
         + '</div>'
     ;
diff --git a/share/static/js/util.js b/share/static/js/util.js
index 3096c9d89..992fd78c5 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -631,16 +631,3 @@ function toggle_hide_unset(e) {
 
     return false;
 }
-
-// home is included in all RT pages, and is generated in Mason by the server from the
-// WebPath config variable, so it should be accurate 
-function rt_home () {
-    var home= jQuery('#home').attr( 'href');
-    // additional safety measure, in case the home url does not include a trailing /
-    if( ! home.match( /\/$/) ) {
-        home = home + '/';
-    }
-    return home;
-}
-
-

commit 16e549b266340ac353befc0dbc8fb7badab155d5
Author: michel <michel at bestpractical.com>
Date:   Thu Sep 5 22:33:49 2019 +0200

    Create a Spinner widget
    
    Not completely done yet

diff --git a/share/html/Admin/Tools/RightsInspector.html b/share/html/Admin/Tools/RightsInspector.html
index 176cbbcad..ed54de238 100644
--- a/share/html/Admin/Tools/RightsInspector.html
+++ b/share/html/Admin/Tools/RightsInspector.html
@@ -1,50 +1,50 @@
-# BEGIN BPS TAGGED BLOCK {{{
-#
-# COPYRIGHT:
-#
-# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
-#                                          <sales at bestpractical.com>
-#
-# (Except where explicitly superseded by other copyright notices)
-#
-#
-# LICENSE:
-#
-# This work is made available to you under the terms of Version 2 of
-# the GNU General Public License. A copy of that license should have
-# been provided with this software, but in any event can be snarfed
-# from www.gnu.org.
-#
-# This work is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-# 02110-1301 or visit their web page on the internet at
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-#
-#
-# CONTRIBUTION SUBMISSION POLICY:
-#
-# (The following paragraph is not intended to limit the rights granted
-# to you to modify and distribute this software under the terms of
-# the GNU General Public License and is only of importance to you if
-# you choose to contribute your changes and enhancements to the
-# community by submitting them to Best Practical Solutions, LLC.)
-#
-# By intentionally submitting any modifications, corrections or
-# derivatives to this work, or any other work intended for use with
-# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-# you are the copyright holder for those contributions and you grant
-# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-# royalty-free, perpetual, license to use, copy, create derivative
-# works based on those contributions, and sublicense and distribute
-# those contributions and any derivatives thereof.
-#
-# END BPS TAGGED BLOCK }}}
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
+%#                                          <sales at bestpractical.com>
+%#
+%# (Except where explicitly superseded by other copyright notices)
+%#
+%#
+%# LICENSE:
+%#
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%#
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%#
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+%#
+%#
+%# CONTRIBUTION SUBMISSION POLICY:
+%#
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%#
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%#
+%# END BPS TAGGED BLOCK }}}
 <& /Admin/Elements/Header, Title => loc("Rights Inspector") &>
 <& /Elements/Tabs &>
 
@@ -91,20 +91,20 @@ results if Joe has access due to multiple different reasons.</p>
 </div>
 
 <&|/Widgets/TitleBox, title => loc("Rights Inspector") &>
-<form action="<%RT->Config->Get('WebPath')%>/Helpers/RightsInspector/Search" id="rights-inspector">
-  <div class="search row">
+<form action="<%RT->Config->Get('WebPath')%>/Helpers/RightsInspector/Search" id="rights-inspector" class="search">
+  <div class="row">
     <input class="col-md-3" value="<% $ARGS{Principal} %>" type="text" name="principal" placeholder="Principal">
     <input class="col-md-3" value="<% $ARGS{Object} %>" type="text" name="object" placeholder="Object">
     <input class="col-md-3" value="<% $ARGS{Right} %>" type="text" name="right" placeholder="Right">
-    <span class="loading"><img src="<%RT->Config->Get('WebPath')%>/static/images/loading.gif" alt="<%loc('Loading')%>" title="<%loc('Loading')%>" /></span>
   </div>
 
-  <script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/static/js/rights-inspector.js"></script>
+  <& /Widgets/Spinner &>
 
   <div class="results">
   </div>
-  <span class="loading"><img src="<%RT->Config->Get('WebPath')%>/static/images/loading.gif" alt="<%loc('Loading')%>" title="<%loc('Loading')%>" /></span>
+  <& /Widgets/Spinner &>
 </form>
+  <script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/static/js/rights-inspector.js"></script>
 </&>
 
 
diff --git a/share/html/Helpers/RightsInspector/Search b/share/html/Helpers/RightsInspector/Search
index d6cafd1b3..bf8548b9e 100644
--- a/share/html/Helpers/RightsInspector/Search
+++ b/share/html/Helpers/RightsInspector/Search
@@ -47,7 +47,7 @@
 # END BPS TAGGED BLOCK }}}
 <%INIT>
 use RT::RightsInspector;
-
+sleep(2);
 my $results = RT::RightsInspector->Search(%ARGS);
 $r->content_type('application/json; charset=utf-8');
 RT::Interface::Web::CacheControlExpiresHeaders( Time => 'no-cache' );
diff --git a/share/static/css/elevator-light/admin.css b/share/static/css/elevator-light/admin.css
index 46cb98e14..6b58c7b90 100644
--- a/share/static/css/elevator-light/admin.css
+++ b/share/static/css/elevator-light/admin.css
@@ -24,26 +24,10 @@
 
 
 
-#rights-inspector .search .loading,
-#rights-inspector > .loading {
+#rights-inspector .loading {
     display: none;
 }
 
-#rights-inspector .search .loading img,
-#rights-inspector > .loading img,
-#rights-inspector .results .revoke img {
-    height: 1.5em;
-    width: 1.5em;
-}
-
-#rights-inspector.awaiting-first-result .search .loading {
-    display: inline;
-}
-
-#rights-inspector.continuing-load > .loading {
-    display: inline;
-}
-
 #rights-inspector.error .results {
     color: red;
     font-weight: bold;

commit 3002b6253ad520ba136f61b283bff6f4404e4471
Author: michel <michel at bestpractical.com>
Date:   Fri Sep 6 17:47:49 2019 +0200

    Made everything work with bootstrap

diff --git a/lib/RT/RightsInspector.pm b/lib/RT/RightsInspector.pm
index 3c287a5e4..e824b1374 100644
--- a/lib/RT/RightsInspector.pm
+++ b/lib/RT/RightsInspector.pm
@@ -16,7 +16,7 @@ use warnings;
 #     record     - generalization of principal and object since rendering
 #                  and whatnot can share code
 
-my $PageLimit = 10;
+my $PageLimit = 100;
 
 $RT::Interface::Web::WHITELISTED_COMPONENT_ARGS{'/Admin/RightsInspector/index.html'} = ['Principal', 'Object', 'Right'];
 
diff --git a/share/html/Admin/Tools/RightsInspector.html b/share/html/Admin/Tools/RightsInspector.html
index ed54de238..5372af48a 100644
--- a/share/html/Admin/Tools/RightsInspector.html
+++ b/share/html/Admin/Tools/RightsInspector.html
@@ -93,18 +93,15 @@ results if Joe has access due to multiple different reasons.</p>
 <&|/Widgets/TitleBox, title => loc("Rights Inspector") &>
 <form action="<%RT->Config->Get('WebPath')%>/Helpers/RightsInspector/Search" id="rights-inspector" class="search">
   <div class="row">
-    <input class="col-md-3" value="<% $ARGS{Principal} %>" type="text" name="principal" placeholder="Principal">
-    <input class="col-md-3" value="<% $ARGS{Object} %>" type="text" name="object" placeholder="Object">
-    <input class="col-md-3" value="<% $ARGS{Right} %>" type="text" name="right" placeholder="Right">
+    <input class="col-md-3 form-control" value="<% $ARGS{Principal} %>" type="text" name="principal" placeholder="Principal">
+    <input class="col-md-3 form-control" value="<% $ARGS{Object} %>" type="text" name="object" placeholder="Object">
+    <input class="col-md-3 form-control" value="<% $ARGS{Right} %>" type="text" name="right" placeholder="Right">
   </div>
 
-  <& /Widgets/Spinner &>
-
   <div class="results">
   </div>
   <& /Widgets/Spinner &>
 </form>
-  <script type="text/javascript" src="<%RT->Config->Get('WebPath')%>/static/js/rights-inspector.js"></script>
 </&>
 
 
diff --git a/share/html/Helpers/RightsInspector/Search b/share/html/Helpers/RightsInspector/Search
index bf8548b9e..d36bd7574 100644
--- a/share/html/Helpers/RightsInspector/Search
+++ b/share/html/Helpers/RightsInspector/Search
@@ -47,7 +47,6 @@
 # END BPS TAGGED BLOCK }}}
 <%INIT>
 use RT::RightsInspector;
-sleep(2);
 my $results = RT::RightsInspector->Search(%ARGS);
 $r->content_type('application/json; charset=utf-8');
 RT::Interface::Web::CacheControlExpiresHeaders( Time => 'no-cache' );
diff --git a/share/html/Widgets/Spinner b/share/html/Widgets/Spinner
new file mode 100644
index 000000000..eb4a5d42b
--- /dev/null
+++ b/share/html/Widgets/Spinner
@@ -0,0 +1,55 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%#
+%# COPYRIGHT:
+%#
+%# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
+%#                                          <sales at bestpractical.com>
+%#
+%# (Except where explicitly superseded by other copyright notices)
+%#
+%#
+%# LICENSE:
+%#
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%#
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%#
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+%#
+%#
+%# CONTRIBUTION SUBMISSION POLICY:
+%#
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%#
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%#
+%# END BPS TAGGED BLOCK }}}
+<div class="spinner">
+  <div class="d-flex justify-content-center">
+    <div class="spinner-border" role="status">
+      <span class="sr-only"><% loc( "Loading...") %></span> 
+    </div>
+  </div>
+</div>
+
diff --git a/share/static/css/elevator-light/admin.css b/share/static/css/elevator-light/admin.css
index 6b58c7b90..dcf4bf5d2 100644
--- a/share/static/css/elevator-light/admin.css
+++ b/share/static/css/elevator-light/admin.css
@@ -38,7 +38,11 @@
     opacity: 0.5;
 }
 
-#rights-inspector .results .result:nth-child(even) {
+#rights-inspector.awaiting-first-result .loading, .continuing-load .loading {
+    display: inline;
+}
+
+#rights-inspector .results .result:nth-child(even) .cell {
     background-color: rgb(236, 246, 252);
 }
 
@@ -76,6 +80,15 @@
     display: none;
 }
 
+#rights-inspector .results .result .right {
+    padding-top: .4em;
+}
+
+#rights-inspector .results .result .revoke {
+    padding-top: .3em;
+}
+
+
 #rt-help-text kbd {
     color: #111;
     border: 1px dashed #AAA;
diff --git a/share/static/js/rights-inspector.js b/share/static/js/rights-inspector.js
index 67b10fc28..0bba28c77 100644
--- a/share/static/js/rights-inspector.js
+++ b/share/static/js/rights-inspector.js
@@ -1,8 +1,7 @@
-jQuery(function () {
-
+jQuery(document).ready( function () {
     var form = jQuery('form#rights-inspector');
     var display = form.find('.results');
-    var loading = form.find('.search .loading');
+    var spinner = form.find('.spinner');
 
     var revoking = {};
     var existingRequest;
@@ -18,7 +17,7 @@ jQuery(function () {
         }
 
         button.addClass('ui-state-disabled').prop('disabled', true);
-        button.after(loading.clone());
+        button.after(spinner.clone());
     };
 
     var displayError = function (message) {
@@ -76,6 +75,7 @@ jQuery(function () {
                         form.removeClass('awaiting-first-result');
                         display.text('No results');
                     }
+                jQuery( '.spinner').hide();
                 }
             },
             error: function (xhr, reason) {
@@ -91,6 +91,7 @@ jQuery(function () {
     var beginSearch = function (delay) {
         form.removeClass('continuing-load').addClass('awaiting-first-result');
         form.find('button').addClass('ui-state-disabled').prop('disabled', true);
+        jQuery( '.spinner').show();
 
         var serialized = form.serializeArray();
         var search = {};
@@ -136,7 +137,7 @@ jQuery(function () {
                     alert(response.msg);
                 }
                 else {
-                    button.closest('.revoke').text(response.msg);
+                    button.closest('.revoke').removeClass('col-md-1').addClass('col-md-3').text(response.msg);
                 }
                 delete revoking[action];
             },
@@ -149,7 +150,7 @@ jQuery(function () {
         });
     });
 
-    form.find('.search input').on('input', function () {
+    form.find('input').on('input', function () {
         beginSearch(200);
     });
 
@@ -157,6 +158,8 @@ jQuery(function () {
 });
 
 
+// rendering functions
+
 function render_inspector_record (record) {
     return '<span class="record ' + cond_text( record.disabled, 'disabled') + '">'
         +  '  <span class="name ' + cond_text( record.highlight, record.match) + '">'
@@ -173,8 +176,6 @@ function render_inspector_record (record) {
 
 }
 
-// rendering functions
-
 function render_inspector_primary_record (primary_record) {
     return primary_record ? '<span class="primary">Contains ' + render_inspector_record( primary_record) + '</span>'
                           : '';
@@ -199,8 +200,8 @@ function render_inspector_result (item) {
         +  '  <div class="principal cell col-md-3">' + render_inspector_record( item.principal) + '</div>'
         +  '  <div class="object cell col-md-3">' + render_inspector_record( item.object) + '</div>'
         +  '  <div class="right cell col-md-3">' + item.right_highlighted + '</div>'
-        +  '  <div class="revoke cell col-md-2">'
-        +  '      <button type="button" data-action="' + RT.Config.WebPath + '/Helpers/RightsInspector/Revoke?id=' + item.ace.id + '" ' + disabled_state + '>Revoke</button>'
+        +  '  <div class="revoke cell col-md-1">'
+        +  '      <button type="button" class="revoke-button" data-action="' + RT.Config.WebPath + '/Helpers/RightsInspector/Revoke?id=' + item.ace.id + '" ' + disabled_state + '>Revoke</button>'
         + '  </div>'
         + '</div>'
     ;

commit df28185732e0c42640ac040aa98f86ae88e7e8c0
Author: michel <michel at bestpractical.com>
Date:   Fri Sep 6 18:03:48 2019 +0200

    Improve look for the dark theme

diff --git a/share/static/css/elevator-dark/main.css b/share/static/css/elevator-dark/main.css
index 0ce5e757d..4e981fc10 100644
--- a/share/static/css/elevator-dark/main.css
+++ b/share/static/css/elevator-dark/main.css
@@ -153,3 +153,12 @@
 .darkmode .btn-outline:hover svg {
     fill: #171A1F;
 }
+
+.darkmode #rights-inspector .results .result:nth-child(even) * {
+    background-color: #111 !important;
+}
+
+.darkmode #rights-inspector .results .result .match {
+    background-color: #114 !important;
+}
+

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


More information about the rt-commit mailing list