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

100 lines
2.5 KiB
Vue
Raw Normal View History

2018-11-18 11:00:15 +05:30
<script>
2021-01-29 00:20:46 +05:30
import { GlSprintf, GlTooltipDirective, GlModal } from '@gitlab/ui';
import { __, s__ } from '~/locale';
2021-03-11 19:13:27 +05:30
import eventHub from '../event_hub';
2018-11-18 11:00:15 +05:30
export default {
id: 'stop-environment-modal',
name: 'StopEnvironmentModal',
components: {
2021-01-29 00:20:46 +05:30
GlModal,
2021-01-03 14:25:43 +05:30
GlSprintf,
2018-11-18 11:00:15 +05:30
},
directives: {
2019-02-15 15:39:39 +05:30
GlTooltip: GlTooltipDirective,
2018-11-18 11:00:15 +05:30
},
props: {
environment: {
type: Object,
required: true,
},
},
2021-01-29 00:20:46 +05:30
computed: {
primaryProps() {
return {
text: s__('Environments|Stop environment'),
attributes: [{ variant: 'danger' }],
};
},
cancelProps() {
return {
text: __('Cancel'),
};
},
},
2018-11-18 11:00:15 +05:30
methods: {
onSubmit() {
eventHub.$emit('stopEnvironment', this.environment);
},
},
};
</script>
<template>
<gl-modal
2021-01-29 00:20:46 +05:30
:modal-id="$options.id"
:action-primary="primaryProps"
:action-cancel="cancelProps"
@primary="onSubmit"
2018-11-18 11:00:15 +05:30
>
2021-01-29 00:20:46 +05:30
<template #modal-title>
<gl-sprintf :message="s__('Environments|Stopping %{environmentName}')">
<template #environmentName>
<span
v-gl-tooltip
:title="environment.name"
class="gl-text-truncate gl-ml-2 gl-mr-2 gl-flex-fill"
>
{{ environment.name }}?
</span>
</template>
</gl-sprintf>
2018-11-18 11:00:15 +05:30
</template>
<p>{{ s__('Environments|Are you sure you want to stop this environment?') }}</p>
2019-02-15 15:39:39 +05:30
<div v-if="!environment.has_stop_action" class="warning_message">
2021-01-03 14:25:43 +05:30
<p>
<gl-sprintf
:message="
s__(`Environments|Note that this action will stop the environment,
but it will %{emphasisStart}not%{emphasisEnd} have an effect on any existing deployment
due to no stop environment action being defined
in the %{ciConfigLinkStart}.gitlab-ci.yml%{ciConfigLinkEnd} file.`)
"
>
<template #emphasis="{ content }">
<strong>{{ content }}</strong>
</template>
<template #ciConfigLink="{ content }">
<a href="https://docs.gitlab.com/ee/ci/yaml/" target="_blank" rel="noopener noreferrer">
{{ content }}</a
>
</template>
</gl-sprintf>
</p>
2018-11-18 11:00:15 +05:30
<a
2021-01-03 14:25:43 +05:30
href="https://docs.gitlab.com/ee/ci/environments/#stopping-an-environment"
2018-11-18 11:00:15 +05:30
target="_blank"
rel="noopener noreferrer"
2019-02-15 15:39:39 +05:30
>{{ s__('Environments|Learn more about stopping environments') }}</a
>
2018-11-18 11:00:15 +05:30
</div>
</gl-modal>
</template>