diff options
author | Natalia Tepluhina <ntepluhina@gitlab.com> | 2019-02-28 08:23:17 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2019-02-28 08:23:17 +0000 |
commit | edfdf568d3ef121ef696f769f6d57a334c961871 (patch) | |
tree | 8f40a6b49d7309f98cbe0c0a4176544f18ea8433 /app/assets/javascripts/diffs | |
parent | b374abec674906fd280133acec66a6dc166aff93 (diff) | |
download | gitlab-ce-edfdf568d3ef121ef696f769f6d57a334c961871.tar.gz |
Resolve "Add missing karma tests to the the MR Diff components"
Diffstat (limited to 'app/assets/javascripts/diffs')
-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'); } |