String dateString = notification.getFieldValue("projectDate");
if (projectKey != null && dateString != null) {
Date date = DateUtils.parseDateTime(dateString);
- String url = String.format("%s/issues/search?componentRoots=%s&createdAtOrAfter=%s",
+ String url = String.format("%s/issues/search?componentRoots=%s&createdAt=%s",
settings.getServerBaseURL(), encode(projectKey), encode(DateUtils.formatDateTime(date)));
sb.append("\n").append("See it in SonarQube: ").append(url).append("\n");
}
issue_filter.private=Private
issue_filter.shared_with_all_users=Shared with all users
issue_filter.sharing=Sharing
-
+issue_filter.no_issues=No issues
#------------------------------------------------------------------------------
#
widget.my_reviews.name=My Unresolved Issues
widget.my_reviews.description=Shows unresolved issues assigned to the current user.
-widget.my_reviews.no_issue=No issue.
widget.my_reviews.property.numberOfLines.name=Number of lines
widget.my_reviews.property.numberOfLines.desc=Maximum number of issues displayed at the same time.
<h3><%= message('widget.reviews_per_developer.name') -%></h3>
<% if assignees.size ==0 %>
- <span class="empty_widget"><%= message('widget.reviews_per_developer.name') -%></span>
+ <span class="empty_widget"><%= message('issue_filter.no_issues') -%></span>
<% else %>
<div id="<%= div_id -%>">
"Project: Struts\n" +
"32 new issues\n" +
"\n" +
- "See it in SonarQube: http://nemo.sonarsource.org/issues/search?componentRoots=org.apache%3Astruts&createdAtOrAfter=2010-05-18T16%3A50%3A45%2B0200\n");
+ "See it in SonarQube: http://nemo.sonarsource.org/issues/search?componentRoots=org.apache%3Astruts&createdAt=2010-05-18T16%3A50%3A45%2B0200\n");
}
@Test
<if test="query.createdAfter() != null">
and i.issue_creation_date > #{query.createdAfter}
</if>
- <if test="query.createdAtOrAfter() != null">
- and i.issue_creation_date >= #{query.createdAtOrAfter}
+ <if test="query.createdAt() != null">
+ and i.issue_creation_date = #{query.createdAt}
</if>
<if test="query.createdBefore() != null">
and i.issue_creation_date < #{query.createdBefore}
public void should_select_by_date_creation() {
setupData("shared", "should_select_by_date_creation");
+ // created after, strictly
IssueQuery query = IssueQuery.builder().createdAfter(DateUtils.parseDate("2013-04-15")).build();
assertThat(dao.selectIssueIds(query)).hasSize(1);
assertThat(dao.selectIssueIds(query).get(0).getId()).isEqualTo(100L);
- query = IssueQuery.builder().createdAtOrAfter(DateUtils.parseDate("2013-04-15")).build();
+ query = IssueQuery.builder().createdAfter(DateUtils.parseDate("2022-01-01")).build();
+ assertThat(dao.selectIssueIds(query)).isEmpty();
+
+
+ // created at a given date
+ query = IssueQuery.builder().createdAt(DateUtils.parseDate("2013-04-16")).build();
assertThat(dao.selectIssueIds(query)).hasSize(1);
assertThat(dao.selectIssueIds(query).get(0).getId()).isEqualTo(100L);
- query = IssueQuery.builder().createdBefore(DateUtils.parseDate("2013-04-17")).requiredRole("user").build();
- assertThat(dao.selectIssueIds(query)).hasSize(2);
+ query = IssueQuery.builder().createdAt(DateUtils.parseDate("2010-01-01")).build();
+ assertThat(dao.selectIssueIds(query)).isEmpty();
+
+
+ // created before
+ query = IssueQuery.builder().createdBefore(DateUtils.parseDate("2013-04-14")).build();
+ assertThat(dao.selectIssueIds(query)).hasSize(1);
+ assertThat(dao.selectIssueIds(query).get(0).getId()).isEqualTo(101L);
+
+ query = IssueQuery.builder().createdBefore(DateUtils.parseDate("2010-01-01")).build();
+ assertThat(dao.selectIssueIds(query)).isEmpty();
}
@Test
assignee="perceval"
author_login="[null]"
issue_attributes="JIRA=FOO-1234"
- issue_creation_date="2013-04-16 15:50:45"
+ issue_creation_date="2013-04-16"
issue_update_date="2013-04-16"
issue_close_date="2013-04-16"
created_at="2013-04-16"
private final Boolean assigned;
private final Boolean planned;
private final Boolean resolved;
- private final Date createdAtOrAfter;
+ private final Date createdAt;
private final Date createdAfter;
private final Date createdBefore;
private final String sort;
this.assigned = builder.assigned;
this.planned = builder.planned;
this.resolved = builder.resolved;
- this.createdAtOrAfter = builder.createdAtOrAfter;
+ this.createdAt = builder.createdAt;
this.createdAfter = builder.createdAfter;
this.createdBefore = builder.createdBefore;
this.sort = builder.sort;
}
@CheckForNull
- public Date createdAtOrAfter() {
- return (createdAtOrAfter == null ? null : new Date(createdAtOrAfter.getTime()));
+ public Date createdAt() {
+ return (createdAt == null ? null : new Date(createdAt.getTime()));
}
@CheckForNull
private Boolean assigned = null;
private Boolean planned = null;
private Boolean resolved = null;
- private Date createdAtOrAfter;
+ private Date createdAt;
private Date createdAfter;
private Date createdBefore;
private String sort;
return this;
}
- public Builder createdAtOrAfter(@Nullable Date d) {
- this.createdAtOrAfter = (d == null ? null : new Date(d.getTime()));
+ public Builder createdAt(@Nullable Date d) {
+ this.createdAt = (d == null ? null : new Date(d.getTime()));
return this;
}
* <li>'assigned': true to get only assigned issues, false to get only unassigned issues. By default no filtering is done.</li>
* <li>'createdAfter': match all the issues created after the given date (strictly).
* Both date and datetime ISO formats are supported: 2013-05-18 or 2010-05-18T15:50:45+0100</li>
- * <li>'createdAtOrAfter': match all the issues created after the given date (inclusive).
+ * <li>'createdAt': match all the issues created at the given date (require second precision).
* Both date and datetime ISO formats are supported: 2013-05-18 or 2010-05-18T15:50:45+0100</li>
* <li>'createdBefore': match all the issues created before the given date (exclusive).
* Both date and datetime ISO formats are supported: 2013-05-18 or 2010-05-18T15:50:45+0100</li>
public static final String ASSIGNED = "assigned";
public static final String PLANNED = "planned";
public static final String CREATED_AFTER = "createdAfter";
- public static final String CREATED_AT_OR_AFTER = "createdAtOrAfter";
+ public static final String CREATED_AT = "createdAt";
public static final String CREATED_BEFORE = "createdBefore";
public static final String PAGE_SIZE = "pageSize";
public static final String PAGE_INDEX = "pageIndex";
public static final String ASC = "asc";
public static final List<String> ALL = ImmutableList.of(ISSUES, SEVERITIES, STATUSES, RESOLUTIONS, RESOLVED, COMPONENTS, COMPONENT_ROOTS, RULES, ACTION_PLANS, REPORTERS,
- ASSIGNEES, ASSIGNED, PLANNED, CREATED_AFTER, CREATED_BEFORE, PAGE_SIZE, PAGE_INDEX, SORT, ASC);
+ ASSIGNEES, ASSIGNED, PLANNED, CREATED_AT, CREATED_AFTER, CREATED_BEFORE, PAGE_SIZE, PAGE_INDEX, SORT, ASC);
public static final List<String> ALL_WITHOUT_PAGINATION = newArrayList(Iterables.filter(ALL, new Predicate<String>() {
@Override
.assignees(RubyUtils.toStrings(props.get(IssueFilterParameters.ASSIGNEES)))
.assigned(RubyUtils.toBoolean(props.get(IssueFilterParameters.ASSIGNED)))
.planned(RubyUtils.toBoolean(props.get(IssueFilterParameters.PLANNED)))
- .createdAtOrAfter(RubyUtils.toDate(props.get(IssueFilterParameters.CREATED_AT_OR_AFTER)))
+ .createdAt(RubyUtils.toDate(props.get(IssueFilterParameters.CREATED_AT)))
.createdAfter(RubyUtils.toDate(props.get(IssueFilterParameters.CREATED_AFTER)))
.createdBefore(RubyUtils.toDate(props.get(IssueFilterParameters.CREATED_BEFORE)))
.pageSize(RubyUtils.toInteger(props.get(IssueFilterParameters.PAGE_SIZE)))
%>
<% if paging.total() == 0 %>
- <span class="empty_widget"><%= message('widget.my_reviews.no_issue') -%></span>
+ <span class="empty_widget"><%= message('issue_filter.no_issues') -%></span>
<% else %>
<table id="issues-widget-list-<%= widget_id -%>" class="data width100">