From dabfb5f4d87c195a7190a60c0d2f955324583f69 Mon Sep 17 00:00:00 2001 From: Julien Lancelot Date: Thu, 23 Oct 2014 10:27:29 +0200 Subject: SONAR-5530 Add uuid in Issue Index --- .../src/main/webapp/WEB-INF/app/controllers/issue_controller.rb | 6 +++--- .../src/main/webapp/WEB-INF/app/controllers/issues_controller.rb | 3 ++- .../src/main/webapp/WEB-INF/app/views/issue/_issue.html.erb | 5 +++-- .../src/main/webapp/WEB-INF/app/views/issue/_show.html.erb | 6 +++--- .../main/webapp/WEB-INF/app/views/issues/_bulk_change_form.html.erb | 5 +++-- 5 files changed, 14 insertions(+), 11 deletions(-) (limited to 'server/sonar-web') 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 @@ -
+ +
@@ -76,7 +77,7 @@ 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() -- cgit v1.2.3