Skip to content

Commit

Permalink
subtask: Change subtask feature
Browse files Browse the repository at this point in the history
- Change new issue button to new subtask button in issue view page
- Hide subtasks in all list
- Make parent issue status bar more distinguishable
  • Loading branch information
doortts committed Sep 24, 2017
1 parent 5c7fcca commit 44f6160
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 11 deletions.
7 changes: 7 additions & 0 deletions app/assets/stylesheets/less/_common.less
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,20 @@ input[type=number]::-webkit-outer-spin-button {
background:#f0f0f0;
filter:none;

&.done-outline {
border: 1px solid @light-green;
}
&.red-outline {
border: 1px solid @yona-red;
}
.box-shadow(inset 0px 1px 1px rgba(0,0,0,0.25));
.bar {
height:100%;
filter:none;
&.orange { background:@orange; .box-shadow(none); } // #f28149
&.blue { background:@blue; .box-shadow(none); }
&.grey { background:@gray-9e; .box-shadow(none); }
&.red { background:@yona-red; .box-shadow(none); }
&.done { background:@light-green; .box-shadow(none); }
&.open { background:@state-open; .box-shadow(none); }
&.closed { background:@state-closed; .box-shadow(none); }
Expand Down
14 changes: 14 additions & 0 deletions app/assets/stylesheets/less/_page.less
Original file line number Diff line number Diff line change
Expand Up @@ -7020,3 +7020,17 @@ div.diff-body[data-outdated="true"] tr:hover .icon-comment {
}
}
}

.subtask-mark {
border: 1px solid #e95e01;
border-radius: 3px;
padding: 2px 5px;
font-size: 14px;
color: #e95e01;
margin-right: 5px;
}
.subtask-number {
color: darkgrey;
font-size: 12px;
margin-right: 5px;
}
1 change: 1 addition & 0 deletions app/assets/stylesheets/less/_variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
@yobi-orange : #FF7332;
@yobi-orange-dark : #E95E01;
@yobi-red : #C93426;
@yona-red : #f44336;
@yobi-red-dark : #B13427;
@yobi-white :#FFF;
@yobi-white-dark :#F2F2F2;
Expand Down
4 changes: 2 additions & 2 deletions app/models/Issue.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,9 @@ public void save() {

public static int countIssues(Long projectId, State state) {
if (state == State.ALL) {
return finder.where().eq("project.id", projectId).findRowCount();
return finder.where().eq("project.id", projectId).isNull("parent.id").findRowCount();
} else {
return finder.where().eq("project.id", projectId).eq("state", state).findRowCount();
return finder.where().eq("project.id", projectId).isNull("parent.id").eq("state", state).findRowCount();
}
}

Expand Down
4 changes: 4 additions & 0 deletions app/models/support/SearchCondition.java
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,10 @@ public ExpressionList<Issue> asExpressionList(Project project) {
el.lt("dueDate", DateUtils.addDays(dueDate, 1));
}

if (authorId == null && StringUtils.isBlank(filter) && assigneeId == null && mentionId == null) {
el.isNull("parent.id");
}

return el;
}

