Commit c5f4049b34ca01f893a490b37e3c452152b14fd6

Authored by Rafael Manzo
1 parent 5a337d1a

[Colab] Fixes processing state query for subdirectory on routes

app/views/repositories/reload_processing.js.erb
@@ -2,10 +2,13 @@ current_path_splited = window.location.pathname.split("/"); @@ -2,10 +2,13 @@ current_path_splited = window.location.pathname.split("/");
2 if(current_path_splited[1] != "projects"){ 2 if(current_path_splited[1] != "projects"){
3 current_path_splited.splice(1,1); // Removes the locale 3 current_path_splited.splice(1,1); // Removes the locale
4 } 4 }
  5 +if(current_path_splited[1] != "projects"){
  6 + current_path_splited.splice(1,1); // Removes the subdirectory
  7 +}
5 current_path = current_path_splited.join("/"); 8 current_path = current_path_splited.join("/");
6 9
7 // This if prevents it from updating the repository's state after the user leaves its page 10 // This if prevents it from updating the repository's state after the user leaves its page
8 -if(current_path == '<%= project_repository_path(project_id: @repository.project_id, id: @repository, locale: nil) %>'){ 11 +if(current_path == '<%= project_repository_path(project_id: @repository.project_id, id: @repository, locale: nil, subdirectory: nil) %>'){
9 $('div#processing_information').html('<%= escape_javascript(render partial: "processing_information") %>'); 12 $('div#processing_information').html('<%= escape_javascript(render partial: "processing_information") %>');
10 repository = new Module.Repository(<%= @repository.project_id %>, <%= @repository.id %>) 13 repository = new Module.Repository(<%= @repository.project_id %>, <%= @repository.id %>)
11 repository.schedule_poll_state('<%= @processing.state %>') 14 repository.schedule_poll_state('<%= @processing.state %>')