Commit 1ca881ab authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Revert author addition on board

parent bb5f1b22
......@@ -70,7 +70,6 @@ $(() => {
detailIssue: Store.detail,
milestoneTitle: $boardApp.dataset.boardMilestoneTitle,
weight: $boardApp.dataset.boardWeight,
authorUsername: $boardApp.dataset.boardAuthorUsername,
assigneeUsername: $boardApp.dataset.boardAssigneeUsername,
labels: JSON.parse($boardApp.dataset.labels || []),
defaultAvatar: $boardApp.dataset.defaultAvatar,
......
......@@ -28,7 +28,6 @@ gl.issueBoards.BoardsStore = {
labels: [],
milestone_id: undefined,
milestone: {},
author_id: '',
assignee: {},
assignee_id: '',
weight: null,
......@@ -60,7 +59,6 @@ gl.issueBoards.BoardsStore = {
this.boardConfig.id = board.id;
this.boardConfig.weight = board.weight;
this.boardConfig.labels = board.labels || [];
this.boardConfig.author_id = board.author_id;
this.boardConfig.assignee_id = board.assignee_id;
Vue.set(this.boardConfig, 'assignee', board.assignee);
},
......
......@@ -7,19 +7,14 @@ class AddBoardFilterFields < ActiveRecord::Migration
def up
add_column :boards, :weight, :integer, index: true
add_reference :boards, :author, index: true
add_reference :boards, :assignee, index: true
add_concurrent_foreign_key :boards, :users, column: :author_id, on_delete: :nullify
add_concurrent_foreign_key :boards, :users, column: :assignee_id, on_delete: :nullify
end
def down
remove_column :boards, :weight
remove_foreign_key :boards, column: :author_id
remove_reference :boards, :author
remove_foreign_key :boards, column: :assignee_id
remove_reference :boards, :assignee
end
......
......@@ -231,12 +231,10 @@ ActiveRecord::Schema.define(version: 20170926203418) do
t.integer "milestone_id"
t.integer "group_id"
t.integer "weight"
t.integer "author_id"
t.integer "assignee_id"
end
add_index "boards", ["assignee_id"], name: "index_boards_on_assignee_id", using: :btree
add_index "boards", ["author_id"], name: "index_boards_on_author_id", using: :btree
add_index "boards", ["group_id"], name: "index_boards_on_group_id", using: :btree
add_index "boards", ["milestone_id"], name: "index_boards_on_milestone_id", using: :btree
add_index "boards", ["project_id"], name: "index_boards_on_project_id", using: :btree
......@@ -2066,7 +2064,6 @@ ActiveRecord::Schema.define(version: 20170926203418) do
add_foreign_key "boards", "namespaces", column: "group_id", name: "fk_1e9a074a35", on_delete: :cascade
add_foreign_key "boards", "projects", name: "fk_f15266b5f9", on_delete: :cascade
add_foreign_key "boards", "users", column: "assignee_id", name: "fk_2a3450e77c", on_delete: :nullify
add_foreign_key "boards", "users", column: "author_id", name: "fk_58e8fc64f3", on_delete: :nullify
add_foreign_key "chat_teams", "namespaces", on_delete: :cascade
add_foreign_key "ci_builds", "ci_pipelines", column: "auto_canceled_by_id", name: "fk_a2141b1522", on_delete: :nullify
add_foreign_key "ci_builds", "ci_stages", column: "stage_id", name: "fk_3a9eaa254d", on_delete: :cascade
......
......@@ -56,7 +56,7 @@ module EE
end
def board_params
params.require(:board).permit(:name, :weight, :milestone_id, :author_id, :assignee_id, label_ids: [])
params.require(:board).permit(:name, :weight, :milestone_id, :assignee_id, label_ids: [])
end
def find_board
......
......@@ -11,7 +11,6 @@ module EE
!@project.feature_available?(:issue_board_focus_mode))).to_s
data = {
board_milestone_title: board&.milestone&.title,
board_author_username: board&.author&.username,
board_assignee_username: board&.assignee&.username,
label_ids: board&.label_ids,
labels: board&.labels.to_json(only: [:id, :title, :color] ),
......@@ -33,10 +32,9 @@ module EE
board = @board || @boards.first
board.to_json(
only: [:id, :name, :milestone_id, :author_id, :assignee_id, :weight, :label_ids],
only: [:id, :name, :milestone_id, :assignee_id, :weight, :label_ids],
include: {
milestone: { only: [:id, :title, :name] },
author: { only: [:id, :name, :username ], methods: [:avatar_url] },
assignee: { only: [:id, :name, :username ], methods: [:avatar_url] },
labels: { only: [:title, :color, :id] }
}
......
......@@ -5,7 +5,6 @@ module EE
prepended do
belongs_to :group
belongs_to :milestone
belongs_to :author, class_name: 'User'
belongs_to :assignee, class_name: 'User'
has_many :board_filter_labels
......
......@@ -44,7 +44,6 @@ describe Projects::BoardsController do
{ name: 'Backend',
weight: 1,
milestone_id: milestone.id,
author_id: user.id,
assignee_id: user.id,
label_ids: [label.id] }
end
......@@ -118,7 +117,6 @@ describe Projects::BoardsController do
{ name: 'Frontend',
weight: 1,
milestone_id: milestone.id,
author_id: user.id,
assignee_id: user.id,
label_ids: [label.id] }
end
......
......@@ -4,7 +4,6 @@ describe Board do
describe 'relationships' do
it { is_expected.to belong_to(:project) }
it { is_expected.to belong_to(:milestone) }
it { is_expected.to belong_to(:author).class_name('User') }
it { is_expected.to belong_to(:assignee).class_name('User') }
it { is_expected.to have_many(:board_filter_labels) }
it { is_expected.to have_many(:labels).through(:board_filter_labels) }
......
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