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

70 lines
1.7 KiB
Vue
Raw Normal View History

2018-11-08 19:23:39 +05:30
<script>
2018-10-15 14:42:47 +05:30
import ModalStore from '../../stores/modal_store';
import modalMixin from '../../mixins/modal_mixins';
2017-08-17 22:00:37 +05:30
2018-11-08 19:23:39 +05:30
export default {
2018-10-15 14:42:47 +05:30
mixins: [modalMixin],
2017-08-17 22:00:37 +05:30
props: {
2018-03-17 18:26:18 +05:30
newIssuePath: {
2017-08-17 22:00:37 +05:30
type: String,
required: true,
},
2018-03-17 18:26:18 +05:30
emptyStateSvg: {
2017-08-17 22:00:37 +05:30
type: String,
required: true,
},
},
2018-11-08 19:23:39 +05:30
data() {
return ModalStore.store;
},
2017-08-17 22:00:37 +05:30
computed: {
contents() {
const obj = {
2018-12-13 13:39:08 +05:30
title: "You haven't added any issues to your project yet",
2017-08-17 22:00:37 +05:30
content: `
An issue can be a bug, a todo or a feature request that needs to be
discussed in a project. Besides, issues are searchable and filterable.
`,
};
if (this.activeTab === 'selected') {
2018-12-13 13:39:08 +05:30
obj.title = "You haven't selected any issues yet";
2017-08-17 22:00:37 +05:30
obj.content = `
Go back to <strong>Open issues</strong> and select some issues
to add to your board.
`;
}
return obj;
},
},
2018-11-08 19:23:39 +05:30
};
</script>
<template>
<section class="empty-state">
<div class="row">
<div class="col-12 col-md-6 order-md-last">
2019-02-15 15:39:39 +05:30
<aside class="svg-content d-none d-md-block"><img :src="emptyStateSvg" /></aside>
2018-11-08 19:23:39 +05:30
</div>
<div class="col-12 col-md-6 order-md-first">
<div class="text-content">
<h4>{{ contents.title }}</h4>
<p v-html="contents.content"></p>
2019-02-15 15:39:39 +05:30
<a v-if="activeTab === 'all'" :href="newIssuePath" class="btn btn-success btn-inverted">
2018-11-08 19:23:39 +05:30
New issue
</a>
<button
v-if="activeTab === 'selected'"
class="btn btn-default"
type="button"
2019-03-02 22:35:43 +05:30
@click="changeTab('all')"
2018-11-08 19:23:39 +05:30
>
Open issues
</button>
2017-08-17 22:00:37 +05:30
</div>
</div>
2018-11-08 19:23:39 +05:30
</div>
</section>
</template>