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
a87815fb
Commit
a87815fb
authored
Mar 01, 2017
by
Kamil Trzciński
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix/gb/improve-merge-request-pipelines-api' into 'master'
Improve internal API for new merge request Closes #27866 See merge request !9304
parents
b3700dea
8f3c8448
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
pipelines_table.js.es6
...ssets/javascripts/commit/pipelines/pipelines_table.js.es6
+3
-1
merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+3
-1
merge_requests_controller_spec.rb
spec/controllers/projects/merge_requests_controller_spec.rb
+2
-1
No files found.
app/assets/javascripts/commit/pipelines/pipelines_table.js.es6
View file @
a87815fb
...
...
@@ -69,7 +69,9 @@ const PipelineStore = require('./pipelines_store');
return pipelinesService.all()
.then(response => response.json())
.then((json) => {
this.store.storePipelines(json);
// depending of the endpoint the response can either bring a `pipelines` key or not.
const pipelines = json.pipelines || json;
this.store.storePipelines(pipelines);
this.isLoading = false;
})
.catch(() => {
...
...
app/controllers/projects/merge_requests_controller.rb
View file @
a87815fb
...
...
@@ -245,9 +245,11 @@ class Projects::MergeRequestsController < Projects::ApplicationController
format
.
json
do
define_pipelines_vars
render
json:
PipelineSerializer
render
json:
{
pipelines:
PipelineSerializer
.
new
(
project:
@project
,
user:
@current_user
)
.
represent
(
@pipelines
)
}
end
end
end
...
...
spec/controllers/projects/merge_requests_controller_spec.rb
View file @
a87815fb
...
...
@@ -43,7 +43,8 @@ describe Projects::MergeRequestsController do
submit_new_merge_request
(
format: :json
)
expect
(
response
).
to
be_ok
expect
(
json_response
).
not_to
be_empty
expect
(
json_response
).
to
have_key
'pipelines'
expect
(
json_response
[
'pipelines'
]).
not_to
be_empty
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