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
60a98584
Commit
60a98584
authored
Sep 05, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7658 from Razer6/refresh_labels_page_on_delete
Show labels help message if last label is deleted
parents
3a971ca9
bd235519
Changes
5
Show 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 @
60a98584
...
@@ -52,7 +52,7 @@ class Projects::LabelsController < Projects::ApplicationController
...
@@ -52,7 +52,7 @@ class Projects::LabelsController < Projects::ApplicationController
respond_to
do
|
format
|
respond_to
do
|
format
|
format
.
html
{
redirect_to
project_labels_path
(
@project
),
notice:
'Label was removed'
}
format
.
html
{
redirect_to
project_labels_path
(
@project
),
notice:
'Label was removed'
}
format
.
js
{
render
nothing:
true
}
format
.
js
end
end
end
end
...
...
app/views/projects/labels/destroy.js.haml
0 → 100644
View file @
60a98584
-
if
@project
.
labels
.
size
==
0
$('.labels').load(document.URL + ' .light-well').hide().fadeIn(1000)
app/views/projects/labels/index.html.haml
View file @
60a98584
...
@@ -7,11 +7,11 @@
...
@@ -7,11 +7,11 @@
Labels
Labels
%hr
%hr
-
if
@labels
.
present?
.labels
-
if
@labels
.
present?
%ul
.bordered-list.manage-labels-list
%ul
.bordered-list.manage-labels-list
=
render
@labels
=
render
@labels
=
paginate
@labels
,
theme:
'gitlab'
=
paginate
@labels
,
theme:
'gitlab'
-
else
-
else
.light-well
.light-well
.nothing-here-block
Create first label or
#{
link_to
'generate'
,
generate_project_labels_path
(
@project
),
method: :post
}
default set of labels
.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 @
60a98584
...
@@ -24,6 +24,11 @@ Feature: Project Labels
...
@@ -24,6 +24,11 @@ Feature: Project Labels
When
I remove label 'bug'
When
I remove label 'bug'
Then
I should not see 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
Scenario
:
I
create a label with invalid color
Given
I visit project
"Shop"
new label page
Given
I visit project
"Shop"
new label page
When
I submit new label with invalid color
When
I submit new label with invalid color
...
...
features/steps/project/labels.rb
View file @
60a98584
...
@@ -25,6 +25,22 @@ class ProjectLabels < Spinach::FeatureSteps
...
@@ -25,6 +25,22 @@ class ProjectLabels < Spinach::FeatureSteps
end
end
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
step
'I submit new label \'support\''
do
fill_in
'Title'
,
with:
'support'
fill_in
'Title'
,
with:
'support'
fill_in
'Background Color'
,
with:
'#F95610'
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