summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/diffs
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-09 06:09:30 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-09 06:09:30 +0000
commit4dfc8711171fe0c04bc6b8b224687603026dea46 (patch)
treee1b4640f8e56bb09f412a3dca1510983245491c2 /app/assets/javascripts/diffs
parentcfd62c3a3ebbc85f5787c103bfa6de1997ab8e11 (diff)
downloadgitlab-ce-4dfc8711171fe0c04bc6b8b224687603026dea46.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/diffs')
-rw-r--r--app/assets/javascripts/diffs/components/diff_content.vue8
-rw-r--r--app/assets/javascripts/diffs/components/diff_file.vue1
-rw-r--r--app/assets/javascripts/diffs/store/actions.js12
3 files changed, 21 insertions, 0 deletions
diff --git a/app/assets/javascripts/diffs/components/diff_content.vue b/app/assets/javascripts/diffs/components/diff_content.vue
index a5ffa84e3fb..5656bfc4707 100644
--- a/app/assets/javascripts/diffs/components/diff_content.vue
+++ b/app/assets/javascripts/diffs/components/diff_content.vue
@@ -12,6 +12,7 @@ import userAvatarLink from '../../vue_shared/components/user_avatar/user_avatar_
import NoteForm from '../../notes/components/note_form.vue';
import ImageDiffOverlay from './image_diff_overlay.vue';
import DiffDiscussions from './diff_discussions.vue';
+import eventHub from '../../notes/event_hub';
import { IMAGE_DIFF_POSITION_TYPE } from '../constants';
import { getDiffMode } from '../store/utils';
import { diffViewerModes } from '~/ide/constants';
@@ -77,6 +78,13 @@ export default {
return this.getUserData;
},
},
+ updated() {
+ if (window.gon?.features?.codeNavigation) {
+ this.$nextTick(() => {
+ eventHub.$emit('showBlobInteractionZones', this.diffFile.new_path);
+ });
+ }
+ },
methods: {
...mapActions('diffs', ['saveDiffDiscussion', 'closeDiffFileCommentForm']),
handleSaveNote(note) {
diff --git a/app/assets/javascripts/diffs/components/diff_file.vue b/app/assets/javascripts/diffs/components/diff_file.vue
index 8babc05f1ce..82ca3749ac1 100644
--- a/app/assets/javascripts/diffs/components/diff_file.vue
+++ b/app/assets/javascripts/diffs/components/diff_file.vue
@@ -145,6 +145,7 @@ export default {
:class="{
'is-active': currentDiffFileId === file.file_hash,
}"
+ :data-path="file.new_path"
class="diff-file file-holder"
>
<diff-file-header
diff --git a/app/assets/javascripts/diffs/store/actions.js b/app/assets/javascripts/diffs/store/actions.js
index 18bbdf402ee..93c242e32ac 100644
--- a/app/assets/javascripts/diffs/store/actions.js
+++ b/app/assets/javascripts/diffs/store/actions.js
@@ -129,6 +129,18 @@ export const fetchDiffFilesBatch = ({ commit, state }) => {
if (!pagination.next_page) {
commit(types.SET_RETRIEVING_BATCHES, false);
+ if (gon.features?.codeNavigation) {
+ // eslint-disable-next-line promise/catch-or-return,promise/no-nesting
+ import('~/code_navigation').then(m =>
+ m.default({
+ blobs: state.diffFiles.map(f => ({
+ path: f.new_path,
+ codeNavigationPath: f.code_navigation_path,
+ })),
+ definitionPathPrefix: state.definitionPathPrefix,
+ }),
+ );
+ }
}
return pagination.next_page;