aboutsummaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-04-22 14:13:55 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-04-22 14:22:21 +0200
commit33ea3a14b5e06fe7c13edf53ddc5ff6245d1fc34 (patch)
treef129ca2fc9b012ac3ff3c547bbbb2b26077b1f1a /server
parent43b3d2f8720f15e24fb0a21e1bf27be7e58d5842 (diff)
downloadsonarqube-33ea3a14b5e06fe7c13edf53ddc5ff6245d1fc34.tar.gz
sonarqube-33ea3a14b5e06fe7c13edf53ddc5ff6245d1fc34.zip
SONAR-6440 The "Quality Gates" page should start by a short description message explaining the concept of Quality Gates
Diffstat (limited to 'server')
-rw-r--r--server/sonar-web/src/main/coffee/quality-gate/app.coffee31
-rw-r--r--server/sonar-web/src/main/coffee/quality-gate/router.coffee4
-rw-r--r--server/sonar-web/src/main/hbs/quality-gates/_quality-gate-intro.hbs7
-rw-r--r--server/sonar-web/src/main/hbs/quality-gates/quality-gates-layout.hbs4
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/config/routes.rb1
-rw-r--r--server/sonar-web/src/test/js/quality-gates-spec.js2
-rw-r--r--server/sonar-web/src/test/views/quality_gates.jade (renamed from server/sonar-web/src/test/views/quality-gates.jade)0
7 files changed, 31 insertions, 18 deletions
diff --git a/server/sonar-web/src/main/coffee/quality-gate/app.coffee b/server/sonar-web/src/main/coffee/quality-gate/app.coffee
index 5aff2a4f4ce..38705f870b2 100644
--- a/server/sonar-web/src/main/coffee/quality-gate/app.coffee
+++ b/server/sonar-web/src/main/coffee/quality-gate/app.coffee
@@ -29,14 +29,12 @@ requirejs [
'quality-gate/views/quality-gate-edit-view',
'quality-gate/router',
'quality-gate/layout'
-], (
- QualityGates,
+], (QualityGates,
QualityGateSidebarListItemView,
QualityGateActionsView,
QualityGateEditView,
QualityGateRouter,
- QualityGateLayout
-) ->
+ QualityGateLayout) ->
# Create a Quality Gate Application
App = new Marionette.Application
@@ -46,10 +44,7 @@ requirejs [
App.openFirstQualityGate = ->
- if @qualityGates.length > 0
- @router.navigate "show/#{@qualityGates.models[0].get('id')}", trigger: true
- else
- App.layout.detailsRegion.reset()
+ App.layout.detailsRegion.reset()
App.deleteQualityGate = (id) ->
@@ -93,7 +88,12 @@ requirejs [
# Start router
App.addInitializer ->
@router = new QualityGateRouter app: @
- Backbone.history.start()
+
+ QUALITY_GATES = '/quality_gates'
+ path = window.location.pathname
+ pos = path.indexOf QUALITY_GATES
+ root = path.substr(0, pos + QUALITY_GATES.length)
+ Backbone.history.start pushState: true, root: root
# Open first quality gate when come to the page
@@ -106,9 +106,9 @@ requirejs [
appXHR = jQuery.ajax
url: "#{baseUrl}/api/qualitygates/app"
.done (r) =>
- App.canEdit = r.edit
- App.periods = r.periods
- App.metrics = r.metrics
+ App.canEdit = r.edit
+ App.periods = r.periods
+ App.metrics = r.metrics
qualityGatesXHR = App.qualityGates.fetch()
@@ -116,6 +116,7 @@ requirejs [
l10nXHR = window.requestMessages()
jQuery.when(qualityGatesXHR, appXHR, l10nXHR)
- .done ->
- # Start the application
- App.start()
+ .done ->
+ # Start the application
+ App.start()
+
diff --git a/server/sonar-web/src/main/coffee/quality-gate/router.coffee b/server/sonar-web/src/main/coffee/quality-gate/router.coffee
index 9f8f30fa713..d63a1fbc713 100644
--- a/server/sonar-web/src/main/coffee/quality-gate/router.coffee
+++ b/server/sonar-web/src/main/coffee/quality-gate/router.coffee
@@ -31,6 +31,7 @@ define [
class QualityGateRouter extends Backbone.Router
routes:
+ '': 'index'
'show/:id': 'show'
@@ -38,6 +39,9 @@ define [
@app = options.app
+ index: ->
+
+
show: (id) ->
qualityGate = @app.qualityGates.get id
if qualityGate
diff --git a/server/sonar-web/src/main/hbs/quality-gates/_quality-gate-intro.hbs b/server/sonar-web/src/main/hbs/quality-gates/_quality-gate-intro.hbs
new file mode 100644
index 00000000000..8d627a11530
--- /dev/null
+++ b/server/sonar-web/src/main/hbs/quality-gates/_quality-gate-intro.hbs
@@ -0,0 +1,7 @@
+<div class="alert alert-info">
+ <p class="spacer-bottom">Quality Gates are collections of simple boolean thresholds set on project measures. A project
+ must pass each of the thresholds in order to pass the Quality Gate as a whole.</p>
+
+ <p>It is possible to set a default Quality Gate, which will be applied to all projects not explicitly assigned to some
+ other gate.</p>
+</div>
diff --git a/server/sonar-web/src/main/hbs/quality-gates/quality-gates-layout.hbs b/server/sonar-web/src/main/hbs/quality-gates/quality-gates-layout.hbs
index e156acf6e18..caac49159fd 100644
--- a/server/sonar-web/src/main/hbs/quality-gates/quality-gates-layout.hbs
+++ b/server/sonar-web/src/main/hbs/quality-gates/quality-gates-layout.hbs
@@ -4,6 +4,6 @@
</div>
<div class="search-navigator-workspace">
- <div class="search-navigator-workspace-header"></div>
- <div class="search-navigator-workspace-list"></div>
+ <div class="search-navigator-workspace-header">&nbsp;</div>
+ <div class="search-navigator-workspace-list">{{> '_quality-gate-intro'}}</div>
</div>
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/config/routes.rb b/server/sonar-web/src/main/webapp/WEB-INF/config/routes.rb
index 6754a315d62..442ebdce8b5 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/config/routes.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/config/routes.rb
@@ -44,6 +44,7 @@ ActionController::Routing::Routes.draw do |map|
map.connect 'rules_configuration/:action/:language/:name/:plugin.:format', :controller => 'rules_configuration'
map.connect 'api_documentation/*other', :controller => 'api_documentation', :action => 'index'
+ map.connect 'quality_gates/*other', :controller => 'quality_gates', :action => 'index'
# Install the default route as the lowest priority.
map.connect ':controller/:action/:id', :requirements => { :id => /.*/ }
diff --git a/server/sonar-web/src/test/js/quality-gates-spec.js b/server/sonar-web/src/test/js/quality-gates-spec.js
index dc3c644d008..b892b5527a3 100644
--- a/server/sonar-web/src/test/js/quality-gates-spec.js
+++ b/server/sonar-web/src/test/js/quality-gates-spec.js
@@ -28,7 +28,7 @@ lib.configureCasper();
casper.test.begin('Quality Gates', function suite (test) {
casper
- .start(lib.buildUrl('quality-gates'), function () {
+ .start(lib.buildUrl('quality_gates#show/1'), function () {
lib.setDefaultViewport();
diff --git a/server/sonar-web/src/test/views/quality-gates.jade b/server/sonar-web/src/test/views/quality_gates.jade
index c7cbf2c021a..c7cbf2c021a 100644
--- a/server/sonar-web/src/test/views/quality-gates.jade
+++ b/server/sonar-web/src/test/views/quality_gates.jade