Commit 97fb0355 authored by Bob Van Landuyt's avatar Bob Van Landuyt

GraphQL is required for design management.

Design Management requires GraphQL, this makes sure we don't expose
design management if GraphQL is disabled
parent f6e7ffe1
......@@ -576,7 +576,9 @@ module EE
# Checking both feature availability on the license, as well as the feature
# flag, because we don't want to enable design_management by default on
# on prem installs yet.
feature_available?(:design_management) && ::Feature.enabled?(:design_management, self)
# GraphQL is also required for using Design Management
feature_available?(:design_management) && ::Feature.enabled?(:design_management, self) &&
::Gitlab::Graphql.enabled?
end
private
......
......@@ -1887,17 +1887,18 @@ describe Project do
describe "#design_management_enabled?" do
let(:project) { build(:project) }
where(:feature_enabled, :license_enabled, :expected) do
false | false | false
false | true | false
true | false | false
true | true | true
where(:feature_enabled, :license_enabled, :graphql, :expected) do
false | false | false | false
false | true | false | false
true | false | false | false
false | false | true | false
true | true | true | true
end
with_them do
before do
stub_licensed_features(design_management: license_enabled)
stub_feature_flags(design_management: feature_enabled)
stub_feature_flags(design_management: feature_enabled, graphql: graphql)
end
it "knows if design management is available" do
......
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