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

81 lines
1.7 KiB
Vue
Raw Normal View History

2018-11-08 19:23:39 +05:30
<script>
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) {
return 'Select all';
}
2018-11-08 19:23:39 +05:30
2018-12-13 13:39:08 +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"
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" />
2019-07-31 22:56:46 +05:30
<div v-if="showSearch" class="d-flex append-bottom-10">
2018-11-08 19:23:39 +05:30
<modal-filters :store="filter" />
<button
ref="selectAllBtn"
type="button"
class="btn btn-success btn-inverted prepend-left-10"
@click="toggleAll"
>
{{ selectAllText }}
</button>
</div>
</div>
</template>