Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-05-08 18:18:11 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-05-08 18:18:11 +0300
commitdcc56fe601580b5d8f6c3da32550c6523f2baff3 (patch)
treef68c28bf7c8715de7242464b344620ae5c394036 /app/assets/javascripts/environments
parent571b02efc9442e73538c3438eb593a83d7807779 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/environments')
-rw-r--r--app/assets/javascripts/environments/components/environment_external_url.vue17
-rw-r--r--app/assets/javascripts/environments/components/environments_detail_header.vue38
2 files changed, 13 insertions, 42 deletions
diff --git a/app/assets/javascripts/environments/components/environment_external_url.vue b/app/assets/javascripts/environments/components/environment_external_url.vue
index 04a390fbba7..27f322eaf93 100644
--- a/app/assets/javascripts/environments/components/environment_external_url.vue
+++ b/app/assets/javascripts/environments/components/environment_external_url.vue
@@ -1,8 +1,6 @@
<script>
import { GlTooltipDirective, GlButton } from '@gitlab/ui';
-import ModalCopyButton from '~/vue_shared/components/modal_copy_button.vue';
-import { s__, __ } from '~/locale';
-import { isSafeURL } from '~/lib/utils/url_utility';
+import { s__ } from '~/locale';
/**
* Renders the external url link in environments table.
@@ -10,7 +8,6 @@ import { isSafeURL } from '~/lib/utils/url_utility';
export default {
components: {
GlButton,
- ModalCopyButton,
},
directives: {
GlTooltip: GlTooltipDirective,
@@ -24,23 +21,16 @@ export default {
i18n: {
title: s__('Environments|Open live environment'),
open: s__('Environments|Open'),
- copy: __('Copy URL'),
- copyTitle: s__('Environments|Copy live environment URL'),
- },
- computed: {
- isSafeUrl() {
- return isSafeURL(this.externalUrl);
- },
},
};
</script>
<template>
<gl-button
- v-if="isSafeUrl"
v-gl-tooltip
:title="$options.i18n.title"
:aria-label="$options.i18n.title"
:href="externalUrl"
+ is-unsafe-link
class="external-url"
target="_blank"
icon="external-link"
@@ -48,7 +38,4 @@ export default {
>
{{ $options.i18n.open }}
</gl-button>
- <modal-copy-button v-else :title="$options.i18n.copyTitle" :text="externalUrl">
- {{ $options.i18n.copy }}
- </modal-copy-button>
</template>
diff --git a/app/assets/javascripts/environments/components/environments_detail_header.vue b/app/assets/javascripts/environments/components/environments_detail_header.vue
index bb2f053b3fc..072c8a08256 100644
--- a/app/assets/javascripts/environments/components/environments_detail_header.vue
+++ b/app/assets/javascripts/environments/components/environments_detail_header.vue
@@ -4,8 +4,6 @@ import csrf from '~/lib/utils/csrf';
import { __, s__ } from '~/locale';
import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue';
import timeagoMixin from '~/vue_shared/mixins/timeago';
-import ModalCopyButton from '~/vue_shared/components/modal_copy_button.vue';
-import { isSafeURL } from '~/lib/utils/url_utility';
import DeleteEnvironmentModal from './delete_environment_modal.vue';
import StopEnvironmentModal from './stop_environment_modal.vue';
@@ -18,7 +16,6 @@ export default {
TimeAgo,
DeleteEnvironmentModal,
StopEnvironmentModal,
- ModalCopyButton,
},
directives: {
GlModalDirective,
@@ -76,8 +73,6 @@ export default {
deleteButtonText: s__('Environments|Delete'),
externalButtonTitle: s__('Environments|Open live environment'),
externalButtonText: __('View deployment'),
- copyUrlText: __('Copy URL'),
- copyUrlTitle: s__('Environments|Copy live environment URL'),
cancelAutoStopButtonTitle: __('Prevent environment from auto-stopping'),
},
computed: {
@@ -87,9 +82,6 @@ export default {
shouldShowExternalUrlButton() {
return Boolean(this.environment.externalUrl);
},
- isSafeUrl() {
- return isSafeURL(this.environment.externalUrl);
- },
shouldShowStopButton() {
return this.canStopEnvironment && this.environment.isAvailable;
},
@@ -131,25 +123,17 @@ export default {
:href="terminalPath"
icon="terminal"
/>
- <template v-if="shouldShowExternalUrlButton">
- <gl-button
- v-if="isSafeUrl"
- v-gl-tooltip.hover
- data-testid="external-url-button"
- :title="$options.i18n.externalButtonTitle"
- :href="environment.externalUrl"
- icon="external-link"
- target="_blank"
- >{{ $options.i18n.externalButtonText }}</gl-button
- >
- <modal-copy-button
- v-else
- :title="$options.i18n.copyUrlTitle"
- :text="environment.externalUrl"
- >
- {{ $options.i18n.copyUrlText }}
- </modal-copy-button>
- </template>
+ <gl-button
+ v-if="shouldShowExternalUrlButton"
+ v-gl-tooltip.hover
+ data-testid="external-url-button"
+ :title="$options.i18n.externalButtonTitle"
+ :href="environment.externalUrl"
+ is-unsafe-link
+ icon="external-link"
+ target="_blank"
+ >{{ $options.i18n.externalButtonText }}</gl-button
+ >
<gl-button
v-if="shouldShowExternalUrlButton"
v-gl-tooltip.hover