Commit 979850b129d2474f192430403b2cd75cb962b9a2
1 parent
057737c7
Exists in
colab
and in
4 other branches
Fix parent module navigation when on root module
* Closes Issue #218 KalibroClient returns 0 instead of nil when the module has no parent. Signed-off-by: Eduardo Silva Araújo <duduktamg@hotmail.com>
Showing
2 changed files
with
3 additions
and
1 deletions
Show diff stats
app/views/modules/_module_tree.html.erb
@@ -10,7 +10,8 @@ | @@ -10,7 +10,8 @@ | ||
10 | <strong><%= KalibroModule.human_attribute_name('grade') %>:</strong> | 10 | <strong><%= KalibroModule.human_attribute_name('grade') %>:</strong> |
11 | <%= format_grade(@root_module_result.grade) %> | 11 | <%= format_grade(@root_module_result.grade) %> |
12 | </p> | 12 | </p> |
13 | -<% unless @root_module_result.parent_id.nil? %> | 13 | + |
14 | +<% unless @root_module_result.parent_id == 0 %> | ||
14 | <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> | 15 | <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> |
15 | <% end %> | 16 | <% end %> |
16 | 17 |
features/repository/show/modules_tree.feature
@@ -17,6 +17,7 @@ Feature: Repository modules tree | @@ -17,6 +17,7 @@ Feature: Repository modules tree | ||
17 | When I visit the repository show page | 17 | When I visit the repository show page |
18 | And I click the "Modules Tree" h3 | 18 | And I click the "Modules Tree" h3 |
19 | Then I should see the given module result | 19 | Then I should see the given module result |
20 | + And I should not see "../" | ||
20 | 21 | ||
21 | @kalibro_configuration_restart @kalibro_processor_restart @javascript | 22 | @kalibro_configuration_restart @kalibro_processor_restart @javascript |
22 | Scenario: Should show children of root when the process has been finished | 23 | Scenario: Should show children of root when the process has been finished |