diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /app/assets/javascripts/diffs/components/app.vue | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'app/assets/javascripts/diffs/components/app.vue')
-rw-r--r-- | app/assets/javascripts/diffs/components/app.vue | 62 |
1 files changed, 27 insertions, 35 deletions
diff --git a/app/assets/javascripts/diffs/components/app.vue b/app/assets/javascripts/diffs/components/app.vue index 5707e4d67f9..c86f2c8451c 100644 --- a/app/assets/javascripts/diffs/components/app.vue +++ b/app/assets/javascripts/diffs/components/app.vue @@ -21,7 +21,7 @@ import MrWidgetHowToMergeModal from '~/vue_merge_request_widget/components/mr_wi import PanelResizer from '~/vue_shared/components/panel_resizer.vue'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; -import notesEventHub from '../../notes/event_hub'; +import notesEventHub from '~/notes/event_hub'; import { TREE_LIST_WIDTH_STORAGE_KEY, INITIAL_TREE_WIDTH, @@ -347,36 +347,34 @@ export default { this.setHighlightedRow(id.split('diff-content').pop().slice(1)); } - if (window.gon?.features?.diffSettingsUsageData) { - const events = []; + const events = []; - if (this.renderTreeList) { - events.push(TRACKING_FILE_BROWSER_TREE); - } else { - events.push(TRACKING_FILE_BROWSER_LIST); - } - - if (this.diffViewType === INLINE_DIFF_VIEW_TYPE) { - events.push(TRACKING_DIFF_VIEW_INLINE); - } else { - events.push(TRACKING_DIFF_VIEW_PARALLEL); - } + if (this.renderTreeList) { + events.push(TRACKING_FILE_BROWSER_TREE); + } else { + events.push(TRACKING_FILE_BROWSER_LIST); + } - if (this.showWhitespace) { - events.push(TRACKING_WHITESPACE_SHOW); - } else { - events.push(TRACKING_WHITESPACE_HIDE); - } + if (this.diffViewType === INLINE_DIFF_VIEW_TYPE) { + events.push(TRACKING_DIFF_VIEW_INLINE); + } else { + events.push(TRACKING_DIFF_VIEW_PARALLEL); + } - if (this.viewDiffsFileByFile) { - events.push(TRACKING_SINGLE_FILE_MODE); - } else { - events.push(TRACKING_MULTIPLE_FILES_MODE); - } + if (this.showWhitespace) { + events.push(TRACKING_WHITESPACE_SHOW); + } else { + events.push(TRACKING_WHITESPACE_HIDE); + } - queueRedisHllEvents(events); + if (this.viewDiffsFileByFile) { + events.push(TRACKING_SINGLE_FILE_MODE); + } else { + events.push(TRACKING_MULTIPLE_FILES_MODE); } + queueRedisHllEvents(events); + this.subscribeToVirtualScrollingEvents(); }, beforeCreate() { @@ -534,10 +532,8 @@ export default { if (delta >= 0 && delta < 1000) { this.disableVirtualScroller(); - if (window.gon?.features?.usageDataDiffSearches) { - api.trackRedisHllUserEvent('i_code_review_user_searches_diff'); - api.trackRedisCounterEvent('diff_searches'); - } + api.trackRedisHllUserEvent('i_code_review_user_searches_diff'); + api.trackRedisCounterEvent('diff_searches'); } } }); @@ -574,12 +570,8 @@ export default { this.scrollVirtualScrollerToIndex(index); } }, - async scrollVirtualScrollerToIndex(index) { + scrollVirtualScrollerToIndex(index) { this.virtualScrollCurrentIndex = index; - - await this.$nextTick(); - - this.virtualScrollCurrentIndex = -1; }, scrollVirtualScrollerToDiffNote() { const id = window?.location?.hash; @@ -705,7 +697,7 @@ export default { </dynamic-scroller-item> </template> </pre-renderer> - <virtual-scroller-scroll-sync :index="virtualScrollCurrentIndex" /> + <virtual-scroller-scroll-sync v-model="virtualScrollCurrentIndex" /> </template> </dynamic-scroller> <template v-else> |