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

57 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';
2018-11-20 20:47:30 +05:30
import eventHub from '../event_hub';
import { getParameterByName } from '../../lib/utils/common_utils';
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) {
const filterGroupsParam = getParameterByName('filter_groups');
const sortParam = getParameterByName('sort');
const archivedParam = getParameterByName('archived');
eventHub.$emit(`${this.action}fetchPage`, page, filterGroupsParam, sortParam, archivedParam);
},
},
};
2017-09-10 17:25:29 +05:30
</script>
<template>
2018-11-20 20:47:30 +05:30
<div class="groups-list-tree-container qa-groups-list-tree-container">
2018-12-23 12:14:25 +05:30
<div v-if="searchEmpty" class="has-no-search-results">{{ searchEmptyMessage }}</div>
<template v-else>
<group-folder :groups="groups" :action="action" />
2018-12-05 23:21:45 +05:30
<pagination-links
:change="change"
:page-info="pageInfo"
class="d-flex justify-content-center prepend-top-default"
/>
</template>
2017-09-10 17:25:29 +05:30
</div>
</template>