aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-04-01 14:50:30 +0200
committerStas Vilchik <vilchiks@gmail.com>2015-04-01 14:50:44 +0200
commit5bf0a42ca702e6ee7eae4871849e9f08e82e9f0a (patch)
tree0b1283a93e7bcdc5b0452a17f4db9ef19901563e
parent80d9b2ebd2c6aa10f35b1e2dbbc3ef79b444e0fd (diff)
downloadsonarqube-5bf0a42ca702e6ee7eae4871849e9f08e82e9f0a.tar.gz
sonarqube-5bf0a42ca702e6ee7eae4871849e9f08e82e9f0a.zip
SONAR-6331 fix display of the overview page of provisioned projects
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb2
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb62
2 files changed, 35 insertions, 29 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb
index 338d95ed2ac..7e5101285b0 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/dashboard_controller.rb
@@ -216,7 +216,7 @@ class DashboardController < ApplicationController
end
def redirect_if_overview
- if @resource && !params[:did] && !params[:name]
+ if @resource && @snapshot && !params[:did] && !params[:name]
redirect_to :controller => 'overview', :action => 'index', :id => @resource.key
end
end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb
index 4627c31d911..48eb422c5d9 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/overview/index.html.erb
@@ -1,34 +1,40 @@
-<div class="overview"></div>
+<% if @snapshot %>
+ <div class="overview"></div>
-<%
- period1Name = short_period_label(@snapshot, 1)
- period2Name = short_period_label(@snapshot, 2)
- period3Name = short_period_label(@snapshot, 3)
+ <%
+ period1Name = short_period_label(@snapshot, 1)
+ period2Name = short_period_label(@snapshot, 2)
+ period3Name = short_period_label(@snapshot, 3)
- period1Date = @snapshot.period_datetime(1)
- period2Date = @snapshot.period_datetime(2)
- period3Date = @snapshot.period_datetime(3)
-%>
+ period1Date = @snapshot.period_datetime(1)
+ period2Date = @snapshot.period_datetime(2)
+ period3Date = @snapshot.period_datetime(3)
+ %>
-<script>
- window.overviewConf = {
- <% if period1Date %>
- period1Name: '<%= period1Name -%>',
- period1Date: '<%= period1Date.strftime('%FT%T%z') -%>',
- <% end %>
+ <script>
+ window.overviewConf = {
+ <% if period1Date %>
+ period1Name: '<%= period1Name -%>',
+ period1Date: '<%= period1Date.strftime('%FT%T%z') -%>',
+ <% end %>
- <% if period2Date %>
- period2Name: '<%= period2Name -%>',
- period2Date: '<%= period2Date.strftime('%FT%T%z') -%>',
- <% end %>
+ <% if period2Date %>
+ period2Name: '<%= period2Name -%>',
+ period2Date: '<%= period2Date.strftime('%FT%T%z') -%>',
+ <% end %>
- <% if period3Date %>
- period3Name: '<%= period3Name -%>',
- period3Date: '<%= period3Date.strftime('%FT%T%z') -%>',
- <% end %>
+ <% if period3Date %>
+ period3Name: '<%= period3Name -%>',
+ period3Date: '<%= period3Date.strftime('%FT%T%z') -%>',
+ <% end %>
- componentKey: '<%= @resource.key -%>',
- componentUuid: '<%= @resource.uuid -%>'
- };
- require(['overview/app']);
-</script>
+ componentKey: '<%= @resource.key -%>',
+ componentUuid: '<%= @resource.uuid -%>'
+ };
+ require(['overview/app']);
+ </script>
+<% else %>
+ <div class="page">
+ <p class="alert alert-warning"><%= message('provisioning.no_analysis') -%></p>
+ </div>
+<% end %>