[Rt-commit] rt branch, menu-take4, created. e1b1580ed795c0a06c2c13afaef0a353a0de034a
jesse
jesse at bestpractical.com
Mon Nov 23 16:50:42 EST 2009
The branch, menu-take4 has been created
at e1b1580ed795c0a06c2c13afaef0a353a0de034a (commit)
- Log -----------------------------------------------------------------
commit eabfc4428cf1374afbf5f13e4a9b3e83a5b719e9
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Mon Nov 23 11:22:22 2009 -0500
Continued menu and header simplification
diff --git a/lib/RT/Dispatcher.pm b/lib/RT/Dispatcher.pm
index 4a8cf1a..1d55a47 100644
--- a/lib/RT/Dispatcher.pm
+++ b/lib/RT/Dispatcher.pm
@@ -193,10 +193,19 @@ $PREFS_NAV->child( _('RT at a glance'), url => '/Prefs/MyRT.html', );
before qr{.*} => run {
next_rule unless (Jifty->web->current_user->user_object);
- main_nav->child( _('Homepage'), url => '/' );
- main_nav->child( _('Simple Search'), url => '/Search/Simple.html' );
- main_nav->child( _('Tickets'), url => '/Search/Build.html' );
- my $tools = main_nav->child( _('Tools'), url => '/Tools/index.html' );
+ main_nav->child( Home => label => _('Homepage'), url => '/', sort_order => 1);
+ my $tickets = main_nav->child( _('Tickets'), url => '/Search/Build.html', sort_order => 2 );
+ $tickets->child( new => label => _('New Search') => url => "/Search/Build.html?new_query=1" );
+ my $new = $tickets->child(create => label => _('New ticket'), url => '/Ticket/Create.html');
+
+ my $q = RT::Model::QueueCollection->new();
+ $q->find_all_rows;
+ while (my $queue = $q->next) {
+ next unless $queue->current_user_has_right('CreateTicket');
+ $new->child( $queue->id => label => $queue->name, url => '/Ticket/Create.html?queue='.$queue->id);
+ }
+
+ my $tools = main_nav->child( _('Tools'), url => '/Tools/index.html', sort_order => 3 );
$tools->child( _('Dashboards'), url => '/Dashboards/index.html' );
my $reports = $tools->child( _('Reports'), url => '/Tools/Reports/index.html' );
@@ -206,9 +215,16 @@ before qr{.*} => run {
$tools->child( _('My Day'), url => '/Tools/MyDay.html' );
+
+ if ( Jifty->web->current_user->has_right( right => 'ShowApprovalsTab', object => RT->system ) ) {
+ $tools->child( _('Approval'), url => '/Approvals/' );
+ }
+
+
+
if ( Jifty->web->current_user->has_right( right => 'ShowConfigTab', object => RT->system ) )
{
- my $admin = main_nav->child( Config => label => _('Configuration'), url => '/Admin/' );
+ my $admin = $tools->child( Config => label => _('Configuration'), url => '/Admin/' );
$admin->child( _('Users'), url => '/Admin/Users/', );
$admin->child( _('Groups'), url => '/Admin/Groups/', );
$admin->child( _('Queues'), url => '/Admin/Queues/', );
@@ -274,14 +290,10 @@ before qr{.*} => run {
if ( Jifty->web->current_user->has_right( right => 'ModifySelf', object => RT->system ) ) {
- main_nav->child( 'Preferences' => menu => $PREFS_NAV );
+ $tools->child( 'Preferences' => menu => $PREFS_NAV, sort_order=> 99 );
}
}
- if ( Jifty->web->current_user->has_right( right => 'ShowApprovalsTab', object => RT->system ) )
- {
- main_nav->child( _('Approval'), url => '/Approvals/' );
- }
@@ -641,7 +653,6 @@ before qr'(?:Ticket|Search)/' => run {
$args = "?" . query_string(%query_args);
- page_nav->child( _('New Search') => url => "/Search/Build.html?new_query=1" );
page_nav->child( _('Edit Search') => url => "/Search/Build.html" . ( ($has_query) ? $args : '' ) );
page_nav->child( _('Advanced') => url => "/Search/Edit.html$args" );
diff --git a/share/html/Elements/Header b/share/html/Elements/Header
index 70aad32..b0a2491 100755
--- a/share/html/Elements/Header
+++ b/share/html/Elements/Header
@@ -80,7 +80,7 @@
% Jifty->handler->stash->{'in_body'} = 1;
<body<% $id && qq[ id="comp-$id"] |n %>>
-% if ($show_bar && Jifty->web->current_user) {
+% if ($show_bar) {
<& /Elements/Logo, %ARGS &>
<div id="quickbar">
@@ -97,13 +97,14 @@
| <a href="<%RT->config->get('web_path')%>/NoAuth/Logout.html<%$url ?
"?URL=".$url : ''%>"><% _('Logout') %></a>
% }
- </div>
+% if (Jifty->web->current_user->user_object && Jifty->web->current_user->user_object->privileged) {
+ <& /Elements/SimpleSearch &>
% }
+ </div>
</div>
+% }
% if ( Jifty->web->current_user->user_object) {
-<div id="nav-widgets"><& /Elements/CreateTicket &><& /Elements/SimpleSearch &></div>
-%}
<div class="nav">
<div class="main-nav">
% Jifty->web->navigation->render_as_yui_menubar();
@@ -112,6 +113,7 @@
% Jifty->web->page_navigation->render_as_yui_menubar();
</div>
</div>
+%}
%# template login already has div with id "body"
% unless ( Jifty->web->request->path =~ m{^/login} ) {
<div id="body">
diff --git a/share/html/Elements/SimpleSearch b/share/html/Elements/SimpleSearch
index 939b1c6..dbeb46a 100755
--- a/share/html/Elements/SimpleSearch
+++ b/share/html/Elements/SimpleSearch
@@ -45,7 +45,7 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<form action="<% RT->config->get('web_path') %>/Search/Simple.html" id="simple-search">
+<form action="<% RT->config->get('web_path') %>/Search/Simple.html" name="simple-search" id="simple-search">
<input size="12" name="q" autocomplete="off" accesskey="0" class="field" value="<% _('Search') %>..."
onfocus="if (this.value=='<%_('Search')%>...') this.value=''"
onblur="if (this.value=='') this.value='<%_('Search')%>...'"
diff --git a/share/web/static/css/layout.css b/share/web/static/css/layout.css
index d208270..c54a93e 100644
--- a/share/web/static/css/layout.css
+++ b/share/web/static/css/layout.css
@@ -13,73 +13,20 @@ body {
div#body {
padding: 1em;
- padding-top: 1.5em;
-moz-border-radius-topright: 0.5em;
-moz-border-radius-bottomright: 0.5em;
-webkit-border-top-right-radius: 0.5em;
-webkit-border-bottom-right-radius: 0.5em;
- margin-left: em;
- margin-top: 5.2em;
+ margin-top: 1em;
margin-right: 1em;
margin-bottom: 0em;
min-height: 10%;
background: #fff;
border-top: 2px solid #ccc;
- border-left: 2px solid #ccc;
+ border-right: 2px solid #ccc;
z-index:1;
-}
-
-#nav-widgets {
- position: absolute;
- background: transparent;
- top: 6.5em;
- right: 1em;
- width: auto;
- min-width: 42em;
- font-size: 0.9em;
- z-index: 99;
-}
-
-#nav-widgets form * {
- vertical-align: top;
-}
-
-#nav-widgets button, #nav-widgets select, #nav-widgets input{
- padding-top: 0em;
- padding-bottom: 0em;
- width: 8em;
-
-}
-
-#nav-widgets form {
- display: block;
-
-}
-
-#nav-widgets #CreateTicketInQueue {
- text-align: right;
-
-}
-#nav-widgets #simple-search {
- float: right;
-}
-
-#nav-widgets #simple-search input.button {
- width: 5em;
-}
-#nav-widgets #simple-search .field{
- margin-left: 1em;
- }
-
-
-.page-nav {
- padding-top: 0.25em;
-}
-
-.page-nav ul {
- background: #ddd;
}
div#footer {
@@ -159,6 +106,15 @@ div#quickbar {
border-bottom: 1px solid #ccc;
}
+
+#simple-search {
+ position: absolute;
+ right: -1em;
+ font-size: 0.6em;
+ font-weight: normal;
+ top: 2em;
+
+}
div#quick-personal {
position: absolute;
right: 1em;
diff --git a/t/mail/gnupg-bad.t b/t/mail/gnupg-bad.t
index b706a4f..94ccbdc 100644
--- a/t/mail/gnupg-bad.t
+++ b/t/mail/gnupg-bad.t
@@ -42,7 +42,7 @@ $m->login;
$m->content_like(qr/Logout/, 'we did log in');
$m->get( $baseurl.'/Admin/Queues/');
$m->follow_link_ok( {text => 'General'} );
-$m->submit_form( form_number => 3,
+$m->submit_form( form_number => 2,
fields => { correspond_address => 'rt at example.com' } );
$m->content_like(qr/rt\@example.com.* - never/, 'has key info.');
ok(my $user = RT::Model::User->new(current_user => RT->system_user));
diff --git a/t/mail/gnupg-incoming.t b/t/mail/gnupg-incoming.t
index d1fce46..3c030e2 100644
--- a/t/mail/gnupg-incoming.t
+++ b/t/mail/gnupg-incoming.t
@@ -48,7 +48,7 @@ $m->login();
$m->content_like(qr/Logout/, 'we did log in');
$m->get( $baseurl.'/Admin/Queues/');
$m->follow_link_ok( {text => 'General'} );
-$m->submit_form( form_number => 3,
+$m->submit_form( form_number => 2,
fields => { correspond_address => 'general at example.com' } );
$m->content_like(qr/general\@example.com.* - never/, 'has key info.');
diff --git a/t/mail/gnupg-realmail.t b/t/mail/gnupg-realmail.t
index bda9e00..42d8dd0 100644
--- a/t/mail/gnupg-realmail.t
+++ b/t/mail/gnupg-realmail.t
@@ -45,7 +45,7 @@ my ($baseurl, $m) = RT::Test->started_ok;
ok $m->login, 'we did log in';
$m->get_ok( '/Admin/Queues/');
$m->follow_link_ok( {text => 'General'} );
-$m->submit_form( form_number => 3,
+$m->submit_form( form_number => 2,
fields => { correspond_address => 'rt-recipient at example.com' } );
$m->content_like(qr/rt-recipient\@example.com.* - never/, 'has key info.');
commit f8edc45a9b28ff21190803519d0a191d2e0f76d0
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Mon Nov 23 15:17:40 2009 -0500
dispatcher update to point at new ticket create page
diff --git a/lib/RT/Dispatcher.pm b/lib/RT/Dispatcher.pm
index 1d55a47..57be552 100644
--- a/lib/RT/Dispatcher.pm
+++ b/lib/RT/Dispatcher.pm
@@ -196,13 +196,13 @@ before qr{.*} => run {
main_nav->child( Home => label => _('Homepage'), url => '/', sort_order => 1);
my $tickets = main_nav->child( _('Tickets'), url => '/Search/Build.html', sort_order => 2 );
$tickets->child( new => label => _('New Search') => url => "/Search/Build.html?new_query=1" );
- my $new = $tickets->child(create => label => _('New ticket'), url => '/Ticket/Create.html');
+ my $new = $tickets->child(create => label => _('New ticket'), url => '/ticket/create');
my $q = RT::Model::QueueCollection->new();
$q->find_all_rows;
while (my $queue = $q->next) {
next unless $queue->current_user_has_right('CreateTicket');
- $new->child( $queue->id => label => $queue->name, url => '/Ticket/Create.html?queue='.$queue->id);
+ $new->child( $queue->id => label => $queue->name, url => '/ticket/create?queue='.$queue->id);
}
my $tools = main_nav->child( _('Tools'), url => '/Tools/index.html', sort_order => 3 );
commit 3c2f289cb007ae51d28d4738ae29a5e9072a4f27
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Mon Nov 23 15:19:05 2009 -0500
update the "get to ticket create page" helper sub in RT/Test/Web
diff --git a/lib/RT/Test/Web.pm b/lib/RT/Test/Web.pm
index 2959436..e2a463d 100644
--- a/lib/RT/Test/Web.pm
+++ b/lib/RT/Test/Web.pm
@@ -128,9 +128,7 @@ sub goto_create_ticket {
}
$self->get('/');
- $self->form_name('create_ticket_in_queue');
- $self->select( 'queue', $id );
- $self->submit;
+ $self->follow_link( url_regex => qr|/ticket/create\?queue=$id|);
return 1;
}
commit e1b1580ed795c0a06c2c13afaef0a353a0de034a
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Mon Nov 23 15:20:07 2009 -0500
update a number of tests for no longer having a ticket creation form.
diff --git a/t/web/cf_access.t b/t/web/cf_access.t
index 217a52e..7350192 100644
--- a/t/web/cf_access.t
+++ b/t/web/cf_access.t
@@ -73,10 +73,7 @@ diag "check that we have no the CF on the create"
." ticket page when user has no SeeCustomField right"
if $ENV{'TEST_VERBOSE'};
{
- $m->submit_form(
- form_name => "create_ticket_in_queue",
- fields => { queue => 'General' },
- );
+ $m->follow_link( url_regex => qr'/ticket/create/', text => 'General');
$m->content_unlike(qr/Upload multiple images/, 'has no upload image field');
my $form = $m->form_name("ticket_create");
@@ -104,10 +101,7 @@ diag "check that we have no the CF on the create"
." ticket page when user has no ModifyCustomField right"
if $ENV{'TEST_VERBOSE'};
{
- $m->submit_form(
- form_name => "create_ticket_in_queue",
- fields => { queue => 'General' },
- );
+ $m->follow_link( url_regex => qr'/ticket/create/', text => 'General');
$m->content_unlike(qr/Upload multiple images/, 'has no upload image field');
my $form = $m->form_name("ticket_create");
@@ -134,10 +128,7 @@ RT::Test->set_rights(
diag "create a ticket with an image" if $ENV{'TEST_VERBOSE'};
{
- $m->submit_form(
- form_name => "create_ticket_in_queue",
- fields => { queue => 'General' },
- );
+ $m->follow_link( url_regex => qr'/ticket/create/', text => 'General');
TODO: {
local $TODO = "Multi-upload CFs not available yet";
$m->content_like(qr/Upload multiple images/, 'has a upload image field');
diff --git a/t/web/cf_onqueue.t b/t/web/cf_onqueue.t
index e12c759..f79ecfa 100644
--- a/t/web/cf_onqueue.t
+++ b/t/web/cf_onqueue.t
@@ -51,7 +51,7 @@ diag "Edit the CF value for default queue" if $ENV{'TEST_VERBOSE'};
$m->title_is(q/Editing Configuration for queue General/, 'default queue configuration screen');
$m->content_like( qr/QueueCFTest/, 'CF QueueCFTest displayed on default queue' );
$m->submit_form(
- form_number => 3,
+ form_number => 2,
# The following doesn't want to works :(
#with_fields => { 'object-RT::Model::Queue-1-CustomField-1-value' },
fields => {
diff --git a/t/web/gnupg-select-keys-on-create.t b/t/web/gnupg-select-keys-on-create.t
index d14094c..759775c 100644
--- a/t/web/gnupg-select-keys-on-create.t
+++ b/t/web/gnupg-select-keys-on-create.t
@@ -57,7 +57,7 @@ diag "check that signing doesn't work if there is no key" if $ENV{TEST_VERBOSE};
RT::Test->clean_caught_mails;
ok $m->goto_create_ticket( $queue ), "UI -> create ticket";
- $m->form_number(3);
+ $m->form_name('ticket_create');
$m->tick( sign => 1 );
$m->field( requestors => 'rt-test at example.com' );
$m->field( content => 'Some content' );
@@ -84,7 +84,7 @@ diag "check that things don't work if there is no key" if $ENV{TEST_VERBOSE};
RT::Test->clean_caught_mails;
ok $m->goto_create_ticket( $queue ), "UI -> create ticket";
- $m->form_number(3);
+ $m->form_name('ticket_create');
$m->tick( encrypt => 1 );
$m->field( requestors => 'rt-test at example.com' );
$m->field( content => 'Some content' );
@@ -98,7 +98,7 @@ diag "check that things don't work if there is no key" if $ENV{TEST_VERBOSE};
'problems with keys'
);
- my $form = $m->form_number(3);
+ my $form = $m->form_name('ticket_create');
ok !$form->find_input( 'UseKey-rt-test at example.com' ), 'no key selector';
my @mail = RT::Test->fetch_caught_mails;
@@ -119,7 +119,7 @@ diag "check that things still doesn't work if key is not trusted" if $ENV{TEST_V
RT::Test->clean_caught_mails;
ok $m->goto_create_ticket( $queue ), "UI -> create ticket";
- $m->form_number(3);
+ $m->form_name('ticket_create');
$m->tick( encrypt => 1 );
$m->field( requestors => 'rt-test at example.com' );
$m->field( content => 'Some content' );
@@ -133,7 +133,7 @@ diag "check that things still doesn't work if key is not trusted" if $ENV{TEST_V
'problems with keys'
);
- my $form = $m->form_number(3);
+ my $form = $m->form_name('ticket_create');
ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
is scalar $input->possible_values, 1, 'one option';
@@ -166,7 +166,7 @@ diag "check that things still doesn't work if two keys are not trusted" if $ENV{
RT::Test->clean_caught_mails;
ok $m->goto_create_ticket( $queue ), "UI -> create ticket";
- $m->form_number(3);
+ $m->form_name('ticket_create');
$m->tick( encrypt => 1 );
$m->field( requestors => 'rt-test at example.com' );
$m->field( content => 'Some content' );
@@ -180,7 +180,7 @@ diag "check that things still doesn't work if two keys are not trusted" if $ENV{
'problems with keys'
);
- my $form = $m->form_number(3);
+ my $form = $m->form_name('ticket_create');
ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
is scalar $input->possible_values, 2, 'two options';
@@ -212,7 +212,7 @@ diag "check that we see key selector even if only one key is trusted but there a
RT::Test->clean_caught_mails;
ok $m->goto_create_ticket( $queue ), "UI -> create ticket";
- $m->form_number(3);
+ $m->form_name('ticket_create');
$m->tick( encrypt => 1 );
$m->field( requestors => 'rt-test at example.com' );
$m->field( content => 'Some content' );
@@ -226,7 +226,7 @@ diag "check that we see key selector even if only one key is trusted but there a
'problems with keys'
);
- my $form = $m->form_number(3);
+ my $form = $m->form_name('ticket_create');
ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
is scalar $input->possible_values, 2, 'two options';
@@ -240,7 +240,7 @@ diag "check that key selector works and we can select trusted key"
RT::Test->clean_caught_mails;
ok $m->goto_create_ticket( $queue ), "UI -> create ticket";
- $m->form_number(3);
+ $m->form_name('ticket_create');
$m->tick( encrypt => 1 );
$m->field( requestors => 'rt-test at example.com' );
$m->field( content => 'Some content' );
@@ -254,7 +254,7 @@ diag "check that key selector works and we can select trusted key"
'problems with keys'
);
- my $form = $m->form_number(3);
+ my $form = $m->form_name('ticket_create');
ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
is scalar $input->possible_values, 2, 'two options';
@@ -272,7 +272,7 @@ diag "check encrypting of attachments" if $ENV{TEST_VERBOSE};
RT::Test->clean_caught_mails;
ok $m->goto_create_ticket( $queue ), "UI -> create ticket";
- $m->form_number(3);
+ $m->form_name('ticket_create');
$m->tick( encrypt => 1 );
$m->field( requestors => 'rt-test at example.com' );
$m->field( content => 'Some content' );
@@ -287,7 +287,7 @@ diag "check encrypting of attachments" if $ENV{TEST_VERBOSE};
'problems with keys'
);
- my $form = $m->form_number(3);
+ my $form = $m->form_name('ticket_create');
ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
is scalar $input->possible_values, 2, 'two options';
diff --git a/t/web/gnupg-select-keys-on-update.t b/t/web/gnupg-select-keys-on-update.t
index df115cd..e28f766 100644
--- a/t/web/gnupg-select-keys-on-update.t
+++ b/t/web/gnupg-select-keys-on-update.t
@@ -69,7 +69,7 @@ diag "check that signing doesn't work if there is no key" if $ENV{TEST_VERBOSE};
ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
$m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
- $m->form_number(3);
+ $m->form_name('ticket_update');
$m->tick( sign => 1 );
$m->field( update_cc => 'rt-test at example.com' );
$m->field( update_content => 'Some content' );
@@ -97,7 +97,7 @@ diag "check that things don't work if there is no key" if $ENV{TEST_VERBOSE};
ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
$m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
- $m->form_number(3);
+ $m->form_name('ticket_update');
$m->tick( encrypt => 1 );
$m->field( update_cc => 'rt-test at example.com' );
$m->field( update_content => 'Some content' );
@@ -111,7 +111,7 @@ diag "check that things don't work if there is no key" if $ENV{TEST_VERBOSE};
'problems with keys'
);
- my $form = $m->form_number(3);
+ my $form = $m->form_name('ticket_update');
ok !$form->find_input( 'UseKey-rt-test at example.com' ), 'no key selector';
my @mail = RT::Test->fetch_caught_mails;
@@ -134,7 +134,7 @@ diag "check that things still doesn't work if key is not trusted" if $ENV{TEST_V
ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
$m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
- $m->form_number(3);
+ $m->form_name('ticket_update');
$m->tick( encrypt => 1 );
$m->field( update_cc => 'rt-test at example.com' );
$m->field( update_content => 'Some content' );
@@ -148,7 +148,7 @@ diag "check that things still doesn't work if key is not trusted" if $ENV{TEST_V
'problems with keys'
);
- my $form = $m->form_number(3);
+ my $form = $m->form_name('ticket_update');
ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
is scalar $input->possible_values, 1, 'one option';
@@ -182,7 +182,7 @@ diag "check that things still doesn't work if two keys are not trusted" if $ENV{
ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
$m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
- $m->form_number(3);
+ $m->form_name('ticket_update');
$m->tick( encrypt => 1 );
$m->field( update_cc => 'rt-test at example.com' );
$m->field( update_content => 'Some content' );
@@ -196,7 +196,7 @@ diag "check that things still doesn't work if two keys are not trusted" if $ENV{
'problems with keys'
);
- my $form = $m->form_number(3);
+ my $form = $m->form_name('ticket_update');
ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
is scalar $input->possible_values, 2, 'two options';
@@ -228,7 +228,7 @@ diag "check that we see key selector even if only one key is trusted but there a
ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
$m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
- $m->form_number(3);
+ $m->form_name('ticket_update');
$m->tick( encrypt => 1 );
$m->field( update_cc => 'rt-test at example.com' );
$m->field( update_content => 'Some content' );
@@ -242,7 +242,7 @@ diag "check that we see key selector even if only one key is trusted but there a
'problems with keys'
);
- my $form = $m->form_number(3);
+ my $form = $m->form_name('ticket_update');
ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
is scalar $input->possible_values, 2, 'two options';
@@ -256,7 +256,7 @@ diag "check that key selector works and we can select trusted key" if $ENV{TEST_
ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
$m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
- $m->form_number(3);
+ $m->form_name('ticket_update');
$m->tick( encrypt => 1 );
$m->field( update_cc => 'rt-test at example.com' );
$m->field( update_content => 'Some content' );
@@ -270,7 +270,7 @@ diag "check that key selector works and we can select trusted key" if $ENV{TEST_
'problems with keys'
);
- my $form = $m->form_number(3);
+ my $form = $m->form_name('ticket_update');
ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
is scalar $input->possible_values, 2, 'two options';
@@ -289,7 +289,7 @@ diag "check encrypting of attachments" if $ENV{TEST_VERBOSE};
ok $m->goto_ticket( $tid ), "UI -> ticket #$tid";
$m->follow_link_ok( { text => 'Reply' }, 'ticket -> reply' );
- $m->form_number(3);
+ $m->form_name('ticket_update');
$m->tick( encrypt => 1 );
$m->field( update_cc => 'rt-test at example.com' );
$m->field( update_content => 'Some content' );
@@ -304,7 +304,7 @@ diag "check encrypting of attachments" if $ENV{TEST_VERBOSE};
'problems with keys'
);
- my $form = $m->form_number(3);
+ my $form = $m->form_name('ticket_update');
ok my $input = $form->find_input( 'UseKey-rt-test at example.com' ), 'found key selector';
is scalar $input->possible_values, 2, 'two options';
diff --git a/t/web/query_builder.t b/t/web/query_builder.t
index 38ff64d..67e0627 100644
--- a/t/web/query_builder.t
+++ b/t/web/query_builder.t
@@ -146,7 +146,7 @@ diag "click advanced, enter 'C1 OR ( C2 AND C3 )', apply, aggregators should sta
{
my $response = $agent->get($url."/Search/Edit.html");
ok( $response->is_success, "Fetched /Search/Edit.html" );
- ok($agent->form_number(3), "found the form");
+ ok($agent->form_number(2), "found the form");
$agent->field("query", "Status = 'new' OR ( Status = 'open' AND subject LIKE 'office' )");
$agent->submit;
is( get_query_from_form,
@@ -234,7 +234,7 @@ diag "input a condition, select (several conditions), click delete"
{
my $response = $agent->get( $url."/Search/Edit.html" );
ok $response->is_success, "Fetched /Search/Edit.html";
- ok $agent->form_number(3), "found the form";
+ ok $agent->form_number(2), "found the form";
$agent->field("query", "( Status = 'new' OR Status = 'open' )");
$agent->submit;
is( get_query_from_form,
diff --git a/t/web/rights.t b/t/web/rights.t
index 2645c08..6a0d961 100644
--- a/t/web/rights.t
+++ b/t/web/rights.t
@@ -16,7 +16,7 @@ sub get_rights {
my $agent = shift;
my $principal_id = shift;
my $object = shift;
- $agent->form_number(3);
+ $agent->form_number(2);
my @inputs = $agent->current_form->find_input("revoke_right-$principal_id-$object");
my @Rights = sort grep $_, map $_->possible_values, grep $_, @inputs;
return @Rights;
@@ -33,7 +33,7 @@ my ($everyone, $everyone_gid);
diag "revoke all global rights from Everyone group" if $ENV{'TEST_VERBOSE'};
my @has = get_rights( $m, $everyone_gid, 'RT::System-1' );
if ( @has ) {
- $m->form_number(3);
+ $m->form_number(2);
$m->tick("revoke_right-$everyone_gid-RT::System-1", $_) foreach @has;
$m->submit;
@@ -44,7 +44,7 @@ if ( @has ) {
diag "grant SuperUser right to everyone" if $ENV{'TEST_VERBOSE'};
{
- $m->form_number(3);
+ $m->form_number(2);
$m->select("grant_right-$everyone_gid-RT::System-1", ['SuperUser']);
$m->submit;
@@ -56,7 +56,7 @@ diag "grant SuperUser right to everyone" if $ENV{'TEST_VERBOSE'};
diag "revoke the right" if $ENV{'TEST_VERBOSE'};
{
- $m->form_number(3);
+ $m->form_number(2);
$m->tick("revoke_right-$everyone_gid-RT::System-1", 'SuperUser');
$m->submit;
@@ -69,7 +69,7 @@ diag "revoke the right" if $ENV{'TEST_VERBOSE'};
diag "return rights the group had in the beginning" if $ENV{'TEST_VERBOSE'};
if ( @has ) {
- $m->form_number(3);
+ $m->form_number(2);
$m->select("grant_right-$everyone_gid-RT::System-1", \@has);
$m->submit;
diff --git a/t/web/ticket_owner.t b/t/web/ticket_owner.t
index eeceb3b..d7884b9 100644
--- a/t/web/ticket_owner.t
+++ b/t/web/ticket_owner.t
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use RT::Test strict => 0, tests => 93, l10n => 1;
+use RT::Test strict => 0, tests => 94, l10n => 1;
my $queue = RT::Test->load_or_create_queue( name => 'Regression' );
@@ -32,9 +32,7 @@ ok $agent_a->login('user_a', 'password'), 'logged in as user A';
diag "current user has no right to own, nobody selected as owner on create" if $ENV{TEST_VERBOSE};
{
$agent_a->get_ok('/', 'open home page');
- $agent_a->form_name('create_ticket_in_queue');
- $agent_a->select( 'queue', $queue->id );
- $agent_a->submit;
+ $agent_a->follow_link_ok( url_regex => qr'ticket/create' , text => $queue->name);
$agent_a->content_like(qr/Create a new ticket/i, 'opened create ticket page');
my $form = $agent_a->form_name('ticket_create');
@@ -56,10 +54,7 @@ diag "current user has no right to own, nobody selected as owner on create" if $
diag "user can chose owner of a new ticket" if $ENV{TEST_VERBOSE};
{
- $agent_a->get_ok('/', 'open home page');
- $agent_a->form_name('create_ticket_in_queue');
- $agent_a->select( 'queue', $queue->id );
- $agent_a->submit;
+ $agent_a->follow_link_ok( url_regex => qr'ticket/create' , text => $queue->name);
$agent_a->content_like(qr/Create a new ticket/i, 'opened create ticket page');
my $moniker = $agent_a->moniker_for('RT::Action::CreateTicket');
@@ -102,7 +97,7 @@ diag "user A can not change owner after create" if $ENV{TEST_VERBOSE};
$agent->goto_ticket( $id );
diag("Going to ticket $id") if $ENV{TEST_VERBOSE};
$agent->follow_link_ok(text => 'Basics');
- my $form = $agent->form_number(3);
+ my $form = $agent->form_number(2);
is $agent->action_field_value(
$agent->moniker_for('RT::Action::UpdateTicket'), 'owner'
),
@@ -142,7 +137,7 @@ diag "on reply correct owner is selected" if $ENV{TEST_VERBOSE};
$agent_a->goto_ticket( $id );
$agent_a->follow_link_ok(text => 'Reply');
- my $form = $agent_a->form_number(3);
+ my $form = $agent_a->form_number(2);
is $form->value('owner'), '', 'empty value selected';
$agent_a->submit;
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list