diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-04 18:06:38 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-10-04 18:06:38 +0300 |
commit | 5ecacec30458330df5fa6d591dc58e37afb41cd4 (patch) | |
tree | 58a9c004fdae78cbedbcc616dcfa783a1172eea3 /app/assets/javascripts/ide/components | |
parent | 0d46bf06388d485824bc2f1e736b92b2a8a397e4 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/ide/components')
6 files changed, 34 insertions, 18 deletions
diff --git a/app/assets/javascripts/ide/components/commit_sidebar/editor_header.vue b/app/assets/javascripts/ide/components/commit_sidebar/editor_header.vue index 11d5d9639b6..6b2ef34c960 100644 --- a/app/assets/javascripts/ide/components/commit_sidebar/editor_header.vue +++ b/app/assets/javascripts/ide/components/commit_sidebar/editor_header.vue @@ -43,7 +43,12 @@ export default { <template> <div class="d-flex ide-commit-editor-header align-items-center"> <file-icon :file-name="activeFile.name" :size="16" class="mr-2" /> - <strong class="mr-2"> {{ activeFile.path }} </strong> + <strong class="mr-2"> + <template v-if="activeFile.prevPath && activeFile.prevPath !== activeFile.path"> + {{ activeFile.prevPath }} → + </template> + {{ activeFile.path }} + </strong> <changed-file-icon :file="activeFile" :is-centered="false" /> <div class="ml-auto"> <button diff --git a/app/assets/javascripts/ide/components/commit_sidebar/list_item.vue b/app/assets/javascripts/ide/components/commit_sidebar/list_item.vue index 47b205f0a75..230dfaf047b 100644 --- a/app/assets/javascripts/ide/components/commit_sidebar/list_item.vue +++ b/app/assets/javascripts/ide/components/commit_sidebar/list_item.vue @@ -110,6 +110,9 @@ export default { > <span class="multi-file-commit-list-file-path d-flex align-items-center"> <file-icon :file-name="file.name" class="append-right-8" /> + <template v-if="file.prevName && file.prevName !== file.name"> + {{ file.prevName }} → + </template> {{ file.name }} </span> <div class="ml-auto d-flex align-items-center"> diff --git a/app/assets/javascripts/ide/components/file_row_extra.vue b/app/assets/javascripts/ide/components/file_row_extra.vue index 5819999a459..f0bedcfbd6b 100644 --- a/app/assets/javascripts/ide/components/file_row_extra.vue +++ b/app/assets/javascripts/ide/components/file_row_extra.vue @@ -34,6 +34,9 @@ export default { 'getUnstagedFilesCountForPath', 'getStagedFilesCountForPath', ]), + isTree() { + return this.file.type === 'tree'; + }, folderUnstagedCount() { return this.getUnstagedFilesCountForPath(this.file.path); }, @@ -58,10 +61,13 @@ export default { }); }, showTreeChangesCount() { - return this.file.type === 'tree' && this.changesCount > 0 && !this.file.opened; + return this.isTree && this.changesCount > 0 && !this.file.opened; + }, + isModified() { + return this.file.changed || this.file.tempFile || this.file.staged || this.file.prevPath; }, showChangedFileIcon() { - return this.file.changed || this.file.tempFile || this.file.staged; + return !this.isTree && this.isModified; }, }, }; diff --git a/app/assets/javascripts/ide/components/ide_tree_list.vue b/app/assets/javascripts/ide/components/ide_tree_list.vue index 1af86a94482..95782b2c88a 100644 --- a/app/assets/javascripts/ide/components/ide_tree_list.vue +++ b/app/assets/javascripts/ide/components/ide_tree_list.vue @@ -30,9 +30,6 @@ export default { showLoading() { return !this.currentTree || this.currentTree.loading; }, - actualTreeList() { - return this.currentTree.tree.filter(entry => !entry.moved); - }, }, mounted() { this.updateViewer(this.viewerType); @@ -57,9 +54,9 @@ export default { <slot name="header"></slot> </header> <div class="ide-tree-body h-100"> - <template v-if="actualTreeList.length"> + <template v-if="currentTree.tree.length"> <file-row - v-for="file in actualTreeList" + v-for="file in currentTree.tree" :key="file.key" :file="file" :level="0" diff --git a/app/assets/javascripts/ide/components/new_dropdown/modal.vue b/app/assets/javascripts/ide/components/new_dropdown/modal.vue index a2dd31aebd4..d2ed1fe3e55 100644 --- a/app/assets/javascripts/ide/components/new_dropdown/modal.vue +++ b/app/assets/javascripts/ide/components/new_dropdown/modal.vue @@ -91,7 +91,6 @@ export default { this.renameEntry({ path: this.entryModal.entry.path, name: entryName, - entryPath: null, parentPath, }), ) diff --git a/app/assets/javascripts/ide/components/repo_editor.vue b/app/assets/javascripts/ide/components/repo_editor.vue index 802b7f1fa6f..3bf8308ccea 100644 --- a/app/assets/javascripts/ide/components/repo_editor.vue +++ b/app/assets/javascripts/ide/components/repo_editor.vue @@ -155,15 +155,7 @@ export default { this.editor.clearEditor(); - this.getFileData({ - path: this.file.path, - makeFileActive: false, - }) - .then(() => - this.getRawFileData({ - path: this.file.path, - }), - ) + this.fetchFileData() .then(() => { this.createEditorInstance(); }) @@ -179,6 +171,20 @@ export default { throw err; }); }, + fetchFileData() { + if (this.file.tempFile) { + return Promise.resolve(); + } + + return this.getFileData({ + path: this.file.path, + makeFileActive: false, + }).then(() => + this.getRawFileData({ + path: this.file.path, + }), + ); + }, createEditorInstance() { this.editor.dispose(); |