]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5851 apply feedback
authorStas Vilchik <vilchiks@gmail.com>
Mon, 4 May 2015 15:40:12 +0000 (17:40 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Mon, 4 May 2015 15:41:32 +0000 (17:41 +0200)
server/sonar-web/src/main/hbs/quality-profiles/quality-profile-changelog.hbs
server/sonar-web/src/main/hbs/quality-profiles/quality-profiles-actions.hbs
server/sonar-web/src/main/hbs/quality-profiles/quality-profiles-profile-details.hbs
server/sonar-web/src/main/hbs/quality-profiles/quality-profiles-profile.hbs
server/sonar-web/src/main/js/quality-profiles/profile-changelog-view.js
server/sonar-web/src/main/js/quality-profiles/profile.js
server/sonar-web/src/test/js/quality-profiles.js

index dfcd86e388d0ac8d1617fcb4591dfa8e55c4a21f..92d872824488d6f90b92f3f79cc82ea200688df2 100644 (file)
     </tbody>
   </table>
 
-  {{#unlessLength events totalEvents}}
-    <p class="spacer-top text-center">
-      <a class="js-show-more-changelog" href="#">{{t 'show_more'}}</a>
-    </p>
-  {{/unlessLength}}
+
+  <p class="spacer-top text-center">
+    {{#unlessLength events totalEvents}}
+      <a class="js-show-more-changelog spacer-right" href="#">{{t 'show_more'}}</a>
+    {{/unlessLength}}
+    <a class="js-hide-changelog" href="#">{{t 'hide'}}</a>
+  </p>
+
 {{else}}
   {{#notNull totalEvents}}
     <div class="alert alert-info">{{t 'quality_profiles.changelog.empty'}}</div>
index 24fa188c8994b3d21d5521e61d459e3ffda7d67e..2d887af6df322f5ed0fc0d6ec50587c92cbf1d4a 100644 (file)
@@ -1,15 +1,12 @@
 <header class="page-header">
   <h1 class="page-title">{{t 'quality_profiles.page'}}</h1>
 
-  <div class="page-actions">
-    {{#if canWrite}}
+  {{#if canWrite}}
+    <div class="page-actions">
       <div class="button-group dropdown">
         <button id="quality-profiles-create">{{t 'create'}}</button>
         <a class="button dropdown-toggle" href="#" data-toggle="dropdown"><i class="icon-dropdown"></i></a>
         <ul class="dropdown-menu dropdown-menu-right">
-          <li>
-            <a id="quality-profiles-compare" href="#">{{t 'quality_profiles.compare_profiles'}}</a>
-          </li>
           <li>
             <a id="quality-profiles-restore" href="#">{{t 'quality_profiles.restore_profile'}}</a>
           </li>
           </li>
         </ul>
       </div>
-    {{else}}
-      <div class="button-group">
-        <button id="quality-profiles-compare">{{t 'quality_profiles.compare_profiles'}}</button>
-      </div>
-    {{/if}}
-  </div>
+    </div>
+  {{/if}}
 </header>
 
 <div class="dropdown" id="quality-profiles-filter-by-language">
index 554aebc60a005391e9b6e79cd8e8d89a8d99d56f..7f1d8c3c99369dd30086b0873028d4a379516851 100644 (file)
@@ -1,35 +1,55 @@
-<div class="panel panel-vertical" id="quality-profile-rules">
-  <header class="page-header">
-    <h3 class="page-title">{{t 'coding_rules'}}</h3>
-  </header>
-  <p>
-    <a class="big" href="{{link rulesSearchUrl}}">{{formatMeasure activeRuleCount 'INT'}}</a>
-    {{tp 'quality_profile.x_active_rules' ''}}
-  </p>
-  {{#notEmpty rulesSeverities}}
-    <div class="abs-width-400 spacer-top">
-      <div class="columns">
-        <div class="column-half">
-          {{#eachEven rulesSeverities}}
-            <p class="spacer-top">
-              {{severityIcon val}}
-              <a href="{{link ../rulesSearchUrl '|active_severities=' val}}">{{formatMeasure count 'INT'}}</a>
-              <span class="text-lowercase">{{t 'severity' val}}</span>
-            </p>
-          {{/eachEven}}
-        </div>
-        <div class="column-half">
-          {{#eachOdd rulesSeverities}}
-            <p class="spacer-top">
-              {{severityIcon val}}
-              <a href="{{link ../rulesSearchUrl '|active_severities=' val}}">{{formatMeasure count 'INT'}}</a>
-              <span class="text-lowercase">{{t 'severity' val}}</span>
-            </p>
-          {{/eachOdd}}
+<div class="panel panel-vertical">
+  <div class="columns">
+    <div class="column-two-thirds" id="quality-profile-rules">
+      <header class="page-header">
+        <h3 class="page-title">{{t 'coding_rules'}}</h3>
+      </header>
+      <p>
+        <a class="big" href="{{link rulesSearchUrl}}">{{formatMeasure activeRuleCount 'INT'}}</a>
+        {{tp 'quality_profile.x_active_rules' ''}}
+      </p>
+      {{#notEmpty rulesSeverities}}
+        <div class="abs-width-400 spacer-top">
+          <div class="columns">
+            <div class="column-half">
+              {{#eachEven rulesSeverities}}
+                <p class="spacer-top">
+                  {{severityIcon val}}
+                  <a href="{{link ../rulesSearchUrl '|active_severities=' val}}">{{formatMeasure count 'INT'}}</a>
+                  <span class="text-lowercase">{{t 'severity' val}}</span>
+                </p>
+              {{/eachEven}}
+            </div>
+            <div class="column-half">
+              {{#eachOdd rulesSeverities}}
+                <p class="spacer-top">
+                  {{severityIcon val}}
+                  <a href="{{link ../rulesSearchUrl '|active_severities=' val}}">{{formatMeasure count 'INT'}}</a>
+                  <span class="text-lowercase">{{t 'severity' val}}</span>
+                </p>
+              {{/eachOdd}}
+            </div>
+          </div>
         </div>
-      </div>
+      {{/notEmpty}}
+    </div>
+
+    <div class="column-third" id="quality-profile-permalinks">
+      <header class="page-header">
+        <h3 class="page-title">{{t 'permalinks'}}</h3>
+      </header>
+      <ul class="list-inline">
+        <li>
+          <a href="{{exporterUrl this null}}" target="_blank"><i class="icon-detach"></i>&nbsp;{{t 'quality_profiles.export_all_rules'}}</a>
+        </li>
+        {{#each exporters}}
+          <li>
+            <a href="{{exporterUrl ../this key}}" target="_blank"><i class="icon-detach"></i>&nbsp;{{name}}</a>
+          </li>
+        {{/each}}
+      </ul>
     </div>
-  {{/notEmpty}}
+  </div>
 </div>
 
 <div class="panel panel-vertical" id="quality-profile-projects">
   {{/if}}
 </div>
 
-<div class="panel panel-vertical" id="quality-profile-permalinks">
-  <header class="page-header">
-    <h3 class="page-title">{{t 'permalinks'}}</h3>
-  </header>
-  <ul class="list-inline">
-    <li>
-      <a href="{{exporterUrl this null}}" target="_blank"><i class="icon-detach"></i>&nbsp;{{t 'quality_profiles.export_all_rules'}}</a>
-    </li>
-    {{#each exporters}}
-      <li>
-        <a href="{{exporterUrl ../this key}}" target="_blank"><i class="icon-detach"></i>&nbsp;{{name}}</a>
-      </li>
-    {{/each}}
-  </ul>
-</div>
-
 <div class="panel panel-vertical" id="quality-profile-inheritance">
   <header class="page-header">
     <h3 class="page-title">{{t 'quality_profiles.profile_inheritance'}}</h3>
index 030140c27b1ba86e7dbc976611c0852cc385249b..f6cc63068b8976e1c181b976aa84a57c3efcfd37 100644 (file)
@@ -1,12 +1,12 @@
 <table>
   <tr>
+    <td class="text-top">{{name}}</td>
     {{#if isInherited}}
-      <td class="text-top thin spacer-right">
+      <td class="text-top thin spacer-left">
         <i class="icon-inheritance" title="{{tp 'quality_profiles.inherits' parentName}}"
            data-toggle="tooltip" data-placement="bottom"></i>
       </td>
     {{/if}}
-    <td class="text-top">{{name}}</td>
     <td class="text-top thin nowrap spacer-left">
       {{#if isDefault}}
         <span class="badge pull-right">{{t 'default'}}</span>
index a07618999bd1d6a2198b3b662df2e383487b1fcc..0e9083ecb7bc04f89694b4b086eb3c23d4eb720f 100644 (file)
@@ -26,7 +26,8 @@ define([
 
     events: {
       'submit #quality-profile-changelog-form': 'onFormSubmit',
-      'click .js-show-more-changelog': 'onShowMoreChangelogClick'
+      'click .js-show-more-changelog': 'onShowMoreChangelogClick',
+      'click .js-hide-changelog': 'onHideChangelogClick'
     },
 
     onFormSubmit: function (e) {
@@ -39,6 +40,11 @@ define([
       this.model.fetchMoreChangelog();
     },
 
+    onHideChangelogClick: function (e) {
+      e.preventDefault();
+      this.model.resetChangelog();
+    },
+
     getSearchParameters: function () {
       var form = this.$('#quality-profile-changelog-form');
       return {
index 4f4bd39133adcf8e75bd0bce81146847898bd0ef..7315821cf1c965fb792ab8f0ec3627fe0d8cde2c 100644 (file)
@@ -105,6 +105,13 @@ define(function () {
       });
     },
 
+
+    resetChangelog: function () {
+      this.unset('events', { silent: true });
+      this.unset('eventsPage', { silent: true });
+      this.unset('totalEvents');
+    },
+
     compareWith: function (withKey) {
       var that = this,
           url = baseUrl + '/api/qualityprofiles/compare',
index 04ca1ff46f62cab5c773f00a9d7e84f5c0612495..50042e42ce2572e89f771699598c1d713d0e388f 100644 (file)
@@ -984,7 +984,7 @@ casper.test.begin(testName('Permalink'), 9, function (test) {
 });
 
 
-casper.test.begin(testName('Changelog'), 21, function (test) {
+casper.test.begin(testName('Changelog'), 22, function (test) {
   casper
       .start(lib.buildUrl('profiles#show?key=java-sonar-way-67887'), function () {
         lib.setDefaultViewport();
@@ -1052,6 +1052,11 @@ casper.test.begin(testName('Changelog'), 21, function (test) {
         test.assertSelectorContains('#quality-profile-changelog tbody tr:nth-child(3)', 'runFinalizersOnExit');
       })
 
+      .then(function () {
+        casper.click('.js-hide-changelog');
+        test.assertDoesntExist('#quality-profile-changelog tbody tr');
+      })
+
       .then(function () {
         lib.sendCoverage();
       })