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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
c896ae7b
Commit
c896ae7b
authored
May 25, 2018
by
Luke Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BE review
parent
d400c94e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
app/controllers/groups/labels_controller.rb
app/controllers/groups/labels_controller.rb
+3
-4
app/views/shared/_label.html.haml
app/views/shared/_label.html.haml
+1
-1
spec/features/projects/labels/update_prioritization_spec.rb
spec/features/projects/labels/update_prioritization_spec.rb
+2
-0
No files found.
app/controllers/groups/labels_controller.rb
View file @
c896ae7b
...
@@ -2,17 +2,16 @@ class Groups::LabelsController < Groups::ApplicationController
...
@@ -2,17 +2,16 @@ class Groups::LabelsController < Groups::ApplicationController
include
ToggleSubscriptionAction
include
ToggleSubscriptionAction
before_action
:label
,
only:
[
:edit
,
:update
,
:destroy
]
before_action
:label
,
only:
[
:edit
,
:update
,
:destroy
]
before_action
:
find
_labels
,
only:
[
:index
]
before_action
:
available
_labels
,
only:
[
:index
]
before_action
:authorize_admin_labels!
,
only:
[
:new
,
:create
,
:edit
,
:update
,
:destroy
]
before_action
:authorize_admin_labels!
,
only:
[
:new
,
:create
,
:edit
,
:update
,
:destroy
]
before_action
:save_previous_label_path
,
only:
[
:edit
]
before_action
:save_previous_label_path
,
only:
[
:edit
]
respond_to
:html
respond_to
:html
def
index
def
index
@labels
=
@group
.
labels
.
page
(
params
[
:page
])
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
do
format
.
html
do
@labels
=
@group
.
labels
.
page
(
params
[
:page
])
end
end
format
.
json
do
format
.
json
do
render
json:
LabelSerializer
.
new
.
represent_appearance
(
@available_labels
)
render
json:
LabelSerializer
.
new
.
represent_appearance
(
@available_labels
)
...
@@ -107,7 +106,7 @@ class Groups::LabelsController < Groups::ApplicationController
...
@@ -107,7 +106,7 @@ class Groups::LabelsController < Groups::ApplicationController
session
[
:previous_labels_path
]
=
URI
(
request
.
referer
||
''
).
path
session
[
:previous_labels_path
]
=
URI
(
request
.
referer
||
''
).
path
end
end
def
find
_labels
def
available
_labels
@available_labels
||=
@available_labels
||=
LabelsFinder
.
new
(
LabelsFinder
.
new
(
current_user
,
current_user
,
...
...
app/views/shared/_label.html.haml
View file @
c896ae7b
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
-
status
=
label_subscription_status
(
label
,
@project
).
inquiry
if
current_user
-
status
=
label_subscription_status
(
label
,
@project
).
inquiry
if
current_user
-
subject
=
local_assigns
[
:subject
]
-
subject
=
local_assigns
[
:subject
]
-
use_label_priority
=
local_assigns
.
fetch
(
:use_label_priority
,
false
)
-
use_label_priority
=
local_assigns
.
fetch
(
:use_label_priority
,
false
)
-
force_priority
=
local_assigns
.
fetch
(
:force_priority
,
use_label_priority
?
label
.
priority?
:
false
)
-
force_priority
=
local_assigns
.
fetch
(
:force_priority
,
use_label_priority
?
label
.
priority
.
present
?
:
false
)
-
toggle_subscription_path
=
toggle_subscription_label_path
(
label
,
@project
)
if
current_user
-
toggle_subscription_path
=
toggle_subscription_label_path
(
label
,
@project
)
if
current_user
-
show_label_merge_requests_link
=
show_label_issuables_link?
(
label
,
:merge_requests
,
project:
@project
)
-
show_label_merge_requests_link
=
show_label_issuables_link?
(
label
,
:merge_requests
,
project:
@project
)
-
show_label_issues_link
=
show_label_issuables_link?
(
label
,
:issues
,
project:
@project
)
-
show_label_issues_link
=
show_label_issuables_link?
(
label
,
:issues
,
project:
@project
)
...
...
spec/features/projects/labels/update_prioritization_spec.rb
View file @
c896ae7b
...
@@ -23,8 +23,10 @@ feature 'Prioritize labels' do
...
@@ -23,8 +23,10 @@ feature 'Prioritize labels' do
expect
(
page
).
to
have_content
(
'Star labels to start sorting by priority'
)
expect
(
page
).
to
have_content
(
'Star labels to start sorting by priority'
)
page
.
within
(
'.other-labels'
)
do
page
.
within
(
'.other-labels'
)
do
screenshot_and_open_image
all
(
'.js-toggle-priority'
)[
1
].
click
all
(
'.js-toggle-priority'
)[
1
].
click
wait_for_requests
wait_for_requests
screenshot_and_open_image
expect
(
page
).
not_to
have_content
(
'feature'
)
expect
(
page
).
not_to
have_content
(
'feature'
)
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