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
bd481e29
Commit
bd481e29
authored
Apr 09, 2021
by
Jose Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move feature flag to features helper
This also addresses some smaller code concerns
parent
e5f104c1
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
9 additions
and
29 deletions
+9
-29
app/assets/javascripts/tags/components/sort_dropdown.vue
app/assets/javascripts/tags/components/sort_dropdown.vue
+3
-3
app/controllers/projects/tags_controller.rb
app/controllers/projects/tags_controller.rb
+1
-1
app/helpers/tags_helper.rb
app/helpers/tags_helper.rb
+0
-4
app/views/projects/tags/index.html.haml
app/views/projects/tags/index.html.haml
+1
-1
lib/gitlab/ci/features.rb
lib/gitlab/ci/features.rb
+4
-0
spec/helpers/tags_helper_spec.rb
spec/helpers/tags_helper_spec.rb
+0
-20
No files found.
app/assets/javascripts/tags/components/sort_dropdown.vue
View file @
bd481e29
...
...
@@ -54,15 +54,15 @@ export default {
};
</
script
>
<
template
>
<div
class=
"gl-display-flex gl-pr-
4
"
>
<div
class=
"gl-display-flex gl-pr-
3
"
>
<gl-search-box-by-click
v-model=
"searchTerm"
:placeholder=
"$options.i18n.searchPlaceholder"
class=
"gl-pr-
4
"
class=
"gl-pr-
3
"
data-testid=
"tag-search"
@
submit=
"visitUrlFromOption(selectedKey)"
/>
<gl-dropdown
:text=
"selectedSortMethod"
data-testid=
"tags-dropdown"
>
<gl-dropdown
:text=
"selectedSortMethod"
right
data-testid=
"tags-dropdown"
>
<gl-dropdown-item
v-for=
"(value, key) in sortOptions"
:key=
"key"
...
...
app/controllers/projects/tags_controller.rb
View file @
bd481e29
...
...
@@ -10,7 +10,7 @@ class Projects::TagsController < Projects::ApplicationController
before_action
:authorize_download_code!
before_action
:authorize_admin_tag!
,
only:
[
:new
,
:create
,
:destroy
]
before_action
do
push_frontend_feature_flag
(
:gldropdown_tags
)
push_frontend_feature_flag
(
:gldropdown_tags
,
default_enabled: :yaml
)
end
feature_category
:source_code_management
,
[
:index
,
:show
,
:new
,
:destroy
]
...
...
app/helpers/tags_helper.rb
View file @
bd481e29
...
...
@@ -47,8 +47,4 @@ module TagsHelper
okTitle:
s_
(
'TagsPage|Delete tag'
)
}.
to_json
end
def
gldropdown_tags_enabled?
Feature
.
enabled?
(
:gldropdown_tags
)
end
end
app/views/projects/tags/index.html.haml
View file @
bd481e29
...
...
@@ -9,7 +9,7 @@
=
s_
(
'TagsPage|Tags give the ability to mark specific points in history as being important'
)
.nav-controls
-
if
!
gldropdown_tags_enabled?
-
unless
Gitlab
::
Ci
::
Features
.
gldropdown_tags_enabled?
=
form_tag
(
filter_tags_path
,
method: :get
)
do
=
search_field_tag
:search
,
params
[
:search
],
{
placeholder:
s_
(
'TagsPage|Filter by tag name'
),
id:
'tag-search'
,
class:
'form-control search-text-input input-short'
,
spellcheck:
false
}
...
...
lib/gitlab/ci/features.rb
View file @
bd481e29
...
...
@@ -63,6 +63,10 @@ module Gitlab
def
self
.
multiple_cache_per_job?
::
Feature
.
enabled?
(
:multiple_cache_per_job
,
default_enabled: :yaml
)
end
def
self
.
gldropdown_tags_enabled?
::
Feature
.
enabled?
(
:gldropdown_tags
,
default_enabled: :yaml
)
end
end
end
end
spec/helpers/tags_helper_spec.rb
deleted
100644 → 0
View file @
e5f104c1
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
TagsHelper
do
describe
'#gl_dropdown_tags_enabled?'
do
context
'when the feature is enabled'
do
it
'returns true'
do
expect
(
helper
.
gldropdown_tags_enabled?
).
to
be_truthy
end
end
context
'when the feature is disabled'
do
it
'returns false'
do
stub_feature_flags
(
gldropdown_tags:
false
)
expect
(
helper
.
gldropdown_tags_enabled?
).
to
be_falsy
end
end
end
end
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