aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-02-04 15:45:00 +0100
committerStas Vilchik <vilchiks@gmail.com>2015-02-04 15:48:53 +0100
commitc2e6ca69eceda7ce764afced77d4ce17a9b279ca (patch)
tree3ca566c91ce8abcffc8e75cb99ec93d9578b116a
parent9482c208d39a6d5c0a0e07e050bbb8fd1a5a950d (diff)
downloadsonarqube-c2e6ca69eceda7ce764afced77d4ce17a9b279ca.tar.gz
sonarqube-c2e6ca69eceda7ce764afced77d4ce17a9b279ca.zip
SONAR-5789 apply feedback
-rw-r--r--server/sonar-web/src/main/coffee/design/app.coffee2
-rw-r--r--server/sonar-web/src/main/coffee/design/view.coffee6
-rw-r--r--server/sonar-web/src/main/hbs/design/design.hbs10
3 files changed, 13 insertions, 5 deletions
diff --git a/server/sonar-web/src/main/coffee/design/app.coffee b/server/sonar-web/src/main/coffee/design/app.coffee
index 1365c63f813..ec4c087de77 100644
--- a/server/sonar-web/src/main/coffee/design/app.coffee
+++ b/server/sonar-web/src/main/coffee/design/app.coffee
@@ -42,7 +42,7 @@ requirejs [
else
cell.status = 'dependency'
data = data.map (row) ->
- _.extend row, empty: row.v.every (item) -> !item.w?
+ _.extend row, empty: row.q == 'DIR' && row.v.every (item) -> !item.w?
collection = new Backbone.Collection data
collection.forEach (model) ->
model.set 'pt', packageTangles[model.get 'i']
diff --git a/server/sonar-web/src/main/coffee/design/view.coffee b/server/sonar-web/src/main/coffee/design/view.coffee
index ba2d817d9cc..f0bcf8ef43c 100644
--- a/server/sonar-web/src/main/coffee/design/view.coffee
+++ b/server/sonar-web/src/main/coffee/design/view.coffee
@@ -127,3 +127,9 @@ define [
rows.each ->
$(@).find('td').eq(index + 1).toggleClass 'hidden'
+
+ serializeData: ->
+ hasDirectories = @collection.some (model) -> model.get('q') == 'DIR'
+ _.extend super,
+ hasDirectories: hasDirectories
+
diff --git a/server/sonar-web/src/main/hbs/design/design.hbs b/server/sonar-web/src/main/hbs/design/design.hbs
index 21d059293de..4c0be31f83e 100644
--- a/server/sonar-web/src/main/hbs/design/design.hbs
+++ b/server/sonar-web/src/main/hbs/design/design.hbs
@@ -21,10 +21,12 @@
<span class="dsm-legend-label">{{t 'design.legend.uses'}}</span>
<span class="dsm-legend-square yellow"></span>
</li>
- <li>
- <input class="js-hide-dir" type="checkbox" id="design-hide-empty-dir" checked>
- <label for="design-hide-empty-dir">{{t 'design.hide_empty_directories'}}</label>
- </li>
+ {{#if hasDirectories}}
+ <li>
+ <input class="js-hide-dir" type="checkbox" id="design-hide-empty-dir" checked>
+ <label for="design-hide-empty-dir">{{t 'design.hide_empty_directories'}}</label>
+ </li>
+ {{/if}}
</ul>
<div class="dsm-body">