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
79fc65c0
Commit
79fc65c0
authored
Feb 24, 2020
by
Fabio Huser
Committed by
Paul Slaughter
Feb 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix pipeline details page initialization on invalid pipeline
https://gitlab.com/gitlab-org/gitlab/-/merge_requests/25302
parent
94b807e2
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
19 deletions
+29
-19
app/assets/javascripts/pages/projects/pipelines/init_pipelines.js
...ts/javascripts/pages/projects/pipelines/init_pipelines.js
+15
-13
app/assets/javascripts/pipelines/pipeline_details_bundle.js
app/assets/javascripts/pipelines/pipeline_details_bundle.js
+4
-4
changelogs/unreleased/fix-pipeline-details-invalid-buttons.yml
...elogs/unreleased/fix-pipeline-details-invalid-buttons.yml
+5
-0
spec/factories/ci/pipelines.rb
spec/factories/ci/pipelines.rb
+1
-0
spec/features/projects/pipelines/pipeline_spec.rb
spec/features/projects/pipelines/pipeline_spec.rb
+4
-2
No files found.
app/assets/javascripts/pages/projects/pipelines/init_pipelines.js
View file @
79fc65c0
...
@@ -13,19 +13,21 @@ export default () => {
...
@@ -13,19 +13,21 @@ export default () => {
});
});
}
}
const
pipelineTabLink
=
document
.
querySelector
(
'
.js-pipeline-tab-link a
'
);
const
{
controllerAction
}
=
document
.
querySelector
(
'
.js-pipeline-container
'
).
dataset
;
const
{
controllerAction
}
=
document
.
querySelector
(
'
.js-pipeline-container
'
).
dataset
;
const
pipelineStatusUrl
=
`
${
document
.
querySelector
(
'
.js-pipeline-tab-link a
'
)
.
getAttribute
(
'
href
'
)}
/status.json`
;
// eslint-disable-next-line no-new
if
(
pipelineTabLink
)
{
new
Pipelines
({
const
pipelineStatusUrl
=
`
${
pipelineTabLink
.
getAttribute
(
'
href
'
)}
/status.json`
;
initTabs
:
true
,
pipelineStatusUrl
,
// eslint-disable-next-line no-new
tabsOptions
:
{
new
Pipelines
({
action
:
controllerAction
,
initTabs
:
true
,
defaultAction
:
'
pipelines
'
,
pipelineStatusUrl
,
parentEl
:
'
.pipelines-tabs
'
,
tabsOptions
:
{
},
action
:
controllerAction
,
});
defaultAction
:
'
pipelines
'
,
parentEl
:
'
.pipelines-tabs
'
,
},
});
}
};
};
app/assets/javascripts/pipelines/pipeline_details_bundle.js
View file @
79fc65c0
...
@@ -95,14 +95,14 @@ export default () => {
...
@@ -95,14 +95,14 @@ export default () => {
},
},
});
});
const
tabsElement
=
document
.
querySelector
(
'
.pipelines-tabs
'
);
const
testReportsEnabled
=
const
testReportsEnabled
=
window
.
gon
&&
window
.
gon
.
features
&&
window
.
gon
.
features
.
junitPipelineView
;
window
.
gon
&&
window
.
gon
.
features
&&
window
.
gon
.
features
.
junitPipelineView
;
if
(
testReportsEnabled
)
{
if
(
t
absElement
&&
t
estReportsEnabled
)
{
const
fetchReportsAction
=
'
fetchReports
'
;
const
fetchReportsAction
=
'
fetchReports
'
;
testReportsStore
.
dispatch
(
'
setEndpoint
'
,
dataset
.
testReportEndpoint
);
testReportsStore
.
dispatch
(
'
setEndpoint
'
,
dataset
.
testReportEndpoint
);
const
tabsElmement
=
document
.
querySelector
(
'
.pipelines-tabs
'
);
const
isTestTabActive
=
Boolean
(
const
isTestTabActive
=
Boolean
(
document
.
querySelector
(
'
.pipelines-tabs > li > a.test-tab.active
'
),
document
.
querySelector
(
'
.pipelines-tabs > li > a.test-tab.active
'
),
);
);
...
@@ -113,11 +113,11 @@ export default () => {
...
@@ -113,11 +113,11 @@ export default () => {
const
tabClickHandler
=
e
=>
{
const
tabClickHandler
=
e
=>
{
if
(
e
.
target
.
className
===
'
test-tab
'
)
{
if
(
e
.
target
.
className
===
'
test-tab
'
)
{
testReportsStore
.
dispatch
(
fetchReportsAction
);
testReportsStore
.
dispatch
(
fetchReportsAction
);
tabsEl
m
ement
.
removeEventListener
(
'
click
'
,
tabClickHandler
);
tabsElement
.
removeEventListener
(
'
click
'
,
tabClickHandler
);
}
}
};
};
tabsEl
m
ement
.
addEventListener
(
'
click
'
,
tabClickHandler
);
tabsElement
.
addEventListener
(
'
click
'
,
tabClickHandler
);
}
}
// eslint-disable-next-line no-new
// eslint-disable-next-line no-new
...
...
changelogs/unreleased/fix-pipeline-details-invalid-buttons.yml
0 → 100644
View file @
79fc65c0
---
title
:
Fix pipeline details page initialisation on invalid pipeline
merge_request
:
25302
author
:
Fabio Huser
type
:
fixed
spec/factories/ci/pipelines.rb
View file @
79fc65c0
...
@@ -22,6 +22,7 @@ FactoryBot.define do
...
@@ -22,6 +22,7 @@ FactoryBot.define do
factory
:ci_pipeline
do
factory
:ci_pipeline
do
trait
:invalid
do
trait
:invalid
do
status
{
:failed
}
yaml_errors
{
'invalid YAML'
}
yaml_errors
{
'invalid YAML'
}
failure_reason
{
:config_error
}
failure_reason
{
:config_error
}
end
end
...
...
spec/features/projects/pipelines/pipeline_spec.rb
View file @
79fc65c0
...
@@ -1077,8 +1077,6 @@ describe 'Pipeline', :js do
...
@@ -1077,8 +1077,6 @@ describe 'Pipeline', :js do
end
end
context
'when pipeline has configuration errors'
do
context
'when pipeline has configuration errors'
do
include_context
'pipeline builds'
let
(
:pipeline
)
do
let
(
:pipeline
)
do
create
(
:ci_pipeline
,
create
(
:ci_pipeline
,
:invalid
,
:invalid
,
...
@@ -1119,6 +1117,10 @@ describe 'Pipeline', :js do
...
@@ -1119,6 +1117,10 @@ describe 'Pipeline', :js do
%Q{span[title="
#{
pipeline
.
present
.
failure_reason
}
"]}
)
%Q{span[title="
#{
pipeline
.
present
.
failure_reason
}
"]}
)
end
end
end
end
it
'contains a pipeline header with title'
do
expect
(
page
).
to
have_content
"Pipeline #
#{
pipeline
.
id
}
"
end
end
end
context
'when pipeline is stuck'
do
context
'when pipeline is stuck'
do
...
...
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