From 899e9116b68a6663ed9fd4aa8cf84556845aa5fb Mon Sep 17 00:00:00 2001 From: Stas Vilchik Date: Mon, 1 Jun 2015 15:56:50 +0200 Subject: [PATCH] show intro on quality gates page --- .../src/main/js/apps/quality-gates/controller.js | 2 +- .../src/main/js/apps/quality-gates/intro-view.js | 9 +++++++++ .../sonar-web/src/main/js/apps/quality-gates/layout.js | 8 +++++++- .../apps/quality-gates/templates/quality-gates-intro.hbs | 4 ++++ .../quality-gates/templates/quality-gates-layout.hbs | 4 ++-- 5 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 server/sonar-web/src/main/js/apps/quality-gates/intro-view.js create mode 100644 server/sonar-web/src/main/js/apps/quality-gates/templates/quality-gates-intro.hbs diff --git a/server/sonar-web/src/main/js/apps/quality-gates/controller.js b/server/sonar-web/src/main/js/apps/quality-gates/controller.js index 0b03a0a0d5c..890adc1ad8b 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/controller.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/controller.js @@ -56,7 +56,7 @@ define([ this.app.router.navigate(''); this.app.layout.headerRegion.reset(); this.app.layout.detailsRegion.reset(); - //this.app.layout.renderIntro(); + this.app.layout.renderIntro(); this.app.gatesView.highlight(null); } diff --git a/server/sonar-web/src/main/js/apps/quality-gates/intro-view.js b/server/sonar-web/src/main/js/apps/quality-gates/intro-view.js new file mode 100644 index 00000000000..c9588a3d48f --- /dev/null +++ b/server/sonar-web/src/main/js/apps/quality-gates/intro-view.js @@ -0,0 +1,9 @@ +define([ + './templates' +], function () { + + return Marionette.ItemView.extend({ + template: Templates['quality-gates-intro'] + }); + +}); diff --git a/server/sonar-web/src/main/js/apps/quality-gates/layout.js b/server/sonar-web/src/main/js/apps/quality-gates/layout.js index 8d695fd34bc..e9ae08550c4 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/layout.js +++ b/server/sonar-web/src/main/js/apps/quality-gates/layout.js @@ -1,6 +1,7 @@ define([ + './intro-view', './templates' -], function () { +], function (IntroView) { var $ = jQuery; @@ -18,6 +19,11 @@ define([ var top = $('.search-navigator').offset().top; this.$('.search-navigator-workspace-header').css({ top: top }); this.$('.search-navigator-side').css({ top: top }).isolatedScroll(); + this.renderIntro(); + }, + + renderIntro: function () { + this.detailsRegion.show(new IntroView()); } }); diff --git a/server/sonar-web/src/main/js/apps/quality-gates/templates/quality-gates-intro.hbs b/server/sonar-web/src/main/js/apps/quality-gates/templates/quality-gates-intro.hbs new file mode 100644 index 00000000000..a16e566c47e --- /dev/null +++ b/server/sonar-web/src/main/js/apps/quality-gates/templates/quality-gates-intro.hbs @@ -0,0 +1,4 @@ +

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.

+

It is possible to set a default Quality Gate, which will be applied to all projects not explicitly assigned to some + other gate.

diff --git a/server/sonar-web/src/main/js/apps/quality-gates/templates/quality-gates-layout.hbs b/server/sonar-web/src/main/js/apps/quality-gates/templates/quality-gates-layout.hbs index 3428ac4d466..4ac8b8b6c37 100644 --- a/server/sonar-web/src/main/js/apps/quality-gates/templates/quality-gates-layout.hbs +++ b/server/sonar-web/src/main/js/apps/quality-gates/templates/quality-gates-layout.hbs @@ -4,6 +4,6 @@
-
 
-
{{> '_quality-gate-intro'}}
+
+
-- 2.39.5