debian-mirror-gitlab/app/assets/javascripts/environments/folder/environments_folder_view.vue

80 lines
2.1 KiB
Vue
Raw Normal View History

2017-08-17 22:00:37 +05:30
<script>
2021-01-03 14:25:43 +05:30
import { GlBadge, GlTab, GlTabs } from '@gitlab/ui';
2020-04-22 19:07:51 +05:30
import DeleteEnvironmentModal from '../components/delete_environment_modal.vue';
2021-03-11 19:13:27 +05:30
import StopEnvironmentModal from '../components/stop_environment_modal.vue';
import environmentsMixin from '../mixins/environments_mixin';
import EnvironmentsPaginationApiMixin from '../mixins/environments_pagination_api_mixin';
2018-03-17 18:26:18 +05:30
2018-12-13 13:39:08 +05:30
export default {
components: {
2020-04-22 19:07:51 +05:30
DeleteEnvironmentModal,
2021-01-03 14:25:43 +05:30
GlBadge,
GlTab,
GlTabs,
StopEnvironmentModal,
2018-12-13 13:39:08 +05:30
},
2018-11-18 11:00:15 +05:30
2021-03-11 19:13:27 +05:30
mixins: [environmentsMixin, EnvironmentsPaginationApiMixin],
2018-11-18 11:00:15 +05:30
2018-12-13 13:39:08 +05:30
props: {
endpoint: {
type: String,
required: true,
},
folderName: {
type: String,
required: true,
},
cssContainerClass: {
type: String,
2020-11-24 15:15:51 +05:30
required: false,
default: '',
2018-12-13 13:39:08 +05:30
},
canReadEnvironment: {
type: Boolean,
required: true,
2017-09-10 17:25:29 +05:30
},
2018-12-13 13:39:08 +05:30
},
methods: {
successCallback(resp) {
this.saveData(resp);
2017-09-10 17:25:29 +05:30
},
2018-12-13 13:39:08 +05:30
},
};
2017-08-17 22:00:37 +05:30
</script>
<template>
<div :class="cssContainerClass">
2018-11-18 11:00:15 +05:30
<stop-environment-modal :environment="environmentInStopModal" />
2020-04-22 19:07:51 +05:30
<delete-environment-modal :environment="environmentInDeleteModal" />
2018-11-18 11:00:15 +05:30
2021-01-03 14:25:43 +05:30
<h4 class="gl-font-weight-normal" data-testid="folder-name">
2020-01-01 13:55:28 +05:30
{{ s__('Environments|Environments') }} /
<b>{{ folderName }}</b>
</h4>
2017-08-17 22:00:37 +05:30
2021-01-03 14:25:43 +05:30
<gl-tabs v-if="!isLoading" scope="environments" content-class="gl-display-none">
<gl-tab
v-for="(tab, i) in tabs"
:key="`${tab.name}-${i}`"
:active="tab.isActive"
:title-item-class="tab.isActive ? 'gl-outline-none' : ''"
:title-link-attributes="{ 'data-testid': `environments-tab-${tab.scope}` }"
@click="onChangeTab(tab.scope)"
>
<template #title>
<span>{{ tab.name }}</span>
<gl-badge size="sm" class="gl-tab-counter-badge">{{ tab.count }}</gl-badge>
</template>
</gl-tab>
</gl-tabs>
2017-08-17 22:00:37 +05:30
2018-03-17 18:26:18 +05:30
<container
:is-loading="isLoading"
:environments="state.environments"
:pagination="state.paginationInformation"
:can-read-environment="canReadEnvironment"
@onChangePage="onChangePage"
/>
2017-08-17 22:00:37 +05:30
</div>
</template>