BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
a7a08738
Commit
a7a08738
authored
Feb 22, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '27287-label-dropdown-error-messages' into 'master'
Fix form response errors not shown for create label dropdown. See merge request !9058
parents
5a84b5fd
7f67b6c2
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
22 deletions
+33
-22
create_label.js.es6
app/assets/javascripts/create_label.js.es6
+3
-3
27287-label-dropdown-error-messages.yml
...gelogs/unreleased/27287-label-dropdown-error-messages.yml
+4
-0
issue_sidebar_spec.rb
spec/features/issues/issue_sidebar_spec.rb
+26
-19
No files found.
app/assets/javascripts/create_label.js.es6
View file @
a7a08738
...
@@ -107,9 +107,9 @@
...
@@ -107,9 +107,9 @@
if (typeof label.message === 'string') {
if (typeof label.message === 'string') {
errors = label.message;
errors = label.message;
} else {
} else {
errors =
label.message.map(function (value, key) {
errors =
Object.keys(label.message).map(key =>
return key + " " + value[0];
`${gl.text.humanize(key)} ${label.message[key].join(', ')}`
}
).join("<br/>");
).join("<br/>");
}
}
this.$newLabelError
this.$newLabelError
...
...
changelogs/unreleased/27287-label-dropdown-error-messages.yml
0 → 100644
View file @
a7a08738
---
title
:
Fix displaying error messages for create label dropdown
merge_request
:
9058
author
:
Tom Koole
spec/features/issues/issue_sidebar_spec.rb
View file @
a7a08738
...
@@ -7,9 +7,9 @@ feature 'Issue Sidebar', feature: true do
...
@@ -7,9 +7,9 @@ feature 'Issue Sidebar', feature: true do
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let!
(
:user
)
{
create
(
:user
)}
let!
(
:user
)
{
create
(
:user
)}
let!
(
:label
)
{
create
(
:label
,
project:
project
,
title:
'bug'
)
}
before
do
before
do
create
(
:label
,
project:
project
,
title:
'bug'
)
login_as
(
user
)
login_as
(
user
)
end
end
...
@@ -50,16 +50,6 @@ feature 'Issue Sidebar', feature: true do
...
@@ -50,16 +50,6 @@ feature 'Issue Sidebar', feature: true do
visit_issue
(
project
,
issue
)
visit_issue
(
project
,
issue
)
end
end
describe
'when clicking on edit labels'
,
js:
true
do
it
'shows dropdown option to create a new label'
do
find
(
'.block.labels .edit-link'
).
click
page
.
within
(
'.block.labels'
)
do
expect
(
page
).
to
have_content
'Create new'
end
end
end
context
'sidebar'
,
js:
true
do
context
'sidebar'
,
js:
true
do
it
'changes size when the screen size is smaller'
do
it
'changes size when the screen size is smaller'
do
sidebar_selector
=
'aside.right-sidebar.right-sidebar-collapsed'
sidebar_selector
=
'aside.right-sidebar.right-sidebar-collapsed'
...
@@ -77,30 +67,34 @@ feature 'Issue Sidebar', feature: true do
...
@@ -77,30 +67,34 @@ feature 'Issue Sidebar', feature: true do
end
end
end
end
context
'
creating a new label
'
,
js:
true
do
context
'
editing issue labels
'
,
js:
true
do
it
'shows option to crate a new label is present'
do
before
do
page
.
within
(
'.block.labels'
)
do
page
.
within
(
'.block.labels'
)
do
find
(
'.edit-link'
).
click
find
(
'.edit-link'
).
click
end
end
it
'shows option to create a new label'
do
page
.
within
(
'.block.labels'
)
do
expect
(
page
).
to
have_content
'Create new'
expect
(
page
).
to
have_content
'Create new'
end
end
end
end
it
'shows dropdown switches to "create label" section'
do
context
'creating a new label'
,
js:
true
do
before
do
page
.
within
(
'.block.labels'
)
do
page
.
within
(
'.block.labels'
)
do
find
(
'.edit-link'
).
click
click_link
'Create new'
click_link
'Create new'
end
end
it
'shows dropdown switches to "create label" section'
do
page
.
within
(
'.block.labels'
)
do
expect
(
page
).
to
have_content
'Create new label'
expect
(
page
).
to
have_content
'Create new label'
end
end
end
end
it
'adds new label'
do
it
'adds new label'
do
page
.
within
(
'.block.labels'
)
do
page
.
within
(
'.block.labels'
)
do
find
(
'.edit-link'
).
click
sleep
1
click_link
'Create new'
fill_in
'new_label_name'
,
with:
'wontfix'
fill_in
'new_label_name'
,
with:
'wontfix'
page
.
find
(
".suggest-colors a"
,
match: :first
).
click
page
.
find
(
".suggest-colors a"
,
match: :first
).
click
click_button
'Create'
click_button
'Create'
...
@@ -110,6 +104,19 @@ feature 'Issue Sidebar', feature: true do
...
@@ -110,6 +104,19 @@ feature 'Issue Sidebar', feature: true do
end
end
end
end
end
end
it
'shows error message if label title is taken'
do
page
.
within
(
'.block.labels'
)
do
fill_in
'new_label_name'
,
with:
label
.
title
page
.
find
(
'.suggest-colors a'
,
match: :first
).
click
click_button
'Create'
page
.
within
(
'.dropdown-page-two'
)
do
expect
(
page
).
to
have_content
'Title has already been taken'
end
end
end
end
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