aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorJulien Lancelot <julien.lancelot@sonarsource.com>2014-10-23 10:27:29 +0200
committerJulien Lancelot <julien.lancelot@sonarsource.com>2014-10-23 15:09:57 +0200
commitdabfb5f4d87c195a7190a60c0d2f955324583f69 (patch)
treea3f6576304ecbad119cf930f6ded417bcaf682f8 /server/sonar-web
parent76bc2bfa058d721700fbb0c2900f9dab1fc61306 (diff)
downloadsonarqube-dabfb5f4d87c195a7190a60c0d2f955324583f69.tar.gz
sonarqube-dabfb5f4d87c195a7190a60c0d2f955324583f69.zip
SONAR-5530 Add uuid in Issue Index
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb6
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb3
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb5
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/views/issue/_show.html.erb6
-rw-r--r--server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb5
5 files changed, 14 insertions, 11 deletions
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb
index 66407eb2395..993dcc86d63 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issue_controller.rb
@@ -206,8 +206,8 @@ class IssueController < ApplicationController
def init_issue(issue_key)
@issue = Internal.issues.getIssueByKey(issue_key)
- @project = Internal.component_api.findByKey(@issue.projectKey())
- @component = Internal.component_api.findByKey(@issue.componentKey())
+ @project = Internal.component_api.findByUuid(@issue.projectUuid())
+ @component = Internal.component_api.findByUuid(@issue.componentUuid())
@rule = Internal.rules.findByKey(@issue.ruleKey().to_s)
@action_plan = Internal.issues.findActionPlan(@issue.actionPlanKey()) if @issue.actionPlanKey()
@comments = Internal.issues.findComments(issue_key)
@@ -224,7 +224,7 @@ class IssueController < ApplicationController
@users[u.login()] = u
end
- resource = Project.by_key(@issue.componentKey())
+ resource = Project.by_key(@component.key())
@snapshot = resource.last_snapshot if resource.last_snapshot
end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb
index 887e8e63797..7d0474c8e00 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/controllers/issues_controller.rb
@@ -138,7 +138,8 @@ class IssuesController < ApplicationController
else
@issues = Internal.issues.execute(issues_query_params).issues()
end
- @projects = Set.new(@issues.map {|issue| issue.projectKey()})
+
+ @projectUuids = Set.new(@issues.map {|issue| issue.projectUuid()})
render :partial => 'issues/bulk_change_form'
end
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb
index 6e6e6dc93cd..01395bc3cd9 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb
@@ -1,4 +1,5 @@
-<div id="issue-<%= u issue.key -%>" class="code-issue code-issue-collapsed" data-issue-key="<%= issue.key -%>" data-issue-component="<%= issue.componentKey() -%>" data-issue-rule="<%= u issue.ruleKey().toString() -%>">
+<!-- TODO @component.key() should be replaced by issue.componentUuid -->
+<div id="issue-<%= u issue.key -%>" class="code-issue code-issue-collapsed" data-issue-key="<%= issue.key -%>" data-issue-component="<%= @component.key() -%>" data-issue-rule="<%= u issue.ruleKey().toString() -%>">
<div class="code-issue-name code-issue-toggle">
<div class="code-issue-name-rule">
<i class="icon-severity-<%= issue.severity.downcase -%>"></i>
@@ -76,7 +77,7 @@
<div class="dropdown">
<a href="#" class="link-action link-more" onclick="showDropdownMenuOnElement($j(this).next('.dropdown-menu')); return false;"><%= message('more_actions') -%></a>
<ul style="display: none" class="dropdown-menu">
- <% if Java::OrgSonarServerUser::UserSession.get().hasProjectPermission('issueadmin', issue.projectKey) %>
+ <% if Java::OrgSonarServerUser::UserSession.get().hasProjectPermissionByUuid('issueadmin', issue.projectUuid()) %>
<% unless issue.resolution %>
<li>
<a href="#" onclick="return issueForm('severity', this)" class="link-action spacer-right"><%= message("issue.set_severity") -%></a>
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issue/_show.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issue/_show.html.erb
index d6e5b8f3923..5b5c3b43895 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issue/_show.html.erb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issue/_show.html.erb
@@ -5,18 +5,18 @@
component = @component
%>
- <% if project && @issue.componentKey() != project.key() %>
+ <% if @issue.componentUuid() != project.uuid() %>
<div class="subtitle">
<%= h project.longName() -%>
</div>
<% end %>
<span class="h1">
- <% if component %>
+ <% if component.isEnabled() %>
<%= qualifier_icon(component) %>
<a href="<%= ApplicationController.root_context -%>/component/index#component=<%= component.key() -%>&tab=issues" class="issue-component-link"
onclick="window.open(this.href,'resource-<%= component.key().parameterize -%>','height=800,width=900,scrollbars=1,resizable=1');return false;"><%= h component.longName() -%></a>
<% else %>
- <%= h @issue.componentKey() %> [<del><%= message('issue.component_deleted') %></del>]
+ <%= h component.key() %> [<del><%= message('issue.component_deleted') %></del>]
<% end %>
</span>
</div>
diff --git a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb
index 729cd13e2cf..3802a05e99d 100644
--- a/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb
+++ b/server/sonar-web/src/main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb
@@ -1,5 +1,6 @@
<%
- project_key = @projects.to_a.first if !@projects.empty? && @projects.to_a.size == 1
+ project_uuid = @projectUuids.to_a.first if !@projectUuids.empty? && @projectUuids.to_a.size == 1
+ project_key = Internal.component_api.findByUuid(project_uuid).key() if project_uuid
max_page_size_reached = @issues.size >= Internal.issues.maxPageSize()
transitions_by_issues = {}
@@ -16,7 +17,7 @@
transitions_by_issues[transition.key] = issues_for_transition
end
unresolved_issues += 1 unless issue.resolution()
- if Java::OrgSonarServerUser::UserSession.get().hasProjectPermission('issueadmin', issue.projectKey)
+ if Java::OrgSonarServerUser::UserSession.get().hasProjectPermissionByUuid('issueadmin', issue.projectUuid)
unresolved_issues_user_can_admin += 1 unless issue.resolution()
end
at_least_one_issue_is_planned ||= issue.actionPlanKey()