diff options
author | Natalia Tepluhina <ntepluhina@gitlab.com> | 2019-02-28 11:23:17 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-02-28 11:23:17 +0300 |
commit | edfdf568d3ef121ef696f769f6d57a334c961871 (patch) | |
tree | 8f40a6b49d7309f98cbe0c0a4176544f18ea8433 /app | |
parent | b374abec674906fd280133acec66a6dc166aff93 (diff) |
Resolve "Add missing karma tests to the the MR Diff components"
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/diffs/components/diff_file_header.vue | 10 | ||||
-rw-r--r-- | app/assets/javascripts/diffs/components/edit_button.vue | 7 |
2 files changed, 8 insertions, 9 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_file_header.vue b/app/assets/javascripts/diffs/components/diff_file_header.vue index 2b801898345..4d33ad23f39 100644 --- a/app/assets/javascripts/diffs/components/diff_file_header.vue +++ b/app/assets/javascripts/diffs/components/diff_file_header.vue @@ -236,11 +236,15 @@ export default { <a v-if="diffFile.replaced_view_path" :href="diffFile.replaced_view_path" - class="btn view-file js-view-file" + class="btn view-file js-view-replaced-file" v-html="viewReplacedFileButtonText" > </a> - <a :href="diffFile.view_path" class="btn view-file js-view-file" v-html="viewFileButtonText"> + <a + :href="diffFile.view_path" + class="btn view-file js-view-file-button" + v-html="viewFileButtonText" + > </a> <a @@ -250,7 +254,7 @@ export default { :title="`View on ${diffFile.formatted_external_url}`" target="_blank" rel="noopener noreferrer" - class="btn btn-file-option" + class="btn btn-file-option js-external-url" > <icon name="external-link" /> </a> diff --git a/app/assets/javascripts/diffs/components/edit_button.vue b/app/assets/javascripts/diffs/components/edit_button.vue index 5d38d545ce8..803f23b9170 100644 --- a/app/assets/javascripts/diffs/components/edit_button.vue +++ b/app/assets/javascripts/diffs/components/edit_button.vue @@ -17,12 +17,7 @@ export default { }, methods: { handleEditClick(evt) { - if (!this.canCurrentUserFork || this.canModifyBlob) { - // if we can Edit, do default Edit button behavior - return; - } - - if (this.canCurrentUserFork) { + if (this.canCurrentUserFork && !this.canModifyBlob) { evt.preventDefault(); this.$emit('showForkMessage'); } |