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
b730fd06
Commit
b730fd06
authored
May 18, 2020
by
Sarah GP
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor file from single function
parent
5534fdcf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
26 deletions
+39
-26
app/assets/javascripts/pipelines/pipeline_details_bundle.js
app/assets/javascripts/pipelines/pipeline_details_bundle.js
+39
-26
No files found.
app/assets/javascripts/pipelines/pipeline_details_bundle.js
View file @
b730fd06
...
...
@@ -14,12 +14,7 @@ import axios from '~/lib/utils/axios_utils';
Vue
.
use
(
Translate
);
export
default
()
=>
{
const
{
dataset
}
=
document
.
querySelector
(
'
.js-pipeline-details-vue
'
);
const
mediator
=
new
PipelinesMediator
({
endpoint
:
dataset
.
endpoint
});
mediator
.
fetchPipeline
();
const
createPipelinesDetailApp
=
(
mediator
)
=>
{
// eslint-disable-next-line no-new
new
Vue
({
...
...
@@ -50,7 +45,9 @@ export default () => {
});
},
});
}
const
createPipelineHeaderApp
=
(
mediator
)
=>
{
// eslint-disable-next-line no-new
new
Vue
({
el
:
'
#js-pipeline-header-vue
'
,
...
...
@@ -94,7 +91,9 @@ export default () => {
});
},
});
}
const
createPipelinesTabs
=
()
=>
{
const
tabsElement
=
document
.
querySelector
(
'
.pipelines-tabs
'
);
const
testReportsEnabled
=
window
.
gon
&&
window
.
gon
.
features
&&
window
.
gon
.
features
.
junitPipelineView
;
...
...
@@ -107,6 +106,7 @@ export default () => {
document
.
querySelector
(
'
.pipelines-tabs > li > a.test-tab.active
'
),
);
if
(
isTestTabActive
)
{
testReportsStore
.
dispatch
(
fetchReportsAction
);
}
else
{
...
...
@@ -119,27 +119,40 @@ export default () => {
tabsElement
.
addEventListener
(
'
click
'
,
tabClickHandler
);
}
}
}
// eslint-disable-next-line no-new
new
Vue
({
el
:
'
#js-pipeline-tests-detail
'
,
components
:
{
TestReports
,
},
render
(
createElement
)
{
return
createElement
(
'
test-reports
'
);
},
});
const
createTestDetails
=
(
detailsEndpoint
)
=>
{
// eslint-disable-next-line no-new
new
Vue
({
el
:
'
#js-pipeline-tests-detail
'
,
components
:
{
TestReports
,
},
render
(
createElement
)
{
return
createElement
(
'
test-reports
'
);
},
});
axios
.
get
(
dataset
.
testReportsCount
Endpoint
)
.
then
(({
data
})
=>
{
if
(
!
data
.
total_count
)
{
return
;
}
axios
.
get
(
details
Endpoint
)
.
then
(({
data
})
=>
{
if
(
!
data
.
total_count
)
{
return
;
}
document
.
querySelector
(
'
.js-test-report-badge-counter
'
).
innerHTML
=
data
.
total_count
;
})
.
catch
(()
=>
{});
}
document
.
querySelector
(
'
.js-test-report-badge-counter
'
).
innerHTML
=
data
.
total_count
;
})
.
catch
(()
=>
{});
}
export
default
()
=>
{
const
{
dataset
}
=
document
.
querySelector
(
'
.js-pipeline-details-vue
'
);
const
mediator
=
new
PipelinesMediator
({
endpoint
:
dataset
.
endpoint
});
mediator
.
fetchPipeline
();
createPipelinesDetailApp
(
mediator
);
createPipelineHeaderApp
(
mediator
);
createPipelinesTabs
();
createTestDetails
(
dataset
.
testReportsCountEndpoint
);
};
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