Skip to content
Snippets Groups Projects
Commit bc36dfe8 authored by Sean McGivern's avatar Sean McGivern
Browse files

Merge branch 'rename_done_to_closed' into 'master'

Change Done column to Closed in issue boards

Closes #29420

See merge request !10198
parents 5f9bdcd0 1fb9de2b
No related branches found
No related tags found
No related merge requests found
Showing
with 49 additions and 45 deletions
Loading
Loading
@@ -79,7 +79,7 @@ $(() => {
resp.json().forEach((board) => {
const list = Store.addList(board);
 
if (list.type === 'done') {
if (list.type === 'closed') {
list.position = Infinity;
}
});
Loading
Loading
Loading
Loading
@@ -48,7 +48,7 @@ import Vue from 'vue';
template: `
<div
class="block list"
v-if="list.type !== 'done'">
v-if="list.type !== 'closed'">
<button
class="btn btn-default btn-block"
type="button"
Loading
Loading
Loading
Loading
@@ -10,7 +10,7 @@ class List {
this.position = obj.position;
this.title = obj.title;
this.type = obj.list_type;
this.preset = ['done', 'blank'].indexOf(this.type) > -1;
this.preset = ['closed', 'blank'].indexOf(this.type) > -1;
this.page = 1;
this.loading = true;
this.loadingMore = false;
Loading
Loading
Loading
Loading
@@ -45,7 +45,7 @@ import Cookies from 'js-cookie';
},
shouldAddBlankState () {
// Decide whether to add the blank state
return !(this.state.lists.filter(list => list.type !== 'done')[0]);
return !(this.state.lists.filter(list => list.type !== 'closed')[0]);
},
addBlankState () {
if (!this.shouldAddBlankState() || this.welcomeIsHidden() || this.disabled) return;
Loading
Loading
@@ -98,7 +98,7 @@ import Cookies from 'js-cookie';
issueTo.removeLabel(listFrom.label);
}
 
if (listTo.type === 'done') {
if (listTo.type === 'closed') {
issueLists.forEach((list) => {
list.removeIssue(issue);
});
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@ class Board < ActiveRecord::Base
 
validates :project, presence: true
 
def done_list
lists.merge(List.done).take
def closed_list
lists.merge(List.closed).take
end
end
Loading
Loading
@@ -2,7 +2,7 @@ class List < ActiveRecord::Base
belongs_to :board
belongs_to :label
 
enum list_type: { label: 1, done: 2 }
enum list_type: { label: 1, closed: 2 }
 
validates :board, :list_type, presence: true
validates :label, :position, presence: true, if: :label?
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ module Boards
 
def create_board!
board = project.boards.create
board.lists.create(list_type: :done)
board.lists.create(list_type: :closed)
 
board
end
Loading
Loading
Loading
Loading
@@ -41,7 +41,7 @@ module Boards
end
 
def set_state
params[:state] = list && list.done? ? 'closed' : 'opened'
params[:state] = list && list.closed? ? 'closed' : 'opened'
end
 
def board_label_ids
Loading
Loading
Loading
Loading
@@ -48,8 +48,8 @@ module Boards
end
 
def issue_state
return 'reopen' if moving_from_list.done?
return 'close' if moving_to_list.done?
return 'reopen' if moving_from_list.closed?
return 'close' if moving_to_list.closed?
end
 
def add_label_ids
Loading
Loading
Loading
Loading
@@ -7,12 +7,12 @@
data: { container: "body", placement: "bottom" } }
{{ list.title }}
.board-issue-count-holder.pull-right.clearfix{ "v-if" => 'list.type !== "blank"' }
%span.board-issue-count.pull-left{ ":class" => '{ "has-btn": list.type !== "done" && !disabled }' }
%span.board-issue-count.pull-left{ ":class" => '{ "has-btn": list.type !== "closed" && !disabled }' }
{{ list.issuesSize }}
- if can?(current_user, :admin_issue, @project)
%button.btn.btn-small.btn-default.pull-right.has-tooltip{ type: "button",
"@click" => "showNewIssueForm",
"v-if" => 'list.type !== "done"',
"v-if" => 'list.type !== "closed"',
"aria-label" => "Add an issue",
"title" => "Add an issue",
data: { placement: "top", container: "body" } }
Loading
Loading
Loading
Loading
@@ -3,7 +3,7 @@
= icon("spinner spin")
- if can? current_user, :create_issue, @project
%board-new-issue{ ":list" => "list",
"v-if" => 'list.type !== "done" && showIssueForm' }
"v-if" => 'list.type !== "closed" && showIssueForm' }
%ul.board-list{ "ref" => "list",
"v-show" => "!loading",
":data-board" => "list.id",
Loading
Loading
---
title: Change Done column to Closed in issue boards
merge_request: 10198
author: blackst0ne
Loading
Loading
@@ -63,7 +63,7 @@ Example response:
## List board lists
 
Get a list of the board's lists.
Does not include `backlog` and `done` lists
Does not include `backlog` and `closed` lists
 
```
GET /projects/:id/boards/:board_id/lists
Loading
Loading
Loading
Loading
@@ -3,7 +3,7 @@ FactoryGirl.define do
project factory: :empty_project
 
after(:create) do |board|
board.lists.create(list_type: :done)
board.lists.create(list_type: :closed)
end
end
end
Loading
Loading
@@ -6,8 +6,8 @@ FactoryGirl.define do
sequence(:position)
end
 
factory :done_list, parent: :list do
list_type :done
factory :closed_list, parent: :list do
list_type :closed
label nil
position nil
end
Loading
Loading
Loading
Loading
@@ -42,7 +42,7 @@ describe 'Issue Boards', feature: true, js: true do
end
 
it 'creates default lists' do
lists = ['To Do', 'Doing', 'Done']
lists = ['To Do', 'Doing', 'Closed']
 
page.within(find('.board-blank-state')) do
click_button('Add default lists')
Loading
Loading
@@ -65,7 +65,7 @@ describe 'Issue Boards', feature: true, js: true do
let(:testing) { create(:label, project: project, name: 'Testing') }
let(:bug) { create(:label, project: project, name: 'Bug') }
let!(:backlog) { create(:label, project: project, name: 'Backlog') }
let!(:done) { create(:label, project: project, name: 'Done') }
let!(:closed) { create(:label, project: project, name: 'Closed') }
let!(:accepting) { create(:label, project: project, name: 'Accepting Merge Requests') }
 
let!(:list1) { create(:list, board: board, label: planning, position: 0) }
Loading
Loading
@@ -114,7 +114,7 @@ describe 'Issue Boards', feature: true, js: true do
end
end
 
it 'search done list' do
it 'search closed list' do
find('.filtered-search').set(issue8.title)
find('.filtered-search').native.send_keys(:enter)
 
Loading
Loading
@@ -186,13 +186,13 @@ describe 'Issue Boards', feature: true, js: true do
end
end
 
context 'done' do
it 'shows list of done issues' do
context 'closed' do
it 'shows list of closed issues' do
wait_for_board_cards(3, 1)
wait_for_ajax
end
 
it 'moves issue to done' do
it 'moves issue to closed' do
drag(list_from_index: 0, list_to_index: 2)
 
wait_for_board_cards(1, 7)
Loading
Loading
@@ -205,7 +205,7 @@ describe 'Issue Boards', feature: true, js: true do
expect(find('.board:nth-child(3)')).not_to have_content(planning.title)
end
 
it 'removes all of the same issue to done' do
it 'removes all of the same issue to closed' do
drag(list_from_index: 0, list_to_index: 2)
 
wait_for_board_cards(1, 7)
Loading
Loading
@@ -252,7 +252,7 @@ describe 'Issue Boards', feature: true, js: true do
expect(find('.board:nth-child(1)').all('.card').first).not_to have_content(planning.title)
end
 
it 'issue moves from done' do
it 'issue moves from closed' do
drag(list_from_index: 2, list_to_index: 1)
 
expect(find('.board:nth-child(2)')).to have_content(issue8.title)
Loading
Loading
@@ -308,12 +308,12 @@ describe 'Issue Boards', feature: true, js: true do
expect(page).to have_selector('.board', count: 4)
end
 
it 'creates new list for Done label' do
it 'creates new list for Closed label' do
click_button 'Add list'
wait_for_ajax
 
page.within('.dropdown-menu-issues-board-new') do
click_link done.title
click_link closed.title
end
 
wait_for_vue_resource
Loading
Loading
@@ -326,7 +326,7 @@ describe 'Issue Boards', feature: true, js: true do
wait_for_ajax
 
page.within('.dropdown-menu-issues-board-new') do
click_link done.title
click_link closed.title
end
 
wait_for_vue_resource
Loading
Loading
Loading
Loading
@@ -25,7 +25,7 @@ describe 'Issue Boards new issue', feature: true, js: true do
expect(page).to have_selector('.board-issue-count-holder .btn', count: 1)
end
 
it 'does not display new issue button in done list' do
it 'does not display new issue button in closed list' do
page.within('.board:nth-child(2)') do
expect(page).not_to have_selector('.board-issue-count-holder .btn')
end
Loading
Loading
Loading
Loading
@@ -10,7 +10,7 @@
"id": { "type": "integer" },
"list_type": {
"type": "string",
"enum": ["label", "done"]
"enum": ["label", "closed"]
},
"label": {
"type": ["object", "null"],
Loading
Loading
Loading
Loading
@@ -106,9 +106,9 @@ describe('Store', () => {
expect(gl.issueBoards.BoardsStore.shouldAddBlankState()).toBe(false);
});
 
it('check for blank state adding when done list exist', () => {
it('check for blank state adding when closed list exist', () => {
gl.issueBoards.BoardsStore.addList({
list_type: 'done'
list_type: 'closed'
});
 
expect(gl.issueBoards.BoardsStore.shouldAddBlankState()).toBe(true);
Loading
Loading
Loading
Loading
@@ -19,8 +19,8 @@ describe List do
expect(subject).to validate_uniqueness_of(:label_id).scoped_to(:board_id)
end
 
context 'when list_type is set to done' do
subject { described_class.new(list_type: :done) }
context 'when list_type is set to closed' do
subject { described_class.new(list_type: :closed) }
 
it { is_expected.not_to validate_presence_of(:label) }
it { is_expected.not_to validate_presence_of(:position) }
Loading
Loading
@@ -34,8 +34,8 @@ describe List do
expect(subject.destroy).to be_truthy
end
 
it 'can not be destroyed when when list_type is set to done' do
subject = create(:done_list)
it 'can not be destroyed when when list_type is set to closed' do
subject = create(:closed_list)
 
expect(subject.destroy).to be_falsey
end
Loading
Loading
@@ -48,8 +48,8 @@ describe List do
expect(subject).to be_destroyable
end
 
it 'returns false when list_type is set to done' do
subject.list_type = :done
it 'returns false when list_type is set to closed' do
subject.list_type = :closed
 
expect(subject).not_to be_destroyable
end
Loading
Loading
@@ -62,8 +62,8 @@ describe List do
expect(subject).to be_movable
end
 
it 'returns false when list_type is set to done' do
subject.list_type = :done
it 'returns false when list_type is set to closed' do
subject.list_type = :closed
 
expect(subject).not_to be_movable
end
Loading
Loading
@@ -77,10 +77,10 @@ describe List do
expect(subject.title).to eq 'Development'
end
 
it 'returns Done when list_type is set to done' do
subject.list_type = :done
it 'returns Closed when list_type is set to closed' do
subject.list_type = :closed
 
expect(subject.title).to eq 'Done'
expect(subject.title).to eq 'Closed'
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment