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

Revert author addition on board

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