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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

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: {
2021-12-11 22:18:48 +05:30
...mapState(['urlQuery', 'sidebarDirty']),
2021-01-29 00:20:46 +05:30
showReset() {
2021-12-11 22:18:48 +05:30
return this.urlQuery.state || this.urlQuery.confidential;
2021-01-29 00:20:46 +05:30
},
},
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-12-11 22:18:48 +05:30
<gl-button category="primary" variant="confirm" type="submit" :disabled="!sidebarDirty">
2021-04-29 21:17:54 +05:30
{{ __('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>