diff options
author | Sebastin Santy <sebastinssanty@gmail.com> | 2017-07-18 18:05:42 +0200 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2017-07-18 18:05:42 +0200 |
commit | d6c10b6532b45b6f59ec3777fb49d7184db68384 (patch) | |
tree | 0f2bb5e02cfbf31affa59860b967bfe09a5fa511 /extensions/BugModal/lib | |
parent | e584382118470d374df647336f6ad45311909b34 (diff) | |
download | bugzilla-d6c10b6532b45b6f59ec3777fb49d7184db68384.tar.gz bugzilla-d6c10b6532b45b6f59ec3777fb49d7184db68384.tar.xz |
Bug 1381749 - Add keywords to new-bug
Diffstat (limited to 'extensions/BugModal/lib')
-rw-r--r-- | extensions/BugModal/lib/WebService.pm | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/extensions/BugModal/lib/WebService.pm b/extensions/BugModal/lib/WebService.pm index 99d0383cc..b69d609dd 100644 --- a/extensions/BugModal/lib/WebService.pm +++ b/extensions/BugModal/lib/WebService.pm @@ -30,9 +30,9 @@ sub rest_resources { return [ # return all the products accessible by the user. # required by new-bug - qr{^/bug_modal/products}, { + qr{^/bug_modal/initial_field_values}, { GET => { - method => 'products' + method => 'initial_field_values' }, }, @@ -82,9 +82,12 @@ sub rest_resources { ] } -sub products { +sub initial_field_values { my $user = Bugzilla->user; - return { products => _name($user->get_enterable_products) }; + return { + products => _name($user->get_enterable_products), + keywords => _name([Bugzilla::Keyword->get_all()]), + }; } sub product_info { @@ -103,8 +106,10 @@ sub product_info { description => $_->description, } } @{ $product->components }; - my @versions = map { { name => $_->name } } grep { $_->is_active } @{ $product->versions }; - return { components => \@components, versions => \@versions }; + return { + components => \@components, + versions => _name($product->versions), + }; } # everything we need for edit mode in a single call, returning just the fields |