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
Boxiang Sun
gitlab-ce
Commits
dded02d1
Commit
dded02d1
authored
Jun 09, 2017
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix milestone page assignees when dropped in ongoing list
Fix
https://gitlab.com/gitlab-org/gitlab-ce/issues/32861
parent
64e85fda
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
11 deletions
+23
-11
app/assets/javascripts/milestone.js
app/assets/javascripts/milestone.js
+14
-10
spec/features/milestones/milestones_spec.rb
spec/features/milestones/milestones_spec.rb
+9
-1
No files found.
app/assets/javascripts/milestone.js
View file @
dded02d1
...
@@ -65,14 +65,18 @@
...
@@ -65,14 +65,18 @@
};
};
Milestone
.
successCallback
=
function
(
data
,
element
)
{
Milestone
.
successCallback
=
function
(
data
,
element
)
{
var
img_tag
;
const
$avatarContainer
=
$
(
element
).
find
(
'
.assignee-icon
'
);
if
(
data
.
assignee
)
{
$avatarContainer
.
empty
();
img_tag
=
$
(
'
<img/>
'
);
img_tag
.
attr
(
'
src
'
,
data
.
assignee
.
avatar_url
);
if
(
data
.
assignees
&&
data
.
assignees
.
length
>
0
)
{
img_tag
.
addClass
(
'
avatar s16
'
);
const
$avatars
=
data
.
assignees
.
map
((
assignee
)
=>
{
$
(
element
).
find
(
'
.assignee-icon img
'
).
replaceWith
(
img_tag
);
const
img_tag
=
$
(
'
<img/>
'
);
}
else
{
img_tag
.
attr
(
'
src
'
,
assignee
.
avatar_url
);
$
(
element
).
find
(
'
.assignee-icon
'
).
empty
();
img_tag
.
addClass
(
'
avatar s16
'
);
return
img_tag
;
});
$avatarContainer
.
append
(
$avatars
);
}
}
};
};
...
@@ -161,9 +165,9 @@
...
@@ -161,9 +165,9 @@
data
=
(
function
()
{
data
=
(
function
()
{
switch
(
newState
)
{
switch
(
newState
)
{
case
'
ongoing
'
:
case
'
ongoing
'
:
return
opts
.
fieldName
+
'
[assignee_id]=
'
+
gon
.
current_user_id
;
return
`
${
opts
.
fieldName
}
[assignee_ids][]=
${
gon
.
current_user_id
}
`
;
case
'
unassigned
'
:
case
'
unassigned
'
:
return
opts
.
fieldName
+
'
[assignee_id]=
'
;
return
`
${
opts
.
fieldName
}
[assignee_ids][]=0`
;
case
'
closed
'
:
case
'
closed
'
:
return
opts
.
fieldName
+
'
[state_event]=close
'
;
return
opts
.
fieldName
+
'
[state_event]=close
'
;
}
}
...
...
spec/features/milestones/milestones_spec.rb
View file @
dded02d1
...
@@ -37,6 +37,14 @@ describe 'Milestone draggable', feature: true, js: true do
...
@@ -37,6 +37,14 @@ describe 'Milestone draggable', feature: true, js: true do
expect
(
issue_target
).
to
have_selector
(
'.issuable-row'
)
expect
(
issue_target
).
to
have_selector
(
'.issuable-row'
)
end
end
it
'assigns issue when it has been dragged to ongoing list'
do
login_as
(
:admin
)
create_and_drag_issue
expect
(
@issue
.
reload
.
assignees
).
not_to
be_empty
expect
(
page
).
to
have_selector
(
"#sortable_issue_
#{
@issue
.
iid
}
.assignee-icon img"
,
count:
1
)
end
end
end
context
'merge requests'
do
context
'merge requests'
do
...
@@ -72,7 +80,7 @@ describe 'Milestone draggable', feature: true, js: true do
...
@@ -72,7 +80,7 @@ describe 'Milestone draggable', feature: true, js: true do
end
end
def
create_and_drag_issue
(
params
=
{})
def
create_and_drag_issue
(
params
=
{})
create
(
:issue
,
params
.
merge
(
title:
'Foo'
,
project:
project
,
milestone:
milestone
))
@issue
=
create
(
:issue
,
params
.
merge
(
title:
'Foo'
,
project:
project
,
milestone:
milestone
))
visit
namespace_project_milestone_path
(
project
.
namespace
,
project
,
milestone
)
visit
namespace_project_milestone_path
(
project
.
namespace
,
project
,
milestone
)
scroll_into_view
(
'.milestone-content'
)
scroll_into_view
(
'.milestone-content'
)
...
...
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