[Rt-commit] rtir branch, 2.6/pick-missed-commits, created. 2.6.1rc1-6-g36bef3b

Ruslan Zakirov ruz at bestpractical.com
Tue Aug 16 12:46:42 EDT 2011


The branch, 2.6/pick-missed-commits has been created
        at  36bef3b0d306046d412a45b128874bd677cd276a (commit)

- Log -----------------------------------------------------------------
commit 63d3d814e09ebc84c6d7483945edfdf6e193ae4d
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Jan 4 12:00:19 2011 +0800

    allow all the 2+ letter tlds for email and test for this

diff --git a/html/Callbacks/RTIR/Elements/MakeClicky/Default b/html/Callbacks/RTIR/Elements/MakeClicky/Default
index 0adfe9e..7e04396 100644
--- a/html/Callbacks/RTIR/Elements/MakeClicky/Default
+++ b/html/Callbacks/RTIR/Elements/MakeClicky/Default
@@ -112,7 +112,7 @@ my @types = (
     },
     {
         name   => "email",
-        regex  => qr{(?:mailto:)?<?[\w\.\+-]+\@[\w\.-]+\.\w{2,3}>?},
+        regex  => qr{(?:mailto:)?<?[\w\.\+-]+\@[\w\.-]+\.\w{2,}>?},
         action => "email",
     },
     {
diff --git a/t/015-make-clicky.t b/t/015-make-clicky.t
index d1942ae..9035b71 100644
--- a/t/015-make-clicky.t
+++ b/t/015-make-clicky.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::IR::Test tests => 38;
+use RT::IR::Test tests => 94;
 
 RT::Test->started_ok;
 my $agent = default_agent();
@@ -47,3 +47,53 @@ diag "clicky ip" if $ENV{'TEST_VERBOSE'};
     ok(!grep( lc $_->text eq 'lookup ip', @links ), "not found link");
 }
 
+diag "clicky email" if $ENV{'TEST_VERBOSE'};
+{
+
+    for my $email (
+        'foo at example.com',  'foo-bar+baz at example.me',
+        'foo at example.mobi', 'foo at localhost.localhost',
+      )
+    {
+        diag "test valid email $email" if $ENV{TEST_VERBOSE};
+        my ( $name, $domain ) = split /@/, $email, 2;
+        my $id =
+          $agent->create_ir( { Subject => 'clicky email', Content => $email } );
+        $agent->display_ticket($id);
+        my @links = $agent->followable_links;
+        if ( $clicky{'email'} ) {
+            my ($email_link) = grep lc $_->text eq 'lookup email', @links;
+            ok( $email_link, "found link" );
+            ok( $email_link->url =~ /(?<!\w)\Q$email\E(?!\w)/,
+                'url has an email' );
+
+            my ($domain_link) = grep lc $_->text eq qq{lookup "$domain"},
+              @links;
+            ok( $domain_link, "found link" );
+            ok( $domain_link->url =~ /(?<!\w)\Q$domain\E(?!\w)/,
+                'url has a domain' );
+        }
+        else {
+            ok( !grep( lc $_->text eq 'lookup email', @links ),
+                "not found email link" );
+            ok( !grep( lc $_->text eq qq{lookup "$domain"}, @links ),
+                "not found domain link" );
+        }
+
+    }
+
+    for my $email ( 'foo at example', '@example.com', ) {
+        diag "test invalid email $email" if $ENV{TEST_VERBOSE};
+
+        my ( $name, $domain ) = split /@/, $email, 2;
+        my $id =
+          $agent->create_ir( { Subject => 'clicky email', Content => $email } );
+        $agent->display_ticket($id);
+        my @links = $agent->followable_links;
+        ok( !grep( lc $_->text eq 'lookup email', @links ),
+            "not found email link" );
+        ok( !grep( lc $_->text eq qq{lookup "$domain"}, @links ),
+            "not found domain link" );
+    }
+}
+

commit b2dc745a84add2da769d0de80d28cd5e92a0c367
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed Nov 10 08:43:25 2010 -0500

    Ignore vim swaps and prove droppings

diff --git a/.gitignore b/.gitignore
index b26b11f..8f20f86 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,5 @@ blib/
 pm_to_blib
 t/tmp
 *.swp
+*.swo
+.prove

commit 36bef3b0d306046d412a45b128874bd677cd276a
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed Nov 10 08:57:32 2010 -0500

    Display our calendars for date selection during creation
    
    We already do this on Edit

diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index 4094f3f..21c63a6 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -235,11 +235,11 @@
       <table border="0">
         <tr>
         <td align="right"><&|/l&>Starts</&>:</td>
-          <td><input size="10" name="Starts" value="<% $ARGS{Starts} || '' %>" /></td>
+          <td ><& /Elements/SelectDate, Name => 'Starts', Default => $ARGS{Starts}||'' &> 
         </tr>
         <tr>
         <td align="right"><&|/l&>Due</&>:</td>
-        <td><input size="10" name="Due" value="<% $ARGS{Due} || '' %>" /></td>
+          <td ><& /Elements/SelectDate, Name => 'Due', Default => $ARGS{Due}||'' &> 
         </tr>
       </table>
     </&>
diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index 9cbc609..0d15990 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -170,10 +170,10 @@ unless ( exists $ARGS{'Content'} ) {
 <table border="0">
 
     <tr><td align="right"><&|/l&>Starts</&>:</td>
-    <td><input size="10" name="Starts" value="<% $ARGS{'Starts'} || '' %>" /></td></tr>
+    <td ><& /Elements/SelectDate, Name => 'Starts', Default => $ARGS{Starts}||'' &> 
     
     <tr><td align="right"><&|/l&>Due</&>:</td>
-    <td><input size="10" name="Due" value="<% $ARGS{'Due'} || '' %>" /></td></tr>
+    <td ><& /Elements/SelectDate, Name => 'Due', Default => $ARGS{Due}||'' &> 
 
 </table>
 </&>

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


More information about the Rt-commit mailing list