Welcome to mirror list, hosted at ThFree Co, Russian Federation.

scope_sidebar_navigation.vue « components « sidebar « search « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 874803a720d625aee6c155c1b3d8b9611051799f (plain)
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
<script>
// eslint-disable-next-line no-restricted-imports
import { mapActions, mapState, mapGetters } from 'vuex';
import { s__ } from '~/locale';
import eventHub from '~/super_sidebar/event_hub';
import NavItem from '~/super_sidebar/components/nav_item.vue';
import { NAV_LINK_DEFAULT_CLASSES, NAV_LINK_COUNT_DEFAULT_CLASSES } from '../constants';

export default {
  name: 'ScopeSidebarNavigation',
  i18n: {
    countOverLimitLabel: s__('GlobalSearch|Result count is over limit.'),
  },
  components: {
    NavItem,
  },
  computed: {
    ...mapState(['navigation', 'urlQuery']),
    ...mapGetters(['navigationItems']),
  },
  created() {
    eventHub.$emit('toggle-menu-header', false);

    if (this.urlQuery?.search) {
      this.fetchSidebarCount();
    }
  },
  methods: {
    ...mapActions(['fetchSidebarCount']),
  },
  NAV_LINK_DEFAULT_CLASSES,
  NAV_LINK_COUNT_DEFAULT_CLASSES,
};
</script>

<template>
  <nav data-testid="search-filter" class="gl-py-2 gl-relative">
    <ul class="gl-px-2 gl-list-style-none">
      <nav-item v-for="item in navigationItems" :key="`menu-${item.title}`" :item="item" />
    </ul>
  </nav>
</template>