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

82 lines
2.2 KiB
Vue
Raw Normal View History

2018-11-18 11:00:15 +05:30
<script>
2021-01-03 14:25:43 +05:30
/* eslint-disable @gitlab/vue-require-i18n-strings */
import { GlSprintf, GlTooltipDirective } from '@gitlab/ui';
2019-12-21 20:55:43 +05:30
import DeprecatedModal2 from '~/vue_shared/components/deprecated_modal_2.vue';
2018-11-18 11:00:15 +05:30
import eventHub from '../event_hub';
export default {
id: 'stop-environment-modal',
name: 'StopEnvironmentModal',
components: {
2019-12-21 20:55:43 +05:30
GlModal: DeprecatedModal2,
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,
},
},
methods: {
onSubmit() {
eventHub.$emit('stopEnvironment', this.environment);
},
},
};
</script>
<template>
<gl-modal
:id="$options.id"
:footer-primary-button-text="s__('Environments|Stop environment')"
footer-primary-button-variant="danger"
@submit="onSubmit"
>
2020-05-24 23:13:21 +05:30
<template #header>
2019-02-15 15:39:39 +05:30
<h4 class="modal-title d-flex mw-100">
2018-11-18 11:00:15 +05:30
Stopping
2020-04-22 19:07:51 +05:30
<span v-gl-tooltip :title="environment.name" class="text-truncate ml-1 mr-1 flex-fill">
{{ environment.name }}?
</span>
2018-11-18 11:00:15 +05:30
</h4>
</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>