debian-mirror-gitlab/app/assets/javascripts/environments/components/empty_state.vue

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

66 lines
1.8 KiB
Vue
Raw Normal View History

2018-03-17 18:26:18 +05:30
<script>
2022-11-25 23:54:43 +05:30
import { GlEmptyState, GlLink } from '@gitlab/ui';
2022-06-21 17:19:12 +05:30
import { s__ } from '~/locale';
import { ENVIRONMENTS_SCOPE } from '../constants';
2018-12-13 13:39:08 +05:30
export default {
2022-11-25 23:54:43 +05:30
components: {
GlEmptyState,
GlLink,
},
inject: ['newEnvironmentPath'],
2018-12-13 13:39:08 +05:30
props: {
helpPath: {
type: String,
required: true,
},
2022-06-21 17:19:12 +05:30
scope: {
type: String,
required: true,
},
2022-11-25 23:54:43 +05:30
hasTerm: {
type: Boolean,
required: false,
default: false,
},
2022-06-21 17:19:12 +05:30
},
computed: {
title() {
2022-11-25 23:54:43 +05:30
return this.hasTerm
? this.$options.i18n.searchingTitle
: this.$options.i18n.title[this.scope];
},
content() {
return this.hasTerm ? this.$options.i18n.searchingContent : this.$options.i18n.content;
},
buttonText() {
return this.hasTerm ? this.$options.i18n.newEnvironmentButtonLabel : '';
2022-06-21 17:19:12 +05:30
},
},
i18n: {
title: {
[ENVIRONMENTS_SCOPE.AVAILABLE]: s__("Environments|You don't have any environments."),
[ENVIRONMENTS_SCOPE.STOPPED]: s__("Environments|You don't have any stopped environments."),
},
content: s__(
'Environments|Environments are places where code gets deployed, such as staging or production.',
),
2022-11-25 23:54:43 +05:30
searchingTitle: s__('Environments|No results found'),
searchingContent: s__('Environments|Edit your search and try again'),
2022-06-21 17:19:12 +05:30
link: s__('Environments|How do I create an environment?'),
2022-11-25 23:54:43 +05:30
newEnvironmentButtonLabel: s__('Environments|New environment'),
2018-12-13 13:39:08 +05:30
},
};
2018-03-17 18:26:18 +05:30
</script>
<template>
2022-11-25 23:54:43 +05:30
<gl-empty-state :primary-button-text="buttonText" :primary-button-link="newEnvironmentPath">
<template #title>
<h4>{{ title }}</h4>
</template>
<template #description>
<p>{{ content }}</p>
<gl-link v-if="!hasTerm" :href="helpPath">{{ $options.i18n.link }}</gl-link>
</template>
</gl-empty-state>
2018-03-17 18:26:18 +05:30
</template>