Commit bcfb9d4c authored by Jarka Košanová's avatar Jarka Košanová

Merge branch 'req-flagon' into 'master'

Enable requirements by default

See merge request gitlab-org/gitlab!29497
parents cb374dfb 9da1c472
......@@ -4,7 +4,7 @@ class Projects::RequirementsController < Projects::ApplicationController
before_action :authorize_read_requirement!
before_action :verify_requirements_management_flag!
before_action do
push_frontend_feature_flag(:requirements_management, project)
push_frontend_feature_flag(:requirements_management, project, default_enabled: true)
end
def index
......@@ -16,6 +16,6 @@ class Projects::RequirementsController < Projects::ApplicationController
private
def verify_requirements_management_flag!
render_404 unless Feature.enabled?(:requirements_management, project)
render_404 unless Feature.enabled?(:requirements_management, project, default_enabled: true)
end
end
......@@ -45,7 +45,7 @@ module EE
end
def self.requirements_available?(project, user)
::Feature.enabled?(:requirements_management, project) && Ability.allowed?(user, :read_requirement, project)
::Feature.enabled?(:requirements_management, project, default_enabled: true) && Ability.allowed?(user, :read_requirement, project)
end
end
end
......
......@@ -41,7 +41,7 @@ module Mutations
private
def validate_flag!(project)
return if ::Feature.enabled?(:requirements_management, project)
return if ::Feature.enabled?(:requirements_management, project, default_enabled: true)
raise Gitlab::Graphql::Errors::ResourceNotAvailable, 'requirements_management flag is not enabled on this project'
end
......
......@@ -26,7 +26,7 @@ module Resolvers
# make sure it's loaded and not `nil` before continuing.
project = object.respond_to?(:sync) ? object.sync : object
return Requirement.none if project.nil?
return Requirement.none unless Feature.enabled?(:requirements_management, project)
return Requirement.none unless Feature.enabled?(:requirements_management, project, default_enabled: true)
args[:project_id] = project.id
args[:iids] ||= [args[:iid]].compact
......
- return unless Feature.enabled?(:requirements_management, project)
- return unless Feature.enabled?(:requirements_management, project, default_enabled: true)
- return unless can?(current_user, :read_requirement, project)
- requirements_count = Hash.new(0).merge(project.requirements.counts_by_state)
......
---
title: Enable requirements for projects and basic actions (CRUD) for them.
merge_request:
author:
type: added
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