[Rt-commit] rt branch, 4.0/saved-search-context, updated. rt-4.0.1-220-gf28d1fd

Jason May jasonmay at bestpractical.com
Mon Sep 12 12:52:42 EDT 2011


The branch, 4.0/saved-search-context has been updated
       via  f28d1fd7084189adcfde13266848b00295449701 (commit)
       via  e4cd6c97cbfe01ff9479158a369aa85ad5049ea9 (commit)
       via  fd869e43909d3c8cd8665444f78e324f2d66b6f2 (commit)
       via  812c29529589cc4f4417682425b7a79941e625b4 (commit)
      from  9cb31b4c8c8dad422e61927ac9fdbd652b2524d0 (commit)

Summary of changes:
 share/html/Search/Chart.html |    4 +++
 t/web/search_tabs.t          |   57 +++++++++++++++++++++++++++++++++++++++--
 2 files changed, 58 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 812c29529589cc4f4417682425b7a79941e625b4
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu Apr 28 17:09:23 2011 -0400

    use warnings in search_tabs.t

diff --git a/t/web/search_tabs.t b/t/web/search_tabs.t
index 3cd8f8b..0528c80 100644
--- a/t/web/search_tabs.t
+++ b/t/web/search_tabs.t
@@ -1,5 +1,5 @@
 #!/usr/bin/perl
-
+use warnings;
 use strict;
 
 use RT::Test tests => 7;

commit fd869e43909d3c8cd8665444f78e324f2d66b6f2
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Apr 29 10:05:17 2011 -0400

    Test for "add and search", #17237

diff --git a/t/web/search_tabs.t b/t/web/search_tabs.t
index 0528c80..53d8bcb 100644
--- a/t/web/search_tabs.t
+++ b/t/web/search_tabs.t
@@ -2,7 +2,7 @@
 use warnings;
 use strict;
 
-use RT::Test tests => 7;
+use RT::Test tests => 12;
 my ($baseurl, $agent) = RT::Test->started_ok;
 
 my $ticket = RT::Ticket->new(RT->SystemUser);
@@ -17,6 +17,7 @@ for ( 1 .. 2 ) {
 
 ok $agent->login('root', 'password'), 'logged in as root';
 
+# [issues.bestpractical.com #16841] {
 $agent->get_ok('/Search/Build.html');
 
 $agent->form_name('BuildQuery');
@@ -32,4 +33,26 @@ $agent->submit('AddClause');
 
 $agent->follow_link_ok({id => 'page-results'});
 $agent->title_is('Found 2 tickets');
+# }
+
+# [issues.bestpractical.com #17237] {
+$agent->follow_link_ok({text => 'New Search'});
+$agent->title_is('Query Builder');
+
+$agent->form_name('BuildQuery');
+$agent->field('idOp', '=');
+$agent->field('ValueOfid', '1');
+$agent->submit('AddClause');
+
+$agent->form_name('BuildQuery');
+$agent->field('idOp', '=');
+$agent->field('ValueOfid', '2');
+$agent->field('AndOr', 'OR');
+$agent->click_button(name => 'DoSearch');
+
+$agent->title_is('Found 2 tickets');
+
+$agent->follow_link_ok({id => 'page-results'});
+$agent->title_is('Found 2 tickets');
+# }
 

commit e4cd6c97cbfe01ff9479158a369aa85ad5049ea9
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Thu May 12 16:52:55 2011 -0400

    Test for search builder dropping SaveChartSearchId

diff --git a/t/web/search_tabs.t b/t/web/search_tabs.t
index 53d8bcb..b3ed2cb 100644
--- a/t/web/search_tabs.t
+++ b/t/web/search_tabs.t
@@ -2,11 +2,11 @@
 use warnings;
 use strict;
 
-use RT::Test tests => 12;
+use RT::Test tests => 21;
 my ($baseurl, $agent) = RT::Test->started_ok;
 
 my $ticket = RT::Ticket->new(RT->SystemUser);
-for ( 1 .. 2 ) {
+for ( 1 .. 3 ) {
     $ticket->Create(
         Subject   => 'Ticket ' . $_,
         Queue     => 'General',
@@ -56,3 +56,31 @@ $agent->follow_link_ok({id => 'page-results'});
 $agent->title_is('Found 2 tickets');
 # }
 
+$agent->follow_link_ok({text => 'Chart'});
+$agent->text_contains('id = 1 OR id = 2');
+$agent->form_name('SaveSearch');
+$agent->field('SavedSearchDescription' => 'this is my saved chart');
+$agent->click_button(name => 'SavedSearchSave');
+
+# Confirm that we saved the chart and that it's the "current chart"
+$agent->text_contains('Chart this is my saved chart saved.');
+$agent->form_name('SaveSearch');
+is($agent->value('SavedSearchDescription'), 'this is my saved chart');
+
+$agent->follow_link_ok({text => 'Edit Search'});
+$agent->form_name('BuildQuery');
+$agent->field('idOp', '=');
+$agent->field('ValueOfid', '3');
+$agent->field('AndOr', 'OR');
+$agent->click_button(name => 'DoSearch');
+
+$agent->title_is('Found 3 tickets');
+
+$agent->follow_link_ok({text => 'Chart'});
+$agent->text_contains('id = 1 OR id = 2 OR id = 3');
+
+# The interesting bit: confirm that the chart we saved is still the
+# "current chart" after roundtripping through search builder
+$agent->form_name('SaveSearch');
+is($agent->value('SavedSearchDescription'), 'this is my saved chart');
+

commit f28d1fd7084189adcfde13266848b00295449701
Author: Jason May <jasonmay at bestpractical.com>
Date:   Fri Sep 9 18:14:21 2011 -0400

    Give the menu tabs the chart ID when saving a new chart
    
    Charts could be saved, but could not be updated unless explicitly
    loaded again. This preserves the saved chart ID between tab clicks.
    
    This change also lets the saved chart context survive when the user
    clicks "Add these terms and Search" (and loses the session data) on
    a new saved chart.

diff --git a/share/html/Search/Chart.html b/share/html/Search/Chart.html
index 05de333..fb24254 100644
--- a/share/html/Search/Chart.html
+++ b/share/html/Search/Chart.html
@@ -105,6 +105,10 @@ my %query;
         $query{'SavedChartSearchId'} = $m->request_args->{'SavedSearchLoad'};
     }
 
+    if ($m->request_args->{'SavedSearchSave'}) {
+        $query{'SavedChartSearchId'} = $saved_search->{'SearchId'};
+    }
+
 }
 
 </%init>

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


More information about the Rt-commit mailing list