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
0
Merge Requests
0
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
Tatuya Kamada
gitlab-ce
Commits
13798c00
Commit
13798c00
authored
Dec 13, 2016
by
Regis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dynamic API consumption for SVGs
parent
562df3a3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
29 additions
and
23 deletions
+29
-23
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
+15
-2
app/assets/javascripts/vue_pipelines_index/stage.js.es6
app/assets/javascripts/vue_pipelines_index/stage.js.es6
+2
-2
app/assets/javascripts/vue_pipelines_index/stages.js.es6
app/assets/javascripts/vue_pipelines_index/stages.js.es6
+2
-2
app/views/projects/pipelines/index.html.haml
app/views/projects/pipelines/index.html.haml
+10
-17
No files found.
app/assets/javascripts/vue_pipelines_index/pipelines.js.es6
View file @
13798c00
...
...
@@ -66,6 +66,9 @@
if (pipeline.commit) return pipeline.commit.commit_url;
return '';
},
match(string) {
return string.replace(/_([a-z])/g, (m, w) => w.toUpperCase());
},
},
template: `
<div>
...
...
@@ -77,7 +80,12 @@
<pipeline-head></pipeline-head>
<tbody>
<tr class="commit" v-for='pipeline in pipelines'>
<status-scope :pipeline='pipeline'></status-scope>
<status-scope
:pipeline='pipeline'
:match='match'
:svgs='svgs'
>
</status-scope>
<pipeline-url :pipeline='pipeline'></pipeline-url>
<td>
<commit
...
...
@@ -91,7 +99,12 @@
>
</commit>
</td>
<stages :pipeline='pipeline'></stages>
<stages
:pipeline='pipeline'
:svgs='svgs'
:match='match'
>
</stages>
<time-ago :pipeline='pipeline'></time-ago>
<pipeline-actions :pipeline='pipeline'></pipeline-actions>
</tr>
...
...
app/assets/javascripts/vue_pipelines_index/stage.js.es6
View file @
13798c00
...
...
@@ -3,7 +3,7 @@
((gl) => {
gl.VueStage = Vue.extend({
props: ['stage'],
props: ['stage'
, 'svgs', 'match'
],
computed: {
buildStatus() {
return `Build: ${this.stage.status.label}`;
...
...
@@ -12,7 +12,7 @@
return `has-tooltip ci-status-icon-${this.stage.status.label}`;
},
svg() {
return
document.querySelector(`.${this.stage.status.icon}`).innerHTML
;
return
this.svgs[this.match(this.stage.status.icon)]
;
},
},
template: `
...
...
app/assets/javascripts/vue_pipelines_index/stages.js.es6
View file @
13798c00
...
...
@@ -6,14 +6,14 @@
components: {
'vue-stage': gl.VueStage,
},
props: ['pipeline'],
props: ['pipeline'
, 'svgs', 'match'
],
template: `
<td class="stage-cell">
<div
class="stage-container"
v-for='stage in pipeline.details.stages'
>
<vue-stage :stage='stage'></vue-stage>
<vue-stage :stage='stage'
:svgs='svgs' :match='match'
></vue-stage>
</div>
</td>
`,
...
...
app/views/projects/pipelines/index.html.haml
View file @
13798c00
...
...
@@ -40,24 +40,17 @@
%div
.nothing-here-block
No pipelines to show
-
else
.pipeline-svgs
{
"data"
=>
{
"commit-icon-svg"
=>
custom_icon
(
"icon_commit"
)}
}
.pipeline-svgs
{
"data"
=>
{
"commit_icon_svg"
=>
custom_icon
(
"icon_commit"
),
"icon_status_canceled"
=>
custom_icon
(
"icon_status_canceled"
),
"icon_status_running"
=>
custom_icon
(
"icon_status_running"
),
"icon_status_skipped"
=>
custom_icon
(
"icon_status_skipped"
),
"icon_status_created"
=>
custom_icon
(
"icon_status_created"
),
"icon_status_pending"
=>
custom_icon
(
"icon_status_pending"
),
"icon_status_success"
=>
custom_icon
(
"icon_status_success"
),
"icon_status_failed"
=>
custom_icon
(
"icon_status_failed"
),
"icon_status_warning"
=>
custom_icon
(
"icon_status_warning"
),
}
}
.icon_status_canceled.hidden
=
custom_icon
(
"icon_status_canceled"
)
.icon_status_running.hidden
=
custom_icon
(
"icon_status_running"
)
.icon_status_skipped.hidden
=
custom_icon
(
"icon_status_skipped"
)
.icon_status_created.hidden
=
custom_icon
(
"icon_status_created"
)
.icon_status_pending.hidden
=
custom_icon
(
"icon_status_pending"
)
.icon_status_success.hidden
=
custom_icon
(
"icon_status_success"
)
.icon_status_failed.hidden
=
custom_icon
(
"icon_status_failed"
)
.icon_status_warning.hidden
=
custom_icon
(
"icon_status_warning"
)
.vue-pipelines-index
=
page_specific_javascript_tag
(
'vue_pagination/index.js'
)
...
...
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