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
59e1b26a
Commit
59e1b26a
authored
Dec 27, 2016
by
Regis
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'mini-stage-graph-vue' into auto-pipelines-vue
parents
589fd93d
71d50042
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
90 additions
and
12 deletions
+90
-12
app/assets/javascripts/dispatcher.js.es6
app/assets/javascripts/dispatcher.js.es6
+3
-3
app/assets/javascripts/vue_pipelines_index/stage.js.es6
app/assets/javascripts/vue_pipelines_index/stage.js.es6
+78
-9
app/views/projects/pipelines/index.html.haml
app/views/projects/pipelines/index.html.haml
+9
-0
No files found.
app/assets/javascripts/dispatcher.js.es6
View file @
59e1b26a
...
...
@@ -174,9 +174,9 @@
}
break;
case 'projects:pipelines:index':
new gl.MiniPipelineGraph({
container: '.js-pipeline-table',
});
//
new gl.MiniPipelineGraph({
//
container: '.js-pipeline-table',
//
});
break;
case 'projects:pipelines:builds':
case 'projects:pipelines:show':
...
...
app/assets/javascripts/vue_pipelines_index/stage.js.es6
View file @
59e1b26a
/* global Vue, gl */
/* global Vue,
Flash,
gl */
/* eslint-disable no-param-reassign */
((gl) => {
gl.VueStage = Vue.extend({
data() {
return {
request: false,
builds: '',
spinner: '<span class="fa fa-spinner fa-spin"></span>',
};
},
props: ['stage', 'svgs', 'match'],
methods: {
fetchBuilds() {
this.$http.get(this.endpoint)
.then((response) => {
this.request = true;
this.builds = JSON.parse(response.body).html;
}, () => new Flash(
'Something went wrong on our end.',
));
},
clearState() {
this.request = false;
this.builds = '';
},
},
computed: {
buildsOrSpinner() {
return this.request ? this.builds : this.spinner;
},
dropdownClass() {
if (this.request) return 'js-builds-dropdown-container';
return 'js-builds-dropdown-loading builds-dropdown-loading';
},
endpoint() {
return '/gitlab-org/gitlab-shell/pipelines/121/stage?stage=deploy';
},
stageTitle() {
return 'deploy: running';
},
buildStatus() {
return `Build: ${this.stage.status.label}`;
},
...
...
@@ -12,17 +47,51 @@
return `has-tooltip ci-status-icon-${this.stage.status.group}`;
},
svg() {
return this.svgs[this.match(this.stage.status.icon)];
const icon = this.stage.status.icon;
icon.replace('icon', 'stageIcon');
return this.svgs[this.match(icon)];
},
spanClass() {
return `ci-status-icon ci-status-icon-${this.stage.status.group}`;
},
},
template: `
<a
:class='tooltip'
:title='buildStatus'
:href='stage.path'
v-html='svg'
>
</a>
<div class="stage-container mini-pipeline-graph">
<div class="dropdown inline build-content">
<button
@click='fetchBuilds'
class="has-tooltip builds-dropdown js-builds-dropdown-button"
data-placement="top"
:title='stageTitle'
data-toggle="dropdown"
type="button"
>
<span :class='tooltip'>
<span class="mini-pipeline-graph-icon-container">
<span
:class='spanClass'
v-html='svg'
>
</span>
<i class="fa fa-caret-down dropdown-caret"></i>
</span>
</span>
</button>
<div class="js-builds-dropdown-container">
<div class="dropdown-menu grouped-pipeline-dropdown">
<div class="arrow-up"></div>
<div
:class='dropdownClass'
v-html='buildsOrSpinner'
>
</div>
</div>
</div>
</div>
</div>
`,
});
})(window.gl || (window.gl = {}));
app/views/projects/pipelines/index.html.haml
View file @
59e1b26a
...
...
@@ -49,8 +49,17 @@
"icon_status_success"
=>
custom_icon
(
"icon_status_success"
),
"icon_status_failed"
=>
custom_icon
(
"icon_status_failed"
),
"icon_status_warning"
=>
custom_icon
(
"icon_status_warning"
),
"stage_icon_status_canceled"
=>
custom_icon
(
"icon_status_canceled_borderless"
),
"stage_icon_status_running"
=>
custom_icon
(
"icon_status_running_borderless"
),
"stage_icon_status_skipped"
=>
custom_icon
(
"icon_status_skipped_borderless"
),
"stage_icon_status_created"
=>
custom_icon
(
"icon_status_created_borderless"
),
"stage_icon_status_pending"
=>
custom_icon
(
"icon_status_pending_borderless"
),
"stage_icon_status_success"
=>
custom_icon
(
"icon_status_success_borderless"
),
"stage_icon_status_failed"
=>
custom_icon
(
"icon_status_failed_borderless"
),
"stage_icon_status_warning"
=>
custom_icon
(
"icon_status_warning_borderless"
),
"icon_play"
=>
custom_icon
(
"icon_play"
),
"icon_timer"
=>
custom_icon
(
"icon_timer"
),
"icon_status_manual"
=>
custom_icon
(
"icon_status_manual"
),
}
}
.vue-pipelines-index
...
...
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