#------------------------------------------------------------------------------
issues.issue_number=Issue #{0}
+issues.no_action_plan=None
+issues.planned_for_x=Planned for {0}
+issues.planned_for_label=Planned for
+issues.an_action_plan_must_be_created_first=An action plan should be first created to plan the remediation effort of this violation.
issues.hide_this_message=Hide this message
issues.user_does_not_exist=\ : user does not exist. \\nPlease select a valid user or leave the field blank.
issues.new_severity_label=New severity:
ruleIds.add(dto.getRuleId());
componentIds.add(dto.getResourceId());
+ actionPlanKeys.add(dto.getActionPlanKey());
}
}
:securityExclusions => results.securityExclusions,
:paging => paging_to_json(results.paging),
:issues => results.issues.map { |issue| issue_to_json(issue) },
- :rules => results.rules.map { |rule| rule_to_json(rule) }
+ :rules => results.rules.map { |rule| rule_to_json(rule) },
+ :actionPlans => results.actionPlans.map { |action_plan| action_plan_to_json(action_plan) }
}
)
end
:rule => issue.ruleKey.toString(),
:status => issue.status
}
+ json[:actionPlan] = issue.actionPlanKey if issue.actionPlanKey
json[:resolution] = issue.resolution if issue.resolution
json[:severity] = issue.severity if issue.severity
json[:desc] = issue.description if issue.description
json
end
+ def action_plan_to_json(action_plan)
+ json = {:key => action_plan.key(), :name => action_plan.name(), :status => action_plan.status()}
+ json[:desc] = action_plan.description() if action_plan.description() && !action_plan.description().blank?
+ json[:userLogin] = action_plan.userLogin() if action_plan.userLogin()
+ json[:deadLine] = format_java_datetime(action_plan.deadLine()) if action_plan.deadLine()
+ json[:creationDate] = format_java_datetime(action_plan.creationDate()) if action_plan.creationDate()
+ json[:updateDate] = format_java_datetime(action_plan.updateDate()) if action_plan.updateDate()
+ json
+ end
+
def paging_to_json(paging)
{
:pageIndex => paging.pageIndex,
protected
def init_issue(issue_key)
- issue_result = find_issue(issue_key)
- @issue = issue_result.issues[0]
+ @issue_result = find_issue(issue_key)
+ @issue = @issue_result.issues[0]
end
def init_resource
<%= l(Api::Utils.to_date(@issue.updateDate())) if @issue.updateDate() -%>
</td>
</tr>
-
- <% # TODO action plan %>
-
-
+ <% if @issue.actionPlanKey() %>
+ <% action_plan = @issue_result.actionPlan(@issue) %>
+ <tr>
+ <td class="key">
+ <%= message('issues.planned_for_label') -%>:
+ </td>
+ <td class="val" colspan="3">
+ <%= h(action_plan.name()) -%>
+ </td>
+ </tr>
+ <% end %>
<% if @issue.rule_key %>
- <% rule_name = Internal.rules.ruleL10nName(@issue.rule_key) %>
+ <% rule_name = Internal.rules.ruleL10nName(@issue_result.rule(@issue)) %>
<tr>
<td class="key">
<%= message('rule') -%>:
<% end %>
<%
# TODO display assignee name instead of login
- #if violation.review && violation.review.assignee_id
if issue.assignee
%>
<%= image_tag 'sep12.png' -%>
when(issueDao.selectIssueIdsAndComponentsId(eq(query), any(SqlSession.class))).thenReturn(dtoList);
when(issueDao.selectByIds(anyCollection(), any(SqlSession.class))).thenReturn(dtoList);
-
IssueFinder.Results results = finder.find(query, null, UserRole.USER);
assertThat(results.issues()).hasSize(2);
- Issue issue = results.issues().iterator().next();
assertThat(results.issues()).hasSize(2);
- assertThat(results.component(issue)).isEqualTo(component);
assertThat(results.components()).hasSize(1);
+ Issue issue = results.issues().iterator().next();
+ assertThat(results.component(issue)).isEqualTo(component);
}
@Test
List<IssueDto> dtoList = newArrayList(issue1, issue2);
when(issueDao.selectIssueIdsAndComponentsId(eq(query), any(SqlSession.class))).thenReturn(dtoList);
when(issueDao.selectByIds(anyCollection(), any(SqlSession.class))).thenReturn(dtoList);
-
when(actionPlanFinder.findByKeys(anyCollection())).thenReturn(newArrayList(actionPlan1, actionPlan2));
IssueFinder.Results results = finder.find(query, null, UserRole.USER);
assertThat(results.issues()).hasSize(2);
+ assertThat(results.actionPlans()).hasSize(2);
Issue issue = results.issues().iterator().next();
assertThat(results.actionPlan(issue)).isNotNull();
}