diff options
author | Clement Ho <clemmakesapps@gmail.com> | 2019-04-22 16:10:51 +0000 |
---|---|---|
committer | Clement Ho <clemmakesapps@gmail.com> | 2019-04-22 16:10:51 +0000 |
commit | 84a1e37f4a889c6b7558f101dc0ecf2932d0a0c6 (patch) | |
tree | 9d6cf158cc28e95bb7c10d068f84597656b2f633 | |
parent | fc77a89d589a3116cc710bb4dab6ff16fd4dd775 (diff) | |
parent | 988fde17fd31c10547bab66eb3a505e0f58b8191 (diff) | |
download | gitlab-ce-84a1e37f4a889c6b7558f101dc0ecf2932d0a0c6.tar.gz |
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
-rw-r--r-- | app/assets/javascripts/ide/components/repo_editor.vue | 2 | ||||
-rw-r--r-- | app/assets/javascripts/ide/stores/mutations.js | 4 | ||||
-rw-r--r-- | changelogs/unreleased/57293-fix-image-rename.yml | 5 |
3 files changed, 8 insertions, 3 deletions
diff --git a/app/assets/javascripts/ide/components/repo_editor.vue b/app/assets/javascripts/ide/components/repo_editor.vue index 94a9e87369c..c7798ad0cd7 100644 --- a/app/assets/javascripts/ide/components/repo_editor.vue +++ b/app/assets/javascripts/ide/components/repo_editor.vue @@ -35,7 +35,7 @@ export default { ]), ...mapGetters('fileTemplates', ['showFileTemplatesBar']), shouldHideEditor() { - return this.file && this.file.binary && !this.file.content; + return this.file && this.file.binary; }, showContentViewer() { return ( diff --git a/app/assets/javascripts/ide/stores/mutations.js b/app/assets/javascripts/ide/stores/mutations.js index 9b9f4b21f1c..344b189decf 100644 --- a/app/assets/javascripts/ide/stores/mutations.js +++ b/app/assets/javascripts/ide/stores/mutations.js @@ -213,7 +213,7 @@ export default { ? `${slashedParentPath}${oldEntry.name}` : `${slashedParentPath}${name}`; - state.entries[newPath] = { + Vue.set(state.entries, newPath, { ...oldEntry, id: newPath, key: `${newPath}-${oldEntry.type}-${oldEntry.id}`, @@ -225,7 +225,7 @@ export default { tree: [], parentPath, raw: '', - }; + }); oldEntry.moved = true; oldEntry.movedPath = newPath; diff --git a/changelogs/unreleased/57293-fix-image-rename.yml b/changelogs/unreleased/57293-fix-image-rename.yml new file mode 100644 index 00000000000..50dddbdf114 --- /dev/null +++ b/changelogs/unreleased/57293-fix-image-rename.yml @@ -0,0 +1,5 @@ +--- +title: Resolve Renaming an image via Web IDE corrupts it +merge_request: 27486 +author: +type: fixed |