diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-31 03:09:08 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-31 03:09:08 +0300 |
commit | 9ae0f24e76fa9d215e1821478968c12618f86722 (patch) | |
tree | 7c5cbdfe46952984b411c9347f086c127b056fa6 /app/assets/javascripts/diffs | |
parent | 07c452dfa09f8215053d42e010efebb0c4b69ae6 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/diffs')
4 files changed, 14 insertions, 7 deletions
diff --git a/app/assets/javascripts/diffs/components/collapsed_files_warning.vue b/app/assets/javascripts/diffs/components/collapsed_files_warning.vue index 1d4168449b2..0cf1cdb17f8 100644 --- a/app/assets/javascripts/diffs/components/collapsed_files_warning.vue +++ b/app/assets/javascripts/diffs/components/collapsed_files_warning.vue @@ -1,7 +1,7 @@ <script> import { GlAlert, GlButton } from '@gitlab/ui'; -import { CENTERED_LIMITED_CONTAINER_CLASSES } from '../constants'; +import { CENTERED_LIMITED_CONTAINER_CLASSES, EVT_EXPAND_ALL_FILES } from '../constants'; import eventHub from '../event_hub'; export default { @@ -40,7 +40,7 @@ export default { this.$emit('dismiss'); }, expand() { - eventHub.$emit('mr:diffs:expandAllFiles'); + eventHub.$emit(EVT_EXPAND_ALL_FILES); this.dismiss(); }, }, diff --git a/app/assets/javascripts/diffs/components/compare_versions.vue b/app/assets/javascripts/diffs/components/compare_versions.vue index e30cbf8be4f..700d5ec86c8 100644 --- a/app/assets/javascripts/diffs/components/compare_versions.vue +++ b/app/assets/javascripts/diffs/components/compare_versions.vue @@ -6,7 +6,7 @@ import { polyfillSticky } from '~/lib/utils/sticky'; import CompareDropdownLayout from './compare_dropdown_layout.vue'; import SettingsDropdown from './settings_dropdown.vue'; import DiffStats from './diff_stats.vue'; -import { CENTERED_LIMITED_CONTAINER_CLASSES } from '../constants'; +import { CENTERED_LIMITED_CONTAINER_CLASSES, EVT_EXPAND_ALL_FILES } from '../constants'; import eventHub from '../event_hub'; export default { @@ -71,7 +71,7 @@ export default { 'toggleShowTreeList', ]), expandAllFiles() { - eventHub.$emit('mr:diffs:expandAllFiles'); + eventHub.$emit(EVT_EXPAND_ALL_FILES); }, }, }; diff --git a/app/assets/javascripts/diffs/components/diff_file.vue b/app/assets/javascripts/diffs/components/diff_file.vue index ff7be75265b..27bda194c5c 100644 --- a/app/assets/javascripts/diffs/components/diff_file.vue +++ b/app/assets/javascripts/diffs/components/diff_file.vue @@ -11,7 +11,11 @@ import DiffFileHeader from './diff_file_header.vue'; import DiffContent from './diff_content.vue'; import { diffViewerErrors } from '~/ide/constants'; import { collapsedType, isCollapsed } from '../diff_file'; -import { DIFF_FILE_AUTOMATIC_COLLAPSE, DIFF_FILE_MANUAL_COLLAPSE } from '../constants'; +import { + DIFF_FILE_AUTOMATIC_COLLAPSE, + DIFF_FILE_MANUAL_COLLAPSE, + EVT_EXPAND_ALL_FILES, +} from '../constants'; import { DIFF_FILE, GENERIC_ERROR } from '../i18n'; import eventHub from '../event_hub'; @@ -154,10 +158,10 @@ export default { }, created() { notesEventHub.$on(`loadCollapsedDiff/${this.file.file_hash}`, this.requestDiff); - eventHub.$on('mr:diffs:expandAllFiles', this.expandAllListener); + eventHub.$on(EVT_EXPAND_ALL_FILES, this.expandAllListener); }, beforeDestroy() { - eventHub.$off('mr:diffs:expandAllFiles', this.expandAllListener); + eventHub.$off(EVT_EXPAND_ALL_FILES, this.expandAllListener); }, methods: { ...mapActions('diffs', [ diff --git a/app/assets/javascripts/diffs/constants.js b/app/assets/javascripts/diffs/constants.js index 0735470bfa2..709bfe693e6 100644 --- a/app/assets/javascripts/diffs/constants.js +++ b/app/assets/javascripts/diffs/constants.js @@ -95,3 +95,6 @@ export const RENAMED_DIFF_TRANSITIONS = { [`${STATE_ERRORED}:${TRANSITION_LOAD_START}`]: STATE_LOADING, [`${STATE_ERRORED}:${TRANSITION_ACKNOWLEDGE_ERROR}`]: STATE_IDLING, }; + +// MR Diffs known events +export const EVT_EXPAND_ALL_FILES = 'mr:diffs:expandAllFiles'; |