diff options
| author | Phil Hughes <me@iamphill.com> | 2016-07-25 16:26:33 +0100 |
|---|---|---|
| committer | Phil Hughes <me@iamphill.com> | 2016-08-17 17:12:47 +0100 |
| commit | c369ea6c9b09a8d552f1917859cee33401a3e797 (patch) | |
| tree | ea5677a686ac59a86bdc24d865cfbc1e040dd729 | |
| parent | b1ec388ca6ab37bc7adefc513459a424855b7717 (diff) | |
| download | gitlab-ce-c369ea6c9b09a8d552f1917859cee33401a3e797.tar.gz | |
Simplified the markding as done to remove from all boards
7 files changed, 16 insertions, 90 deletions
diff --git a/app/assets/javascripts/boards/components/board.js.coffee b/app/assets/javascripts/boards/components/board.js.coffee index 0ed5a5b7bbc..fde62ba569b 100644 --- a/app/assets/javascripts/boards/components/board.js.coffee +++ b/app/assets/javascripts/boards/components/board.js.coffee @@ -7,7 +7,6 @@ Board = Vue.extend clearSearch: -> this.query = '' computed: - newDone: -> BoardsStore.state.done isPreset: -> typeof this.board.id != 'number' ready: -> diff --git a/app/assets/javascripts/boards/components/board_list.js.coffee b/app/assets/javascripts/boards/components/board_list.js.coffee index ea2931cdb3e..b063cf4f2ee 100644 --- a/app/assets/javascripts/boards/components/board_list.js.coffee +++ b/app/assets/javascripts/boards/components/board_list.js.coffee @@ -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 diff --git a/app/assets/javascripts/boards/components/issue_done.js.coffee b/app/assets/javascripts/boards/components/issue_done.js.coffee deleted file mode 100644 index 14f441cd682..00000000000 --- a/app/assets/javascripts/boards/components/issue_done.js.coffee +++ /dev/null @@ -1,12 +0,0 @@ -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) diff --git a/app/assets/javascripts/boards/stores/boards_store.js.coffee b/app/assets/javascripts/boards/stores/boards_store.js.coffee index a2ec248ae57..8d28c24a2b1 100644 --- a/app/assets/javascripts/boards/stores/boards_store.js.coffee +++ b/app/assets/javascripts/boards/stores/boards_store.js.coffee @@ -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 - boardTo.issues.splice(toIndex, 0, issue) + # 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) diff --git a/app/assets/stylesheets/pages/boards.scss b/app/assets/stylesheets/pages/boards.scss index 76eef6a884a..65c29bea905 100644 --- a/app/assets/stylesheets/pages/boards.scss +++ b/app/assets/stylesheets/pages/boards.scss @@ -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; - } -} diff --git a/app/views/projects/boards/components/_board.html.haml b/app/views/projects/boards/components/_board.html.haml index 3af36640839..15eae09ea90 100644 --- a/app/views/projects/boards/components/_board.html.haml +++ b/app/views/projects/boards/components/_board.html.haml @@ -1,5 +1,5 @@ %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 diff --git a/app/views/projects/boards/components/_card.html.haml b/app/views/projects/boards/components/_card.html.haml index e5ea8cf608a..db11654d72f 100644 --- a/app/views/projects/boards/components/_card.html.haml +++ b/app/views/projects/boards/components/_card.html.haml @@ -1,4 +1,4 @@ -%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 }} |
