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

57 lines
1.3 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) {
2020-04-22 19:07:51 +05:30
const filterGroupsParam = getParameterByName('filter');
2018-11-20 20:47:30 +05:30
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">
2019-02-15 15:39:39 +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"
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>