gitlab-org--gitlab-foss/app/assets/javascripts/environments/components/container.vue

71 lines
1.5 KiB
Vue
Raw Normal View History

2017-11-23 07:04:03 -05:00
<script>
import loadingIcon from '../../vue_shared/components/loading_icon.vue';
import tablePagination from '../../vue_shared/components/table_pagination.vue';
import environmentTable from '../components/environments_table.vue';
export default {
2018-01-05 09:31:01 -05:00
components: {
environmentTable,
loadingIcon,
tablePagination,
},
2017-11-23 07:04:03 -05:00
props: {
isLoading: {
type: Boolean,
required: true,
},
environments: {
type: Array,
required: true,
},
pagination: {
type: Object,
required: true,
},
canCreateDeployment: {
type: Boolean,
required: true,
},
canReadEnvironment: {
type: Boolean,
required: true,
},
},
methods: {
onChangePage(page) {
this.$emit('onChangePage', page);
},
},
};
</script>
<template>
<div class="environments-container">
<loading-icon
label="Loading environments"
v-if="isLoading"
size="3"
2018-01-05 09:31:01 -05:00
/>
2017-11-23 07:04:03 -05:00
<slot name="emptyState"></slot>
<div
class="table-holder"
v-if="!isLoading && environments.length > 0">
<environment-table
:environments="environments"
:can-create-deployment="canCreateDeployment"
:can-read-environment="canReadEnvironment"
2018-01-05 09:31:01 -05:00
/>
2017-11-23 07:04:03 -05:00
<table-pagination
v-if="pagination && pagination.totalPages > 1"
:change="onChangePage"
2018-01-05 09:31:01 -05:00
:page-info="pagination"
/>
2017-11-23 07:04:03 -05:00
</div>
</div>
</template>