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
|
|
|
},
|
2022-11-25 23:54:43 +05:30
|
|
|
showSidebar() {
|
|
|
|
return this.urlQuery.scope === 'issues' || this.urlQuery.scope === 'merge_requests';
|
|
|
|
},
|
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"
|
|
|
|
>
|
2022-11-25 23:54:43 +05:30
|
|
|
<template v-if="showSidebar">
|
|
|
|
<status-filter />
|
|
|
|
<confidentiality-filter />
|
|
|
|
<div class="gl-display-flex gl-align-items-center gl-mt-3">
|
|
|
|
<gl-button category="primary" variant="confirm" type="submit" :disabled="!sidebarDirty">
|
|
|
|
{{ __('Apply') }}
|
|
|
|
</gl-button>
|
|
|
|
<gl-link v-if="showReset" class="gl-ml-auto" @click="resetQuery">{{
|
|
|
|
__('Reset filters')
|
|
|
|
}}</gl-link>
|
|
|
|
</div>
|
|
|
|
</template>
|
2021-01-29 00:20:46 +05:30
|
|
|
</form>
|
|
|
|
</template>
|