Commit c369ea6c authored by Phil Hughes's avatar Phil Hughes

Simplified the markding as done to remove from all boards

parent b1ec388c
......@@ -7,7 +7,6 @@ Board = Vue.extend
clearSearch: ->
this.query = ''
computed:
newDone: -> BoardsStore.state.done
isPreset: ->
typeof this.board.id != 'number'
ready: ->
......
......@@ -5,13 +5,9 @@ BoardList = Vue.extend
filters: Object
issues: Array
query: String
done: Object
data: ->
scrollOffset: 20
loadMore: false
watch:
done: (done) ->
this.sortable.option('disabled', done.issue?)
methods:
listHeight: -> this.$els.list.getBoundingClientRect().height
scrollHeight: -> this.$els.list.scrollHeight
......@@ -21,11 +17,6 @@ BoardList = Vue.extend
setTimeout =>
this.loadMore = false
, 2000
doneFilter: (issue) ->
if this.boardId is 'done' and this.done?.issue?
issue.id is this.done.issue.id
else
issue
customFilter: (issue) ->
returnIssue = issue
if this.filters.author?.id
......
IssueDone = Vue.extend
props:
done: Object
methods:
removeFromAll: ->
BoardsStore.removeIssueFromBoards(this.done.issue, this.done.boards)
BoardsStore.clearDone()
removeFromSingle: ->
BoardsStore.removeIssueFromBoard(this.done.issue, this.done.board)
BoardsStore.clearDone()
Vue.component('issue-done', IssueDone)
......@@ -27,25 +27,29 @@
board.id is boardToId
issue = _.find boardFrom.issues, (issue) ->
issue.id is issueId
issueTo = _.find boardTo.issues, (issue) ->
issue.id is issueId
issueBoards = BoardsStore.getBoardsForIssue(issue)
# Remove the issue from old board
boardFrom.issues = _.reject boardFrom.issues, (issue) ->
issue.id is issueId
# Add to new boards issues
# Add to new boards issues if it doesn't already exist
if issueTo?
issue = issueTo
else
boardTo.issues.splice(toIndex, 0, issue)
if boardTo.id is 'done' and issueBoards.length > 1
Vue.set(BoardsStore.state.done, 'board', boardFrom)
Vue.set(BoardsStore.state.done, 'issue', issue)
Vue.set(BoardsStore.state.done, 'boards', issueBoards)
else if boardTo.id is 'done' and boardFrom.id != 'backlog'
if boardTo.id is 'done' and boardFrom.id != 'backlog'
BoardsStore.removeIssueFromBoards(issue, issueBoards)
issue.labels = _.reject issue.labels, (label) ->
label.title is boardFrom.title
else
if boardTo.label?
BoardsStore.removeIssueFromBoard(issue, boardTo)
BoardsStore.removeIssueFromBoard(issue, boardFrom)
foundLabel = _.find issue.labels, (label) ->
label.title is boardTo.title
unless foundLabel?
issue.labels.push(boardTo.label)
......
......@@ -37,10 +37,6 @@
height: 100%;
padding-right: ($gl-padding / 2);
padding-left: ($gl-padding / 2);
&.is-faded {
opacity: .4;
}
}
.board-inner {
......@@ -125,10 +121,6 @@
margin: 0;
padding: 5px;
overflow: scroll;
&.is-marking-done {
flex: 0 0 auto;
}
}
.is-ghost {
......@@ -175,37 +167,3 @@
margin-right: 8px;
font-weight: 500;
}
.board-done {
flex: 1;
padding: 10px 18px;
color: #8c8c8c;
background-color: #fff;
border-top: 1px solid $border-color;
> p {
margin: 0;
font-size: 1em;
}
}
.board-done-label-list {
margin: 10px 0 10px 30px;
padding: 0;
color: #333;
list-style: none;
> li:not(:last-child) {
margin-bottom: 5px;
}
.label {
display: inline-block;
position: relative;
top: 2px;
width: 16px;
height: 16px;
margin-right: 5px;
border-radius: $border-radius-default;
}
}
%board{ "inline-template" => true, "v-cloak" => true, "v-for" => "board in state.boards | orderBy 'index'", ":board" => "board" }
.board{ ":class" => "{ 'is-draggable': !isPreset, 'is-faded': board.id != 'done' && newDone.issue }" }
.board{ ":class" => "{ 'is-draggable': !isPreset }" }
.board-inner
%header.board-inner-container.board-header{ ":class" => "{ 'has-border': board.label }", ":style" => "{ borderTopColor: board.label.backgroundColor }" }
%h3.board-title
......@@ -18,20 +18,6 @@
%span.sr-only
Clear search
= icon("times", class: "board-search-clear")
%board-list{ "inline-template" => true, ":board-id" => "board.id", ":issues" => "board.issues", ":disabled" => "#{current_user.nil?}", ":query" => "query", ":filters" => "filters", ":done" => "newDone" }
%ul.board-list{ "v-el:list" => true, ":data-board" => "boardId", ":class" => "{ 'is-marking-done': boardId == 'done' && done.board }" }
%board-list{ "inline-template" => true, ":board-id" => "board.id", ":issues" => "board.issues", ":disabled" => "#{current_user.nil?}", ":query" => "query", ":filters" => "filters" }
%ul.board-list{ "v-el:list" => true, ":data-board" => "boardId" }
= render "projects/boards/components/card"
%issue-done{ "inline-template" => true, ":done" => "done", "v-if" => "boardId == 'done' && done.board" }
.board-done
%p
This issue is currently in the following lists:
%ul.board-done-label-list
%li{ "v-for" => "board in done.boards" }
%span.label{ ":style" => "{ 'background-color': board.label.backgroundColor, 'color': board.label.color }" }
{{ board.title }}
%p
Moving it to Done will remove it from all lists and close the issue.
%button.btn.btn-gray.btn-block.prepend-top-10{ type: "button", "@click" => "removeFromAll" }
Remove from all lists and close
%button.btn.btn-gray.btn-block{ type: "button", "@click" => "removeFromSingle" }
Remove from {{ done.board.title }} list
%li.card{ ":data-issue" => "issue.id", "v-for" => "issue in issues | filterBy query in 'title' | filterBy customFilter | filterBy doneFilter" }
%li.card{ ":data-issue" => "issue.id", "v-for" => "issue in issues | filterBy query in 'title' | filterBy customFilter" }
%h4.card-title
%a{ href: "#", ":title" => "issue.title" }
{{ issue.title }}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment