Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9da1c472
Commit
9da1c472
authored
Apr 14, 2020
by
Jan Provaznik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable requirements by default
Default to on for requirements feature flag.
parent
66f4082d
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
6 deletions
+11
-6
ee/app/controllers/projects/requirements_controller.rb
ee/app/controllers/projects/requirements_controller.rb
+2
-2
ee/app/graphql/ee/types/project_type.rb
ee/app/graphql/ee/types/project_type.rb
+1
-1
ee/app/graphql/mutations/requirements/create.rb
ee/app/graphql/mutations/requirements/create.rb
+1
-1
ee/app/graphql/resolvers/requirements_resolver.rb
ee/app/graphql/resolvers/requirements_resolver.rb
+1
-1
ee/app/views/layouts/nav/_requirements_link.html.haml
ee/app/views/layouts/nav/_requirements_link.html.haml
+1
-1
ee/changelogs/unreleased/requirements.yml
ee/changelogs/unreleased/requirements.yml
+5
-0
No files found.
ee/app/controllers/projects/requirements_controller.rb
View file @
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
ee/app/graphql/ee/types/project_type.rb
View file @
9da1c472
...
...
@@ -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
...
...
ee/app/graphql/mutations/requirements/create.rb
View file @
9da1c472
...
...
@@ -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
...
...
ee/app/graphql/resolvers/requirements_resolver.rb
View file @
9da1c472
...
...
@@ -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
...
...
ee/app/views/layouts/nav/_requirements_link.html.haml
View file @
9da1c472
-
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
)
...
...
ee/changelogs/unreleased/requirements.yml
0 → 100644
View file @
9da1c472
---
title
:
Enable requirements for projects and basic actions (CRUD) for them.
merge_request
:
author
:
type
:
added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment