Commit afb1ef14 authored by Sean McGivern's avatar Sean McGivern

Resolve boards backend conflicts

parent a859ce0c
module Boards module Boards
class ListsController < Boards::ApplicationController class ListsController < Boards::ApplicationController
<<<<<<< HEAD
prepend EE::BoardsResponses prepend EE::BoardsResponses
=======
>>>>>>> upstream/master
include BoardsResponses include BoardsResponses
before_action :authorize_admin_list, only: [:create, :update, :destroy, :generate] before_action :authorize_admin_list, only: [:create, :update, :destroy, :generate]
......
class Projects::BoardsController < Projects::ApplicationController class Projects::BoardsController < Projects::ApplicationController
<<<<<<< HEAD
prepend EE::Boards::BoardsController prepend EE::Boards::BoardsController
prepend EE::BoardsResponses prepend EE::BoardsResponses
=======
>>>>>>> upstream/master
include BoardsResponses include BoardsResponses
include IssuableCollections include IssuableCollections
......
...@@ -5,18 +5,11 @@ class Board < ActiveRecord::Base ...@@ -5,18 +5,11 @@ class Board < ActiveRecord::Base
has_many :lists, -> { order(:list_type, :position) }, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent has_many :lists, -> { order(:list_type, :position) }, dependent: :delete_all # rubocop:disable Cop/ActiveRecordDependent
<<<<<<< HEAD
validates :name, presence: true
=======
>>>>>>> upstream/master
validates :project, presence: true, if: :project_needed? validates :project, presence: true, if: :project_needed?
def project_needed? def project_needed?
true true
end end
<<<<<<< HEAD
=======
def parent def parent
project project
...@@ -25,7 +18,6 @@ class Board < ActiveRecord::Base ...@@ -25,7 +18,6 @@ class Board < ActiveRecord::Base
def group_board? def group_board?
false false
end end
>>>>>>> upstream/master
def backlog_list def backlog_list
lists.merge(List.backlog).take lists.merge(List.backlog).take
......
module Boards module Boards
class CreateService < Boards::BaseService class CreateService < Boards::BaseService
<<<<<<< HEAD
prepend EE::Boards::CreateService prepend EE::Boards::CreateService
=======
>>>>>>> upstream/master
def execute def execute
create_board! if can_create_board? create_board! if can_create_board?
end end
......
module Boards module Boards
module Issues module Issues
class ListService < Boards::BaseService class ListService < Boards::BaseService
<<<<<<< HEAD
prepend EE::Boards::Issues::ListService prepend EE::Boards::Issues::ListService
=======
>>>>>>> upstream/master
def execute def execute
issues = IssuesFinder.new(current_user, filter_params).execute issues = IssuesFinder.new(current_user, filter_params).execute
issues = without_board_labels(issues) unless movable_list? || closed_list? issues = without_board_labels(issues) unless movable_list? || closed_list?
......
module Boards module Boards
module Issues module Issues
class MoveService < Boards::BaseService class MoveService < Boards::BaseService
<<<<<<< HEAD
prepend EE::Boards::Issues::MoveService prepend EE::Boards::Issues::MoveService
=======
>>>>>>> upstream/master
def execute(issue) def execute(issue)
return false unless can?(current_user, :update_issue, issue) return false unless can?(current_user, :update_issue, issue)
return false if issue_params.empty? return false if issue_params.empty?
......
module Boards module Boards
class ListService < Boards::BaseService class ListService < Boards::BaseService
<<<<<<< HEAD
prepend EE::Boards::ListService prepend EE::Boards::ListService
=======
>>>>>>> upstream/master
def execute def execute
create_board! if parent.boards.empty? create_board! if parent.boards.empty?
parent.boards parent.boards
......
module Boards module Boards
module Lists module Lists
class CreateService < Boards::BaseService class CreateService < Boards::BaseService
<<<<<<< HEAD
prepend EE::Boards::Lists::CreateService prepend EE::Boards::Lists::CreateService
=======
>>>>>>> upstream/master
def execute(board) def execute(board)
List.transaction do List.transaction do
label = available_labels_for(board).find(params[:label_id]) label = available_labels_for(board).find(params[:label_id])
......
...@@ -59,13 +59,8 @@ module Issues ...@@ -59,13 +59,8 @@ module Issues
after_id, before_id = params.delete(:move_between_ids) after_id, before_id = params.delete(:move_between_ids)
<<<<<<< HEAD
issue_before = get_issue_if_allowed(before_id) if before_id issue_before = get_issue_if_allowed(before_id) if before_id
issue_after = get_issue_if_allowed(after_id) if after_id issue_after = get_issue_if_allowed(after_id) if after_id
=======
issue_before = get_issue_if_allowed(issue.project, before_id) if before_id
issue_after = get_issue_if_allowed(issue.project, after_id) if after_id
>>>>>>> upstream/master
issue.move_between(issue_before, issue_after) issue.move_between(issue_before, issue_after)
end end
...@@ -92,13 +87,8 @@ module Issues ...@@ -92,13 +87,8 @@ module Issues
private private
<<<<<<< HEAD
def get_issue_if_allowed(id) def get_issue_if_allowed(id)
issue = Issue.find(id) issue = Issue.find(id)
=======
def get_issue_if_allowed(project, id)
issue = project.issues.find(id)
>>>>>>> upstream/master
issue if can?(current_user, :update_issue, issue) issue if can?(current_user, :update_issue, issue)
end end
......
...@@ -6,6 +6,7 @@ module EE ...@@ -6,6 +6,7 @@ module EE
belongs_to :milestone belongs_to :milestone
belongs_to :group belongs_to :group
validates :name, presence: true
validates :group, presence: true, unless: :project validates :group, presence: true, unless: :project
end end
......
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