Aklapper has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/90565


Change subject: Add support for Trello URLs to Bugzilla's 'See Also' field.
......................................................................

Add support for Trello URLs to Bugzilla's 'See Also' field.

Bug: 53969
Change-Id: I66eafe3b4e31a1a8dc9dbbeebc6c810a1d3e7014
---
M Bugzilla/BugUrl.pm
A Bugzilla/BugUrl/Trello.pm
M template/en/custom/global/user-error.html.tmpl
3 files changed, 47 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/bugzilla/modifications 
refs/changes/65/90565/1

diff --git a/Bugzilla/BugUrl.pm b/Bugzilla/BugUrl.pm
index 62ad5aa..4d31462 100644
--- a/Bugzilla/BugUrl.pm
+++ b/Bugzilla/BugUrl.pm
@@ -73,6 +73,7 @@
     Bugzilla::BugUrl::RequestTracker
     Bugzilla::BugUrl::Mingle
     Bugzilla::BugUrl::SourceForgeAllura
+    Bugzilla::BugUrl::Trello
 );
 
 ###############################
diff --git a/Bugzilla/BugUrl/Trello.pm b/Bugzilla/BugUrl/Trello.pm
new file mode 100644
index 0000000..a5482f8
--- /dev/null
+++ b/Bugzilla/BugUrl/Trello.pm
@@ -0,0 +1,45 @@
+# -*- Mode: perl; indent-tabs-mode: nil -*-
+#
+# The contents of this file are subject to the Mozilla Public
+# License Version 1.1 (the "License"); you may not use this file
+# except in compliance with the License. You may obtain a copy of
+# the License at http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS
+# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+# implied. See the License for the specific language governing
+# rights and limitations under the License.
+#
+# The Original Code is the Bugzilla Bug Tracking System.
+#
+# Contributor(s): Andre Klapper <[email protected]>
+
+package Bugzilla::BugUrl::Trello;
+use strict;
+use base qw(Bugzilla::BugUrl);
+
+use Bugzilla::Error;
+use Bugzilla::Util;
+
+###############################
+####        Methods        ####
+###############################
+
+sub should_handle {
+    my ($class, $uri) = @_;
+    # Trello URLs have this form:
+    #   https://trello.com/c/*/*
+    return (lc($uri->authority) eq 'trello.com'
+           and $uri->path =~ m|^/c/[0-9a-zA-Z]+/[0-9a-zA-Z_-]+$|) ? 1 : 0;
+}
+
+sub _check_value {
+    my $class = shift;
+
+    my $uri = $class->SUPER::_check_value(@_);
+    # Always make the link https:
+    $uri->scheme('https');
+    return $uri;
+}
+
+1;
diff --git a/template/en/custom/global/user-error.html.tmpl 
b/template/en/custom/global/user-error.html.tmpl
index 5d8800d..31be805 100644
--- a/template/en/custom/global/user-error.html.tmpl
+++ b/template/en/custom/global/user-error.html.tmpl
@@ -273,6 +273,7 @@
         <li>An issue on github.com.</li>
         <li>A ticket in rt.wikimedia.org.</li>
         <li>A card in Wikimedia's Mingle installation.</li>
+        <li>A card in Trello.</li>
       </ul>
     [% ELSIF reason == 'id' %]
       There is no valid [% terms.bug %] id in that URL.

-- 
To view, visit https://gerrit.wikimedia.org/r/90565
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I66eafe3b4e31a1a8dc9dbbeebc6c810a1d3e7014
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/bugzilla/modifications
Gerrit-Branch: master
Gerrit-Owner: Aklapper <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to