gitlab-org--gitlab-foss/app/assets/javascripts/issue_show/components/locked_warning.vue

29 lines
698 B
Vue
Raw Normal View History

<script>
/* eslint-disable vue/no-v-html */
2019-07-16 02:48:40 +00:00
import { __, sprintf } from '~/locale';
2018-10-10 06:23:54 +00:00
export default {
computed: {
currentPath() {
return window.location.pathname;
},
2019-07-16 02:48:40 +00:00
alertMessage() {
return sprintf(
__(
'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.',
),
{
linkStart: `<a href="${this.currentPath}" target="_blank" rel="nofollow">`,
linkEnd: `</a>`,
},
false,
);
},
2018-10-10 06:23:54 +00:00
},
};
</script>
<template>
2019-07-16 02:48:40 +00:00
<div class="alert alert-danger" v-html="alertMessage"></div>
</template>