[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.7-847-g102542f

Shawn Moore sartak at bestpractical.com
Mon Dec 13 15:49:14 EST 2010


The branch, 3.9-trunk has been updated
       via  102542f693b5f5d773e7f14b4ee7d3121a3b1ed5 (commit)
      from  6238b63b55d21e09a012e221658ec7a5dfeda17d (commit)

Summary of changes:
 sbin/rt-test-dependencies.in   |    1 -
 share/html/Elements/Tabs       |    1 -
 share/html/Tools/Watching.html |   94 ----------
 share/html/Tools/index.html    |    5 -
 t/web/watching-queues.t        |  378 ----------------------------------------
 5 files changed, 0 insertions(+), 479 deletions(-)
 delete mode 100644 share/html/Tools/Watching.html
 delete mode 100644 t/web/watching-queues.t

- Log -----------------------------------------------------------------
commit 102542f693b5f5d773e7f14b4ee7d3121a3b1ed5
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Dec 13 15:49:02 2010 -0500

    Remove /Tools/Watching.html, it's moving into an extension

diff --git a/sbin/rt-test-dependencies.in b/sbin/rt-test-dependencies.in
index 87a4d09..5ecf010 100755
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@ -278,7 +278,6 @@ Test::Warn
 Test::Builder 0.90 # needed for is_passing
 Test::MockTime
 Log::Dispatch::Perl
-Web::Scraper
 Test::WWW::Mechanize::PSGI
 Plack::Middleware::Test::StashWarnings
 .
diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index 0479bd0..1f75989 100755
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -107,7 +107,6 @@ if ( $request_path !~ qr{^/SelfService/} ) {
     $tools->child( my_day => title => loc('My Day'), path   => '/Tools/MyDay.html', sort_order => 25 );
 
     $tools->child( offline => title => loc('Offline'), path    => '/Tools/Offline.html', sort_order => 30 );
-    $tools->child( watching => title => loc('Watching Queues'), path => '/Tools/Watching.html', sort_order => 35 );
 
     if ( $session{'CurrentUser'}->HasRight( Right => 'ShowApprovalsTab', Object => $RT::System ) )
     {
diff --git a/share/html/Tools/Watching.html b/share/html/Tools/Watching.html
deleted file mode 100644
index 3c3144e..0000000
--- a/share/html/Tools/Watching.html
+++ /dev/null
@@ -1,94 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-%#                                          <jesse 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 }}}
-<& /Elements/Header, Title => loc("Watching Queues") &>
-<& /Elements/Tabs &>
-
-<p><&|/l&>This page shows you the queues on which you have a role (e.g. Cc, AdminCc) membership.</p>
-
-<%perl>
-my $count = 0;
-my $Queues = RT::Queues->new($session{CurrentUser});
-$Queues->UnLimit;
-while (my $Queue = $Queues->Next) {
-    my @types;
-
-    for my $type ($Queue->AllRoleGroupTypes) {
-        push @types, $type if $Queue->IsWatcher(
-            PrincipalId => $session{CurrentUser}->id,
-            Type        => $type,
-        );
-    }
-
-    next if !@types;
-
-    my $first = ($count == 0);
-    if ($first) {
-</%perl>
-        <ul class="queue-list">
-<%perl>
-    }
-
-    $count += @types;
-</%perl>
-
-    <li class="queue-roles">
-        <span class="queue-name"><& /Ticket/Elements/ShowQueue, QueueObj => $Queue &></span>
-        <ul class="queue-role-list">
-%           for my $type (@types) {
-                <li class="queue-role"><% $type %></li>
-%           }
-        </ul>
-    </li>
-% }
-
-% if ($count) {
-    </ul>
-% } else {
-    <p><&|/l&>You are not watching any queues.</&></p>
-% }
-
diff --git a/share/html/Tools/index.html b/share/html/Tools/index.html
index 4d8c480..b27b5f9 100644
--- a/share/html/Tools/index.html
+++ b/share/html/Tools/index.html
@@ -67,11 +67,6 @@ my $tabs = {
         path        => '/Tools/MyDay.html',
         description => loc('Easy updating of your open tickets'),
     },
-    E => {
-        title       => loc('Watching Queues'),
-        path        => '/Tools/Watching.html',
-        description => loc('A list of queues you watch'),
-    },
 };
 
 my $can_see_dashboards = $session{CurrentUser}->HasRight(Right => 'SubscribeDashboard', Object => $RT::System)
diff --git a/t/web/watching-queues.t b/t/web/watching-queues.t
deleted file mode 100644
index 9e79804..0000000
--- a/t/web/watching-queues.t
+++ /dev/null
@@ -1,378 +0,0 @@
-#!/usr/bin/perl -w
-use strict;
-
-use RT::Test tests => 77;
-use Web::Scraper;
-my ($baseurl, $m) = RT::Test->started_ok;
-
-ok $m->login, 'logged in';
-
-my $user = RT::User->new(RT->SystemUser);
-$user->LoadByEmail('root at localhost');
-
-my $other_queue = RT::Queue->new(RT->SystemUser);
-$other_queue->Create(
-    Name => 'Fancypants',
-);
-
-my $loopy_queue = RT::Queue->new(RT->SystemUser);
-$loopy_queue->Create(
-    Name => 'Loopy',
-);
-
-my $group = RT::Group->new(RT->SystemUser);
-$group->CreateUserDefinedGroup(
-    Name => 'Groupies',
-    Description => 'for the Metallica Speed of Sound tour',
-);
-
-my $outer_group = RT::Group->new(RT->SystemUser);
-$outer_group->CreateUserDefinedGroup(
-    Name => 'Groupies 2.0',
-    Description => 'for the Metallica Ride The Lightning tour',
-);
-
-my $watching = scraper {
-    process "li.queue-roles", 'queues[]' => scraper {
-        # trim the queue name
-        process 'span.queue-name', name => sub {
-            my $name = shift->as_text;
-            $name =~ s/^\s*//;
-            $name =~ s/\s*$//;
-            return $name;
-        };
-        process "li.queue-role", 'roles[]' => 'TEXT';
-    };
-};
-
-diag "check watching page" if $ENV{'TEST_VERBOSE'};
-{
-    $m->follow_link( text => 'Tools' );
-    $m->title_is('Tools', 'tools screen');
-    $m->follow_link( text => 'Watching Queues' );
-    $m->title_is('Watching Queues', 'watching screen');
-
-    $m->content_contains('You are not watching any queues.');
-
-    is_deeply($watching->scrape($m->content), {});
-}
-
-diag "add self as AdminCc on General" if $ENV{'TEST_VERBOSE'};
-{
-    $m->follow_link( text => 'Configuration' );
-    $m->title_is('RT Administration', 'admin page');
-    $m->follow_link( text => 'Queues' );
-    $m->title_is('Admin queues', 'queues page');
-    $m->follow_link( text => 'General' );
-    $m->title_is('Configuration for queue General');
-    $m->follow_link( text => 'Watchers' );
-    $m->title_is('People related to queue General');
-
-    $m->submit_form_ok({
-        form_number => 3,
-        fields => {
-            UserField  => 'Name',
-            UserOp     => 'LIKE',
-            UserString => 'root',
-        },
-    });
-
-    $m->title_is('People related to queue General', 'caught the right form! :)');
-
-    $m->submit_form_ok({
-        form_number => 3,
-        fields => {
-            'Queue-AddWatcher-Principal-' . $user->PrincipalId => 'AdminCc',
-        },
-    });
-
-    $m->title_is('People related to queue General', 'caught the right form! :)');
-
-    my $queue = RT::Queue->new(RT->SystemUser);
-    $queue->Load('General');
-    ok($queue->IsWatcher(Type => 'AdminCc', PrincipalId => $user->PrincipalId), 'added root as AdminCc on General');
-}
-
-diag "check watching page" if $ENV{'TEST_VERBOSE'};
-{
-    $m->follow_link( text => 'Tools' );
-    $m->title_is('Tools', 'tools screen');
-    $m->follow_link( text => 'Watching Queues' );
-    $m->title_is('Watching Queues', 'watching screen');
-
-    $m->content_lacks('You are not watching any queues.');
-
-    is_deeply($watching->scrape($m->content), {
-        queues => [
-            {
-                name  => 'General',
-                roles => ['AdminCc'],
-            },
-        ],
-    });
-}
-
-diag "add self as Cc on General" if $ENV{'TEST_VERBOSE'};
-{
-    $m->follow_link( text => 'Configuration' );
-    $m->title_is('RT Administration', 'admin page');
-    $m->follow_link( text => 'Queues' );
-    $m->title_is('Admin queues', 'queues page');
-    $m->follow_link( text => 'General' );
-    $m->title_is('Configuration for queue General');
-    $m->follow_link( text => 'Watchers' );
-    $m->title_is('People related to queue General');
-
-    $m->submit_form_ok({
-        form_number => 3,
-        fields => {
-            UserField  => 'Name',
-            UserOp     => 'LIKE',
-            UserString => 'root',
-        },
-    });
-
-    $m->title_is('People related to queue General', 'caught the right form! :)');
-
-    $m->submit_form_ok({
-        form_number => 3,
-        fields => {
-            'Queue-AddWatcher-Principal-' . $user->PrincipalId => 'Cc',
-        },
-    });
-
-    $m->title_is('People related to queue General', 'caught the right form! :)');
-
-    my $queue = RT::Queue->new(RT->SystemUser);
-    $queue->Load('General');
-    ok($queue->IsWatcher(Type => 'Cc', PrincipalId => $user->PrincipalId), 'added root as Cc on General');
-}
-
-diag "check watching page" if $ENV{'TEST_VERBOSE'};
-{
-    $m->follow_link( text => 'Tools' );
-    $m->title_is('Tools', 'tools screen');
-    $m->follow_link( text => 'Watching Queues' );
-    $m->title_is('Watching Queues', 'watching screen');
-
-    $m->content_lacks('You are not watching any queues.');
-
-    is_deeply($watching->scrape($m->content), {
-        queues => [
-            {
-                name  => 'General',
-                roles => ['Cc', 'AdminCc'],
-            },
-        ],
-    });
-}
-
-diag "add self as AdminCc on Fancypants" if $ENV{'TEST_VERBOSE'};
-{
-    $m->follow_link( text => 'Configuration' );
-    $m->title_is('RT Administration', 'admin page');
-    $m->follow_link( text => 'Queues' );
-    $m->title_is('Admin queues', 'queues page');
-    $m->follow_link( text => 'Fancypants' );
-    $m->title_is('Configuration for queue Fancypants');
-    $m->follow_link( text => 'Watchers' );
-    $m->title_is('People related to queue Fancypants');
-
-    $m->submit_form_ok({
-        form_number => 3,
-        fields => {
-            UserField  => 'Name',
-            UserOp     => 'LIKE',
-            UserString => 'root',
-        },
-    });
-
-    $m->title_is('People related to queue Fancypants', 'caught the right form! :)');
-
-    $m->submit_form_ok({
-        form_number => 3,
-        fields => {
-            'Queue-AddWatcher-Principal-' . $user->PrincipalId => 'AdminCc',
-        },
-    });
-
-    $m->title_is('People related to queue Fancypants', 'caught the right form! :)');
-
-    ok($other_queue->IsWatcher(Type => 'AdminCc', PrincipalId => $user->PrincipalId), 'added root as AdminCc on Fancypants');
-}
-
-diag "check watching page" if $ENV{'TEST_VERBOSE'};
-{
-    $m->follow_link( text => 'Tools' );
-    $m->title_is('Tools', 'tools screen');
-    $m->follow_link( text => 'Watching Queues' );
-    $m->title_is('Watching Queues', 'watching screen');
-
-    $m->content_lacks('You are not watching any queues.');
-
-    is_deeply($watching->scrape($m->content), {
-        queues => [
-            {
-                name  => 'Fancypants',
-                roles => ['AdminCc'],
-            },
-            {
-                name  => 'General',
-                roles => ['Cc', 'AdminCc'],
-            },
-        ],
-    });
-}
-
-diag "add group as Cc on Loopy" if $ENV{'TEST_VERBOSE'};
-{
-    $m->follow_link( text => 'Configuration' );
-    $m->title_is('RT Administration', 'admin page');
-    $m->follow_link( text => 'Queues' );
-    $m->title_is('Admin queues', 'queues page');
-    $m->follow_link( text => 'Loopy' );
-    $m->title_is('Configuration for queue Loopy');
-    $m->follow_link( text => 'Watchers' );
-    $m->title_is('People related to queue Loopy');
-
-    $m->submit_form_ok({
-        form_number => 3,
-        fields => {
-            GroupField  => 'Name',
-            GroupOp     => 'LIKE',
-            GroupString => 'Groupies',
-        },
-    });
-
-    $m->title_is('People related to queue Loopy', 'caught the right form! :)');
-
-    $m->submit_form_ok({
-        form_number => 3,
-        fields => {
-            'Queue-AddWatcher-Principal-' . $group->PrincipalId => 'Cc',
-        },
-    });
-
-    $m->title_is('People related to queue Loopy', 'caught the right form! :)');
-
-    ok($loopy_queue->IsWatcher(Type => 'Cc', PrincipalId => $group->PrincipalId), 'added Groupies as Cc on Loopy');
-}
-
-$group->AddMember($user->PrincipalId);
-
-diag "check watching page (no change since root is not a groupy)" if $ENV{'TEST_VERBOSE'};
-{
-    $m->follow_link( text => 'Tools' );
-    $m->title_is('Tools', 'tools screen');
-    $m->follow_link( text => 'Watching Queues' );
-    $m->title_is('Watching Queues', 'watching screen');
-
-    $m->content_lacks('You are not watching any queues.');
-
-    is_deeply($watching->scrape($m->content), {
-        queues => [
-            {
-                name  => 'Fancypants',
-                roles => ['AdminCc'],
-            },
-            {
-                name  => 'General',
-                roles => ['Cc', 'AdminCc'],
-            },
-            {
-                name  => 'Loopy',
-                roles => ['Cc'],
-            },
-        ],
-    });
-}
-
-diag "add other group as AdminCc on Loopy" if $ENV{'TEST_VERBOSE'};
-{
-    $m->follow_link( text => 'Configuration' );
-    $m->title_is('RT Administration', 'admin page');
-    $m->follow_link( text => 'Queues' );
-    $m->title_is('Admin queues', 'queues page');
-    $m->follow_link( text => 'Loopy' );
-    $m->title_is('Configuration for queue Loopy');
-    $m->follow_link( text => 'Watchers' );
-    $m->title_is('People related to queue Loopy');
-
-    $m->submit_form_ok({
-        form_number => 3,
-        fields => {
-            GroupField  => 'Name',
-            GroupOp     => 'LIKE',
-            GroupString => 'Groupies',
-        },
-    });
-
-    $m->title_is('People related to queue Loopy', 'caught the right form! :)');
-
-    $m->submit_form_ok({
-        form_number => 3,
-        fields => {
-            'Queue-AddWatcher-Principal-' . $outer_group->PrincipalId => 'AdminCc',
-        },
-    });
-
-    $m->title_is('People related to queue Loopy', 'caught the right form! :)');
-
-    ok($loopy_queue->IsWatcher(Type => 'AdminCc', PrincipalId => $outer_group->PrincipalId), 'added Groupies 2.0 as AdminCc on Loopy');
-}
-
-diag "check watching page (no change since root is not in groupy 2.0)" if $ENV{'TEST_VERBOSE'};
-{
-    $m->follow_link( text => 'Tools' );
-    $m->title_is('Tools', 'tools screen');
-    $m->follow_link( text => 'Watching Queues' );
-    $m->title_is('Watching Queues', 'watching screen');
-
-    $m->content_lacks('You are not watching any queues.');
-
-    is_deeply($watching->scrape($m->content), {
-        queues => [
-            {
-                name  => 'Fancypants',
-                roles => ['AdminCc'],
-            },
-            {
-                name  => 'General',
-                roles => ['Cc', 'AdminCc'],
-            },
-            {
-                name  => 'Loopy',
-                roles => ['Cc'],
-            },
-        ],
-    });
-}
-
-$outer_group->AddMember($group->PrincipalId);
-
-diag "user is not a member of the outer group recursively" if $ENV{'TEST_VERBOSE'};
-{
-    $m->follow_link( text => 'Tools' );
-    $m->title_is('Tools', 'tools screen');
-    $m->follow_link( text => 'Watching Queues' );
-    $m->title_is('Watching Queues', 'watching screen');
-
-    $m->content_lacks('You are not watching any queues.');
-
-    is_deeply($watching->scrape($m->content), {
-        queues => [
-            {
-                name  => 'Fancypants',
-                roles => ['AdminCc'],
-            },
-            {
-                name  => 'General',
-                roles => ['Cc', 'AdminCc'],
-            },
-            {
-                name  => 'Loopy',
-                roles => ['Cc', 'AdminCc'],
-            },
-        ],
-    });
-}

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


More information about the Rt-commit mailing list