debian-mirror-gitlab/app/assets/javascripts/vue_merge_request_widget/components/mr_widget_alert_message.vue

47 lines
854 B
Vue
Raw Normal View History

2019-07-07 11:18:12 +05:30
<script>
2021-09-04 01:27:46 +05:30
import { GlLink, GlAlert } from '@gitlab/ui';
2019-07-07 11:18:12 +05:30
export default {
2021-09-04 01:27:46 +05:30
name: 'MRWidgetAlertMessage',
2019-07-07 11:18:12 +05:30
components: {
2021-09-04 01:27:46 +05:30
GlAlert,
2019-07-07 11:18:12 +05:30
GlLink,
},
props: {
type: {
type: String,
2021-09-04 01:27:46 +05:30
required: true,
2019-07-07 11:18:12 +05:30
},
helpPath: {
type: String,
required: false,
default: undefined,
},
2021-09-04 01:27:46 +05:30
dismissible: {
type: Boolean,
required: false,
default: false,
},
2019-07-07 11:18:12 +05:30
},
2021-09-04 01:27:46 +05:30
data() {
return {
isDismissed: false,
};
},
methods: {
onDismiss() {
this.isDismissed = true;
2019-07-07 11:18:12 +05:30
},
},
};
</script>
<template>
2021-09-04 01:27:46 +05:30
<gl-alert v-if="!isDismissed" :variant="type" :dismissible="dismissible" @dismiss="onDismiss">
2019-07-07 11:18:12 +05:30
<slot></slot>
2021-09-04 01:27:46 +05:30
<gl-link v-if="helpPath" :href="helpPath" target="_blank" class="gl-label-link">
<slot name="link-content"></slot>
2019-07-07 11:18:12 +05:30
</gl-link>
2021-09-04 01:27:46 +05:30
</gl-alert>
2019-07-07 11:18:12 +05:30
</template>