debian-mirror-gitlab/app/assets/javascripts/issues/show/components/locked_warning.vue

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
1.3 KiB
Vue
Raw Normal View History

2017-09-10 17:25:29 +05:30
<script>
2022-06-21 17:19:12 +05:30
import { GlSprintf, GlLink, GlAlert } from '@gitlab/ui';
2023-03-04 22:38:38 +05:30
import { __, sprintf } from '~/locale';
2023-05-27 22:25:52 +05:30
import {
TYPE_ALERT,
TYPE_EPIC,
TYPE_ISSUE,
TYPE_MERGE_REQUEST,
TYPE_TEST_CASE,
} from '~/issues/constants';
2021-11-18 22:05:49 +05:30
2023-03-04 22:38:38 +05:30
export const i18n = Object.freeze({
alertMessage: __(
"Someone edited the %{issuableType} at the same time you did. Review %{linkStart}the %{issuableType}%{linkEnd} and make sure you don't unintentionally overwrite their changes.",
),
});
2019-09-30 21:07:59 +05:30
2018-12-13 13:39:08 +05:30
export default {
2021-11-18 22:05:49 +05:30
components: {
GlSprintf,
GlLink,
2022-06-21 17:19:12 +05:30
GlAlert,
2021-11-18 22:05:49 +05:30
},
2023-03-04 22:38:38 +05:30
props: {
issuableType: {
type: String,
required: true,
validator(value) {
2023-05-27 22:25:52 +05:30
return [TYPE_ALERT, TYPE_EPIC, TYPE_ISSUE, TYPE_MERGE_REQUEST, TYPE_TEST_CASE].includes(
value,
);
2023-03-04 22:38:38 +05:30
},
},
},
2018-12-13 13:39:08 +05:30
computed: {
currentPath() {
return window.location.pathname;
2017-09-10 17:25:29 +05:30
},
2023-03-04 22:38:38 +05:30
alertMessage() {
return sprintf(this.$options.i18n.alertMessage, { issuableType: this.issuableType });
},
2018-12-13 13:39:08 +05:30
},
2023-03-04 22:38:38 +05:30
i18n,
2018-12-13 13:39:08 +05:30
};
2017-09-10 17:25:29 +05:30
</script>
<template>
2022-06-21 17:19:12 +05:30
<gl-alert variant="danger" class="gl-mb-5" :dismissible="false">
2023-03-04 22:38:38 +05:30
<gl-sprintf :message="alertMessage">
2021-11-18 22:05:49 +05:30
<template #link="{ content }">
<gl-link :href="currentPath" target="_blank" rel="nofollow">
{{ content }}
</gl-link>
</template>
</gl-sprintf>
2022-06-21 17:19:12 +05:30
</gl-alert>
2017-09-10 17:25:29 +05:30
</template>