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

64 lines
1.4 KiB
Vue
Raw Normal View History

2017-09-10 17:25:29 +05:30
<script>
2018-11-20 20:47:30 +05:30
import tablePagination from '~/vue_shared/components/table_pagination.vue';
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: {
tablePagination,
},
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-03-17 18:26:18 +05:30
<div
v-if="searchEmpty"
class="has-no-search-results"
>
{{ searchEmptyMessage }}
</div>
2017-09-10 17:25:29 +05:30
<group-folder
2018-03-17 18:26:18 +05:30
v-if="!searchEmpty"
2017-09-10 17:25:29 +05:30
:groups="groups"
2018-11-20 20:47:30 +05:30
:action="action"
2017-09-10 17:25:29 +05:30
/>
<table-pagination
2018-03-17 18:26:18 +05:30
v-if="!searchEmpty"
2017-09-10 17:25:29 +05:30
:change="change"
2018-03-17 18:26:18 +05:30
:page-info="pageInfo"
2017-09-10 17:25:29 +05:30
/>
</div>
</template>