debian-mirror-gitlab/app/assets/javascripts/jobs/components/empty_state.vue

77 lines
1.6 KiB
Vue
Raw Normal View History

2018-11-20 20:47:30 +05:30
<script>
export default {
props: {
illustrationPath: {
type: String,
required: true,
},
illustrationSizeClass: {
type: String,
required: true,
},
title: {
type: String,
required: true,
},
content: {
type: String,
required: false,
default: null,
},
action: {
type: Object,
required: false,
default: null,
validator(value) {
return (
value === null ||
2018-12-05 23:21:45 +05:30
(Object.prototype.hasOwnProperty.call(value, 'path') &&
2018-11-20 20:47:30 +05:30
Object.prototype.hasOwnProperty.call(value, 'method') &&
2018-12-05 23:21:45 +05:30
Object.prototype.hasOwnProperty.call(value, 'button_title'))
2018-11-20 20:47:30 +05:30
);
},
},
},
};
</script>
<template>
<div class="row empty-state">
<div class="col-12">
<div
:class="illustrationSizeClass"
class="svg-content"
>
<img :src="illustrationPath" />
</div>
</div>
<div class="col-12">
<div class="text-content">
<h4 class="js-job-empty-state-title text-center">
{{ title }}
</h4>
<p
v-if="content"
class="js-job-empty-state-content"
>
{{ content }}
</p>
<div
v-if="action"
class="text-center"
>
<a
2018-12-05 23:21:45 +05:30
:href="action.path"
2018-11-20 20:47:30 +05:30
:data-method="action.method"
class="js-job-empty-state-action btn btn-primary"
>
2018-12-05 23:21:45 +05:30
{{ action.button_title }}
2018-11-20 20:47:30 +05:30
</a>
</div>
</div>
</div>
</div>
</template>