Skip to content

Commit

Permalink
Fix parent module navigation when on root module
Browse files Browse the repository at this point in the history
  * Closes Issue #218

KalibroClient returns 0 instead of nil when the module has no parent.

Signed-off-by: Eduardo Silva Araújo <[email protected]>
  • Loading branch information
diegoamc committed Nov 9, 2015
1 parent 057737c commit 979850b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/views/modules/_module_tree.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
<strong><%= KalibroModule.human_attribute_name('grade') %>:</strong>
<%= format_grade(@root_module_result.grade) %>
</p>
<% unless @root_module_result.parent_id.nil? %>

<% unless @root_module_result.parent_id == 0 %>
<p id="parent"><i class="icon-arrow-up"></i><%= link_to '../', '#parent', onClick: "Module.Tree.load('#{escape_javascript(image_tag 'loader.gif')} #{escape_javascript(t('loading_data'))}', #{@root_module_result.parent_id});" %></p>
<% end %>

Expand Down
1 change: 1 addition & 0 deletions features/repository/show/modules_tree.feature
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Feature: Repository modules tree
When I visit the repository show page
And I click the "Modules Tree" h3
Then I should see the given module result
And I should not see "../"

@kalibro_configuration_restart @kalibro_processor_restart @javascript
Scenario: Should show children of root when the process has been finished
Expand Down

0 comments on commit 979850b

Please sign in to comment.