2018-03-17 18:26:18 +05:30
|
|
|
<script>
|
2019-02-15 15:39:39 +05:30
|
|
|
import { GlLoadingIcon } from '@gitlab/ui';
|
2020-01-01 13:55:28 +05:30
|
|
|
import TablePagination from '~/vue_shared/components/pagination/table_pagination.vue';
|
2020-05-24 23:13:21 +05:30
|
|
|
import EnvironmentTable from './environments_table.vue';
|
2018-03-17 18:26:18 +05:30
|
|
|
|
2018-12-13 13:39:08 +05:30
|
|
|
export default {
|
|
|
|
components: {
|
2019-07-07 11:18:12 +05:30
|
|
|
EnvironmentTable,
|
|
|
|
TablePagination,
|
2018-12-13 13:39:08 +05:30
|
|
|
GlLoadingIcon,
|
|
|
|
},
|
|
|
|
props: {
|
2020-05-24 23:13:21 +05:30
|
|
|
canaryDeploymentFeatureId: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: null,
|
|
|
|
},
|
2018-12-13 13:39:08 +05:30
|
|
|
isLoading: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
2018-03-17 18:26:18 +05:30
|
|
|
},
|
2018-12-13 13:39:08 +05:30
|
|
|
environments: {
|
|
|
|
type: Array,
|
|
|
|
required: true,
|
2018-03-17 18:26:18 +05:30
|
|
|
},
|
2018-12-13 13:39:08 +05:30
|
|
|
pagination: {
|
|
|
|
type: Object,
|
|
|
|
required: true,
|
2018-03-17 18:26:18 +05:30
|
|
|
},
|
2018-12-13 13:39:08 +05:30
|
|
|
canReadEnvironment: {
|
|
|
|
type: Boolean,
|
|
|
|
required: true,
|
|
|
|
},
|
2020-05-24 23:13:21 +05:30
|
|
|
deployBoardsHelpPath: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
helpCanaryDeploymentsPath: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
lockPromotionSvgPath: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: '',
|
|
|
|
},
|
|
|
|
showCanaryDeploymentCallout: {
|
|
|
|
type: Boolean,
|
|
|
|
required: false,
|
|
|
|
default: false,
|
|
|
|
},
|
|
|
|
userCalloutsPath: {
|
|
|
|
type: String,
|
|
|
|
required: false,
|
|
|
|
default: '',
|
|
|
|
},
|
2018-12-13 13:39:08 +05:30
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onChangePage(page) {
|
|
|
|
this.$emit('onChangePage', page);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
2018-03-17 18:26:18 +05:30
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<div class="environments-container">
|
2020-07-28 23:09:34 +05:30
|
|
|
<gl-loading-icon v-if="isLoading" size="md" class="gl-mt-3" label="Loading environments" />
|
2018-03-17 18:26:18 +05:30
|
|
|
|
|
|
|
<slot name="emptyState"></slot>
|
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
<div v-if="!isLoading && environments.length > 0" class="table-holder">
|
2019-07-07 11:18:12 +05:30
|
|
|
<environment-table
|
|
|
|
:environments="environments"
|
|
|
|
:can-read-environment="canReadEnvironment"
|
|
|
|
:canary-deployment-feature-id="canaryDeploymentFeatureId"
|
|
|
|
:show-canary-deployment-callout="showCanaryDeploymentCallout"
|
|
|
|
:user-callouts-path="userCalloutsPath"
|
|
|
|
:lock-promotion-svg-path="lockPromotionSvgPath"
|
|
|
|
:help-canary-deployments-path="helpCanaryDeploymentsPath"
|
2019-09-30 21:07:59 +05:30
|
|
|
:deploy-boards-help-path="deployBoardsHelpPath"
|
2019-07-07 11:18:12 +05:30
|
|
|
/>
|
2018-03-17 18:26:18 +05:30
|
|
|
|
|
|
|
<table-pagination
|
|
|
|
v-if="pagination && pagination.totalPages > 1"
|
|
|
|
:change="onChangePage"
|
|
|
|
:page-info="pagination"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|