diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-12 12:08:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-12 12:08:22 +0300 |
commit | 2e3f13a01a2833f85fb2201a245205b8e9d0ca9a (patch) | |
tree | e827a69320fa3f457d22a243672ab5f0857c2cdd /app/assets/javascripts/diffs | |
parent | 9e10ffebdd7550dc72c1124aa5db2eaa97dd0282 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/diffs')
-rw-r--r-- | app/assets/javascripts/diffs/components/app.vue | 46 | ||||
-rw-r--r-- | app/assets/javascripts/diffs/store/actions.js | 28 |
2 files changed, 33 insertions, 41 deletions
diff --git a/app/assets/javascripts/diffs/components/app.vue b/app/assets/javascripts/diffs/components/app.vue index 075e1b4071e..0a400fa95d2 100644 --- a/app/assets/javascripts/diffs/components/app.vue +++ b/app/assets/javascripts/diffs/components/app.vue @@ -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() { diff --git a/app/assets/javascripts/diffs/store/actions.js b/app/assets/javascripts/diffs/store/actions.js index 7a30dc226a2..d5cd4af4d06 100644 --- a/app/assets/javascripts/diffs/store/actions.js +++ b/app/assets/javascripts/diffs/store/actions.js @@ -376,9 +376,7 @@ export const setInlineDiffViewType = ({ commit }) => { const url = mergeUrlParams({ view: INLINE_DIFF_VIEW_TYPE }, window.location.href); historyPushState(url); - if (window.gon?.features?.diffSettingsUsageData) { - queueRedisHllEvents([TRACKING_CLICK_DIFF_VIEW_SETTING, TRACKING_DIFF_VIEW_INLINE]); - } + queueRedisHllEvents([TRACKING_CLICK_DIFF_VIEW_SETTING, TRACKING_DIFF_VIEW_INLINE]); }; export const setParallelDiffViewType = ({ commit }) => { @@ -388,9 +386,7 @@ export const setParallelDiffViewType = ({ commit }) => { const url = mergeUrlParams({ view: PARALLEL_DIFF_VIEW_TYPE }, window.location.href); historyPushState(url); - if (window.gon?.features?.diffSettingsUsageData) { - queueRedisHllEvents([TRACKING_CLICK_DIFF_VIEW_SETTING, TRACKING_DIFF_VIEW_PARALLEL]); - } + queueRedisHllEvents([TRACKING_CLICK_DIFF_VIEW_SETTING, TRACKING_DIFF_VIEW_PARALLEL]); }; export const showCommentForm = ({ commit }, { lineCode, fileHash }) => { @@ -576,7 +572,7 @@ export const setRenderTreeList = ({ commit }, { renderTreeList, trackClick = tru localStorage.setItem(TREE_LIST_STORAGE_KEY, renderTreeList); - if (window.gon?.features?.diffSettingsUsageData && trackClick) { + if (trackClick) { const events = [TRACKING_CLICK_FILE_BROWSER_SETTING]; if (renderTreeList) { @@ -600,7 +596,7 @@ export const setShowWhitespace = async ( commit(types.SET_SHOW_WHITESPACE, showWhitespace); notesEventHub.$emit('refetchDiffData'); - if (window.gon?.features?.diffSettingsUsageData && trackClick) { + if (trackClick) { const events = [TRACKING_CLICK_WHITESPACE_SETTING]; if (showWhitespace) { @@ -827,18 +823,16 @@ export const navigateToDiffFileIndex = ({ commit, state }, index) => { export const setFileByFile = ({ state, commit }, { fileByFile }) => { commit(types.SET_FILE_BY_FILE, fileByFile); - if (window.gon?.features?.diffSettingsUsageData) { - const events = [TRACKING_CLICK_SINGLE_FILE_SETTING]; - - if (fileByFile) { - events.push(TRACKING_SINGLE_FILE_MODE); - } else { - events.push(TRACKING_MULTIPLE_FILES_MODE); - } + const events = [TRACKING_CLICK_SINGLE_FILE_SETTING]; - queueRedisHllEvents(events); + if (fileByFile) { + events.push(TRACKING_SINGLE_FILE_MODE); + } else { + events.push(TRACKING_MULTIPLE_FILES_MODE); } + queueRedisHllEvents(events); + return axios .put(state.endpointUpdateUser, { view_diffs_file_by_file: fileByFile, |