debian-mirror-gitlab/app/assets/javascripts/groups/components/groups.vue

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

62 lines
1.4 KiB
Vue
Raw Normal View History

2017-09-10 17:25:29 +05:30
<script>
2018-12-05 23:21:45 +05:30
import PaginationLinks from '~/vue_shared/components/pagination_links.vue';
2022-06-21 17:19:12 +05:30
import { getParameterByName } from '~/lib/utils/url_utility';
2021-03-11 19:13:27 +05:30
import eventHub from '../event_hub';
2017-09-10 17:25:29 +05:30
2018-11-20 20:47:30 +05:30
export default {
components: {
2018-12-05 23:21:45 +05:30
PaginationLinks,
2018-11-20 20:47:30 +05:30
},
props: {
groups: {
type: Array,
required: true,
2017-09-10 17:25:29 +05:30
},
2018-11-20 20:47:30 +05:30
pageInfo: {
type: Object,
required: true,
2017-09-10 17:25:29 +05:30
},
2018-11-20 20:47:30 +05:30
searchEmpty: {
type: Boolean,
required: true,
2017-09-10 17:25:29 +05:30
},
2018-11-20 20:47:30 +05:30
searchEmptyMessage: {
type: String,
required: true,
},
action: {
type: String,
required: false,
default: '',
},
},
methods: {
change(page) {
2021-11-11 11:23:49 +05:30
const filterGroupsBy = getParameterByName('filter');
const sortBy = getParameterByName('sort');
const archived = getParameterByName('archived');
eventHub.$emit(`${this.action}fetchPage`, { page, filterGroupsBy, sortBy, archived });
2018-11-20 20:47:30 +05:30
},
},
};
2017-09-10 17:25:29 +05:30
</script>
<template>
2022-08-27 11:52:29 +05:30
<div class="groups-list-tree-container" data-qa-selector="groups_list_tree_container">
2022-07-23 23:45:48 +05:30
<div
v-if="searchEmpty"
class="has-no-search-results gl-font-style-italic gl-text-center gl-text-gray-600 gl-p-5"
>
{{ searchEmptyMessage }}
</div>
2019-02-15 15:39:39 +05:30
<template v-else>
<group-folder :groups="groups" :action="action" />
2018-12-05 23:21:45 +05:30
<pagination-links
:change="change"
:page-info="pageInfo"
2020-07-28 23:09:34 +05:30
class="d-flex justify-content-center gl-mt-3"
2018-12-05 23:21:45 +05:30
/>
</template>
2017-09-10 17:25:29 +05:30
</div>
</template>