}
public List<Transition> listTransitions(String issueKey) {
- return issueService.listTransitions(issueKey, UserSession.get());
+ return issueService.listTransitions(issueKey);
+ }
+
+ public List<Transition> listTransitions(Issue issue) {
+ return issueService.listTransitions(issue);
}
public Issue doTransition(String issueKey, String transitionKey) {
return issueService.setSeverity(issueKey, severity, UserSession.get());
}
- public Issue plan(String issueKey, String actionPlanKey) {
+ public Issue plan(String issueKey, @Nullable String actionPlanKey) {
return issueService.plan(issueKey, actionPlanKey, UserSession.get());
}
import org.sonar.server.platform.UserSession;
import javax.annotation.Nullable;
-
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
this.actionPlanService = actionPlanService;
}
- public List<Transition> listTransitions(String issueKey, UserSession userSession) {
+ public List<Transition> listTransitions(String issueKey) {
DefaultIssue issue = loadIssue(issueKey);
List<Transition> transitions = workflow.outTransitions(issue);
Collections.sort(transitions, new Comparator<Transition>() {
return transitions;
}
+ public List<Transition> listTransitions(Issue issue) {
+ List<Transition> transitions = workflow.outTransitions(issue);
+ Collections.sort(transitions, new Comparator<Transition>() {
+ @Override
+ public int compare(Transition transition, Transition transition2) {
+ return transition.key().compareTo(transition2.key());
+ }
+ });
+ return transitions;
+ }
+
public Issue doTransition(String issueKey, String transition, UserSession userSession) {
verifyLoggedIn(userSession);
DefaultIssue issue = loadIssue(issueKey);
@issue_results = Api.issues.find(params[:id])
if request.xhr?
- render :partial => 'resource/issue', :locals => {:issue => @issue_results.issues.get(0)}
+ render :partial => 'issue/issue', :locals => {:issue => @issue_results.issues.get(0)}
else
params[:layout] = 'false'
render :action => 'show'
end
@issue_results = Api.issues.find(issue_key)
- render :partial => 'resource/issue', :locals => {:issue => @issue_results.issues.get(0)}
+ render :partial => 'issue/issue', :locals => {:issue => @issue_results.issues.get(0)}
end
# form to edit comment
comment = Internal.issues.editComment(params[:key], text)
@issue_results = Api.issues.find(comment.issueKey)
- render :partial => 'resource/issue', :locals => {:issue => @issue_results.issues.get(0)}
+ render :partial => 'issue/issue', :locals => {:issue => @issue_results.issues.get(0)}
end
# modal window to delete comment
comment = Internal.issues.deleteComment(params[:id])
@issue_results = Api.issues.find(comment.issueKey)
- render :partial => 'resource/issue', :locals => {:issue => @issue_results.issues.get(0)}
+ render :partial => 'issue/issue', :locals => {:issue => @issue_results.issues.get(0)}
end
--- /dev/null
+<div class="code-issue" data-issue-key="<%= issue.key -%>" data-issue-component="<%= issue.componentKey() -%>">
+ <div class="code-issue-name">
+ <img src="<%= ApplicationController.root_context -%>/images/priority/<%= issue.severity -%>.png">
+
+ <span class="rulename">
+ <% rule_name = Internal.rules.ruleL10nName(@issue_results.rule(issue)) %>
+ <a class="open-modal" modal-width="800" href="<%= url_for :controller => 'rules', :action => 'show', :id => issue.rule_key.to_s, :modal => 'true', :layout => 'false' -%>"><%= h rule_name -%></a>
+ </span>
+
+ <%= image_tag 'sep12.png' -%>
+
+
+ <%
+ created_at = Api::Utils.java_to_ruby_datetime(issue.creationDate())
+ updated_at = Api::Utils.java_to_ruby_datetime(issue.updateDate())
+ dates_title = "Created at #{l created_at} and updated at #{l updated_at}"
+ %>
+ <span title="<%= h dates_title -%>"><%= distance_of_time_in_words_to_now(created_at) -%></span>
+
+ <%
+ if issue.resolution
+ %>
+ <%= image_tag 'sep12.png' -%>
+
+ <span><%= message("issue.resolution.#{issue.resolution}") -%></span>
+
+ <% end %>
+ <%
+ if issue.assignee
+ %>
+ <%= image_tag 'sep12.png' -%>
+
+ <%= message('assigned_to') -%> <%= h(@issue_results.user(issue.assignee).name) -%>
+
+ <% end %>
+ <%
+ if issue.actionPlanKey()
+ %>
+ <%= image_tag 'sep12.png' -%>
+
+ <%= message('issue.planned_for_x', :params => h(@issue_results.actionPlan(issue).name())) if @issue_results.actionPlan(issue) -%>
+
+ <% end %>
+
+ </div>
+
+ <% unless issue.message.blank? %>
+ <div class="code-issue-msg">
+ <%= Api::Utils.split_newlines(h(issue.message)).join('<br/>') -%>
+ </div>
+ <% end %>
+
+ <%
+ issue.comments.each do |comment|
+ comment_html_id = "comment-#{comment.key}-#{rand(100)}"
+ %>
+ <div class="code-issue-comment" id="<%= comment_html_id -%>" data-comment-key="<%= comment.key -%>">
+ <h4>
+ <%= image_tag('reviews/comment.png') -%> <b><%= @issue_results.user(comment.userLogin()).name() -%></b>
+ (<%= distance_of_time_in_words_to_now(Api::Utils.java_to_ruby_datetime(comment.createdAt)) -%>)
+ <% if current_user && current_user.login==comment.userLogin %>
+
+ <%= image_tag 'sep12.png' -%>
+
+ <a class="link-action" href="#" onclick="return formEditIssueComment(this)"><%= message('edit') -%></a>
+ <a class="link-action spacer-right" href="#" onclick="return formDeleteIssueComment(this)"><%= message('delete') -%></a>
+ <% end %>
+ </h4>
+ <%= Internal.text.markdownToHtml(comment.markdownText) -%>
+ </div>
+ <% end %>
+
+ <% if current_user %>
+ <div class="code-issue-actions">
+ <a href='#' onclick="return issueForm('comment', this)" class="link-action spacer-right"><%= message('issue.comment.formlink') -%></a>
+ <% unless issue.resolution %>
+ <span class="spacer-right">
+ <a href='#' onclick="return issueForm('assign', this)" class="link-action"><%= message('issue.assign.formlink') -%></a>
+ <% if issue.assignee!=current_user.login %>
+ [<a href="#" onclick="return assignIssueToMe(this)" class="link-action"><%= message('issue.assign.to_me') -%></a>]
+ <% end %>
+ </span>
+ <% end %>
+
+ <% Internal.issues.listTransitions(issue).each do |transition| %>
+ <a href="#" onclick="return doIssueTransition(this, '<%= transition.key -%>')" class="link-action spacer-right"><%= message("issue.transition.#{transition.key}") -%></a>
+ <% end %>
+
+ <% unless issue.resolution %>
+ <a href="#" onclick="return issueForm('severity', this)" class="link-action spacer-right"><%= message("issue.set_severity") -%></a>
+ <a href="#" onclick="return issueForm('plan', this)" class="link-action spacer-right"><%= message("issue.do_plan") -%></a>
+ <% end %>
+ </div>
+ <div class="code-issue-form hidden"></div>
+ <% end %>
+</div>
\ No newline at end of file
<input type="hidden" name="id" value="plan"/>
<select name="plan">
+ <option value=""></option>
<% plans.each do |plan| %>
<option value="<%= plan.key() -%>"><%= h(plan.name()) -%></option>
<% end %>
<div>
- <%= render :partial => 'resource/issue', :locals => {:issue => @issue_results.issues.get(0)} -%>
+ <%= render :partial => 'issue/issue', :locals => {:issue => @issue_results.issues.get(0)} -%>
</div>
\ No newline at end of file
<% if @display_issues && @global_issues && @global_issues.size>0 -%>
<div class="code-global-issues">
<% @global_issues.each do |issue| %>
- <%= render :partial => 'issue', :locals => {:issue => issue} -%></td>
+ <%= render :partial => 'issue/issue', :locals => {:issue => issue} -%></td>
<% end %>
</div>
<% end %>
+++ /dev/null
-<div class="code-issue" data-issue-key="<%= issue.key -%>" data-issue-component="<%= issue.componentKey() -%>">
- <div class="code-issue-name">
- <img src="<%= ApplicationController.root_context -%>/images/priority/<%= issue.severity -%>.png">
-
- <span class="rulename">
- <% rule_name = Internal.rules.ruleL10nName(@issue_results.rule(issue)) %>
- <a class="open-modal" modal-width="800" href="<%= url_for :controller => 'rules', :action => 'show', :id => issue.rule_key.to_s, :modal => 'true', :layout => 'false' -%>"><%= h rule_name -%></a>
- </span>
-
- <%= image_tag 'sep12.png' -%>
-
-
- <%
- created_at = Api::Utils.java_to_ruby_datetime(issue.creationDate())
- updated_at = Api::Utils.java_to_ruby_datetime(issue.updateDate())
- dates_title = "Created at #{l created_at} and updated at #{l updated_at}"
- %>
- <span title="<%= h dates_title -%>"><%= distance_of_time_in_words_to_now(created_at) -%></span>
-
- <%
- if issue.resolution
- %>
- <%= image_tag 'sep12.png' -%>
-
- <span><%= message("issue.resolution.#{issue.resolution}") -%></span>
-
- <% end %>
- <%
- if issue.assignee
- %>
- <%= image_tag 'sep12.png' -%>
-
- <%= message('assigned_to') -%> <%= h(@issue_results.user(issue.assignee).name) -%>
-
- <% end %>
- <%
- if issue.actionPlanKey()
- %>
- <%= image_tag 'sep12.png' -%>
-
- <%= message('issue.planned_for_x', :params => h(@issue_results.actionPlan(issue).name())) if @issue_results.actionPlan(issue) -%>
-
- <% end %>
-
- </div>
-
- <% unless issue.message.blank? %>
- <div class="code-issue-msg">
- <%= Api::Utils.split_newlines(h(issue.message)).join('<br/>') -%>
- </div>
- <% end %>
-
- <%
- issue.comments.each do |comment|
- comment_html_id = "comment-#{comment.key}-#{rand(100)}"
- %>
- <div class="code-issue-comment" id="<%= comment_html_id -%>" data-comment-key="<%= comment.key -%>">
- <h4>
- <%= image_tag('reviews/comment.png') -%> <b><%= @issue_results.user(comment.userLogin()).name() -%></b>
- (<%= distance_of_time_in_words_to_now(Api::Utils.java_to_ruby_datetime(comment.createdAt)) -%>)
- <% if current_user && current_user.login==comment.userLogin %>
-
- <%= image_tag 'sep12.png' -%>
-
- <a class="link-action" href="#" onclick="return formEditIssueComment(this)"><%= message('edit') -%></a>
- <a class="link-action spacer-right" href="#" onclick="return formDeleteIssueComment(this)"><%= message('delete') -%></a>
- <% end %>
- </h4>
- <%= Internal.text.markdownToHtml(comment.markdownText) -%>
- </div>
- <% end %>
-
- <% if current_user %>
- <div class="code-issue-actions">
- <a href='#' onclick="return issueForm('comment', this)" class="link-action spacer-right"><%= message('issue.comment.formlink') -%></a>
- <% unless issue.resolution %>
- <span class="spacer-right">
- <a href='#' onclick="return issueForm('assign', this)" class="link-action"><%= message('issue.assign.formlink') -%></a>
- <% if issue.assignee!=current_user.login %>
- [<a href="#" onclick="return assignIssueToMe(this)" class="link-action"><%= message('issue.assign.to_me') -%></a>]
- <% end %>
- </span>
- <% end %>
-
- <% Internal.issues.listTransitions(issue.key).each do |transition| %>
- <a href="#" onclick="return doIssueTransition(this, '<%= transition.key -%>')" class="link-action spacer-right"><%= message("issue.transition.#{transition.key}") -%></a>
- <% end %>
-
- <% unless issue.resolution %>
- <a href="#" onclick="return issueForm('severity', this)" class="link-action spacer-right"><%= message("issue.set_severity") -%></a>
- <a href="#" onclick="return issueForm('plan', this)" class="link-action spacer-right"><%= message("issue.do_plan") -%></a>
- <% end %>
- </div>
- <div class="code-issue-form hidden"></div>
- <% end %>
-</div>
\ No newline at end of file
<td class="lid"></td>
<td class="code-issues">
<% line.issues.each_with_index do |issue, index| %>
- <%= render :partial => 'issue', :locals => {:issue => issue} -%>
+ <%= render :partial => 'issue/issue', :locals => {:issue => issue} -%>
<% if index < line.issues.size-1 %>
<% end %>