Expand Down
4 changes: 2 additions & 2 deletions app/views/issue/partial_list_subtask.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
@defining(Issue.countByParentIssueIdAndState(issue.id, State.OPEN)) { openIssueCount =>
@defining(Issue.countByParentIssueIdAndState(issue.id, State.CLOSED)) { closedIssueCount =>
@defining(getPercent(closedIssueCount.toDouble, openIssueCount + closedIssueCount)) { percentage =>
<div class="upload-progress">
<div class="bar @if(percentage == 100) {done} else {grey}" style="width: @percentage%;" title="Subtask"></div>
<div class="upload-progress @if(percentage == 100){done-outline} else {red-outline}">
<div class="bar @if(percentage == 100) {done} else {red}" style="width: @percentage%;" title="Subtask"></div>
</div>
<span class="completion-ratio @if(percentage == 100){txt-green}">@if(percentage != 100){@closedIssueCount/}@(closedIssueCount + openIssueCount)</span>
}
Expand Down
2 changes: 1 addition & 1 deletion app/views/issue/partial_select_subtask.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
**@
@(project:Project, parentIssueId:Long, currentIssueId:Long)

@showOption = @{Option(parentIssueId).isDefined && Option(currentIssueId).isDefined}
@showOption = @{Option(parentIssueId).isDefined || Option(currentIssueId).isDefined}
@hasChildIssue = @{Option(currentIssueId).isDefined && Issue.finder.byId(currentIssueId).hasChildIssue}
@import utils.TemplateHelper._

Expand Down
15 changes: 9 additions & 6 deletions app/views/issue/view.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@
@if(!openChildIssues.isEmpty || !closedChildIssues.isEmpty) {
<div class="child-issues">
@defining(Issue.finder.byId(parentIssueId)) { parentIssue =>
<div class="issue-item parent-issue"><a href="@routes.IssueApp.issue(parentIssue.project.owner, parentIssue.project.name, parentIssue.getNumber)" class="@if(parentIssue.id == issue.id){bold}">#@parentIssue.getNumber @parentIssue.title @if(parentIssue.assignee != null) {- @parentIssue.assignee.user.name}</a>
<div class="issue-item parent-issue"><a href="@routes.IssueApp.issue(parentIssue.project.owner, parentIssue.project.name, parentIssue.getNumber)" class="@if(parentIssue.id == issue.id){bold}">#@parentIssue.getNumber @parentIssue.title @if(parentIssue.assignee != null) {- @parentIssue.assignee.user.getPureNameOnly}</a>
@defining(getPercent(closedChildIssues.size.toDouble, (openChildIssues.size + closedChildIssues.size).toDouble)) { percentage =>
<div class="upload-progress">
<div class="bar @if(percentage == 100){done} else {grey}" style="width: @percentage%;" title="Subtask"></div>
<div class="upload-progress @if(percentage == 100){done-outline} else {red-outline}">
<div class="bar @if(percentage == 100){done} else {red}" style="width: @percentage%;" title="Subtask"></div>
</div>
<span class="@if(percentage == 100){txt-green}">@if(percentage != 100){@closedChildIssues.size/}@(openChildIssues.size + closedChildIssues.size)</span>
<span class="parent-issue-state @parentIssue.state.state">@Messages("issue.state." + parentIssue.state.state)</span>
Expand All @@ -81,15 +81,15 @@
<div class="issue-item @if(childIssue.id == issue.id){bold}">
<span class="state-label open"></span>
<a href="@routes.IssueApp.issue(childIssue.project.owner, childIssue.project.name, childIssue.getNumber)">
<span class="item-name">@childIssue.title @if(childIssue.assignee != null) {- @childIssue.assignee.user.name}</span>
<span class="item-name"><span class="subtask-number">#@childIssue.getNumber</span> @childIssue.title @if(childIssue.assignee != null) {- @childIssue.assignee.user.getPureNameOnly}</span>
</a>
</div>
}
@for(childIssue <- closedChildIssues) {
<div class="issue-item @if(childIssue.id == issue.id){bold}">
<span class="state-label closed"><i class=" yobicon-checkmark"></i></span>
<a href="@routes.IssueApp.issue(childIssue.project.owner, childIssue.project.name, childIssue.getNumber)">
<span class="item-name">@childIssue.title @if(childIssue.assignee != null) {- @childIssue.assignee.user.name}</span>
<span class="item-name"><span class="subtask-number">#@childIssue.getNumber</span> @childIssue.title @if(childIssue.assignee != null) {- @childIssue.assignee.user.getPureNameOnly}</span>
</a>
</div>
}
Expand All @@ -114,6 +114,9 @@
<span class="badge badge-issue-@issue.state.state.toLowerCase">@Messages("issue.state." + issue.state.state)</span>
</div>
<div class="title">
@if(issue.parent != null) {
<span class="subtask-mark">subtask</span>
}
<strong class="board-id">#@issue.getNumber</strong> @issue.title
<div class="pull-right hide show-in-mobile" style="font-size: 0.7em">
<span class="date" title="@JodaDateUtil.getDateString(issue.createdDate)">
Expand Down Expand Up @@ -246,7 +249,7 @@
<dl>
@if(project.menuSetting.issue) {
<dd class="project-btn-item">
<a href="@routes.IssueApp.newIssueForm(project.owner, project.name)?parentIssueId=@parentIssueId" class="ybtn ybtn-success">@Messages("button.newIssue")</a>
<a href="@routes.IssueApp.newIssueForm(project.owner, project.name)?parentIssueId=@parentIssueId" class="ybtn ybtn-success">@Messages("button.newSubtask")</a>
</dd>
}
<dt>@Messages("issue.assignee")</dt>
Expand Down
1 change: 1 addition & 0 deletions conf/messages
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ button.login = Log in
button.new.enrollment = Send sign-up request
button.newIssue = New issue
button.newProject = Create new project
button.newSubtask = New subtask
button.nextPage = Next page
button.nextState.closed = Close issue
button.nextState.open = Reopen issue
Expand Down
1 change: 1 addition & 0 deletions conf/messages.ko-KR
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ button.login = 로그인
button.new.enrollment = 멤버 등록 요청하기
button.newIssue = 새 이슈 등록
button.newProject = 새 프로젝트 만들기
button.newSubtask = 새 서브 태스크
button.nextPage = 다음 페이지
button.nextState.closed = 이슈 닫기
button.nextState.open = 이슈 다시 열기
Expand Down

0 comments on commit 44f6160

Please sign in to comment.