'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 () {
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);
}
});
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);
});
},
'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 () {
}, 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() });
}
{{/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>
<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>
<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;"/>
{
"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",
.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')