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
Léo-Paul Géneau
gitlab-ce
Commits
a855d427
Commit
a855d427
authored
Feb 13, 2017
by
Eric Eastwood
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix stray pipelines API request when showing MR
Fixes
https://gitlab.com/gitlab-org/gitlab-ce/issues/27925
parent
14527293
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
25 additions
and
8 deletions
+25
-8
app/assets/javascripts/commit/pipelines/pipelines_bundle.js.es6
...sets/javascripts/commit/pipelines/pipelines_bundle.js.es6
+6
-3
app/assets/javascripts/commit/pipelines/pipelines_table.js.es6
...ssets/javascripts/commit/pipelines/pipelines_table.js.es6
+2
-3
app/assets/javascripts/merge_request_tabs.js.es6
app/assets/javascripts/merge_request_tabs.js.es6
+8
-0
app/views/projects/commit/_pipelines_list.haml
app/views/projects/commit/_pipelines_list.haml
+4
-1
app/views/projects/merge_requests/_show.html.haml
app/views/projects/merge_requests/_show.html.haml
+1
-1
changelogs/unreleased/27925-fix-mr-stray-pipelines-api-request.yml
...s/unreleased/27925-fix-mr-stray-pipelines-api-request.yml
+4
-0
No files found.
app/assets/javascripts/commit/pipelines/pipelines_bundle.js.es6
View file @
a855d427
...
...
@@ -20,7 +20,10 @@ $(() => {
gl.commits.PipelinesTableBundle.$destroy(true);
}
gl.commits.pipelines.PipelinesTableBundle = new gl.commits.pipelines.PipelinesTableView({
el: document.querySelector('#commit-pipeline-table-view'),
});
const pipelineTableViewEl = document.querySelector('#commit-pipeline-table-view');
gl.commits.pipelines.PipelinesTableBundle = new gl.commits.pipelines.PipelinesTableView();
if (pipelineTableViewEl && pipelineTableViewEl.dataset.disableInitialization === undefined) {
gl.commits.pipelines.PipelinesTableBundle.$mount(pipelineTableViewEl);
}
});
app/assets/javascripts/commit/pipelines/pipelines_table.js.es6
View file @
a855d427
...
...
@@ -56,15 +56,14 @@ require('./pipelines_store');
},
/**
* When the component is created the service to fetch the data will be
* initialized with the correct endpoint.
* When the component is about to be mounted, tell the service to fetch the data
*
* A request to fetch the pipelines will be made.
* In case of a successfull response we will store the data in the provided
* store, in case of a failed response we need to warn the user.
*
*/
created
() {
beforeMount
() {
const pipelinesService = new gl.commits.pipelines.PipelinesService(this.endpoint);
this.isLoading = true;
...
...
app/assets/javascripts/merge_request_tabs.js.es6
View file @
a855d427
...
...
@@ -61,6 +61,7 @@ require('./flash');
constructor({ action, setUrl, stubLocation } = {}) {
this.diffsLoaded = false;
this.pipelinesLoaded = false;
this.commitsLoaded = false;
this.fixedLayoutPref = null;
...
...
@@ -128,6 +129,13 @@ require('./flash');
$.scrollTo('.merge-request-details .merge-request-tabs', {
offset: 0,
});
} else if (action === 'pipelines') {
if (this.pipelinesLoaded) {
return;
}
const pipelineTableViewEl = document.querySelector('#commit-pipeline-table-view');
gl.commits.pipelines.PipelinesTableBundle.$mount(pipelineTableViewEl);
this.pipelinesLoaded = true;
} else {
this.expandView();
this.resetViewContainer();
...
...
app/views/projects/commit/_pipelines_list.haml
View file @
a855d427
#commit-pipeline-table-view
{
data:
{
endpoint:
endpoint
}
}
-
disable_initialization
=
local_assigns
.
fetch
(
:disable_initialization
,
false
)
#commit-pipeline-table-view
{
data:
{
disable_initialization:
disable_initialization
,
endpoint:
endpoint
,
}
}
.pipeline-svgs
{
data:
{
"commit_icon_svg"
=>
custom_icon
(
"icon_commit"
),
"icon_status_canceled"
=>
custom_icon
(
"icon_status_canceled"
),
"icon_status_running"
=>
custom_icon
(
"icon_status_running"
),
...
...
app/views/projects/merge_requests/_show.html.haml
View file @
a855d427
...
...
@@ -94,7 +94,7 @@
-# This tab is always loaded via AJAX
#pipelines
.pipelines.tab-pane
-
if
@pipelines
.
any?
=
render
'projects/commit/pipelines_list'
,
endpoint:
pipelines_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
=
render
'projects/commit/pipelines_list'
,
disable_initialization:
true
,
endpoint:
pipelines_namespace_project_merge_request_path
(
@project
.
namespace
,
@project
,
@merge_request
)
#diffs
.diffs.tab-pane
-# This tab is always loaded via AJAX
...
...
changelogs/unreleased/27925-fix-mr-stray-pipelines-api-request.yml
0 → 100644
View file @
a855d427
---
title
:
Fix stray pipelines API request when showing MR
merge_request
:
author
:
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