Commit 5b1879b1 authored by Igor Drozdov's avatar Igor Drozdov

Merge branch 'pl-rubocop-prepend-ee-banzai' into 'master'

Prepend EE modules in the last line for Banzai

See merge request gitlab-org/gitlab!29248
parents 8eb2ad31 47b64f2d
...@@ -4,8 +4,6 @@ module Banzai ...@@ -4,8 +4,6 @@ module Banzai
module Filter module Filter
# The actual filter is implemented in the EE mixin # The actual filter is implemented in the EE mixin
class EpicReferenceFilter < IssuableReferenceFilter class EpicReferenceFilter < IssuableReferenceFilter
prepend_if_ee('EE::Banzai::Filter::EpicReferenceFilter') # rubocop: disable Cop/InjectEnterpriseEditionModule
self.reference_type = :epic self.reference_type = :epic
def self.object_class def self.object_class
...@@ -20,3 +18,5 @@ module Banzai ...@@ -20,3 +18,5 @@ module Banzai
end end
end end
end end
Banzai::Filter::EpicReferenceFilter.prepend_if_ee('EE::Banzai::Filter::EpicReferenceFilter')
...@@ -9,8 +9,6 @@ module Banzai ...@@ -9,8 +9,6 @@ module Banzai
# so we can avoid N+1 queries problem # so we can avoid N+1 queries problem
class IssuableExtractor class IssuableExtractor
prepend_if_ee('EE::Banzai::IssuableExtractor') # rubocop: disable Cop/InjectEnterpriseEditionModule
attr_reader :context attr_reader :context
ISSUE_REFERENCE_TYPE = '@data-reference-type="issue"' ISSUE_REFERENCE_TYPE = '@data-reference-type="issue"'
...@@ -59,3 +57,5 @@ module Banzai ...@@ -59,3 +57,5 @@ module Banzai
end end
end end
end end
Banzai::IssuableExtractor.prepend_if_ee('EE::Banzai::IssuableExtractor')
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
module Banzai module Banzai
module Pipeline module Pipeline
class GfmPipeline < BasePipeline class GfmPipeline < BasePipeline
prepend_if_ee('EE::Banzai::Pipeline::GfmPipeline') # rubocop: disable Cop/InjectEnterpriseEditionModule
# These filters transform GitLab Flavored Markdown (GFM) to HTML. # These filters transform GitLab Flavored Markdown (GFM) to HTML.
# The nodes and marks referenced in app/assets/javascripts/behaviors/markdown/editor_extensions.js # The nodes and marks referenced in app/assets/javascripts/behaviors/markdown/editor_extensions.js
# consequently transform that same HTML to GFM to be copied to the clipboard. # consequently transform that same HTML to GFM to be copied to the clipboard.
...@@ -77,3 +75,5 @@ module Banzai ...@@ -77,3 +75,5 @@ module Banzai
end end
end end
end end
Banzai::Pipeline::GfmPipeline.prepend_if_ee('EE::Banzai::Pipeline::GfmPipeline')
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
module Banzai module Banzai
module Pipeline module Pipeline
class PostProcessPipeline < BasePipeline class PostProcessPipeline < BasePipeline
prepend_if_ee('EE::Banzai::Pipeline::PostProcessPipeline') # rubocop: disable Cop/InjectEnterpriseEditionModule
def self.filters def self.filters
@filters ||= FilterArray[ @filters ||= FilterArray[
*internal_link_filters, *internal_link_filters,
...@@ -34,3 +32,5 @@ module Banzai ...@@ -34,3 +32,5 @@ module Banzai
end end
end end
end end
Banzai::Pipeline::PostProcessPipeline.prepend_if_ee('EE::Banzai::Pipeline::PostProcessPipeline')
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
module Banzai module Banzai
module Pipeline module Pipeline
class SingleLinePipeline < GfmPipeline class SingleLinePipeline < GfmPipeline
prepend_if_ee('EE::Banzai::Pipeline::SingleLinePipeline') # rubocop: disable Cop/InjectEnterpriseEditionModule
def self.filters def self.filters
@filters ||= FilterArray[ @filters ||= FilterArray[
Filter::HtmlEntityFilter, Filter::HtmlEntityFilter,
...@@ -41,3 +39,5 @@ module Banzai ...@@ -41,3 +39,5 @@ module Banzai
end end
end end
end end
Banzai::Pipeline::SingleLinePipeline.prepend_if_ee('EE::Banzai::Pipeline::SingleLinePipeline')
...@@ -4,8 +4,6 @@ module Banzai ...@@ -4,8 +4,6 @@ module Banzai
module ReferenceParser module ReferenceParser
# The actual parser is implemented in the EE mixin # The actual parser is implemented in the EE mixin
class EpicParser < IssuableParser class EpicParser < IssuableParser
prepend_if_ee('::EE::Banzai::ReferenceParser::EpicParser') # rubocop: disable Cop/InjectEnterpriseEditionModule
self.reference_type = :epic self.reference_type = :epic
def records_for_nodes(_nodes) def records_for_nodes(_nodes)
...@@ -14,3 +12,5 @@ module Banzai ...@@ -14,3 +12,5 @@ module Banzai
end end
end end
end end
Banzai::ReferenceParser::EpicParser.prepend_if_ee('::EE::Banzai::ReferenceParser::EpicParser')
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