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
c6420ce2
Commit
c6420ce2
authored
Jun 14, 2018
by
Mario de la Ossa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix milestones disappearing when changed on MR
parent
edfa2e3f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
6 deletions
+23
-6
app/assets/javascripts/milestone_select.js
app/assets/javascripts/milestone_select.js
+2
-3
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+1
-1
app/serializers/merge_request_basic_entity.rb
app/serializers/merge_request_basic_entity.rb
+4
-0
spec/controllers/projects/merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+1
-1
spec/fixtures/api/schemas/entities/merge_request_basic.json
spec/fixtures/api/schemas/entities/merge_request_basic.json
+15
-1
No files found.
app/assets/javascripts/milestone_select.js
View file @
c6420ce2
...
...
@@ -16,10 +16,10 @@ export default class MilestoneSelect {
typeof
currentProject
===
'
string
'
?
JSON
.
parse
(
currentProject
)
:
currentProject
;
}
this
.
init
(
els
,
options
);
MilestoneSelect
.
init
(
els
,
options
);
}
init
(
els
,
options
)
{
static
init
(
els
,
options
)
{
let
$els
=
$
(
els
);
if
(
!
els
)
{
...
...
@@ -224,7 +224,6 @@ export default class MilestoneSelect {
$selectBox
.
hide
();
$value
.
css
(
'
display
'
,
''
);
if
(
data
.
milestone
!=
null
)
{
data
.
milestone
.
full_path
=
this
.
currentProject
.
full_path
;
data
.
milestone
.
remaining
=
timeFor
(
data
.
milestone
.
due_date
);
data
.
milestone
.
name
=
data
.
milestone
.
title
;
$value
.
html
(
milestoneLinkTemplate
(
data
.
milestone
));
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
c6420ce2
...
...
@@ -115,7 +115,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
end
format
.
json
do
render
json:
@merge_request
.
to_json
(
include:
{
milestone:
{},
assignee:
{
only:
[
:name
,
:username
],
methods:
[
:avatar_url
]
},
labels:
{
methods: :text_color
}
},
methods:
[
:task_status
,
:task_status_short
]
)
render
json:
serializer
.
represent
(
@merge_request
,
serializer:
'basic'
)
end
end
rescue
ActiveRecord
::
StaleObjectError
...
...
app/serializers/merge_request_basic_entity.rb
View file @
c6420ce2
...
...
@@ -5,4 +5,8 @@ class MergeRequestBasicEntity < IssuableSidebarEntity
expose
:state
expose
:source_branch_exists?
,
as: :source_branch_exists
expose
:rebase_in_progress?
,
as: :rebase_in_progress
expose
:milestone
,
using:
API
::
Entities
::
Milestone
expose
:labels
,
using:
LabelEntity
expose
:assignee
,
using:
API
::
Entities
::
UserBasic
expose
:task_status
,
:task_status_short
end
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
c6420ce2
...
...
@@ -234,7 +234,7 @@ describe Projects::MergeRequestsController do
body
=
JSON
.
parse
(
response
.
body
)
expect
(
body
[
'assignee'
].
keys
)
.
to
match_array
(
%w(name username avatar_url)
)
.
to
match_array
(
%w(name username avatar_url
id state web_url
)
)
end
end
...
...
spec/fixtures/api/schemas/entities/merge_request_basic.json
View file @
c6420ce2
...
...
@@ -14,7 +14,21 @@
"subscribed"
:
{
"type"
:
[
"boolean"
,
"null"
]
},
"participants"
:
{
"type"
:
"array"
},
"allow_collaboration"
:
{
"type"
:
"boolean"
},
"allow_maintainer_to_push"
:
{
"type"
:
"boolean"
}
"allow_maintainer_to_push"
:
{
"type"
:
"boolean"
},
"assignee"
:
{
"oneOf"
:
[
{
"type"
:
"null"
},
{
"$ref"
:
"user.json"
}
]
},
"milestone"
:
{
"type"
:
[
"object"
,
"null"
]
},
"labels"
:
{
"type"
:
[
"array"
,
"null"
]
},
"task_status"
:
{
"type"
:
"string"
},
"task_status_short"
:
{
"type"
:
"string"
}
},
"additionalProperties"
:
false
}
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