]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-6661 apply feedback
authorStas Vilchik <vilchiks@gmail.com>
Tue, 7 Jul 2015 10:16:05 +0000 (12:16 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Tue, 7 Jul 2015 10:16:15 +0000 (12:16 +0200)
server/sonar-web/src/main/js/apps/update-center/list-item-view.js
server/sonar-web/src/main/js/apps/update-center/plugins.js
server/sonar-web/src/main/js/apps/update-center/search-view.js
server/sonar-web/src/main/js/apps/update-center/templates/_update-center-plugin-changelog-entry.hbs
server/sonar-web/src/main/js/apps/update-center/templates/update-center-plugin.hbs
server/sonar-web/src/main/js/apps/update-center/templates/update-center-system-update.hbs
server/sonar-web/src/test/json/update-center-spec/available.json
server/sonar-web/test/medium/update-center.spec.js

index aec237a36bbdf26099969fa07923434f3f80178e..67750c343ecf5a82b1d93f607f3358dd03fff054 100644 (file)
@@ -22,7 +22,8 @@ define([
       'click .js-install': 'install',
       'click .js-update': 'update',
       'click .js-uninstall': 'uninstall',
-      'change .js-terms': 'onTermsChange'
+      'change .js-terms': 'onTermsChange',
+      'click .js-plugin-category': 'onCategoryClick'
     },
 
     getTemplate: function () {
@@ -86,6 +87,11 @@ define([
     onTermsChange: function () {
       var isAccepted = this.$('.js-terms').is(':checked');
       this.$('.js-install').prop('disabled', !isAccepted);
+    },
+
+    onCategoryClick: function (e) {
+      e.preventDefault();
+      this.model.trigger('filter', this.model);
     }
   });
 
index f81c7702a38b68002dd173981931813e888fc285..021e124511cf78a73cb992ecdaf98d538ae866d1 100644 (file)
@@ -146,7 +146,6 @@ define([
             plugins.set(that._installed);
             plugins.set(that._updates, { remove: true });
             plugins.set(that._pending, { add: false, remove: false });
-            plugins.add(that._systemUpdates);
             that.reset(plugins.models);
           });
     },
index 3ace406ba067e02cd769f1c0ddb5ca55b8b08d07..d9988d3f4484e54b6da50e703aef6f4b1a27c5d3 100644 (file)
@@ -10,7 +10,12 @@ define([
 
       'submit #update-center-search-form': 'onFormSubmit',
       'search #update-center-search-query': 'debouncedOnKeyUp',
-      'keyup #update-center-search-query': 'debouncedOnKeyUp'
+      'keyup #update-center-search-query': 'debouncedOnKeyUp',
+      'change #update-center-search-query': 'debouncedOnKeyUp'
+    },
+
+    collectionEvents: {
+      'filter': 'onFilter'
     },
 
     initialize: function () {
@@ -57,6 +62,12 @@ define([
       }, 0);
     },
 
+    onFilter: function (model) {
+      var q = model.get('category');
+      this.$('#update-center-search-query').val(q)
+      this.search(q);
+    },
+
     serializeData: function () {
       return _.extend(this._super(), { state: this.options.state.toJSON() });
     }
index 859ec420626b86902317ca622744ab227ae108ce..fddb84bce8c8d30fcedd41afa1c8c875301444aa 100644 (file)
@@ -7,7 +7,7 @@
   {{/notEq}}
   <span class="js-plugin-changelog-date note spacer-right">{{d release.date}}</span>
   {{#if release.changeLogUrl}}
-    <a class="js-plugin-changelog-link" href="{{release.changeLogUrl}}">Release Notes</a>
+    <a class="js-plugin-changelog-link" href="{{release.changeLogUrl}}" target="_blank">Release Notes</a>
   {{/if}}
 </div>
 <div class="js-plugin-changelog-description">{{{release.description}}}</div>
index eff324407616244b56b3a0e127d6aa6c894ee6f9..e8c8aab5cc2744a87641f4d8e1d491ddf69331b9 100644 (file)
@@ -4,7 +4,7 @@
       <div>
         <strong class="js-plugin-name">{{name}}</strong>
         {{#if category}}
-          <span class="js-plugin-category badge spacer-left">{{category}}</span>
+          <a class="js-plugin-category badge spacer-left" href="#">{{category}}</a>
         {{/if}}
       </div>
       <div class="js-plugin-description little-spacer-top">{{{description}}}</div>
index 0096dea967e865613b19d05689778ab69892f3df..bc50d859efcf48f9ebab444ad2ddbd14946747dd 100644 (file)
@@ -1,6 +1,6 @@
 <table class="width-100">
   <tr>
-    <td class="text-top big-spacer-right">
+    <td class="text-top thin big-spacer-right">
       <svg width="60" height="60" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;">
         <g id="Layer1">
             <path d="M52.0841,58.4777L48.8003,58.4777C48.8003,32.0551 26.9663,10.4603 0,10.4603L0,7.06778C28.7278,7.06778 52.1493,30.2719 52.1493,58.4777L52.084,58.4777L52.0841,58.4777Z" style="fill:rgb(75,159,213);fill-rule:nonzero;"/>
index 95658631f6d216033ec37212b337e97e860fe509..bda1a3dae08ed43a7565b53e70836a4d7ccccba0 100644 (file)
@@ -23,7 +23,7 @@
     {
       "key": "visualstudio",
       "name": "Analysis Bootstrapper for Visual Studio Projects",
-      "category": "Languages",
+      "category": "Integration",
       "description": "Bootstraps the analysis from Visual Studio solution and project files.",
       "license": "GNU LGPL 3",
       "organizationName": "SonarSource",
index 978fafaff2f3635f0a8336f1bf69c2fafbf2ce89..bcb2d66b0f897b8d422b8bb84322a6d294b4e3a0 100644 (file)
@@ -155,6 +155,18 @@ define(function (require) {
           .checkElementInclude('li:not(.hidden)[data-id] .js-plugin-name', 'JavaScript');
     });
 
+    bdd.it('should search by category on click', function () {
+      return this.remote
+          .open('#available')
+          .mockFromString('/api/l10n/index', '{}')
+          .mockFromFile('/api/plugins/available', 'update-center-spec/available.json')
+          .mockFromFile('/api/plugins/pending', 'update-center-spec/pending.json')
+          .startApp('update-center', { urlRoot: '/test/medium/base.html' })
+          .checkElementCount('li[data-id]:not(.hidden)', 3)
+          .clickElement('li[data-id="abap"] .js-plugin-category')
+          .checkElementCount('li[data-id]:not(.hidden)', 2);
+    });
+
     bdd.it('should show changelog of plugin update', function () {
       return this.remote
           .open('#installed')