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
84a3ab25
Commit
84a3ab25
authored
Jul 25, 2017
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved Inline JS for Pipelines Charts + new Pipeline to dispatcher
parent
395e34bd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
5 deletions
+39
-5
dispatcher.js
app/assets/javascripts/dispatcher.js
+4
-0
pipelines_times.js
app/assets/javascripts/pipelines/pipelines_times.js
+27
-0
_pipeline_times.haml
app/views/projects/pipelines/charts/_pipeline_times.haml
+5
-0
new.html.haml
app/views/projects/pipelines/new.html.haml
+1
-4
webpack.config.js
config/webpack.config.js
+2
-1
No files found.
app/assets/javascripts/dispatcher.js
View file @
84a3ab25
...
...
@@ -8,6 +8,7 @@
/* global LabelsSelect */
/* global MilestoneSelect */
/* global Commit */
/* global NewBranchForm */
/* global NotificationsForm */
/* global NotificationsDropdown */
/* global GroupAvatar */
...
...
@@ -316,6 +317,9 @@ import PerformanceBar from './performance_bar';
case
'projects:edit'
:
setupProjectEdit
();
break
;
case
'projects:pipelines:new'
:
new
NewBranchForm
(
$
(
'.js-new-pipeline-form'
),
JSON
.
parse
(
document
.
getElementById
(
'availableRefs'
).
innerHTML
));
break
;
case
'projects:pipelines:builds'
:
case
'projects:pipelines:failures'
:
case
'projects:pipelines:show'
:
...
...
app/assets/javascripts/pipelines/pipelines_times.js
0 → 100644
View file @
84a3ab25
import
Chart
from
'vendor/Chart'
;
document
.
addEventListener
(
'DOMContentLoaded'
,
()
=>
{
const
chartData
=
JSON
.
parse
(
document
.
getElementById
(
'pipelinesTimesChartsData'
).
innerHTML
);
const
data
=
{
labels
:
chartData
.
labels
,
datasets
:
[{
fillColor
:
'rgba(220,220,220,0.5)'
,
strokeColor
:
'rgba(220,220,220,1)'
,
barStrokeWidth
:
1
,
barValueSpacing
:
1
,
barDatasetSpacing
:
1
,
data
:
chartData
.
values
,
}],
};
const
ctx
=
$
(
'#build_timesChart'
).
get
(
0
).
getContext
(
'2d'
);
const
options
=
{
scaleOverlay
:
true
,
responsive
:
true
,
maintainAspectRatio
:
false
,
};
if
(
window
.
innerWidth
<
768
)
{
// Scale fonts if window width lower than 768px (iPad portrait)
options
.
scaleFontSize
=
8
;
}
new
Chart
(
ctx
).
Bar
(
data
,
options
);
});
app/views/projects/pipelines/charts/_pipeline_times.haml
View file @
84a3ab25
-
content_for
:page_specific_javascripts
do
=
webpack_bundle_tag
(
'pipelines_times'
)
%div
%p
.light
=
_
(
"Commit duration in minutes for last 30 commits"
)
%canvas
#build_timesChart
{
height:
200
}
%script
#pipelinesTimesChartsData
{
type:
"application/json"
}=
{
:labels
=>
@charts
[
:pipeline_times
].
labels
,
:values
=>
@charts
[
:pipeline_times
].
pipeline_times
}.
to_json
.
html_safe
:javascript
var
data
=
{
labels
:
#{
@charts
[
:pipeline_times
].
labels
.
to_json
}
,
...
...
app/views/projects/pipelines/new.html.haml
View file @
84a3ab25
...
...
@@ -20,7 +20,4 @@
=
f
.
submit
'Create pipeline'
,
class:
'btn btn-create'
,
tabindex:
3
=
link_to
'Cancel'
,
project_pipelines_path
(
@project
),
class:
'btn btn-cancel'
:javascript
var
availableRefs
=
#{
@project
.
repository
.
ref_names
.
to_json
}
;
new
NewBranchForm
(
$
(
'.js-new-pipeline-form'
),
availableRefs
)
%script
#availableRefs
{
type:
"application/json"
}=
@project
.
repository
.
ref_names
.
to_json
.
html_safe
config/webpack.config.js
View file @
84a3ab25
...
...
@@ -54,7 +54,8 @@ var config = {
notebook_viewer
:
'./blob/notebook_viewer.js'
,
pdf_viewer
:
'./blob/pdf_viewer.js'
,
pipelines
:
'./pipelines/pipelines_bundle.js'
,
pipelines_details
:
'./pipelines/pipeline_details_bundle.js'
,
pipelines_details
:
'./pipelines/pipeline_details_bundle.js'
,
pipelines_times
:
'./pipelines/pipelines_times.js'
,
profile
:
'./profile/profile_bundle.js'
,
project_new
:
'./projects/project_new.js'
,
prometheus_metrics
:
'./prometheus_metrics'
,
...
...
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