BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
5defad2d
Commit
5defad2d
authored
Sep 29, 2016
by
Luke Bennett
Committed by
Annabel Dunstone Gray
Oct 10, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finished up margin JS logic
parent
eb55ac7d
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
26 deletions
+38
-26
dispatcher.js
app/assets/javascripts/dispatcher.js
+3
-0
pipeline.js.es6
app/assets/javascripts/pipeline.js.es6
+27
-23
pipelines.scss
app/assets/stylesheets/pages/pipelines.scss
+4
-0
_pipeline.html.haml
app/views/projects/commit/_pipeline.html.haml
+4
-3
No files found.
app/assets/javascripts/dispatcher.js
View file @
5defad2d
...
@@ -126,6 +126,9 @@
...
@@ -126,6 +126,9 @@
new
TreeView
();
new
TreeView
();
}
}
break
;
break
;
case
'projects:pipelines:show'
:
new
window
.
gl
.
Pipelines
();
break
;
case
'groups:activity'
:
case
'groups:activity'
:
new
Activities
();
new
Activities
();
break
;
break
;
...
...
app/assets/javascripts/pipeline.js.es6
View file @
5defad2d
(
function()
{
(
(global) =>
{
function addMarginToBuild () {
class Pipelines {
const $secondChildBuildNode = $('.build:nth-child(2)');
constructor() {
const $firstChildBuildNode = $secondChildBuildNode.prev('.build');
$(document).off('click', '.toggle-pipeline-btn').on('click', '.toggle-pipeline-btn', this.toggleGraph);
// const $previousBuildColumn = $secondChildBuildNode.closest('.stage-column').prev('.stage-column');
$(document).off('ready.addMarginToBuildColumns').on('ready.addMarginToBuildColumns', this.addMarginToBuildColumns);
if ($secondChildBuildNode.length) {
$secondChildBuildNode.closest('.stage-column').addClass('left-margin');
$firstChildBuildNode.addClass('left-connector');
}
}
}
function
toggleGraph() {
toggleGraph() {
const $pipelineBtn = $(this).closest('.toggle-pipeline-btn');
const $pipelineBtn = $(this).closest('.toggle-pipeline-btn');
const $pipelineGraph = $(this).closest('.row-content-block').next('.pipeline-graph');
const $pipelineGraph = $(this).closest('.row-content-block').next('.pipeline-graph');
const $btnText = $(this).find('.toggle-btn-text');
const $btnText = $(this).find('.toggle-btn-text');
const $icon = $(this).find('.fa');
$($pipelineBtn).add($pipelineGraph).toggleClass('graph-collapsed');
$($pipelineBtn).add($pipelineGraph).toggleClass('graph-collapsed');
const graphCollapsed = $pipelineGraph.hasClass('graph-collapsed');
const graphCollapsed = $pipelineGraph.hasClass('graph-collapsed');
const expandIcon = 'fa-caret-down';
const hideIcon = 'fa-caret-up';
graphCollapsed ? $btnText.text('Expand') : $btnText.text('Hide')
}
if(graphCollapsed) {
$btnText.text('Expand');
addMarginToBuildColumns() {
$icon.removeClass(hideIcon).addClass(expandIcon);
const $secondChildBuildNode = $('.build:nth-child(2)');
} else {
if ($secondChildBuildNode.length) {
$btnText.text('Hide');
const $firstChildBuildNode = $secondChildBuildNode.prev('.build');
$icon.removeClass(expandIcon).addClass(hideIcon);
const $multiBuildColumn = $secondChildBuildNode.closest('.stage-column');
const $previousColumn = $multiBuildColumn.prev('.stage-column');
$multiBuildColumn.addClass('left-margin');
$firstChildBuildNode.addClass('left-connector');
$previousColumn.each(function() {
$this = $(this);
if ($('.build', $this).length === 1) $this.addClass('no-margin');
});
}
$('.pipeline-graph-container').removeClass('hidden');
}
}
}
}
$(document).on('click', '.toggle-pipeline-btn', toggleGraph)
;
global.Pipelines = Pipelines
;
$(document).on('ready', addMarginToBuild);
})();
})(
window.gl || (window.gl = {})
);
app/assets/stylesheets/pages/pipelines.scss
View file @
5defad2d
...
@@ -326,6 +326,10 @@
...
@@ -326,6 +326,10 @@
}
}
}
}
&
.no-margin
{
margin
:
0
;
}
li
{
li
{
list-style
:
none
;
list-style
:
none
;
}
}
...
...
app/views/projects/commit/_pipeline.html.haml
View file @
5defad2d
.row-content-block.build-content.middle-block.pipeline-actions
.pipeline-graph-container.hidden
.row-content-block.build-content.middle-block.pipeline-actions
.pull-right
.pull-right
.btn.btn-grouped.btn-white.toggle-pipeline-btn
.btn.btn-grouped.btn-white.toggle-pipeline-btn
%span
.toggle-btn-text
Hide
%span
.toggle-btn-text
Hide
%span
pipeline graph
%span
pipeline graph
=
icon
(
'caret-up'
)
%span
.caret
-
if
can?
(
current_user
,
:update_pipeline
,
pipeline
.
project
)
-
if
can?
(
current_user
,
:update_pipeline
,
pipeline
.
project
)
-
if
pipeline
.
builds
.
latest
.
failed
.
any?
(
&
:retryable?
)
-
if
pipeline
.
builds
.
latest
.
failed
.
any?
(
&
:retryable?
)
=
link_to
"Retry failed"
,
retry_namespace_project_pipeline_path
(
pipeline
.
project
.
namespace
,
pipeline
.
project
,
pipeline
.
id
),
class:
'btn btn-grouped btn-primary'
,
method: :post
=
link_to
"Retry failed"
,
retry_namespace_project_pipeline_path
(
pipeline
.
project
.
namespace
,
pipeline
.
project
,
pipeline
.
id
),
class:
'btn btn-grouped btn-primary'
,
method: :post
...
@@ -27,7 +28,7 @@
...
@@ -27,7 +28,7 @@
in
in
=
time_interval_in_words
pipeline
.
duration
=
time_interval_in_words
pipeline
.
duration
.row-content-block.build-content.middle-block.pipeline-graph
.row-content-block.build-content.middle-block.pipeline-graph
.pipeline-visualization
.pipeline-visualization
%ul
.stage-column-list
%ul
.stage-column-list
-
stages
=
pipeline
.
stages_with_latest_statuses
-
stages
=
pipeline
.
stages_with_latest_statuses
...
...
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