Commit afb1ef14 authored by Sean McGivern's avatar Sean McGivern

Resolve boards backend conflicts

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