2017-05-06 00:15:04 -04:00
|
|
|
<script>
|
2018-09-10 15:36:09 -04:00
|
|
|
import PaginationLinks from '~/vue_shared/components/pagination_links.vue';
|
2018-09-07 02:09:13 -04:00
|
|
|
import eventHub from '../event_hub';
|
|
|
|
import { getParameterByName } from '../../lib/utils/common_utils';
|
2017-05-22 13:47:05 -04:00
|
|
|
|
2018-09-07 02:09:13 -04:00
|
|
|
export default {
|
|
|
|
components: {
|
2018-09-10 15:36:09 -04:00
|
|
|
PaginationLinks,
|
2018-09-07 02:09:13 -04:00
|
|
|
},
|
|
|
|
props: {
|
|
|
|
groups: {
|
|
|
|
type: Array,
|
|
|
|
required: true,
|
2017-05-08 16:22:26 -04:00
|
|
|
},
|
2018-09-07 02:09:13 -04:00
|
|
|
pageInfo: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
2017-05-22 13:47:05 -04:00
|
|
|
},
|
2018-09-07 02:09:13 -04:00
|
|
|
searchEmpty: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
2017-10-04 10:10:24 -04:00
|
|
|
},
|
2018-09-07 02:09:13 -04:00
|
|
|
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-05-06 00:15:04 -04:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2018-09-03 09:05:16 -04:00
|
|
|
<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" />
|
2018-09-10 15:36:09 -04:00
|
|
|
<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>
|
2017-05-06 00:15:04 -04:00
|
|
|
</template>
|