Skip to content

Commit

Permalink
Merge pull request #11366 from rubhanazeem/fixes-11353
Browse files Browse the repository at this point in the history
Add missing parameter for diffs in supersede
  • Loading branch information
saraycp committed Jul 9, 2021
2 parents 4fadf12 + 566a85e commit 03e1f31
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/api/app/assets/javascripts/webui/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,13 @@ function loadDiffs(element){
var index = element.data('index');
var url = element.data('url') + '?index=' + index;
var diffLimit = $('.sourcediff').data('diff-limit');
var diffToSuperseded = element.data('diff-to-superseded');
if(diffLimit){
url = url + '&full_diff=' + diffLimit;
}
if(diffToSuperseded){
url = url + '&diff_to_superseded=' + diffToSuperseded;
}
$.ajax({
url: url,
success: function(){
Expand Down
3 changes: 2 additions & 1 deletion src/api/app/controllers/webui/request_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def modify_review

def show
@diff_limit = params[:full_diff] ? 0 : nil

@diff_to_superseded_id = params[:diff_to_superseded]
@is_author = @bs_request.creator == User.possibly_nobody.login

@is_target_maintainer = @bs_request.is_target_maintainer?(User.session)
Expand Down Expand Up @@ -143,6 +143,7 @@ def request_action
@action = @actions.find { |action| action[:id] == params['id'].to_i }
@active = @action[:name]
@not_full_diff = BsRequest.truncated_diffs?(@actions)
@diff_to_superseded_id = params[:diff_to_superseded]

respond_to do |format|
format.js
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/views/webui/request/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
- @actions.each_with_index do |action, index|
%li.nav-item
= link_to(action[:name], "##{valid_xml_id(action[:name])}", class: "request-tab nav-link text-nowrap #{'active' if index.zero?}",
data: { toggle: 'tab', url: request_action_url(action[:number], action[:id]), tab_pane_id: valid_xml_id(action[:name]), index: index },
role: 'tab')
data: { toggle: 'tab', url: request_action_url(action[:number], action[:id]), tab_pane_id: valid_xml_id(action[:name]), index: index,
diff_to_superseded: @diff_to_superseded_id }, role: 'tab')
.card-body
.d-flex.justify-content-center.loading-diff
.spinner-border{ role: 'status' }
Expand Down

0 comments on commit 03e1f31

Please sign in to comment.