From 09de3de190a692dfbc2533ceee8f31648905b91a Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Fri, 17 Apr 2015 12:56:18 +0800 Subject: Bug 1154730: rewrite product/component searching to use jquery-ui instead of yui --- extensions/ProdCompSearch/lib/WebService.pm | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'extensions/ProdCompSearch/lib') diff --git a/extensions/ProdCompSearch/lib/WebService.pm b/extensions/ProdCompSearch/lib/WebService.pm index b9a03eb27..3bf0e1377 100644 --- a/extensions/ProdCompSearch/lib/WebService.pm +++ b/extensions/ProdCompSearch/lib/WebService.pm @@ -15,10 +15,31 @@ use base qw(Bugzilla::WebService); use Bugzilla::Error; use Bugzilla::Util qw(detaint_natural trick_taint trim); +############# +# Constants # +############# + use constant PUBLIC_METHODS => qw( prod_comp_search ); +sub rest_resources { + return [ + qr{^/prod_comp_search/(.*)$}, { + GET => { + method => 'prod_comp_search', + params => sub { + return { search => $_[0] } + } + } + } + ] +} + +################## +# Public Methods # +################## + sub prod_comp_search { my ($self, $params) = @_; my $user = Bugzilla->user; @@ -104,6 +125,10 @@ sub prod_comp_search { return { products => $products }; } +################### +# Private Methods # +################### + sub _build_terms { my ($query, $product, $component) = @_; my $dbh = Bugzilla->dbh(); -- cgit v1.2.3-24-g4f1b