]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5820 Complete rule details with sqale metadata
authorStas Vilchik <vilchiks@gmail.com>
Tue, 23 Dec 2014 15:10:11 +0000 (16:10 +0100)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 23 Dec 2014 16:36:46 +0000 (17:36 +0100)
server/sonar-web/src/main/hbs/coding-rules/rule/coding-rules-rule-meta.hbs
server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-details.js
server/sonar-web/src/main/less/coding-rules.less

index 829003f8ed41efd3d45e078121d0ba61a7561936..44cd94a7adfc268958186edcc297dba2fa517cac 100644 (file)
@@ -32,9 +32,7 @@
     </li>
   {{/if}}
 
-  {{#if subCharacteristic}}
-    <li class="coding-rules-detail-property coding-rules-subcharacteristic">{{subCharacteristic}}</li>
-  {{/if}}
+
 
   <li class="coding-rules-detail-property">{{t 'coding_rules.available_since'}} {{d createdAt}}</li>
 
     </li>
   {{/if}}
 </ul>
+
+{{#if subCharacteristic}}
+  <ul class="coding-rules-detail-properties">
+    <li class="coding-rules-detail-property">{{subCharacteristic}}</li>
+
+    {{#if debtRemFnType}}
+      <li class="coding-rules-detail-property">
+        <span title="{{t 'coding_rules.remediation_function'}}">
+          {{t 'coding_rules.remediation_function' debtRemFnType}}
+        </span>
+      </li>
+    {{/if}}
+
+    {{#if debtRemFnCoeff}}
+      <li class="coding-rules-detail-property">
+        <span title="{{t 'coding_rules.remediation_function.coeff'}}">
+          {{debtRemFnCoeff}}
+        </span>
+      </li>
+    {{/if}}
+
+    {{#if debtRemFnOffset}}
+      <li class="coding-rules-detail-property">
+        <span title="{{#eq debtRemFnType 'CONSTANT_ISSUE'}}{{t 'coding_rules.remediation_function.constant'}}{{else}}{{t 'coding_rules.remediation_function.offset'}}{{/eq}}">
+          {{debtRemFnOffset}}
+        </span>
+      </li>
+    {{/if}}
+  </ul>
+{{/if}}
index 0598f9019fdb189e29eb46b9ccc4e5a7c677b696..1dfd0d48d287020538dd49cb458d5520cac70a9f 100644 (file)
@@ -6,7 +6,7 @@ lib.initMessages();
 lib.changeWorkingDirectory('coding-rules-page-should-show-details');
 
 
-casper.test.begin('coding-rules-page-should-show-details', 17, function (test) {
+casper.test.begin('coding-rules-page-should-show-details', 20, function (test) {
   casper
       .start(lib.buildUrl('coding-rules'), function () {
         lib.setDefaultViewport();
@@ -36,6 +36,9 @@ casper.test.begin('coding-rules-page-should-show-details', 17, function (test) {
         test.assertSelectorContains('.coding-rules-detail-properties', 'error-handling');
         test.assertSelectorContains('.coding-rules-detail-properties', '2013');
         test.assertSelectorContains('.coding-rules-detail-properties', 'SonarQube (Java)');
+        test.assertSelectorContains('.coding-rules-detail-properties', 'Reliability > Exception handling');
+        test.assertSelectorContains('.coding-rules-detail-properties', 'LINEAR');
+        test.assertSelectorContains('.coding-rules-detail-properties', '20min');
 
         test.assertSelectorContains('.coding-rules-detail-description', 'is the superclass of all errors and');
         test.assertSelectorContains('.coding-rules-detail-description', 'its subclasses should be caught.');
index 86badc92f7affb894ebd2a792e172d7267a2509d..295a1854e5626f9fbff2e76f6d1afef88545b969 100644 (file)
   font-size: 0;
 }
 
+.coding-rules-detail-properties + .coding-rules-detail-properties {
+  margin-top: -@navigatorPadding;
+}
+
 .coding-rules-detail-property {
   display: inline-block;
   vertical-align: middle;