debian-mirror-gitlab/app/assets/javascripts/issue_show/components/pinned_links.vue

64 lines
1.4 KiB
Vue
Raw Normal View History

2019-09-04 21:01:54 +05:30
<script>
2020-07-28 23:09:34 +05:30
import { GlButton } from '@gitlab/ui';
import { STATUS_PAGE_PUBLISHED, JOIN_ZOOM_MEETING } from '../constants';
2019-09-04 21:01:54 +05:30
export default {
components: {
2020-07-28 23:09:34 +05:30
GlButton,
2019-09-04 21:01:54 +05:30
},
props: {
2019-09-30 21:07:59 +05:30
zoomMeetingUrl: {
2019-09-04 21:01:54 +05:30
type: String,
2019-09-30 21:07:59 +05:30
required: false,
2020-06-23 00:09:42 +05:30
default: '',
},
publishedIncidentUrl: {
type: String,
required: false,
default: '',
2019-09-04 21:01:54 +05:30
},
},
2020-07-28 23:09:34 +05:30
computed: {
pinnedLinks() {
return [
{
id: 'publishedIncidentUrl',
url: this.publishedIncidentUrl,
text: STATUS_PAGE_PUBLISHED,
icon: 'tanuki',
},
{
id: 'zoomMeetingUrl',
url: this.zoomMeetingUrl,
text: JOIN_ZOOM_MEETING,
icon: 'brand-zoom',
},
];
},
},
methods: {
needsPaddingClass(i) {
return i < this.pinnedLinks.length - 1;
},
},
2019-09-04 21:01:54 +05:30
};
</script>
<template>
2020-06-23 00:09:42 +05:30
<div class="border-bottom gl-mb-6 gl-display-flex gl-justify-content-start">
2020-07-28 23:09:34 +05:30
<template v-for="(link, i) in pinnedLinks">
<div v-if="link.url" :key="link.id" :class="{ 'gl-pr-3': needsPaddingClass(i) }">
<gl-button
:href="link.url"
target="_blank"
:icon="link.icon"
size="small"
class="gl-font-weight-bold gl-mb-5"
:data-testid="link.id"
>{{ link.text }}</gl-button
>
</div>
</template>
2019-09-04 21:01:54 +05:30
</div>
</template>