Commit 9da1c472 authored by Jan Provaznik's avatar Jan Provaznik

Enable requirements by default

Default to on for requirements feature flag.
parent 66f4082d
...@@ -4,7 +4,7 @@ class Projects::RequirementsController < Projects::ApplicationController ...@@ -4,7 +4,7 @@ class Projects::RequirementsController < Projects::ApplicationController
before_action :authorize_read_requirement! before_action :authorize_read_requirement!
before_action :verify_requirements_management_flag! before_action :verify_requirements_management_flag!
before_action do before_action do
push_frontend_feature_flag(:requirements_management, project) push_frontend_feature_flag(:requirements_management, project, default_enabled: true)
end end
def index def index
...@@ -16,6 +16,6 @@ class Projects::RequirementsController < Projects::ApplicationController ...@@ -16,6 +16,6 @@ class Projects::RequirementsController < Projects::ApplicationController
private private
def verify_requirements_management_flag! 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
end end
...@@ -45,7 +45,7 @@ module EE ...@@ -45,7 +45,7 @@ module EE
end end
def self.requirements_available?(project, user) 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 end
end end
......
...@@ -41,7 +41,7 @@ module Mutations ...@@ -41,7 +41,7 @@ module Mutations
private private
def validate_flag!(project) 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' raise Gitlab::Graphql::Errors::ResourceNotAvailable, 'requirements_management flag is not enabled on this project'
end end
......
...@@ -26,7 +26,7 @@ module Resolvers ...@@ -26,7 +26,7 @@ module Resolvers
# make sure it's loaded and not `nil` before continuing. # make sure it's loaded and not `nil` before continuing.
project = object.respond_to?(:sync) ? object.sync : object project = object.respond_to?(:sync) ? object.sync : object
return Requirement.none if project.nil? 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[:project_id] = project.id
args[:iids] ||= [args[:iid]].compact 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) - return unless can?(current_user, :read_requirement, project)
- requirements_count = Hash.new(0).merge(project.requirements.counts_by_state) - 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