aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-07-07 12:16:05 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-07-07 12:16:15 +0200
commit8e17de7b37bcbcbb5e34497023ce1fead8462c5a (patch)
tree82a7306aad0d7e9dfc3d153c972a8633eec551f7 /server
parent2b9d9cbc933df1391c9e483ffcd8e8dba7e0d9ea (diff)
downloadsonarqube-8e17de7b37bcbcbb5e34497023ce1fead8462c5a.tar.gz
sonarqube-8e17de7b37bcbcbb5e34497023ce1fead8462c5a.zip
SONAR-6661 apply feedback
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/js/apps/update-center/list-item-view.js8
-rw-r--r--server/sonar-web/src/main/js/apps/update-center/plugins.js1
-rw-r--r--server/sonar-web/src/main/js/apps/update-center/search-view.js13
-rw-r--r--server/sonar-web/src/main/js/apps/update-center/templates/_update-center-plugin-changelog-entry.hbs2
-rw-r--r--server/sonar-web/src/main/js/apps/update-center/templates/update-center-plugin.hbs2
-rw-r--r--server/sonar-web/src/main/js/apps/update-center/templates/update-center-system-update.hbs2
-rw-r--r--server/sonar-web/src/test/json/update-center-spec/available.json2
-rw-r--r--server/sonar-web/test/medium/update-center.spec.js12
8 files changed, 35 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/apps/update-center/list-item-view.js b/server/sonar-web/src/main/js/apps/update-center/list-item-view.js
index aec237a36bb..67750c343ec 100644
--- a/server/sonar-web/src/main/js/apps/update-center/list-item-view.js
+++ b/server/sonar-web/src/main/js/apps/update-center/list-item-view.js
@@ -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);
}
});
diff --git a/server/sonar-web/src/main/js/apps/update-center/plugins.js b/server/sonar-web/src/main/js/apps/update-center/plugins.js
index f81c7702a38..021e124511c 100644
--- a/server/sonar-web/src/main/js/apps/update-center/plugins.js
+++ b/server/sonar-web/src/main/js/apps/update-center/plugins.js
@@ -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);
});
},
diff --git a/server/sonar-web/src/main/js/apps/update-center/search-view.js b/server/sonar-web/src/main/js/apps/update-center/search-view.js
index 3ace406ba06..d9988d3f448 100644
--- a/server/sonar-web/src/main/js/apps/update-center/search-view.js
+++ b/server/sonar-web/src/main/js/apps/update-center/search-view.js
@@ -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() });
}
diff --git a/server/sonar-web/src/main/js/apps/update-center/templates/_update-center-plugin-changelog-entry.hbs b/server/sonar-web/src/main/js/apps/update-center/templates/_update-center-plugin-changelog-entry.hbs
index 859ec420626..fddb84bce8c 100644
--- a/server/sonar-web/src/main/js/apps/update-center/templates/_update-center-plugin-changelog-entry.hbs
+++ b/server/sonar-web/src/main/js/apps/update-center/templates/_update-center-plugin-changelog-entry.hbs
@@ -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>
diff --git a/server/sonar-web/src/main/js/apps/update-center/templates/update-center-plugin.hbs b/server/sonar-web/src/main/js/apps/update-center/templates/update-center-plugin.hbs
index eff32440761..e8c8aab5cc2 100644
--- a/server/sonar-web/src/main/js/apps/update-center/templates/update-center-plugin.hbs
+++ b/server/sonar-web/src/main/js/apps/update-center/templates/update-center-plugin.hbs
@@ -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>
diff --git a/server/sonar-web/src/main/js/apps/update-center/templates/update-center-system-update.hbs b/server/sonar-web/src/main/js/apps/update-center/templates/update-center-system-update.hbs
index 0096dea967e..bc50d859efc 100644
--- a/server/sonar-web/src/main/js/apps/update-center/templates/update-center-system-update.hbs
+++ b/server/sonar-web/src/main/js/apps/update-center/templates/update-center-system-update.hbs
@@ -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;"/>
diff --git a/server/sonar-web/src/test/json/update-center-spec/available.json b/server/sonar-web/src/test/json/update-center-spec/available.json
index 95658631f6d..bda1a3dae08 100644
--- a/server/sonar-web/src/test/json/update-center-spec/available.json
+++ b/server/sonar-web/src/test/json/update-center-spec/available.json
@@ -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",
diff --git a/server/sonar-web/test/medium/update-center.spec.js b/server/sonar-web/test/medium/update-center.spec.js
index 978fafaff2f..bcb2d66b0f8 100644
--- a/server/sonar-web/test/medium/update-center.spec.js
+++ b/server/sonar-web/test/medium/update-center.spec.js
@@ -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')