BigW Consortium Gitlab

Commit c369ea6c by Phil Hughes

Simplified the markding as done to remove from all boards

parent b1ec388c
...@@ -7,7 +7,6 @@ Board = Vue.extend ...@@ -7,7 +7,6 @@ Board = Vue.extend
clearSearch: -> clearSearch: ->
this.query = '' this.query = ''
computed: computed:
newDone: -> BoardsStore.state.done
isPreset: -> isPreset: ->
typeof this.board.id != 'number' typeof this.board.id != 'number'
ready: -> ready: ->
......
...@@ -5,13 +5,9 @@ BoardList = Vue.extend ...@@ -5,13 +5,9 @@ BoardList = Vue.extend
filters: Object filters: Object
issues: Array issues: Array
query: String query: String
done: Object
data: -> data: ->
scrollOffset: 20 scrollOffset: 20
loadMore: false loadMore: false
watch:
done: (done) ->
this.sortable.option('disabled', done.issue?)
methods: methods:
listHeight: -> this.$els.list.getBoundingClientRect().height listHeight: -> this.$els.list.getBoundingClientRect().height
scrollHeight: -> this.$els.list.scrollHeight scrollHeight: -> this.$els.list.scrollHeight
...@@ -21,11 +17,6 @@ BoardList = Vue.extend ...@@ -21,11 +17,6 @@ BoardList = Vue.extend
setTimeout => setTimeout =>
this.loadMore = false this.loadMore = false
, 2000 , 2000
doneFilter: (issue) ->
if this.boardId is 'done' and this.done?.issue?
issue.id is this.done.issue.id
else
issue
customFilter: (issue) -> customFilter: (issue) ->
returnIssue = issue returnIssue = issue
if this.filters.author?.id 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 @@ ...@@ -27,25 +27,29 @@
board.id is boardToId board.id is boardToId
issue = _.find boardFrom.issues, (issue) -> issue = _.find boardFrom.issues, (issue) ->
issue.id is issueId issue.id is issueId
issueTo = _.find boardTo.issues, (issue) ->
issue.id is issueId
issueBoards = BoardsStore.getBoardsForIssue(issue) issueBoards = BoardsStore.getBoardsForIssue(issue)
# Remove the issue from old board # Remove the issue from old board
boardFrom.issues = _.reject boardFrom.issues, (issue) -> boardFrom.issues = _.reject boardFrom.issues, (issue) ->
issue.id is issueId 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) boardTo.issues.splice(toIndex, 0, issue)
if boardTo.id is 'done' and issueBoards.length > 1 if boardTo.id is 'done' and boardFrom.id != 'backlog'
Vue.set(BoardsStore.state.done, 'board', boardFrom) BoardsStore.removeIssueFromBoards(issue, issueBoards)
Vue.set(BoardsStore.state.done, 'issue', issue)
Vue.set(BoardsStore.state.done, 'boards', issueBoards)
else if boardTo.id is 'done' and boardFrom.id != 'backlog'
issue.labels = _.reject issue.labels, (label) -> issue.labels = _.reject issue.labels, (label) ->
label.title is boardFrom.title label.title is boardFrom.title
else else
if boardTo.label? if boardTo.label?
BoardsStore.removeIssueFromBoard(issue, boardTo) BoardsStore.removeIssueFromBoard(issue, boardFrom)
foundLabel = _.find issue.labels, (label) ->
label.title is boardTo.title
unless foundLabel? unless foundLabel?
issue.labels.push(boardTo.label) issue.labels.push(boardTo.label)
......
...@@ -37,10 +37,6 @@ ...@@ -37,10 +37,6 @@
height: 100%; height: 100%;
padding-right: ($gl-padding / 2); padding-right: ($gl-padding / 2);
padding-left: ($gl-padding / 2); padding-left: ($gl-padding / 2);
&.is-faded {
opacity: .4;
}
} }
.board-inner { .board-inner {
...@@ -125,10 +121,6 @@ ...@@ -125,10 +121,6 @@
margin: 0; margin: 0;
padding: 5px; padding: 5px;
overflow: scroll; overflow: scroll;
&.is-marking-done {
flex: 0 0 auto;
}
} }
.is-ghost { .is-ghost {
...@@ -175,37 +167,3 @@ ...@@ -175,37 +167,3 @@
margin-right: 8px; margin-right: 8px;
font-weight: 500; 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{ "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 .board-inner
%header.board-inner-container.board-header{ ":class" => "{ 'has-border': board.label }", ":style" => "{ borderTopColor: board.label.backgroundColor }" } %header.board-inner-container.board-header{ ":class" => "{ 'has-border': board.label }", ":style" => "{ borderTopColor: board.label.backgroundColor }" }
%h3.board-title %h3.board-title
...@@ -18,20 +18,6 @@ ...@@ -18,20 +18,6 @@
%span.sr-only %span.sr-only
Clear search Clear search
= icon("times", class: "board-search-clear") = 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" } %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", ":class" => "{ 'is-marking-done': boardId == 'done' && done.board }" } %ul.board-list{ "v-el:list" => true, ":data-board" => "boardId" }
= render "projects/boards/components/card" = 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 %h4.card-title
%a{ href: "#", ":title" => "issue.title" } %a{ href: "#", ":title" => "issue.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