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
1d43689e
Commit
1d43689e
authored
Jun 01, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reduced duplication of job details
parent
9827f3db
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
134 additions
and
80 deletions
+134
-80
app/assets/javascripts/ide/components/jobs/detail.vue
app/assets/javascripts/ide/components/jobs/detail.vue
+18
-57
app/assets/javascripts/ide/components/jobs/detail/description.vue
...ts/javascripts/ide/components/jobs/detail/description.vue
+47
-0
app/assets/javascripts/ide/components/jobs/detail/scroll_button.vue
.../javascripts/ide/components/jobs/detail/scroll_button.vue
+61
-0
app/assets/javascripts/ide/components/jobs/item.vue
app/assets/javascripts/ide/components/jobs/item.vue
+4
-22
app/assets/javascripts/ide/stores/modules/pipelines/actions.js
...ssets/javascripts/ide/stores/modules/pipelines/actions.js
+4
-1
No files found.
app/assets/javascripts/ide/components/jobs/detail.vue
View file @
1d43689e
<
script
>
import
{
mapActions
,
mapState
}
from
'
vuex
'
;
import
_
from
'
underscore
'
;
import
CiIcon
from
'
../../../vue_shared/components/ci_icon.vue
'
;
import
tooltip
from
'
../../../vue_shared/directives/tooltip
'
;
import
Icon
from
'
../../../vue_shared/components/icon.vue
'
;
import
ScrollButton
from
'
./detail/scroll_button.vue
'
;
import
JobDescription
from
'
./detail/description.vue
'
;
const
scrollPositions
=
{
top
:
0
,
...
...
@@ -15,8 +16,9 @@ export default {
tooltip
,
},
components
:
{
CiIcon
,
Icon
,
ScrollButton
,
JobDescription
,
},
data
()
{
return
{
...
...
@@ -46,7 +48,7 @@ export default {
scrollUp
()
{
this
.
$refs
.
buildTrace
.
scrollTo
(
0
,
0
);
},
scrollBuildLog
:
_
.
throttle
(
function
s
crollDebounce
()
{
scrollBuildLog
:
_
.
throttle
(
function
buildLogS
crollDebounce
()
{
const
scrollTop
=
this
.
$refs
.
buildTrace
.
scrollTop
;
const
offsetHeight
=
this
.
$refs
.
buildTrace
.
offsetHeight
;
const
scrollHeight
=
this
.
$refs
.
buildTrace
.
scrollHeight
;
...
...
@@ -80,28 +82,9 @@ export default {
</button>
</header>
<div
class=
"top-bar d-flex"
>
<div
class=
"ide-job-details d-flex align-items-center"
>
<ci-icon
class=
"append-right-4 d-flex"
:status=
"detailJob.status"
:borderless=
"true"
:size=
"24"
/>
<span>
{{
detailJob
.
name
}}
<a
:href=
"detailJob.path"
target=
"_blank"
class=
"ide-external-link"
>
{{
jobId
}}
<icon
name=
"external-link"
:size=
"12"
/>
</a>
</span>
</div>
<job-description
:job=
"detailJob"
/>
<div
class=
"controllers ml-auto"
>
<a
v-tooltip
...
...
@@ -117,38 +100,16 @@ export default {
class=
"fa fa-file-text-o"
></i>
</a>
<div
v-tooltip
class=
"controllers-buttons"
data-container=
"body"
data-placement=
"top"
:title=
"__('Scroll to top')"
>
<button
class=
"btn-scroll btn-transparent btn-blank"
type=
"button"
:disabled=
"isScrolledToTop"
@
click=
"scrollUp"
>
<icon
name=
"scroll_up"
/>
</button>
</div>
<div
v-tooltip
class=
"controllers-buttons"
data-container=
"body"
data-placement=
"top"
:title=
"__('Scroll to bottom')"
>
<button
class=
"btn-scroll btn-transparent btn-blank"
type=
"button"
:disabled=
"isScrolledToBottom"
@
click=
"scrollDown"
>
<icon
name=
"scroll_down"
/>
</button>
</div>
<scroll-button
direction=
"up"
:disabled=
"isScrolledToTop"
@
click=
"scrollUp"
/>
<scroll-button
direction=
"down"
:disabled=
"isScrolledToBottom"
@
click=
"scrollDown"
/>
</div>
</div>
<pre
...
...
app/assets/javascripts/ide/components/jobs/detail/description.vue
0 → 100644
View file @
1d43689e
<
script
>
import
Icon
from
'
../../../../vue_shared/components/icon.vue
'
;
import
CiIcon
from
'
../../../../vue_shared/components/ci_icon.vue
'
;
export
default
{
components
:
{
Icon
,
CiIcon
,
},
props
:
{
job
:
{
type
:
Object
,
required
:
true
,
},
},
computed
:
{
jobId
()
{
return
`#
${
this
.
job
.
id
}
`
;
},
},
};
</
script
>
<
template
>
<div
class=
"d-flex align-items-center"
>
<ci-icon
class=
"d-flex"
:status=
"job.status"
:borderless=
"true"
:size=
"24"
/>
<span
class=
"prepend-left-8"
>
{{
job
.
name
}}
<a
:href=
"job.path"
target=
"_blank"
class=
"ide-external-link"
>
{{
jobId
}}
<icon
name=
"external-link"
:size=
"12"
/>
</a>
</span>
</div>
</
template
>
app/assets/javascripts/ide/components/jobs/detail/scroll_button.vue
0 → 100644
View file @
1d43689e
<
script
>
import
{
__
}
from
'
../../../../locale
'
;
import
Icon
from
'
../../../../vue_shared/components/icon.vue
'
;
import
tooltip
from
'
../../../../vue_shared/directives/tooltip
'
;
export
default
{
directives
:
{
tooltip
,
},
components
:
{
Icon
,
},
props
:
{
direction
:
{
type
:
String
,
required
:
true
,
validator
(
value
)
{
return
[
'
up
'
,
'
down
'
].
includes
(
value
);
},
},
disabled
:
{
type
:
Boolean
,
required
:
true
,
},
},
computed
:
{
tooltipTitle
()
{
return
this
.
direction
===
'
up
'
?
__
(
'
Scroll to top
'
)
:
__
(
'
Scroll to bottom
'
);
},
iconName
()
{
return
`scroll_
${
this
.
direction
}
`
;
},
},
methods
:
{
clickedScroll
()
{
this
.
$emit
(
'
click
'
);
},
},
};
</
script
>
<
template
>
<div
v-tooltip
class=
"controllers-buttons"
data-container=
"body"
data-placement=
"top"
:title=
"tooltipTitle"
>
<button
class=
"btn-scroll btn-transparent btn-blank"
type=
"button"
:disabled=
"disabled"
@
click=
"clickedScroll"
>
<icon
:name=
"iconName"
/>
</button>
</div>
</
template
>
app/assets/javascripts/ide/components/jobs/item.vue
View file @
1d43689e
<
script
>
import
Icon
from
'
../../../vue_shared/components/icon.vue
'
;
import
CiIcon
from
'
../../../vue_shared/components/ci_icon.vue
'
;
import
JobDescription
from
'
./detail/description.vue
'
;
export
default
{
components
:
{
Icon
,
CiIcon
,
JobDescription
,
},
props
:
{
job
:
{
...
...
@@ -28,25 +26,9 @@ export default {
<
template
>
<div
class=
"ide-job-item"
>
<ci-icon
:status=
"job.status"
:borderless=
"true"
:size=
"24"
<job-description
:job=
"job"
/>
<span
class=
"prepend-left-8"
>
{{
job
.
name
}}
<a
:href=
"job.path"
target=
"_blank"
class=
"ide-external-link"
>
{{
jobId
}}
<icon
name=
"external-link"
:size=
"12"
/>
</a>
</span>
<button
class=
"btn btn-default btn-sm ml-auto"
@
click=
"clickViewLog"
...
...
app/assets/javascripts/ide/stores/modules/pipelines/actions.js
View file @
1d43689e
...
...
@@ -86,7 +86,10 @@ export const setDetailJob = ({ commit, dispatch }, job) => {
};
export
const
requestJobTrace
=
({
commit
})
=>
commit
(
types
.
REQUEST_JOB_TRACE
);
export
const
receiveJobTraceError
=
({
commit
})
=>
commit
(
types
.
RECEIVE_JOB_TRACE_ERROR
);
export
const
receiveJobTraceError
=
({
commit
})
=>
{
flash
(
__
(
'
Error fetching job trace
'
));
commit
(
types
.
RECEIVE_JOB_TRACE_ERROR
);
};
export
const
receiveJobTraceSuccess
=
({
commit
},
data
)
=>
commit
(
types
.
RECEIVE_JOB_TRACE_SUCCESS
,
data
);
...
...
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