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

85 lines
2.2 KiB
Vue
Raw Normal View History

2018-11-08 19:23:39 +05:30
<script>
2021-01-29 00:20:46 +05:30
import { GlButton, GlSprintf } from '@gitlab/ui';
import { __ } from '~/locale';
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 {
2020-11-24 15:15:51 +05:30
components: {
GlButton,
2021-01-29 00:20:46 +05:30
GlSprintf,
2020-11-24 15:15:51 +05:30
},
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 = {
2019-09-30 21:07:59 +05:30
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.',
),
2017-08-17 22:00:37 +05:30
};
if (this.activeTab === 'selected') {
2019-09-30 21:07:59 +05:30
obj.title = __("You haven't selected any issues yet");
2021-01-29 00:20:46 +05:30
obj.content = __(
'Go back to %{tagStart}Open issues%{tagEnd} and select some issues to add to your board.',
2019-09-30 21:07:59 +05:30
);
2017-08-17 22:00:37 +05:30
}
return obj;
},
},
2018-11-08 19:23:39 +05:30
};
</script>
<template>
2019-07-31 22:56:46 +05:30
<section class="empty-state d-flex mt-0 h-100">
<div class="row w-100 my-auto mx-0">
2018-11-08 19:23:39 +05:30
<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>
2021-01-29 00:20:46 +05:30
<p>
<gl-sprintf :message="contents.content">
<template #tag="{ content }">
<strong>{{ content }}</strong>
</template>
</gl-sprintf>
</p>
2020-11-24 15:15:51 +05:30
<gl-button
v-if="activeTab === 'all'"
:href="newIssuePath"
category="secondary"
variant="success"
>
{{ __('New issue') }}
</gl-button>
<gl-button
2018-11-08 19:23:39 +05:30
v-if="activeTab === 'selected'"
2020-11-24 15:15:51 +05:30
category="primary"
variant="default"
2019-03-02 22:35:43 +05:30
@click="changeTab('all')"
2018-11-08 19:23:39 +05:30
>
2019-09-30 21:07:59 +05:30
{{ __('Open issues') }}
2020-11-24 15:15:51 +05:30
</gl-button>
2017-08-17 22:00:37 +05:30
</div>
</div>
2018-11-08 19:23:39 +05:30
</div>
</section>
</template>