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
iv
gitlab-ce
Commits
bd235519
Commit
bd235519
authored
Sep 01, 2014
by
Robert Schilling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Show labels help message if last label is deleted
parent
7a0e1c72
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
9 deletions
+32
-9
app/controllers/projects/labels_controller.rb
app/controllers/projects/labels_controller.rb
+1
-1
app/views/projects/labels/destroy.js.haml
app/views/projects/labels/destroy.js.haml
+2
-0
app/views/projects/labels/index.html.haml
app/views/projects/labels/index.html.haml
+8
-8
features/project/issues/labels.feature
features/project/issues/labels.feature
+5
-0
features/steps/project/labels.rb
features/steps/project/labels.rb
+16
-0
No files found.
app/controllers/projects/labels_controller.rb
View file @
bd235519
...
...
@@ -52,7 +52,7 @@ class Projects::LabelsController < Projects::ApplicationController
respond_to
do
|
format
|
format
.
html
{
redirect_to
project_labels_path
(
@project
),
notice:
'Label was removed'
}
format
.
js
{
render
nothing:
true
}
format
.
js
end
end
...
...
app/views/projects/labels/destroy.js.haml
0 → 100644
View file @
bd235519
-
if
@project
.
labels
.
size
==
0
$('.labels').load(document.URL + ' .light-well').hide().fadeIn(1000)
app/views/projects/labels/index.html.haml
View file @
bd235519
...
...
@@ -7,11 +7,11 @@
Labels
%hr
-
if
@labels
.
present?
%ul
.bordered-list.manage-labels-list
=
render
@labels
=
paginate
@labels
,
theme:
'gitlab'
-
else
.light-well
.nothing-here-block
Create first label or
#{
link_to
'generate'
,
generate_project_labels_path
(
@project
),
method: :post
}
default set of labels
.labels
-
if
@labels
.
present?
%ul
.bordered-list.manage-labels-list
=
render
@labels
=
paginate
@labels
,
theme:
'gitlab'
-
else
.light-well
.nothing-here-block
Create first label or
#{
link_to
'generate'
,
generate_project_labels_path
(
@project
),
method: :post
}
default set of labels
features/project/issues/labels.feature
View file @
bd235519
...
...
@@ -24,6 +24,11 @@ Feature: Project Labels
When
I remove label 'bug'
Then
I should not see label 'bug'
@javascript
Scenario
:
I
remove all labels
When
I delete all labels
Then
I should see labels help message
Scenario
:
I
create a label with invalid color
Given
I visit project
"Shop"
new label page
When
I submit new label with invalid color
...
...
features/steps/project/labels.rb
View file @
bd235519
...
...
@@ -25,6 +25,22 @@ class ProjectLabels < Spinach::FeatureSteps
end
end
step
'I delete all labels'
do
within
'.labels'
do
all
(
'.btn-remove'
).
each
do
|
remove
|
remove
.
click
sleep
0.05
end
end
end
step
'I should see labels help message'
do
within
'.labels'
do
page
.
should
have_content
'Create first label or generate default set of '
\
'labels'
end
end
step
'I submit new label \'support\''
do
fill_in
'Title'
,
with:
'support'
fill_in
'Background Color'
,
with:
'#F95610'
...
...
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