Commit 38a67a7a authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents 097f7799 a8e19494
...@@ -67,6 +67,18 @@ export default { ...@@ -67,6 +67,18 @@ export default {
errorMessage() { errorMessage() {
return this.file.viewer.error_message; return this.file.viewer.error_message;
}, },
forkMessage() {
return sprintf(
__(
"You're not allowed to %{tag_start}edit%{tag_end} files in this project directly. Please fork this project, make your changes there, and submit a merge request.",
),
{
tag_start: '<span class="js-file-fork-suggestion-section-action">',
tag_end: '</span>',
},
false,
);
},
}, },
watch: { watch: {
isCollapsed: function fileCollapsedWatch(newVal, oldVal) { isCollapsed: function fileCollapsedWatch(newVal, oldVal) {
...@@ -150,12 +162,7 @@ export default { ...@@ -150,12 +162,7 @@ export default {
/> />
<div v-if="forkMessageVisible" class="js-file-fork-suggestion-section file-fork-suggestion"> <div v-if="forkMessageVisible" class="js-file-fork-suggestion-section file-fork-suggestion">
<span class="file-fork-suggestion-note"> <span class="file-fork-suggestion-note" v-html="forkMessage"></span>
{{ sprintf(__("You're not allowed to %{tag_start}edit%{tag_end} files in this project
directly. Please fork this project, make your changes there, and submit a merge request."),
{ tag_start: '<span class="js-file-fork-suggestion-section-action">', tag_end: '</span>' })
}}
</span>
<a <a
:href="file.fork_path" :href="file.fork_path"
class="js-fork-suggestion-button btn btn-grouped btn-inverted btn-success" class="js-fork-suggestion-button btn btn-grouped btn-inverted btn-success"
......
<script> <script>
import { __, sprintf } from '~/locale';
export default { export default {
computed: { computed: {
currentPath() { currentPath() {
return window.location.pathname; return window.location.pathname;
}, },
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,
);
},
}, },
}; };
</script> </script>
<template> <template>
<div class="alert alert-danger"> <div class="alert alert-danger" v-html="alertMessage"></div>
{{ 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="${currentPath}" target="_blank" rel="nofollow">` linkEnd: '</a
>', }) }}
</div>
</template> </template>
---
title: Fix broken warnings while Editing Issues and Edit File on MR
merge_request:
author:
type: fixed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment