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
9f832e59
Commit
9f832e59
authored
Jun 12, 2019
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adds margins to the section lines
parent
4e249e54
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
12 deletions
+17
-12
app/assets/javascripts/jobs/components/job_log.vue
app/assets/javascripts/jobs/components/job_log.vue
+9
-8
app/assets/stylesheets/pages/builds.scss
app/assets/stylesheets/pages/builds.scss
+4
-0
lib/gitlab/ci/ansi2html.rb
lib/gitlab/ci/ansi2html.rb
+4
-4
No files found.
app/assets/javascripts/jobs/components/job_log.vue
View file @
9f832e59
...
@@ -29,9 +29,7 @@ export default {
...
@@ -29,9 +29,7 @@ export default {
});
});
},
},
destroyed
()
{
destroyed
()
{
this
.
$el
this
.
removeEventListener
();
.
querySelector
(
'
.js-section-start
'
)
.
removeEventListener
(
'
click
'
,
this
.
handleSectionClick
);
},
},
methods
:
{
methods
:
{
...
mapActions
([
'
scrollBottom
'
]),
...
mapActions
([
'
scrollBottom
'
]),
...
@@ -49,6 +47,11 @@ export default {
...
@@ -49,6 +47,11 @@ export default {
},
0
);
},
0
);
}
}
},
},
removeEventListener
()
{
this
.
$el
.
querySelector
(
'
.js-section-start
'
)
.
removeEventListener
(
'
click
'
,
this
.
handleSectionClick
);
},
/**
/**
* The collapsible rows are sent in HTML from the backend
* The collapsible rows are sent in HTML from the backend
* We need to add a onclick handler for the divs that match `.js-section-start`
* We need to add a onclick handler for the divs that match `.js-section-start`
...
@@ -60,7 +63,8 @@ export default {
...
@@ -60,7 +63,8 @@ export default {
.
forEach
(
el
=>
el
.
addEventListener
(
'
click
'
,
this
.
handleSectionClick
));
.
forEach
(
el
=>
el
.
addEventListener
(
'
click
'
,
this
.
handleSectionClick
));
},
},
/**
/**
*
* On click, we toggle the hidden class of
* all the rows that match the `data-section` selector
*/
*/
handleSectionClick
(
evt
)
{
handleSectionClick
(
evt
)
{
const
clickedArrow
=
evt
.
currentTarget
;
const
clickedArrow
=
evt
.
currentTarget
;
...
@@ -70,11 +74,8 @@ export default {
...
@@ -70,11 +74,8 @@ export default {
clickedArrow
.
classList
.
toggle
(
'
fa-caret-down
'
);
clickedArrow
.
classList
.
toggle
(
'
fa-caret-down
'
);
const
dataSection
=
clickedArrow
.
getAttribute
(
'
data-section
'
);
const
dataSection
=
clickedArrow
.
getAttribute
(
'
data-section
'
);
const
sibilings
=
this
.
$el
.
querySelectorAll
(
const
sibilings
=
this
.
$el
.
querySelectorAll
(
`.js-s_
${
dataSection
}
:not(.js-section-header)`
);
`.s_
${
dataSection
}
:not(.js-section-header)`
,
);
// Get all sibilings between the clicked element and the next
sibilings
.
forEach
(
row
=>
row
.
classList
.
toggle
(
'
hidden
'
));
sibilings
.
forEach
(
row
=>
row
.
classList
.
toggle
(
'
hidden
'
));
},
},
},
},
...
...
app/assets/stylesheets/pages/builds.scss
View file @
9f832e59
...
@@ -124,6 +124,10 @@
...
@@ -124,6 +124,10 @@
float
:
left
;
float
:
left
;
padding-left
:
$gl-padding-8
;
padding-left
:
$gl-padding-8
;
}
}
.section-header
~
.section.line
{
margin-left
:
$gl-padding
;
}
}
}
.build-header
{
.build-header
{
...
...
lib/gitlab/ci/ansi2html.rb
View file @
9f832e59
...
@@ -193,7 +193,7 @@ module Gitlab
...
@@ -193,7 +193,7 @@ module Gitlab
if
@sections
.
any?
if
@sections
.
any?
css_classes
<<
"section"
css_classes
<<
"section"
css_classes
+=
sections
.
map
{
|
section
|
"s_
#{
section
}
"
}
css_classes
+=
sections
.
map
{
|
section
|
"s_
#{
section
}
"
}
css_classes
<<
"
prepend-left-default
line"
css_classes
<<
"line"
end
end
write_in_tag
%{<br/>}
write_in_tag
%{<br/>}
...
@@ -222,7 +222,7 @@ module Gitlab
...
@@ -222,7 +222,7 @@ module Gitlab
return
if
@sections
.
include?
(
section
)
return
if
@sections
.
include?
(
section
)
@sections
<<
section
@sections
<<
section
write_raw
%{<div class="
section-start js-section-start fa fa-caret-down js-open append-right-8 cursor-pointer" id="id_#{section}" data-action="start
" data-timestamp="#{timestamp}" data-section="#{data_section_names}" role="button"></div>}
write_raw
%{<div class="
js-section-start fa fa-caret-down append-right-8 cursor-pointer
" data-timestamp="#{timestamp}" data-section="#{data_section_names}" role="button"></div>}
@lineno_in_section
=
0
@lineno_in_section
=
0
end
end
...
@@ -231,7 +231,7 @@ module Gitlab
...
@@ -231,7 +231,7 @@ module Gitlab
# close all sections up to section
# close all sections up to section
until
@sections
.
empty?
until
@sections
.
empty?
write_raw
%{<div class="section-end
js-section-end" data-action="end" data-timestamp="#{timestamp}
" data-section="#{data_section_names}"></div>}
write_raw
%{<div class="section-end" data-section="#{data_section_names}"></div>}
last_section
=
@sections
.
pop
last_section
=
@sections
.
pop
break
if
section
==
last_section
break
if
section
==
last_section
...
@@ -309,7 +309,7 @@ module Gitlab
...
@@ -309,7 +309,7 @@ module Gitlab
if
@sections
.
any?
if
@sections
.
any?
css_classes
<<
"section"
css_classes
<<
"section"
css_classes
<<
"js-section-header"
if
@lineno_in_section
==
0
css_classes
<<
"js-section-header"
if
@lineno_in_section
==
0
css_classes
+=
sections
.
map
{
|
section
|
"s_
#{
section
}
"
}
css_classes
+=
sections
.
map
{
|
section
|
"
js-
s_
#{
section
}
"
}
end
end
@out
<<
%{<span class="#{css_classes.join(' ')}">}
@out
<<
%{<span class="#{css_classes.join(' ')}">}
...
...
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