gitlab-org--gitlab-foss/app/assets/javascripts/groups/components/groups.vue

57 lines
1.4 KiB
Vue
Raw Normal View History

<script>
import PaginationLinks from '~/vue_shared/components/pagination_links.vue';
import eventHub from '../event_hub';
import { getParameterByName } from '../../lib/utils/common_utils';
2017-05-22 13:47:05 -04:00
export default {
components: {
PaginationLinks,
},
props: {
groups: {
type: Array,
required: true,
},
pageInfo: {
type: Object,
required: true,
2017-05-22 13:47:05 -04:00
},
searchEmpty: {
type: Boolean,
required: true,
},
searchEmptyMessage: {
type: String,
required: true,
},
action: {
type: String,
required: false,
default: '',
},
},
methods: {
change(page) {
const filterGroupsParam = getParameterByName('filter_groups');
const sortParam = getParameterByName('sort');
const archivedParam = getParameterByName('archived');
eventHub.$emit(`${this.action}fetchPage`, page, filterGroupsParam, sortParam, archivedParam);
},
},
};
</script>
<template>
<div class="groups-list-tree-container qa-groups-list-tree-container">
2018-11-16 15:07:38 -05:00
<div v-if="searchEmpty" class="has-no-search-results">{{ searchEmptyMessage }}</div>
<template v-else>
<group-folder :groups="groups" :action="action" />
<pagination-links
:change="change"
:page-info="pageInfo"
class="d-flex justify-content-center prepend-top-default"
/>
</template>
2017-05-09 19:10:19 -04:00
</div>
</template>