2020-05-13 14:08:47 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module DesignManagement
|
|
|
|
class DesignService < ::BaseService
|
|
|
|
def initialize(project, user, params = {})
|
|
|
|
super
|
|
|
|
|
|
|
|
@issue = params.fetch(:issue)
|
|
|
|
end
|
|
|
|
|
|
|
|
# Accessors common to all subclasses:
|
|
|
|
|
|
|
|
attr_reader :issue
|
|
|
|
|
|
|
|
def target_branch
|
2021-05-26 17:10:49 -04:00
|
|
|
repository.root_ref || Gitlab::DefaultBranch.value(object: project)
|
2020-05-13 14:08:47 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def collection
|
|
|
|
issue.design_collection
|
|
|
|
end
|
2020-09-28 20:09:59 -04:00
|
|
|
alias_method :design_collection, :collection
|
2020-05-13 14:08:47 -04:00
|
|
|
|
|
|
|
def repository
|
|
|
|
collection.repository
|
|
|
|
end
|
|
|
|
|
|
|
|
def project
|
|
|
|
issue.project
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|