diff options
Diffstat (limited to 'app/assets/javascripts/issues/show/components/locked_warning.vue')
-rw-r--r-- | app/assets/javascripts/issues/show/components/locked_warning.vue | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/app/assets/javascripts/issues/show/components/locked_warning.vue b/app/assets/javascripts/issues/show/components/locked_warning.vue new file mode 100644 index 00000000000..4b99888ae73 --- /dev/null +++ b/app/assets/javascripts/issues/show/components/locked_warning.vue @@ -0,0 +1,33 @@ +<script> +import { GlSprintf, GlLink } from '@gitlab/ui'; +import { __ } from '~/locale'; + +const alertMessage = __( + 'Someone edited the issue at the same time you did. Please check out %{linkStart}the issue%{linkEnd} and make sure your changes will not unintentionally remove theirs.', +); + +export default { + alertMessage, + components: { + GlSprintf, + GlLink, + }, + computed: { + currentPath() { + return window.location.pathname; + }, + }, +}; +</script> + +<template> + <div class="alert alert-danger"> + <gl-sprintf :message="$options.alertMessage"> + <template #link="{ content }"> + <gl-link :href="currentPath" target="_blank" rel="nofollow"> + {{ content }} + </gl-link> + </template> + </gl-sprintf> + </div> +</template> |