Welcome to mirror list, hosted at ThFree Co, Russian Federation.

feature_flag_reference_filter.rb « references « filter « banzai « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: be9ded1ff430339551f568b28e31e36105dc4e39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# frozen_string_literal: true

module Banzai
  module Filter
    module References
      class FeatureFlagReferenceFilter < IssuableReferenceFilter
        self.reference_type = :feature_flag

        def self.object_class
          Operations::FeatureFlag
        end

        def self.object_sym
          :feature_flag
        end

        def parent_records(parent, ids)
          parent.operations_feature_flags.where(iid: ids.to_a)
        end

        def url_for_object(feature_flag, project)
          ::Gitlab::Routing.url_helpers.edit_project_feature_flag_url(
            project,
            feature_flag.iid,
            only_path: context[:only_path]
          )
        end

        def object_link_title(object, matches)
          object.name
        end
      end
    end
  end
end