2017-08-17 22:00:37 +05:30
|
|
|
import Vue from 'vue';
|
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
|
|
|
|
|
|
|
gl.issueBoards.ModalEmptyState = Vue.extend({
|
2018-10-15 14:42:47 +05:30
|
|
|
mixins: [modalMixin],
|
2017-08-17 22:00:37 +05:30
|
|
|
data() {
|
|
|
|
return ModalStore.store;
|
|
|
|
},
|
|
|
|
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,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
contents() {
|
|
|
|
const obj = {
|
|
|
|
title: 'You haven\'t added any issues to your project yet',
|
|
|
|
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') {
|
|
|
|
obj.title = 'You haven\'t selected any issues yet';
|
|
|
|
obj.content = `
|
|
|
|
Go back to <strong>Open issues</strong> and select some issues
|
|
|
|
to add to your board.
|
|
|
|
`;
|
|
|
|
}
|
|
|
|
|
|
|
|
return obj;
|
|
|
|
},
|
|
|
|
},
|
|
|
|
template: `
|
|
|
|
<section class="empty-state">
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-xs-12 col-sm-6 col-sm-push-6">
|
2018-03-17 18:26:18 +05:30
|
|
|
<aside class="svg-content"><img :src="emptyStateSvg"/></aside>
|
2017-08-17 22:00:37 +05:30
|
|
|
</div>
|
|
|
|
<div class="col-xs-12 col-sm-6 col-sm-pull-6">
|
|
|
|
<div class="text-content">
|
|
|
|
<h4>{{ contents.title }}</h4>
|
|
|
|
<p v-html="contents.content"></p>
|
|
|
|
<a
|
|
|
|
:href="newIssuePath"
|
|
|
|
class="btn btn-success btn-inverted"
|
|
|
|
v-if="activeTab === 'all'">
|
|
|
|
New issue
|
|
|
|
</a>
|
|
|
|
<button
|
|
|
|
type="button"
|
|
|
|
class="btn btn-default"
|
|
|
|
@click="changeTab('all')"
|
|
|
|
v-if="activeTab === 'selected'">
|
|
|
|
Open issues
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
`,
|
|
|
|
});
|