Skip to content

Commit

Permalink
Merge pull request #11307 from rubhanazeem/fix-hardcoded-route
Browse files Browse the repository at this point in the history
Move url to data variable
  • Loading branch information
vpereira committed Jun 29, 2021
2 parents 048a9cf + afa428c commit e5ed563
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/api/app/assets/javascripts/webui/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,9 @@ $(document).ready(function(){

function loadDiffs(element){
$('.loading-diff').removeClass('invisible');
var id = element.data('action-id');
var number = element.data('req-number');
var index = element.data('index');
var url = element.data('url') + '?index=' + index;
var diffLimit = $('.sourcediff').data('diff-limit');
var url = '/request/'+ number + '/request_action/' + id + '?index=' + index;
if(diffLimit){
url = url + '&full_diff=' + diffLimit;
}
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/views/webui/request/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
- @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', action_id: action[:id], req_number: action[:number], tab_pane_id: valid_xml_id(action[:name]), index: index },
data: { toggle: 'tab', url: request_action_url(action[:number], action[:id]), tab_pane_id: valid_xml_id(action[:name]), index: index },
role: 'tab')
.card-body
.d-flex.justify-content-center.loading-diff
Expand Down

0 comments on commit e5ed563

Please sign in to comment.