]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-5851 properly restore the initial page state
authorStas Vilchik <vilchiks@gmail.com>
Thu, 7 May 2015 12:07:13 +0000 (14:07 +0200)
committerStas Vilchik <vilchiks@gmail.com>
Thu, 7 May 2015 12:07:13 +0000 (14:07 +0200)
server/sonar-web/src/main/hbs/quality-profiles/_quality-profiles-intro.hbs [deleted file]
server/sonar-web/src/main/hbs/quality-profiles/quality-profiles-intro.hbs [new file with mode: 0644]
server/sonar-web/src/main/hbs/quality-profiles/quality-profiles-layout.hbs
server/sonar-web/src/main/js/quality-profiles/controller.js
server/sonar-web/src/main/js/quality-profiles/intro-view.js [new file with mode: 0644]
server/sonar-web/src/main/js/quality-profiles/layout.js

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 (file)
index a79a158..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<div class="">
-  <p class="spacer-bottom">Quality Profiles are collections of rules to apply during an analysis.</p>
-  <p>For each language there is a default profile. All projects not explicitly assigned to some other profile will be
-    analyzed with the default.</p>
-</div>
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 (file)
index 0000000..ae369f7
--- /dev/null
@@ -0,0 +1,3 @@
+<p class="spacer-bottom">Quality Profiles are collections of rules to apply during an analysis.</p>
+<p>For each language there is a default profile. All projects not explicitly assigned to some other profile will be
+  analyzed with the default.</p>
index 45418b726364a6cfc97e3eced662870e6877c86b..91e2e23a237cf1012c00e71d68db815720af2abb 100644 (file)
@@ -4,6 +4,6 @@
 </div>
 
 <div class="search-navigator-workspace">
-  <div class="search-navigator-workspace-header">&nbsp;</div>
-  <div class="search-navigator-workspace-details">{{> '_quality-profiles-intro'}}</div>
+  <div class="search-navigator-workspace-header"></div>
+  <div class="search-navigator-workspace-details"></div>
 </div>
index b3fabdd04d0a44210a19442899ba111d12bbae8c..2087cd447fe847c053827e72d892bbdbeb8bd641 100644 (file)
@@ -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 (file)
index 0000000..a074bc6
--- /dev/null
@@ -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']
+  });
+
+});
index d2882a0a1479483f964c65a8aa9ed576c59ebae1..ccc2f6df8056df86d827659680b0f48509f70968 100644 (file)
@@ -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());
     }
   });