aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-07-03 10:24:58 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-07-06 11:24:08 +0200
commitc87a6ff50a25de17b5675c5c450cddf3bddd95a7 (patch)
tree3fcc8ae44b79e5512aa1c15857ed156c006bb3b4
parent305df737845a9f3c982735e28907ba6dbdf84623 (diff)
downloadsonarqube-c87a6ff50a25de17b5675c5c450cddf3bddd95a7.tar.gz
sonarqube-c87a6ff50a25de17b5675c5c450cddf3bddd95a7.zip
SONAR-6661 apply feedback
-rw-r--r--server/sonar-web/src/main/js/apps/update-center/list-item-view.js4
-rw-r--r--server/sonar-web/src/main/js/apps/update-center/plugin-changelog-view.js14
-rw-r--r--server/sonar-web/src/main/js/apps/update-center/templates/_update-center-plugin-changelog-entry.hbs13
-rw-r--r--server/sonar-web/src/main/js/apps/update-center/templates/update-center-plugin-changelog.hbs32
-rw-r--r--server/sonar-web/src/main/js/apps/update-center/templates/update-center-plugin.hbs15
-rw-r--r--server/sonar-web/src/main/js/apps/update-center/templates/update-center-search.hbs2
-rw-r--r--server/sonar-web/src/main/js/apps/update-center/templates/update-center-system-update.hbs8
-rw-r--r--server/sonar-web/src/main/less/components/panels.less6
-rw-r--r--server/sonar-web/test/medium/update-center.spec.js26
9 files changed, 69 insertions, 51 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 578ae82589a..2005490f3b0 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
@@ -51,7 +51,9 @@ define([
e.stopPropagation();
$('body').click();
var index = $(e.currentTarget).data('idx'),
- update = this.model.get('updates')[index],
+ // if show changelog of update, show details of this update
+ // otherwise show changelog of the available release
+ update = this.model.has('release') ? this.model.toJSON() : this.model.get('updates')[index],
popup = new PluginChangelogView({
triggerEl: $(e.currentTarget),
model: new Backbone.Model(update)
diff --git a/server/sonar-web/src/main/js/apps/update-center/plugin-changelog-view.js b/server/sonar-web/src/main/js/apps/update-center/plugin-changelog-view.js
index 6ea23463630..9ece2454bb7 100644
--- a/server/sonar-web/src/main/js/apps/update-center/plugin-changelog-view.js
+++ b/server/sonar-web/src/main/js/apps/update-center/plugin-changelog-view.js
@@ -9,6 +9,20 @@ define([
onRender: function () {
this._super();
this.$('.bubble-popup-container').isolatedScroll();
+ this.$('[data-toggle="tooltip"]').tooltip({ container: 'body', placement: 'bottom' });
+ },
+
+ onClose: function () {
+ this._super();
+ this.$('[data-toggle="tooltip"]').tooltip('destroy');
+ },
+
+ serializeData: function () {
+ return _.extend(this._super(), {
+ // if there is no status, this is a new plugin
+ // => force COMPATIBLE status
+ status: this.model.get('status') || 'COMPATIBLE'
+ });
}
});
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
new file mode 100644
index 00000000000..859ec420626
--- /dev/null
+++ b/server/sonar-web/src/main/js/apps/update-center/templates/_update-center-plugin-changelog-entry.hbs
@@ -0,0 +1,13 @@
+<div class="little-spacer-bottom">
+ {{#notEq status 'COMPATIBLE'}}
+ <span class="js-plugin-changelog-version badge badge-warning spacer-right" data-toggle="tooltip"
+ title="{{t 'update_center.status' status}}">{{release.version}}</span>
+ {{else}}
+ <span class="js-plugin-changelog-version badge badge-success spacer-right">{{release.version}}</span>
+ {{/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>
+ {{/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-changelog.hbs b/server/sonar-web/src/main/js/apps/update-center/templates/update-center-plugin-changelog.hbs
index ebfb458f314..aed176b42d8 100644
--- a/server/sonar-web/src/main/js/apps/update-center/templates/update-center-plugin-changelog.hbs
+++ b/server/sonar-web/src/main/js/apps/update-center/templates/update-center-plugin-changelog.hbs
@@ -3,38 +3,12 @@
<ul class="js-plugin-changelog-list">
{{#each previousUpdates}}
- <li class="spacer-bottom">
- <div class="pull-left spacer-right">
- <span class="js-plugin-changelog-version badge badge-success little-spacer-bottom">{{release.version}}</span>
- </div>
- <div class="pull-left spacer-right">
- <p class="js-plugin-changelog-date note">{{d release.date}}</p>
- </div>
- {{#if release.changeLogUrl}}
- <div class="pull-right spacer-left">
- <a class="js-plugin-changelog-link" href="{{release.changeLogUrl}}">Release Notes</a>
- </div>
- {{/if}}
- <div class="js-plugin-changelog-description overflow-hidden">
- {{{release.description}}}
- </div>
+ <li class="big-spacer-bottom">
+ {{> '_update-center-plugin-changelog-entry'}}
</li>
{{/each}}
<li class="spacer-bottom">
- <div class="pull-left spacer-right">
- <span class="js-plugin-changelog-version badge badge-success little-spacer-bottom">{{release.version}}</span>
- </div>
- <div class="pull-left spacer-right">
- <p class="js-plugin-changelog-date note">{{d release.date}}</p>
- </div>
- {{#if release.changeLogUrl}}
- <div class="pull-right spacer-left">
- <a class="js-plugin-changelog-link" href="{{release.changeLogUrl}}">Release Notes</a>
- </div>
- {{/if}}
- <div class="js-plugin-changelog-description overflow-hidden">
- {{{release.description}}}
- </div>
+ {{> '_update-center-plugin-changelog-entry'}}
</li>
</ul>
</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 34fba6afb36..81d8c2b4740 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
@@ -46,9 +46,10 @@
</div>
<div class="overflow-hidden">
{{{release.description}}}
+ <button class="button-link js-changelog issue-rule icon-ellipsis-h" data-idx="{{@index}}"></button>
{{#notEmpty update.requires}}
<p class="little-spacer-top">
- <strong>Requires</strong>: {{#each update.requires}}{{name}}{{/each}}
+ <strong>Installing this plugin will also install</strong>: {{#each update.requires}} {{name}}{{/each}}
</p>
{{/notEmpty}}
</div>
@@ -63,13 +64,13 @@
<li class="little-spacer-bottom">
<ul class="list-inline">
{{#if homepageUrl}}
- <li><a class="js-plugin-homepage" href="{{homepageUrl}}">Homepage</a></li>
+ <li><a class="js-plugin-homepage" href="{{homepageUrl}}" target="_blank">Homepage</a></li>
{{/if}}
{{#if issueTrackerUrl}}
- <li><a class="js-plugin-issues" href="{{issueTrackerUrl}}">Issue Tracker</a></li>
+ <li><a class="js-plugin-issues" href="{{issueTrackerUrl}}" target="_blank">Issue Tracker</a></li>
{{/if}}
{{#if termsAndConditionsUrl}}
- <li><a class="js-plugin-terms" href="{{termsAndConditionsUrl}}">Terms and Conditions</a></li>
+ <li><a class="js-plugin-terms" href="{{termsAndConditionsUrl}}" target="_blank">Terms and Conditions</a></li>
{{/if}}
</ul>
</li>
@@ -83,7 +84,7 @@
<li class="little-spacer-bottom">
Developed by
{{#if organizationUrl}}
- <a class="js-plugin-organization" href="{{organizationUrl}}">{{organizationName}}</a>
+ <a class="js-plugin-organization" href="{{organizationUrl}}" target="_blank">{{organizationName}}</a>
{{else}}
<span class="js-plugin-organization">{{organizationName}}</span>
{{/if}}
@@ -94,11 +95,11 @@
<div class="pull-right big-spacer-left nowrap text-right">
{{#eq _status 'installing'}}
- <p class="text-success">To Be Installed</p>
+ <p class="text-success">{{#if version}}Update{{else}}Install{{/if}} Pending</p>
{{/eq}}
{{#eq _status 'uninstalling'}}
- <p class="text-danger">To Be Uninstalled</p>
+ <p class="text-danger">Uninstall Pending</p>
{{/eq}}
{{#unless _status}}
diff --git a/server/sonar-web/src/main/js/apps/update-center/templates/update-center-search.hbs b/server/sonar-web/src/main/js/apps/update-center/templates/update-center-search.hbs
index 6c7d20d15b1..c4801a0ae05 100644
--- a/server/sonar-web/src/main/js/apps/update-center/templates/update-center-search.hbs
+++ b/server/sonar-web/src/main/js/apps/update-center/templates/update-center-search.hbs
@@ -9,7 +9,7 @@
<li>
<input type="radio" name="update-center-filter" value="updates" id="update-center-filter-updates"
{{#eq state.section 'updates'}}checked{{/eq}}>
- <label for="update-center-filter-updates">Updates</label>
+ <label for="update-center-filter-updates">Updates Only</label>
</li>
<li>
<input type="radio" name="update-center-filter" value="available" id="update-center-filter-available"
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 7ecc1b25fb4..09d8b04ece0 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
@@ -11,14 +11,14 @@
<div class="display-inline-block text-top width-20">
<div>
<strong class="js-plugin-name">SonarQube {{version}}</strong>
- <span class="js-plugin-category badge badge-success spacer-left">System Update</span>
+ <span class="js-plugin-category badge badge-success spacer-left">System Upgrade</span>
</div>
<div class="js-plugin-description little-spacer-top">{{{description}}}</div>
<ul class="big-spacer-top">
{{#if changeLogUrl}}
<li class="little-spacer-bottom">
- <a class="js-plugin-release-notes" href="{{changeLogUrl}}">Release Notes</a>
+ <a class="js-plugin-release-notes" href="{{changeLogUrl}}" target="_blank">Release Notes</a>
</li>
{{/if}}
{{#if releaseDate}}
@@ -33,9 +33,9 @@
</div>
<ul class="js-plugin-update-steps list-styled overflow-hidden bordered-left">
<li class="little-spacer-bottom">Stop SonarQube</li>
- <li class="little-spacer-bottom"><a href="{{downloadUrl}}">Download</a> and install
+ <li class="little-spacer-bottom"><a href="{{downloadUrl}}" target="_blank">Download</a> and install
SonarQube {{version}} after having carefully read the
- <a href="http://redirect.sonarsource.com/doc/upgrading.html">upgrade guide</a>.
+ <a href="http://redirect.sonarsource.com/doc/upgrading.html" target="_blank">upgrade guide</a>.
</li>
{{#each plugins.incompatible}}
<li class="little-spacer-bottom">
diff --git a/server/sonar-web/src/main/less/components/panels.less b/server/sonar-web/src/main/less/components/panels.less
index 6cdd8de70cf..9200d4eb339 100644
--- a/server/sonar-web/src/main/less/components/panels.less
+++ b/server/sonar-web/src/main/less/components/panels.less
@@ -25,10 +25,8 @@
padding: 10px;
}
-.panel:not(.hidden) + .panel {
- margin-top: 10px;
- padding-top: 20px;
- border-top: 1px solid @barBorderColor;
+.panel:not(:last-child) {
+ border-bottom: 1px solid @barBorderColor;
}
.panel-vertical {
diff --git a/server/sonar-web/test/medium/update-center.spec.js b/server/sonar-web/test/medium/update-center.spec.js
index c46fddaa590..6ef19879e78 100644
--- a/server/sonar-web/test/medium/update-center.spec.js
+++ b/server/sonar-web/test/medium/update-center.spec.js
@@ -42,7 +42,7 @@ define(function (require) {
.checkElementExist('.js-plugin-name')
.checkElementCount('li[data-system]', 1)
.checkElementInclude('li[data-system] .js-plugin-name', 'SonarQube 5.3')
- .checkElementInclude('li[data-system] .js-plugin-category', 'System Update')
+ .checkElementInclude('li[data-system] .js-plugin-category', 'System Upgrade')
.checkElementInclude('li[data-system] .js-plugin-description', 'New!')
.checkElementCount('li[data-system] .js-plugin-release-notes', 1)
.checkElementCount('li[data-system] .js-plugin-date', 1)
@@ -152,7 +152,7 @@ define(function (require) {
.checkElementInclude('li:not(.hidden)[data-id] .js-plugin-name', 'JavaScript');
});
- bdd.it('should show plugin changelog', function () {
+ bdd.it('should show changelog of plugin update', function () {
return this.remote
.open('#installed')
.mockFromString('/api/l10n/index', '{}')
@@ -169,6 +169,22 @@ define(function (require) {
.checkElementCount('.bubble-popup .js-plugin-changelog-description', 2);
});
+ bdd.it('should show changelog of plugin release', 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' })
+ .checkElementExist('.js-plugin-name')
+ .clickElement('li[data-id="abap"] .js-changelog')
+ .checkElementExist('.bubble-popup')
+ .checkElementCount('.bubble-popup .js-plugin-changelog-version', 1)
+ .checkElementCount('.bubble-popup .js-plugin-changelog-date', 1)
+ .checkElementCount('.bubble-popup .js-plugin-changelog-link', 1)
+ .checkElementCount('.bubble-popup .js-plugin-changelog-description', 1);
+ });
+
bdd.it('should update plugin', function () {
return this.remote
.open('#installed')
@@ -181,7 +197,7 @@ define(function (require) {
.checkElementExist('.js-plugin-name')
.clickElement('li[data-id="scmgit"] .js-update')
.checkElementNotExist('li[data-id="scmgit"] .js-spinner')
- .checkElementInclude('li[data-id="scmgit"]', 'To Be Installed');
+ .checkElementInclude('li[data-id="scmgit"]', 'Update Pending');
});
bdd.it('should uninstall plugin', function () {
@@ -196,7 +212,7 @@ define(function (require) {
.checkElementExist('.js-plugin-name')
.clickElement('li[data-id="scmgit"] .js-uninstall')
.checkElementNotExist('li[data-id="scmgit"] .js-spinner')
- .checkElementInclude('li[data-id="scmgit"]', 'To Be Uninstalled');
+ .checkElementInclude('li[data-id="scmgit"]', 'Uninstall Pending');
});
bdd.it('should install plugin', function () {
@@ -210,7 +226,7 @@ define(function (require) {
.checkElementExist('.js-plugin-name')
.clickElement('li[data-id="abap"] .js-install')
.checkElementNotExist('li[data-id="abap"] .js-spinner')
- .checkElementInclude('li[data-id="abap"]', 'To Be Installed');
+ .checkElementInclude('li[data-id="abap"]', 'Install Pending');
});
bdd.it('should cancel all pending', function () {