summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/issues/show/components/locked_warning.vue
blob: 4b99888ae73472e5c901309b62a1fa957190439a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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>