summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/diffs/components
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2018-07-09 10:21:18 +0100
committerFilipa Lacerda <filipa@gitlab.com>2018-07-09 10:21:18 +0100
commit81b9b6f4095a430d2afe54a95ea1fa172fe9c0e1 (patch)
tree8d15b3a4ca984bff193ee0807ab48d7e1cad7d78 /app/assets/javascripts/diffs/components
parent156a9d39131b6193e0e6bc5ec7f1683305166fa8 (diff)
parentdc71b4004bd9773d03d5a4eeaba2db883e5a2251 (diff)
downloadgitlab-ce-81b9b6f4095a430d2afe54a95ea1fa172fe9c0e1.tar.gz
Merge branch 'master' into 48960-namespace-diff-module
* master: (29 commits) Update the dependencies license list for 11.1.0 Update .gitignore, .gitlab-ci.yml, and Dockerfile templates for 11.1.0 This updates only the actual new discussion and not the full tree , which leads to a very costly full rerender Resolve "MR Refactor: Improve performance by setting v-once" Changed Inline + Parallel Views to v-if instead of v-show add basic export to fix timeout problem on import_file_spec.rb Add changelog entry for !20465 Improve render performance of large wiki pages Refactor rspec matchers in read_only_spec.rb add CHANGELOG.md entry for !20461 resolve node 6 compatibility issues Add missing foreign key in import_export_uploads Redesign for mr widget info and pipelines section Use proper markdown rendering for previews remove extra tick for eks docs Make it clear that we need to enable omniauth for SAML and Bitbucket Add GPL Commitment language Add ExclusiveLease guards for RepositoryCheck::{DispatchWorker,BatchWorker} Ability to check if underlying database is read only fix spec ...
Diffstat (limited to 'app/assets/javascripts/diffs/components')
-rw-r--r--app/assets/javascripts/diffs/components/diff_content.vue4
-rw-r--r--app/assets/javascripts/diffs/components/diff_file_header.vue1
-rw-r--r--app/assets/javascripts/diffs/components/diff_line_gutter_content.vue1
-rw-r--r--app/assets/javascripts/diffs/components/diff_line_note_form.vue6
-rw-r--r--app/assets/javascripts/diffs/components/diff_table_cell.vue8
-rw-r--r--app/assets/javascripts/diffs/components/inline_diff_table_row.vue11
-rw-r--r--app/assets/javascripts/diffs/components/parallel_diff_table_row.vue28
7 files changed, 25 insertions, 34 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_content.vue b/app/assets/javascripts/diffs/components/diff_content.vue
index ff58e45400b..02d5be1821b 100644
--- a/app/assets/javascripts/diffs/components/diff_content.vue
+++ b/app/assets/javascripts/diffs/components/diff_content.vue
@@ -39,12 +39,12 @@ export default {
<div class="diff-viewer">
<template v-if="isTextFile">
<inline-diff-view
- v-show="isInlineView"
+ v-if="isInlineView"
:diff-file="diffFile"
:diff-lines="diffFile.highlightedDiffLines || []"
/>
<parallel-diff-view
- v-show="isParallelView"
+ v-if="isParallelView"
:diff-file="diffFile"
:diff-lines="diffFile.parallelDiffLines || []"
/>
diff --git a/app/assets/javascripts/diffs/components/diff_file_header.vue b/app/assets/javascripts/diffs/components/diff_file_header.vue
index a8e8732053b..1957698c6c1 100644
--- a/app/assets/javascripts/diffs/components/diff_file_header.vue
+++ b/app/assets/javascripts/diffs/components/diff_file_header.vue
@@ -145,6 +145,7 @@ export default {
@click.stop="handleToggle"
/>
<a
+ v-once
ref="titleWrapper"
:href="titleLink"
class="append-right-4"
diff --git a/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue b/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue
index a73f898e10b..ad838a32518 100644
--- a/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue
+++ b/app/assets/javascripts/diffs/components/diff_line_gutter_content.vue
@@ -189,6 +189,7 @@ export default {
</button>
<a
v-if="lineNumber"
+ v-once
:data-linenumber="lineNumber"
:href="lineHref"
>
diff --git a/app/assets/javascripts/diffs/components/diff_line_note_form.vue b/app/assets/javascripts/diffs/components/diff_line_note_form.vue
index fcbb42b101e..db380e68bd1 100644
--- a/app/assets/javascripts/diffs/components/diff_line_note_form.vue
+++ b/app/assets/javascripts/diffs/components/diff_line_note_form.vue
@@ -60,7 +60,7 @@ export default {
},
methods: {
...mapActions('diffs', ['cancelCommentForm']),
- ...mapActions(['saveNote', 'fetchDiscussions']),
+ ...mapActions(['saveNote', 'refetchDiscussionById']),
handleCancelCommentForm() {
this.autosave.reset();
this.cancelCommentForm({
@@ -79,10 +79,10 @@ export default {
});
this.saveNote(postData)
- .then(() => {
+ .then(result => {
const endpoint = this.getNotesDataByProp('discussionsPath');
- this.fetchDiscussions(endpoint)
+ this.refetchDiscussionById({ path: endpoint, discussionId: result.discussion_id })
.then(() => {
this.handleCancelCommentForm();
})
diff --git a/app/assets/javascripts/diffs/components/diff_table_cell.vue b/app/assets/javascripts/diffs/components/diff_table_cell.vue
index 5b08b161114..bd02b45a63c 100644
--- a/app/assets/javascripts/diffs/components/diff_table_cell.vue
+++ b/app/assets/javascripts/diffs/components/diff_table_cell.vue
@@ -117,14 +117,6 @@ export default {
<template>
<td
- v-if="isContentLine"
- :class="lineType"
- class="line_content"
- v-html="normalizedLine.richText"
- >
- </td>
- <td
- v-else
:class="classNameMap"
>
<diff-line-gutter-content
diff --git a/app/assets/javascripts/diffs/components/inline_diff_table_row.vue b/app/assets/javascripts/diffs/components/inline_diff_table_row.vue
index 7188371692f..8e4715c9862 100644
--- a/app/assets/javascripts/diffs/components/inline_diff_table_row.vue
+++ b/app/assets/javascripts/diffs/components/inline_diff_table_row.vue
@@ -94,11 +94,12 @@ export default {
:is-hover="isHover"
class="diff-line-num new_line"
/>
- <diff-table-cell
+ <td
+ v-once
:class="line.type"
- :diff-file="diffFile"
- :line="line"
- :is-content-line="true"
- />
+ class="line_content"
+ v-html="line.richText"
+ >
+ </td>
</tr>
</template>
diff --git a/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue b/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue
index 236a51be355..b76fc63205b 100644
--- a/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue
+++ b/app/assets/javascripts/diffs/components/parallel_diff_table_row.vue
@@ -113,17 +113,15 @@ export default {
:diff-view-type="parallelDiffViewType"
class="diff-line-num old_line"
/>
- <diff-table-cell
+ <td
+ v-once
:id="line.left.lineCode"
- :diff-file="diffFile"
- :line="line"
- :is-content-line="true"
- :line-position="linePositionLeft"
- :line-type="parallelViewLeftLineType"
- :diff-view-type="parallelDiffViewType"
+ :class="parallelViewLeftLineType"
class="line_content parallel left-side"
@mousedown.native="handleParallelLineMouseDown"
- />
+ v-html="line.left.richText"
+ >
+ </td>
<diff-table-cell
:diff-file="diffFile"
:line="line"
@@ -135,16 +133,14 @@ export default {
:diff-view-type="parallelDiffViewType"
class="diff-line-num new_line"
/>
- <diff-table-cell
+ <td
+ v-once
:id="line.right.lineCode"
- :diff-file="diffFile"
- :line="line"
- :is-content-line="true"
- :line-position="linePositionRight"
- :line-type="line.right.type"
- :diff-view-type="parallelDiffViewType"
+ :class="line.right.type"
class="line_content parallel right-side"
@mousedown.native="handleParallelLineMouseDown"
- />
+ v-html="line.right.richText"
+ >
+ </td>
</tr>
</template>