]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-4610 Highlight product name in red when license details do not match product
authorStas Vilchik <vilchiks@gmail.com>
Thu, 14 Jan 2016 13:52:25 +0000 (14:52 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Thu, 14 Jan 2016 13:52:25 +0000 (14:52 +0100)
server/sonar-web/src/main/webapp/WEB-INF/app/views/settings/_type_LICENSE.html.erb

index 346c555d249c0a5af8ea54d9f197f0644a42fc20..b28e4cd0efc62bbcdb039fedf7ef26e540358838 100644 (file)
@@ -3,6 +3,10 @@
 <%
    else
      license = controller.java_facade.parseLicense(value)
+     product = license.getProduct() || '-'
+     # super-hack here
+     # should be avoided in the future
+     does_product_match = property.key == "sonar.#{product}.license.secured"
 %>
   <div class="width100">
     <textarea rows="6" name="<%= name -%>" id="<%= id -%>" style="float: left;width: 390px"><%= h value -%></textarea>
@@ -10,8 +14,8 @@
     <div style="margin-left: 400px">
       <table>
         <tr>
-          <td class="form-key-cell">Product:</td>
-          <td class="form-val-cell"><%= license.getProduct() || '-' -%></td>
+          <td class="form-key-cell <% if !does_product_match -%>bg-danger<% end -%>">Product:</td>
+          <td class="form-val-cell <% if !does_product_match -%>bg-danger<% end -%>"><%= product -%></td>
         </tr>
         <tr>
           <td class="form-key-cell">Organization:</td>
@@ -43,7 +47,7 @@
               <span class='error'><%= license.getServer() -%></span>
             <% else %>
               <%= license.getServer() || '-' -%>
-            <% end %>            
+            <% end %>
           </td>
         </tr>
         <% license.additionalProperties().each do |k,v| -%>
@@ -55,4 +59,4 @@
       </table>
     </div>
   </div>
-<% end %>
\ No newline at end of file
+<% end %>