]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4593 Display group description in User window
authorStas Vilchik <vilchiks@gmail.com>
Mon, 25 Aug 2014 09:24:43 +0000 (15:24 +0600)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 25 Aug 2014 09:24:43 +0000 (15:24 +0600)
Fix the issue with the empty group description

server/sonar-web/src/main/webapp/WEB-INF/app/views/users/_select_group.html.erb

index bbc663788872057b26c46152b0f04fc69945cf3e..e55c18626fd30b6f9e22ee3ebc9320e6fc917cf0 100644 (file)
   var selectList = new SelectList({
     el: '#select-list-user',
     width: '100%',
-    format: function (item) { return item.name + ' <div class="subtitle">' + item.description + '</div>'; },
+    format: function (item) {
+      var label = item.name;
+      if (item.description) {
+        label += ' <div class="subtitle">' + item.description + '</div>'
+      }
+      return label;
+    },
     searchUrl: baseUrl + '/user_groups/search?user=<%= @user.login -%>',
     selectUrl: baseUrl + '/groups/add_member',
     deselectUrl: baseUrl + '/groups/remove_member',