2017-05-06 17:02:06 +00:00
|
|
|
<script>
|
2017-10-05 21:16:37 +00:00
|
|
|
import icon from '../../vue_shared/components/icon.vue';
|
2017-05-06 17:02:06 +00:00
|
|
|
|
2017-05-12 11:28:26 +00:00
|
|
|
/**
|
|
|
|
* Renders CI icon based on API response shared between all places where it is used.
|
|
|
|
*
|
|
|
|
* Receives status object containing:
|
|
|
|
* status: {
|
|
|
|
* details_path: "/gitlab-org/gitlab-ce/pipelines/8150156" // url
|
|
|
|
* group:"running" // used for CSS class
|
|
|
|
* icon: "icon_status_running" // used to render the icon
|
|
|
|
* label:"running" // used for potential tooltip
|
|
|
|
* text:"running" // text rendered
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* Used in:
|
|
|
|
* - Pipelines table Badge
|
|
|
|
* - Pipelines table mini graph
|
|
|
|
* - Pipeline graph
|
|
|
|
* - Pipeline show view badge
|
|
|
|
* - Jobs table
|
|
|
|
* - Jobs show view header
|
|
|
|
* - Jobs show view sidebar
|
|
|
|
*/
|
2017-05-06 17:02:06 +00:00
|
|
|
export default {
|
|
|
|
props: {
|
|
|
|
status: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
2017-10-05 21:16:37 +00:00
|
|
|
components: {
|
|
|
|
icon,
|
|
|
|
},
|
2017-05-06 17:02:06 +00:00
|
|
|
|
2017-10-05 21:16:37 +00:00
|
|
|
computed: {
|
2017-05-06 17:02:06 +00:00
|
|
|
cssClass() {
|
2017-05-12 11:28:26 +00:00
|
|
|
const status = this.status.group;
|
2017-05-06 17:02:06 +00:00
|
|
|
return `ci-status-icon ci-status-icon-${status} js-ci-status-icon-${status}`;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
</script>
|
|
|
|
<template>
|
|
|
|
<span
|
2017-10-05 21:16:37 +00:00
|
|
|
:class="cssClass">
|
|
|
|
<icon
|
|
|
|
:name="status.icon"/>
|
2017-05-06 17:02:06 +00:00
|
|
|
</span>
|
|
|
|
</template>
|