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
3a38cdda
Commit
3a38cdda
authored
Jun 14, 2016
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue when assigning no weight
Closes
https://gitlab.com/gitlab-org/gitlab-ce/issues/18374
parent
15191864
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
4 deletions
+37
-4
app/assets/javascripts/weight_select.js.coffee
app/assets/javascripts/weight_select.js.coffee
+7
-3
app/views/shared/issuable/_sidebar.html.haml
app/views/shared/issuable/_sidebar.html.haml
+1
-1
spec/features/issues/issue_sidebar_spec.rb
spec/features/issues/issue_sidebar_spec.rb
+29
-0
No files found.
app/assets/javascripts/weight_select.js.coffee
View file @
3a38cdda
...
...
@@ -13,7 +13,7 @@ class @WeightSelect
updateWeight
=
(
selected
)
->
data
=
{}
data
[
abilityName
]
=
{}
data
[
abilityName
].
weight
=
selected
data
[
abilityName
].
weight
=
if
selected
?
then
selected
else
null
$loading
.
fadeIn
()
$dropdown
.
trigger
(
'loading.gl.dropdown'
)
...
...
@@ -27,7 +27,10 @@ class @WeightSelect
$loading
.
fadeOut
()
$selectbox
.
hide
()
$value
.
html
(
data
.
weight
)
if
data
.
weight
?
$value
.
html
(
data
.
weight
)
else
$value
.
html
(
'None'
)
$sidebarCollapsedValue
.
html
(
data
.
weight
)
$dropdown
.
glDropdown
(
...
...
@@ -38,7 +41,8 @@ class @WeightSelect
# display:block overrides the hide-collapse rule
$value
.
css
(
'display'
,
''
)
id
:
(
obj
,
el
)
->
$
(
el
).
data
"id"
if
not
$
(
el
).
data
(
"none"
)
?
$
(
el
).
data
"id"
clicked
:
(
selected
)
->
if
$
(
dropdown
).
is
".js-filter-submit"
$
(
dropdown
).
parents
(
'form'
).
submit
()
...
...
app/views/shared/issuable/_sidebar.html.haml
View file @
3a38cdda
...
...
@@ -151,7 +151,7 @@
%ul
-
Issue
.
weight_options
.
select
{
|
weight
|
weight
!=
"Everything"
&&
weight
!=
"Any Weight"
}.
each
do
|
weight
|
%li
%a
{
href:
"#"
,
data:
{
id:
weight
},
class:
(
"is-active"
if
params
[
:weight
]
==
weight
.
to_s
)}
%a
{
href:
"#"
,
data:
{
id:
weight
,
none:
(
"true"
if
weight
==
Issue
::
WEIGHT_NONE
)
},
class:
(
"is-active"
if
params
[
:weight
]
==
weight
.
to_s
)}
=
weight
=
render
"shared/issuable/participants"
,
participants:
issuable
.
participants
(
current_user
)
...
...
spec/features/issues/issue_sidebar_spec.rb
View file @
3a38cdda
...
...
@@ -73,6 +73,35 @@ feature 'Issue Sidebar', feature: true do
end
end
context
'updating weight'
,
js:
true
do
before
do
project
.
team
<<
[
user
,
:master
]
visit_issue
(
project
,
issue
)
end
it
'should update weight in sidebar to 1'
do
page
.
within
'.weight'
do
click_link
'Edit'
click_link
'1'
page
.
within
'.value'
do
expect
(
page
).
to
have_content
'1'
end
end
end
it
'should update weight in sidebar to no weight'
do
page
.
within
'.weight'
do
click_link
'Edit'
click_link
'No Weight'
page
.
within
'.value'
do
expect
(
page
).
to
have_content
'None'
end
end
end
end
def
visit_issue
(
project
,
issue
)
visit
namespace_project_issue_path
(
project
.
namespace
,
project
,
issue
)
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