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
5e8bae25
Commit
5e8bae25
authored
Sep 19, 2019
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Follow up after review
parent
d0ade1af
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
10 deletions
+15
-10
app/assets/javascripts/jobs/components/log/collapsible_section.vue
...s/javascripts/jobs/components/log/collapsible_section.vue
+8
-3
app/assets/javascripts/jobs/components/log/log.vue
app/assets/javascripts/jobs/components/log/log.vue
+1
-1
spec/frontend/jobs/components/log/collapsible_section_spec.js
.../frontend/jobs/components/log/collapsible_section_spec.js
+6
-6
No files found.
app/assets/javascripts/jobs/components/log/collapsible_section.vue
View file @
5e8bae25
...
@@ -18,9 +18,14 @@ export default {
...
@@ -18,9 +18,14 @@ export default {
required
:
true
,
required
:
true
,
},
},
},
},
computed
:
{
badgeDuration
()
{
return
this
.
section
.
line
&&
this
.
section
.
line
.
section_duration
;
},
},
methods
:
{
methods
:
{
handleOnClickCollapsibleLine
(
section
)
{
handleOnClickCollapsibleLine
(
section
)
{
this
.
$emit
(
'
handleO
nClickCollapsibleLine
'
,
section
);
this
.
$emit
(
'
o
nClickCollapsibleLine
'
,
section
);
},
},
},
},
};
};
...
@@ -29,7 +34,7 @@ export default {
...
@@ -29,7 +34,7 @@ export default {
<div>
<div>
<log-line-header
<log-line-header
:line=
"section.line"
:line=
"section.line"
:duration=
"
section.line.section_d
uration"
:duration=
"
badgeD
uration"
:path=
"traceEndpoint"
:path=
"traceEndpoint"
:is-closed=
"section.isClosed"
:is-closed=
"section.isClosed"
@
toggleLine=
"handleOnClickCollapsibleLine(section)"
@
toggleLine=
"handleOnClickCollapsibleLine(section)"
...
@@ -41,7 +46,7 @@ export default {
...
@@ -41,7 +46,7 @@ export default {
:key=
"`collapsible-nested-$
{line.offset}`"
:key=
"`collapsible-nested-$
{line.offset}`"
:section="line"
:section="line"
:trace-endpoint="traceEndpoint"
:trace-endpoint="traceEndpoint"
@
handleOnClickCollapsib
leLine="handleOnClickCollapsibleLine"
@
togg
leLine="handleOnClickCollapsibleLine"
/>
/>
<log-line
v-else
:key=
"line.offset"
:line=
"line"
:path=
"traceEndpoint"
/>
<log-line
v-else
:key=
"line.offset"
:line=
"line"
:path=
"traceEndpoint"
/>
</
template
>
</
template
>
...
...
app/assets/javascripts/jobs/components/log/log.vue
View file @
5e8bae25
...
@@ -27,7 +27,7 @@ export default {
...
@@ -27,7 +27,7 @@ export default {
:key=
"`collapsible-$
{index}`"
:key=
"`collapsible-$
{index}`"
:section="section"
:section="section"
:trace-endpoint="traceEndpoint"
:trace-endpoint="traceEndpoint"
@
handleO
nClickCollapsibleLine="handleOnClickCollapsibleLine"
@
o
nClickCollapsibleLine="handleOnClickCollapsibleLine"
/>
/>
<log-line
v-else
:key=
"section.offset"
:line=
"section"
:path=
"traceEndpoint"
/>
<log-line
v-else
:key=
"section.offset"
:line=
"section"
:path=
"traceEndpoint"
/>
</
template
>
</
template
>
...
...
spec/frontend/jobs/components/log/collapsible_section_spec.js
View file @
5e8bae25
...
@@ -7,6 +7,8 @@ describe('Job Log Collapsible Section', () => {
...
@@ -7,6 +7,8 @@ describe('Job Log Collapsible Section', () => {
const
traceEndpoint
=
'
jobs/335
'
;
const
traceEndpoint
=
'
jobs/335
'
;
const
findCollapsibleLine
=
()
=>
wrapper
.
find
(
'
.collapsible-line
'
);
const
createComponent
=
(
props
=
{})
=>
{
const
createComponent
=
(
props
=
{})
=>
{
wrapper
=
mount
(
CollpasibleSection
,
{
wrapper
=
mount
(
CollpasibleSection
,
{
sync
:
true
,
sync
:
true
,
...
@@ -16,8 +18,6 @@ describe('Job Log Collapsible Section', () => {
...
@@ -16,8 +18,6 @@ describe('Job Log Collapsible Section', () => {
});
});
};
};
beforeEach
(()
=>
{});
afterEach
(()
=>
{
afterEach
(()
=>
{
wrapper
.
destroy
();
wrapper
.
destroy
();
});
});
...
@@ -31,7 +31,7 @@ describe('Job Log Collapsible Section', () => {
...
@@ -31,7 +31,7 @@ describe('Job Log Collapsible Section', () => {
});
});
it
(
'
renders clickable header line
'
,
()
=>
{
it
(
'
renders clickable header line
'
,
()
=>
{
expect
(
wrapper
.
find
(
'
.collapsible-line
'
).
attributes
(
'
role
'
)).
toBe
(
'
button
'
);
expect
(
findCollapsibleLine
(
).
attributes
(
'
role
'
)).
toBe
(
'
button
'
);
});
});
});
});
...
@@ -48,13 +48,13 @@ describe('Job Log Collapsible Section', () => {
...
@@ -48,13 +48,13 @@ describe('Job Log Collapsible Section', () => {
});
});
});
});
it
(
'
emits
handleO
nClickCollapsibleLine on click
'
,
()
=>
{
it
(
'
emits
o
nClickCollapsibleLine on click
'
,
()
=>
{
createComponent
({
createComponent
({
section
:
nestedSectionOpened
,
section
:
nestedSectionOpened
,
traceEndpoint
,
traceEndpoint
,
});
});
wrapper
.
find
(
'
.collapsible-line
'
).
trigger
(
'
click
'
);
findCollapsibleLine
(
).
trigger
(
'
click
'
);
expect
(
wrapper
.
emitted
(
'
handleO
nClickCollapsibleLine
'
).
length
).
toBe
(
1
);
expect
(
wrapper
.
emitted
(
'
o
nClickCollapsibleLine
'
).
length
).
toBe
(
1
);
});
});
});
});
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