From: Stas Vilchik Date: Thu, 7 May 2015 12:07:13 +0000 (+0200) Subject: SONAR-5851 properly restore the initial page state X-Git-Tag: 5.2-RC1~2027 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=1c5a4985c3127ac229eeef1a7cbd74bd4aff3691;p=sonarqube.git SONAR-5851 properly restore the initial page state --- diff --git a/server/sonar-web/src/main/hbs/quality-profiles/_quality-profiles-intro.hbs b/server/sonar-web/src/main/hbs/quality-profiles/_quality-profiles-intro.hbs deleted file mode 100644 index a79a158b38f..00000000000 --- a/server/sonar-web/src/main/hbs/quality-profiles/_quality-profiles-intro.hbs +++ /dev/null @@ -1,5 +0,0 @@ -
-

Quality Profiles are collections of rules to apply during an analysis.

-

For each language there is a default profile. All projects not explicitly assigned to some other profile will be - analyzed with the default.

-
diff --git a/server/sonar-web/src/main/hbs/quality-profiles/quality-profiles-intro.hbs b/server/sonar-web/src/main/hbs/quality-profiles/quality-profiles-intro.hbs new file mode 100644 index 00000000000..ae369f7f707 --- /dev/null +++ b/server/sonar-web/src/main/hbs/quality-profiles/quality-profiles-intro.hbs @@ -0,0 +1,3 @@ +

Quality Profiles are collections of rules to apply during an analysis.

+

For each language there is a default profile. All projects not explicitly assigned to some other profile will be + analyzed with the default.

diff --git a/server/sonar-web/src/main/hbs/quality-profiles/quality-profiles-layout.hbs b/server/sonar-web/src/main/hbs/quality-profiles/quality-profiles-layout.hbs index 45418b72636..91e2e23a237 100644 --- a/server/sonar-web/src/main/hbs/quality-profiles/quality-profiles-layout.hbs +++ b/server/sonar-web/src/main/hbs/quality-profiles/quality-profiles-layout.hbs @@ -4,6 +4,6 @@
-
 
-
{{> '_quality-profiles-intro'}}
+
+
diff --git a/server/sonar-web/src/main/js/quality-profiles/controller.js b/server/sonar-web/src/main/js/quality-profiles/controller.js index b3fabdd04d0..2087cd447fe 100644 --- a/server/sonar-web/src/main/js/quality-profiles/controller.js +++ b/server/sonar-web/src/main/js/quality-profiles/controller.js @@ -111,6 +111,7 @@ define([ this.options.app.router.navigate(''); this.options.app.layout.headerRegion.reset(); this.options.app.layout.detailsRegion.reset(); + this.options.app.layout.renderIntro(); this.options.app.profilesView.highlight(null); }, diff --git a/server/sonar-web/src/main/js/quality-profiles/intro-view.js b/server/sonar-web/src/main/js/quality-profiles/intro-view.js new file mode 100644 index 00000000000..a074bc6da1d --- /dev/null +++ b/server/sonar-web/src/main/js/quality-profiles/intro-view.js @@ -0,0 +1,28 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +define([ + 'templates/quality-profiles' +], function () { + + return Marionette.ItemView.extend({ + template: Templates['quality-profiles-intro'] + }); + +}); diff --git a/server/sonar-web/src/main/js/quality-profiles/layout.js b/server/sonar-web/src/main/js/quality-profiles/layout.js index d2882a0a147..ccc2f6df805 100644 --- a/server/sonar-web/src/main/js/quality-profiles/layout.js +++ b/server/sonar-web/src/main/js/quality-profiles/layout.js @@ -18,8 +18,9 @@ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ define([ + 'quality-profiles/intro-view', 'templates/quality-profiles' -], function () { +], function (IntroView) { var $ = jQuery; @@ -39,6 +40,11 @@ define([ var top = 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()); } });