1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
<script>
// eslint-disable-next-line no-restricted-imports
import { mapGetters, mapState } from 'vuex';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { HR_DEFAULT_CLASSES, SEARCH_TYPE_ADVANCED } from '../constants';
import { statusFilterData } from './status_filter/data';
import StatusFilter from './status_filter/index.vue';
import FiltersTemplate from './filters_template.vue';
import { archivedFilterData } from './archived_filter/data';
import ArchivedFilter from './archived_filter/index.vue';
export default {
name: 'MergeRequestsFilters',
components: {
StatusFilter,
FiltersTemplate,
ArchivedFilter,
},
mixins: [glFeatureFlagsMixin()],
computed: {
...mapGetters(['currentScope']),
...mapState(['useSidebarNavigation', 'searchType']),
showArchivedFilter() {
return (
Object.values(archivedFilterData.scopes).includes(this.currentScope) &&
this.glFeatures.searchMergeRequestsHideArchivedProjects &&
this.searchType === SEARCH_TYPE_ADVANCED
);
},
showStatusFilter() {
return Object.values(statusFilterData.scopes).includes(this.currentScope);
},
showDivider() {
return !this.useSidebarNavigation;
},
hrClasses() {
return [...HR_DEFAULT_CLASSES, 'gl-display-none', 'gl-md-display-block'];
},
},
};
</script>
<template>
<filters-template>
<status-filter v-if="showStatusFilter" class="gl-mb-5" />
<hr v-if="showArchivedFilter && showDivider" :class="hrClasses" />
<archived-filter v-if="showArchivedFilter" class="gl-mb-5" />
</filters-template>
</template>
|