gitlab-org--gitlab-foss/app/assets/javascripts/jobs/components/sidebar_detail_row.vue

46 lines
900 B
Vue
Raw Normal View History

<script>
import { GlIcon, GlLink } from '@gitlab/ui';
2018-10-10 02:23:54 -04:00
export default {
name: 'SidebarDetailRow',
components: {
GlIcon,
GlLink,
},
2018-10-10 02:23:54 -04:00
props: {
title: {
type: String,
required: false,
default: '',
},
2018-10-10 02:23:54 -04:00
value: {
type: String,
required: true,
},
2018-10-10 02:23:54 -04:00
helpUrl: {
type: String,
required: false,
default: '',
},
},
computed: {
hasTitle() {
return this.title.length > 0;
},
hasHelpURL() {
return this.helpUrl.length > 0;
},
},
};
</script>
<template>
<p class="build-detail-row">
<span v-if="hasTitle" class="font-weight-bold">{{ title }}:</span> {{ value }}
2018-11-16 15:07:38 -05:00
<span v-if="hasHelpURL" class="help-button float-right">
<gl-link :href="helpUrl" target="_blank" rel="noopener noreferrer nofollow">
<gl-icon name="question-o" />
</gl-link>
</span>
</p>
</template>