action_plans.col.closed_on=Closed on
action_plans.col.operations=Operations
action_plans.no_action_plan=No action plan
-action_plans.no_reviews_linked_to_action_plan=No reviews linked to this action plan yet.
-action_plans.confirm_delete=Delete this action plan? Associated reviews will not be deleted.
-action_plans.confirm_close=Close this action plan? There are still open reviews linked to it.
+action_plans.confirm_delete=Delete this action plan? Associated issues will not be deleted.
+action_plans.confirm_close=Close this action plan? There are still open issues linked to it.
action_plans.create_form_title=Create Action Plan
action_plans.edit_action_plan=Edit Action Plan
action_plans.same_name_in_same_project=An action plan with this name already exists in this project.
action_plans.date_format_help=The date should be entered using the following pattern: 'day/month/year'. For instance, '31/12/2011'.
action_plans.date_not_valid=Date not valid
action_plans.date_cant_be_in_past=The dead-line can't be in the past
-action_plans.x_out_of_x_reviews_solved={0} of {1} reviews solved
-action_plans.resolved_reviews_x_percent=Resolved reviews - {0}% ({1} reviews)
-action_plans.open_reviews_x_percent=Open reviews - {0}% ({1} reviews)
action_plans.closed_action_plan=Closed Action Plans
action_plans.no_issues_linked_to_action_plan=No issues linked to this action plan yet.
action_plans.status.OPEN=Open
action_plans.unresolved_issues_x_percent=Unresolved issues - {0}% ({1} issues)
action_plans.x_out_of_x_issues_solved={0} of {1} issues solved
action_plans.reopen=Reopen
-
+action_plans.errors.action_plan_does_not_exist=Action plan with key {0} does not exists
#------------------------------------------------------------------------------
#
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Strings;
import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang.time.DateUtils;
import org.sonar.api.ServerComponent;
import org.sonar.api.issue.ActionPlan;
import org.sonar.api.issue.Issue;
DefaultActionPlan existingActionPlan = (DefaultActionPlan) actionPlanService.findByKey(key);
if (existingActionPlan == null) {
Result<ActionPlan> result = Result.of();
- result.addError(Result.Message.ofL10n("issues_action_plans.errors.action_plan_does_not_exists", key));
+ result.addError(Result.Message.ofL10n("action_plans.errors.action_plan_does_not_exist", key));
return result;
} else {
Result<ActionPlan> result = createActionPlanResult(parameters, existingActionPlan.name());
} else {
ResourceDto project = resourceDao.getResource(ResourceQuery.create().setKey(projectParam));
if (project == null) {
- result.addError(Result.Message.ofL10n("issues_action_plans.errors.project_does_not_exists", projectParam));
+ result.addError(Result.Message.ofL10n("action_plans.errors.project_does_not_exist", projectParam));
}
}
try {
SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy");
deadLine = dateFormat.parse(deadLineParam);
- if (deadLine.before(new Date())) {
- result.addError(Result.Message.ofL10n("issues_action_plans.date_cant_be_in_past"));
+ Date today = new Date();
+ if (deadLine.before(today) && !DateUtils.isSameDay(deadLine, today)) {
+ result.addError(Result.Message.ofL10n("action_plans.date_cant_be_in_past"));
}
} catch (Exception e) {
result.addError(Result.Message.ofL10n("errors.is_not_valid", "date"));
if (!Strings.isNullOrEmpty(projectParam) && !Strings.isNullOrEmpty(name) && !name.equals(oldName)
&& actionPlanService.isNameAlreadyUsedForProject(name, projectParam)) {
- result.addError(Result.Message.ofL10n("issues_action_plans.same_name_in_same_project"));
+ result.addError(Result.Message.ofL10n("action_plans.same_name_in_same_project"));
}
if (result.ok()) {
private Result<ActionPlan> createResultForExistingActionPlan(String actionPlanKey) {
Result<ActionPlan> result = Result.of();
if (findActionPlan(actionPlanKey) == null) {
- result.addError(Result.Message.ofL10n("issues_action_plans.errors.action_plan_does_not_exists", actionPlanKey));
+ result.addError(Result.Message.ofL10n("action_plans.errors.action_plan_does_not_exist", actionPlanKey));
}
return result;
}
Result result = internalRubyIssueService.updateActionPlan("ABCD", null);
assertThat(result.ok()).isFalse();
- assertThat(result.errors()).contains(Result.Message.ofL10n("issues_action_plans.errors.action_plan_does_not_exists", "ABCD"));
+ assertThat(result.errors()).contains(Result.Message.ofL10n("action_plans.errors.action_plan_does_not_exist", "ABCD"));
}
@Test
Result result = internalRubyIssueService.deleteActionPlan("ABCD");
verify(actionPlanService, never()).delete("ABCD");
assertThat(result.ok()).isFalse();
- assertThat(result.errors()).contains(Result.Message.ofL10n("issues_action_plans.errors.action_plan_does_not_exists", "ABCD"));
+ assertThat(result.errors()).contains(Result.Message.ofL10n("action_plans.errors.action_plan_does_not_exist", "ABCD"));
}
@Test
Result result = internalRubyIssueService.createActionPlanResult(parameters);
assertThat(result.ok()).isFalse();
- assertThat(result.errors()).contains(Result.Message.ofL10n("issues_action_plans.date_cant_be_in_past"));
+ assertThat(result.errors()).contains(Result.Message.ofL10n("action_plans.date_cant_be_in_past"));
}
@Test
Result result = internalRubyIssueService.createActionPlanResult(parameters, "Short term");
assertThat(result.ok()).isFalse();
- assertThat(result.errors()).contains(Result.Message.ofL10n("issues_action_plans.same_name_in_same_project"));
+ assertThat(result.errors()).contains(Result.Message.ofL10n("action_plans.same_name_in_same_project"));
}
@Test
Result result = internalRubyIssueService.createActionPlanResult(parameters);
assertThat(result.ok()).isFalse();
- assertThat(result.errors()).contains(Result.Message.ofL10n("issues_action_plans.errors.project_does_not_exists", "org.sonar.Sample"));
+ assertThat(result.errors()).contains(Result.Message.ofL10n("action_plans.errors.project_does_not_exist", "org.sonar.Sample"));
}
public String createLongString(int size) {
String result = "";