From a6f98de0d4e842351222b0173a1fff151da8738e Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Mon, 3 Jul 2017 16:48:52 -0700 Subject: Revert "Bug 1365345 - Modal Bug Entry Prototype" This reverts commit 8835db60a8d637fe3aec82c718bad8a8177a6acf. --- extensions/BugModal/lib/WebService.pm | 23 +- .../template/en/default/bug_modal/field.html.tmpl | 3 +- extensions/BugModal/web/new_bug.js | 105 ++---- js/jquery/plugins/selectize/selectize-min.js | 3 - js/jquery/plugins/selectize/selectize.default.css | 394 --------------------- new_bug.cgi | 23 +- template/en/default/bug/new_bug.html.tmpl | 31 +- 7 files changed, 45 insertions(+), 537 deletions(-) delete mode 100644 js/jquery/plugins/selectize/selectize-min.js delete mode 100644 js/jquery/plugins/selectize/selectize.default.css diff --git a/extensions/BugModal/lib/WebService.pm b/extensions/BugModal/lib/WebService.pm index 99d0383cc..556a2d7cc 100644 --- a/extensions/BugModal/lib/WebService.pm +++ b/extensions/BugModal/lib/WebService.pm @@ -38,9 +38,9 @@ sub rest_resources { # return all the components pertaining to the product. # required by new-bug - qr{^/bug_modal/product_info}, { + qr{^/bug_modal/components}, { GET => { - method => 'product_info', + method => 'components', params => sub { return { product_name => Bugzilla->input_params->{product} } }, @@ -87,24 +87,19 @@ sub products { return { products => _name($user->get_enterable_products) }; } -sub product_info { +sub components { my ( $self, $params ) = @_; if ( !ref $params->{product_name} ) { untaint( $params->{product_name} ); } else { - ThrowCodeError( 'params_required', { function => 'BugModal.components', params => ['product'] } ); + ThrowCodeError( 'params_required', + { function => 'BugModal.components', params => ['product'] } ); } - my $product = Bugzilla::Product->check( { name => $params->{product_name}, cache => 1 } ); - $product = Bugzilla->user->can_enter_product( $product, 1 ); - my @components = map { - { - name => $_->name, - description => $_->description, - } - } @{ $product->components }; - my @versions = map { { name => $_->name } } grep { $_->is_active } @{ $product->versions }; - return { components => \@components, versions => \@versions }; + my $product = Bugzilla::Product->check({ name => $params->{product_name}, cache => 1 }); + $product = Bugzilla->user->can_enter_product($product, 1); + my @components = map { { name => $_->name, description => Bugzilla::Component->check({ product => $product, name => $_->name })->description} } @{ $product->components }; + return { components => \@components } } # everything we need for edit mode in a single call, returning just the fields diff --git a/extensions/BugModal/template/en/default/bug_modal/field.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/field.html.tmpl index c54f7c257..e84327307 100644 --- a/extensions/BugModal/template/en/default/bug_modal/field.html.tmpl +++ b/extensions/BugModal/template/en/default/bug_modal/field.html.tmpl @@ -28,7 +28,6 @@ # edit html instead of replacing it. forces edit_only (default: false); # default: (string) default value (eg. used as a placeholder in user fields) # help: (string) optional url that describes the field (requires a label to be defined and visible) - # required: (boolean) if the field is required. (At present, only implemented for FIELD_TYPE_FREETEXT) # action: (hash) show a button to the right of the edit field (user fields only currently). keys: # id: (string) optional button id # class: (string) optional button class @@ -219,7 +218,7 @@ END; [% CASE constants.FIELD_TYPE_FREETEXT %] [%# normal input field %] - + [% CASE constants.FIELD_TYPE_USER %] [% IF action && !action.hidden %] - + [% PROCESS global/footer.html.tmpl %] \ No newline at end of file -- cgit v1.2.3-24-g4f1b