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

83 lines
1.8 KiB
Vue
Raw Normal View History

2018-11-08 19:23:39 +05:30
<script>
2020-04-22 19:07:51 +05:30
/* eslint-disable @gitlab/vue-require-i18n-strings */
2019-09-30 21:07:59 +05:30
import { __ } from '~/locale';
2018-12-13 13:39:08 +05:30
import ModalFilters from './filters';
import ModalTabs from './tabs.vue';
import ModalStore from '../../stores/modal_store';
import modalMixin from '../../mixins/modal_mixins';
2018-11-08 19:23:39 +05:30
2018-12-13 13:39:08 +05:30
export default {
components: {
ModalTabs,
ModalFilters,
},
mixins: [modalMixin],
props: {
projectId: {
type: Number,
required: true,
2018-11-08 19:23:39 +05:30
},
2018-12-13 13:39:08 +05:30
milestonePath: {
type: String,
required: true,
2018-11-08 19:23:39 +05:30
},
2018-12-13 13:39:08 +05:30
labelPath: {
type: String,
required: true,
2018-11-08 19:23:39 +05:30
},
2018-12-13 13:39:08 +05:30
},
data() {
return ModalStore.store;
},
computed: {
selectAllText() {
if (ModalStore.selectedCount() !== this.issues.length || this.issues.length === 0) {
2019-09-30 21:07:59 +05:30
return __('Select all');
2018-12-13 13:39:08 +05:30
}
2018-11-08 19:23:39 +05:30
2019-09-30 21:07:59 +05:30
return __('Deselect all');
2018-11-08 19:23:39 +05:30
},
2018-12-13 13:39:08 +05:30
showSearch() {
return this.activeTab === 'all' && !this.loading && this.issuesCount > 0;
},
},
methods: {
toggleAll() {
this.$refs.selectAllBtn.blur();
2018-11-08 19:23:39 +05:30
2018-12-13 13:39:08 +05:30
ModalStore.toggleAll();
2018-11-08 19:23:39 +05:30
},
2018-12-13 13:39:08 +05:30
},
};
2018-11-08 19:23:39 +05:30
</script>
<template>
<div>
2019-07-31 22:56:46 +05:30
<header class="add-issues-header border-top-0 form-actions">
<h2 class="m-0">
2018-11-08 19:23:39 +05:30
Add issues
<button
type="button"
class="close"
data-dismiss="modal"
2019-09-30 21:07:59 +05:30
:aria-label="__('Close')"
2019-03-02 22:35:43 +05:30
@click="toggleModal(false)"
2018-11-08 19:23:39 +05:30
>
<span aria-hidden="true">×</span>
</button>
</h2>
</header>
2019-02-15 15:39:39 +05:30
<modal-tabs v-if="!loading && issuesCount > 0" />
2020-10-24 23:57:45 +05:30
<div v-if="showSearch" class="d-flex gl-mb-3">
2018-11-08 19:23:39 +05:30
<modal-filters :store="filter" />
<button
ref="selectAllBtn"
type="button"
2020-07-28 23:09:34 +05:30
class="btn btn-success btn-inverted gl-ml-3"
2018-11-08 19:23:39 +05:30
@click="toggleAll"
>
{{ selectAllText }}
</button>
</div>
</div>
</template>