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 ...@@ -576,7 +576,9 @@ module EE
# Checking both feature availability on the license, as well as the feature # 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 # flag, because we don't want to enable design_management by default on
# on prem installs yet. # 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 end
private private
......
...@@ -1887,17 +1887,18 @@ describe Project do ...@@ -1887,17 +1887,18 @@ describe Project do
describe "#design_management_enabled?" do describe "#design_management_enabled?" do
let(:project) { build(:project) } let(:project) { build(:project) }
where(:feature_enabled, :license_enabled, :expected) do where(:feature_enabled, :license_enabled, :graphql, :expected) do
false | false | false false | false | false | false
false | true | false false | true | false | false
true | false | false true | false | false | false
true | true | true false | false | true | false
true | true | true | true
end end
with_them do with_them do
before do before do
stub_licensed_features(design_management: license_enabled) stub_licensed_features(design_management: license_enabled)
stub_feature_flags(design_management: feature_enabled) stub_feature_flags(design_management: feature_enabled, graphql: graphql)
end end
it "knows if design management is available" do 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