Commit a0fd6828 authored by Douwe Maan's avatar Douwe Maan

Merge branch 'remove-issue-suggestions-flag' into 'master'

Remove issue_suggestions feature flag

Closes #55166

See merge request gitlab-org/gitlab-ce!23723
parents 703cd967 2e8d0153
......@@ -17,7 +17,7 @@ export default () => {
new MilestoneSelect();
new IssuableTemplateSelectors();
if (gon.features.issueSuggestions && gon.features.graphql) {
if (gon.features.graphql) {
initSuggestions();
}
};
......@@ -43,6 +43,6 @@ class GraphqlController < ApplicationController
end
def check_graphql_feature_flag!
render_404 unless Feature.enabled?(:graphql)
render_404 unless Gitlab::Graphql.enabled?
end
end
......@@ -268,7 +268,6 @@ class Projects::IssuesController < Projects::ApplicationController
end
def set_suggested_issues_feature_flags
push_frontend_feature_flag(:graphql)
push_frontend_feature_flag(:issue_suggestions)
push_frontend_feature_flag(:graphql, default_enabled: true)
end
end
......@@ -17,7 +17,7 @@
= render 'shared/issuable/form/template_selector', issuable: issuable
= render 'shared/issuable/form/title', issuable: issuable, form: form, has_wip_commits: commits && commits.detect(&:work_in_progress?)
- if Feature.enabled?(:issue_suggestions) && Feature.enabled?(:graphql)
- if Gitlab::Graphql.enabled?
#js-suggestions{ data: { project_path: @project.full_path } }
= render 'shared/form_elements/description', model: issuable, form: form, project: project
......
constraints(::Constraints::FeatureConstrainer.new(:graphql)) do
constraints(::Constraints::FeatureConstrainer.new(:graphql, default_enabled: true)) do
post '/api/graphql', to: 'graphql#execute'
mount GraphiQL::Rails::Engine, at: '/-/graphql-explorer', graphql_path: '/api/graphql'
end
......
......@@ -2,14 +2,14 @@
module Constraints
class FeatureConstrainer
attr_reader :feature
attr_reader :args
def initialize(feature)
@feature = feature
def initialize(*args)
@args = args
end
def matches?(_request)
Feature.enabled?(feature)
Feature.enabled?(*args)
end
end
end
......@@ -3,5 +3,9 @@
module Gitlab
module Graphql
StandardGraphqlError = Class.new(StandardError)
def self.enabled?
Feature.enabled?(:graphql, default_enabled: true)
end
end
end
require 'spec_helper'
describe Constraints::FeatureConstrainer do
describe '#matches' do
it 'calls Feature.enabled? with the correct arguments' do
expect(Feature).to receive(:enabled?).with(:feature_name, "an object", default_enabled: true)
described_class.new(:feature_name, "an object", default_enabled: true).matches?(double('request'))
end
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