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
Jérome Perrin
gitlab-ce
Commits
07da8651
Commit
07da8651
authored
Mar 22, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shows error messages when trying to create label in dropdown menu
Closes #14495
parent
8df6c3b9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
1 deletion
+21
-1
app/assets/javascripts/api.js.coffee
app/assets/javascripts/api.js.coffee
+2
-0
app/assets/javascripts/labels_select.js.coffee
app/assets/javascripts/labels_select.js.coffee
+11
-1
app/assets/stylesheets/pages/labels.scss
app/assets/stylesheets/pages/labels.scss
+7
-0
app/views/shared/issuable/_label_dropdown.html.haml
app/views/shared/issuable/_label_dropdown.html.haml
+1
-0
No files found.
app/assets/javascripts/api.js.coffee
View file @
07da8651
...
@@ -74,6 +74,8 @@
...
@@ -74,6 +74,8 @@
dataType
:
"json"
dataType
:
"json"
).
done
(
label
)
->
).
done
(
label
)
->
callback
(
label
)
callback
(
label
)
.
error
(
message
)
->
callback
(
message
.
responseJSON
)
# Return group projects list. Filtered by query
# Return group projects list. Filtered by query
groupProjects
:
(
group_id
,
query
,
callback
)
->
groupProjects
:
(
group_id
,
query
,
callback
)
->
...
...
app/assets/javascripts/labels_select.js.coffee
View file @
07da8651
...
@@ -14,6 +14,9 @@ class @LabelsSelect
...
@@ -14,6 +14,9 @@ class @LabelsSelect
defaultLabel
=
$dropdown
.
data
(
'default-label'
)
defaultLabel
=
$dropdown
.
data
(
'default-label'
)
if
newLabelField
.
length
if
newLabelField
.
length
$newLabelError
=
$dropdown
.
parent
().
find
(
'.js-label-error'
)
$newLabelError
.
hide
()
$
(
'.suggest-colors-dropdown a'
).
on
'click'
,
(
e
)
->
$
(
'.suggest-colors-dropdown a'
).
on
'click'
,
(
e
)
->
e
.
preventDefault
()
e
.
preventDefault
()
e
.
stopPropagation
()
e
.
stopPropagation
()
...
@@ -27,6 +30,7 @@ class @LabelsSelect
...
@@ -27,6 +30,7 @@ class @LabelsSelect
e
.
stopPropagation
()
e
.
stopPropagation
()
if
newLabelField
.
val
()
isnt
''
and
newColorField
.
val
()
isnt
''
if
newLabelField
.
val
()
isnt
''
and
newColorField
.
val
()
isnt
''
$newLabelError
.
hide
()
$
(
'.js-new-label-btn'
).
disable
()
$
(
'.js-new-label-btn'
).
disable
()
# Create new label with API
# Create new label with API
...
@@ -35,7 +39,13 @@ class @LabelsSelect
...
@@ -35,7 +39,13 @@ class @LabelsSelect
color
:
newColorField
.
val
()
color
:
newColorField
.
val
()
},
(
label
)
->
},
(
label
)
->
$
(
'.js-new-label-btn'
).
enable
()
$
(
'.js-new-label-btn'
).
enable
()
$
(
'.dropdown-menu-back'
,
$dropdown
.
parent
()).
trigger
'click'
if
label
.
message
?
$newLabelError
.
text
label
.
message
.
show
()
else
$
(
'.dropdown-menu-back'
,
$dropdown
.
parent
()).
trigger
'click'
$dropdown
.
glDropdown
(
$dropdown
.
glDropdown
(
data
:
(
term
,
callback
)
->
data
:
(
term
,
callback
)
->
...
...
app/assets/stylesheets/pages/labels.scss
View file @
07da8651
...
@@ -45,3 +45,10 @@
...
@@ -45,3 +45,10 @@
.label-subscription
{
.label-subscription
{
display
:
inline-block
;
display
:
inline-block
;
}
}
.dropdown-labels-error
{
padding
:
5px
10px
;
margin-bottom
:
10px
;
background-color
:
$gl-danger
;
color
:
$white-light
;
}
app/views/shared/issuable/_label_dropdown.html.haml
View file @
07da8651
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
.dropdown-page-two
.dropdown-page-two
=
dropdown_title
(
"Create new label"
,
back:
true
)
=
dropdown_title
(
"Create new label"
,
back:
true
)
=
dropdown_content
do
=
dropdown_content
do
.dropdown-labels-error.js-label-error
%input
#new_label_color
{
type:
"hidden"
}
%input
#new_label_color
{
type:
"hidden"
}
%input
#new_label_name
.dropdown-input-field
{
type:
"text"
,
placeholder:
"Name new label"
}
%input
#new_label_name
.dropdown-input-field
{
type:
"text"
,
placeholder:
"Name new label"
}
.dropdown-label-color-preview.js-dropdown-label-color-preview
.dropdown-label-color-preview.js-dropdown-label-color-preview
...
...
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