Commit 84a1e37f authored by Clement Ho's avatar Clement Ho

Merge branch '57293-fix-image-rename' into 'master'

Resolve "Renaming an image via Web IDE corrupts it"

Closes #57293

See merge request gitlab-org/gitlab-ce!27486
parents fc77a89d 988fde17
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
]), ]),
...mapGetters('fileTemplates', ['showFileTemplatesBar']), ...mapGetters('fileTemplates', ['showFileTemplatesBar']),
shouldHideEditor() { shouldHideEditor() {
return this.file && this.file.binary && !this.file.content; return this.file && this.file.binary;
}, },
showContentViewer() { showContentViewer() {
return ( return (
......
...@@ -213,7 +213,7 @@ export default { ...@@ -213,7 +213,7 @@ export default {
? `${slashedParentPath}${oldEntry.name}` ? `${slashedParentPath}${oldEntry.name}`
: `${slashedParentPath}${name}`; : `${slashedParentPath}${name}`;
state.entries[newPath] = { Vue.set(state.entries, newPath, {
...oldEntry, ...oldEntry,
id: newPath, id: newPath,
key: `${newPath}-${oldEntry.type}-${oldEntry.id}`, key: `${newPath}-${oldEntry.type}-${oldEntry.id}`,
...@@ -225,7 +225,7 @@ export default { ...@@ -225,7 +225,7 @@ export default {
tree: [], tree: [],
parentPath, parentPath,
raw: '', raw: '',
}; });
oldEntry.moved = true; oldEntry.moved = true;
oldEntry.movedPath = newPath; oldEntry.movedPath = newPath;
......
---
title: Resolve Renaming an image via Web IDE corrupts it
merge_request: 27486
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