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
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
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
5 deletions
+39
-5
app/assets/javascripts/dispatcher.js
app/assets/javascripts/dispatcher.js
+4
-0
app/assets/javascripts/pipelines/pipelines_times.js
app/assets/javascripts/pipelines/pipelines_times.js
+27
-0
app/views/projects/pipelines/charts/_pipeline_times.haml
app/views/projects/pipelines/charts/_pipeline_times.haml
+5
-0
app/views/projects/pipelines/new.html.haml
app/views/projects/pipelines/new.html.haml
+1
-4
config/webpack.config.js
config/webpack.config.js
+2
-1
No files found.
app/assets/javascripts/dispatcher.js
View file @
84a3ab25
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
/* global LabelsSelect */
/* global LabelsSelect */
/* global MilestoneSelect */
/* global MilestoneSelect */
/* global Commit */
/* global Commit */
/* global NewBranchForm */
/* global NotificationsForm */
/* global NotificationsForm */
/* global NotificationsDropdown */
/* global NotificationsDropdown */
/* global GroupAvatar */
/* global GroupAvatar */
...
@@ -316,6 +317,9 @@ import PerformanceBar from './performance_bar';
...
@@ -316,6 +317,9 @@ import PerformanceBar from './performance_bar';
case
'
projects:edit
'
:
case
'
projects:edit
'
:
setupProjectEdit
();
setupProjectEdit
();
break
;
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:builds
'
:
case
'
projects:pipelines:failures
'
:
case
'
projects:pipelines:failures
'
:
case
'
projects:pipelines:show
'
:
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
%div
%p
.light
%p
.light
=
_
(
"Commit duration in minutes for last 30 commits"
)
=
_
(
"Commit duration in minutes for last 30 commits"
)
%canvas
#build_timesChart
{
height:
200
}
%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
:javascript
var
data
=
{
var
data
=
{
labels
:
#{
@charts
[
:pipeline_times
].
labels
.
to_json
}
,
labels
:
#{
@charts
[
:pipeline_times
].
labels
.
to_json
}
,
...
...
app/views/projects/pipelines/new.html.haml
View file @
84a3ab25
...
@@ -20,7 +20,4 @@
...
@@ -20,7 +20,4 @@
=
f
.
submit
'Create pipeline'
,
class:
'btn btn-create'
,
tabindex:
3
=
f
.
submit
'Create pipeline'
,
class:
'btn btn-create'
,
tabindex:
3
=
link_to
'Cancel'
,
project_pipelines_path
(
@project
),
class:
'btn btn-cancel'
=
link_to
'Cancel'
,
project_pipelines_path
(
@project
),
class:
'btn btn-cancel'
:javascript
%script
#availableRefs
{
type:
"application/json"
}=
@project
.
repository
.
ref_names
.
to_json
.
html_safe
var
availableRefs
=
#{
@project
.
repository
.
ref_names
.
to_json
}
;
new
NewBranchForm
(
$
(
'
.js-new-pipeline-form
'
),
availableRefs
)
config/webpack.config.js
View file @
84a3ab25
...
@@ -55,6 +55,7 @@ var config = {
...
@@ -55,6 +55,7 @@ var config = {
pdf_viewer
:
'
./blob/pdf_viewer.js
'
,
pdf_viewer
:
'
./blob/pdf_viewer.js
'
,
pipelines
:
'
./pipelines/pipelines_bundle.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
'
,
profile
:
'
./profile/profile_bundle.js
'
,
project_new
:
'
./projects/project_new.js
'
,
project_new
:
'
./projects/project_new.js
'
,
prometheus_metrics
:
'
./prometheus_metrics
'
,
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