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

57 lines
1.2 KiB
Vue
Raw Normal View History

<script>
2017-06-08 03:29:21 -04:00
import tablePagination from '~/vue_shared/components/table_pagination.vue';
import eventHub from '../event_hub';
import { getParameterByName } from '../../lib/utils/common_utils';
2017-05-22 13:47:05 -04:00
export default {
components: {
tablePagination,
},
props: {
groups: {
type: Array,
required: true,
},
2017-05-22 13:47:05 -04:00
pageInfo: {
type: Object,
required: true,
},
searchEmpty: {
type: Boolean,
required: true,
},
searchEmptyMessage: {
type: String,
required: true,
},
2017-06-07 04:45:48 -04:00
},
2017-05-22 13:47:05 -04:00
methods: {
change(page) {
const filterGroupsParam = getParameterByName('filter_groups');
const sortParam = getParameterByName('sort');
2017-10-13 04:36:25 -04:00
const archivedParam = getParameterByName('archived');
eventHub.$emit('fetchPage', page, filterGroupsParam, sortParam, archivedParam);
2017-05-22 13:47:05 -04:00
},
},
};
</script>
<template>
<div class="groups-list-tree-container">
<div
v-if="searchEmpty"
class="has-no-search-results">
{{searchEmptyMessage}}
</div>
2017-06-07 04:45:48 -04:00
<group-folder
v-if="!searchEmpty"
2017-06-07 04:45:48 -04:00
:groups="groups"
/>
<table-pagination
v-if="!searchEmpty"
2017-05-22 13:47:05 -04:00
:change="change"
2017-06-07 04:45:48 -04:00
:pageInfo="pageInfo"
/>
2017-05-09 19:10:19 -04:00
</div>
</template>