debian-mirror-gitlab/app/assets/javascripts/search/sidebar/components/app.vue

44 lines
1.1 KiB
Vue
Raw Normal View History

2021-01-29 00:20:46 +05:30
<script>
import { GlButton, GlLink } from '@gitlab/ui';
2021-03-11 19:13:27 +05:30
import { mapActions, mapState } from 'vuex';
2021-01-29 00:20:46 +05:30
import ConfidentialityFilter from './confidentiality_filter.vue';
2021-03-11 19:13:27 +05:30
import StatusFilter from './status_filter.vue';
2021-01-29 00:20:46 +05:30
export default {
name: 'GlobalSearchSidebar',
components: {
GlButton,
GlLink,
StatusFilter,
ConfidentialityFilter,
},
computed: {
...mapState(['query']),
showReset() {
return this.query.state || this.query.confidential;
},
},
methods: {
...mapActions(['applyQuery', 'resetQuery']),
},
};
</script>
<template>
<form
2021-02-22 17:27:13 +05:30
class="search-sidebar gl-display-flex gl-flex-direction-column gl-mr-4 gl-mb-6 gl-mt-5"
2021-01-29 00:20:46 +05:30
@submit.prevent="applyQuery"
>
<status-filter />
<confidentiality-filter />
<div class="gl-display-flex gl-align-items-center gl-mt-3">
2021-04-29 21:17:54 +05:30
<gl-button category="primary" variant="confirm" size="small" type="submit">
{{ __('Apply') }}
</gl-button>
2021-01-29 00:20:46 +05:30
<gl-link v-if="showReset" class="gl-ml-auto" @click="resetQuery">{{
__('Reset filters')
}}</gl-link>
</div>
</form>
</template>