diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-11-07 17:55:14 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2018-11-07 17:55:14 +0300 |
commit | ac8f157301fed1ce83969ff4bb9aa6dc99a895e6 (patch) | |
tree | 93840e1dab8f62dadff712a4d0e1625f0af6a214 /app | |
parent | 2120078e6ba5217dc2604235e799ed5d0de13bff (diff) | |
parent | e354a64e89bcbce64871af8d49a3515f652f4e37 (diff) |
Merge branch 'diff-expand-all-button' into 'master'
Show expand all button on merge request diffs
Closes #51737
See merge request gitlab-org/gitlab-ce!22873
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/diffs/components/compare_versions.vue | 6 | ||||
-rw-r--r-- | app/assets/javascripts/diffs/store/getters.js | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/assets/javascripts/diffs/components/compare_versions.vue b/app/assets/javascripts/diffs/components/compare_versions.vue index 29b5aff0fb1..a5b87dfc2d9 100644 --- a/app/assets/javascripts/diffs/components/compare_versions.vue +++ b/app/assets/javascripts/diffs/components/compare_versions.vue @@ -36,7 +36,7 @@ export default { }, computed: { ...mapState('diffs', ['commit', 'showTreeList']), - ...mapGetters('diffs', ['isInlineView', 'isParallelView', 'areAllFilesCollapsed']), + ...mapGetters('diffs', ['isInlineView', 'isParallelView', 'hasCollapsedFile']), comparableDiffs() { return this.mergeRequestDiffs.slice(1); }, @@ -113,8 +113,8 @@ export default { class="inline-parallel-buttons d-none d-md-flex ml-auto" > <a - v-if="areAllFilesCollapsed" - class="btn btn-default" + v-show="hasCollapsedFile" + class="btn btn-default append-right-8" @click="expandAllFiles" > {{ __('Expand all') }} diff --git a/app/assets/javascripts/diffs/store/getters.js b/app/assets/javascripts/diffs/store/getters.js index 2bf0ad99c22..bf490f9d78a 100644 --- a/app/assets/javascripts/diffs/store/getters.js +++ b/app/assets/javascripts/diffs/store/getters.js @@ -5,7 +5,7 @@ export const isParallelView = state => state.diffViewType === PARALLEL_DIFF_VIEW export const isInlineView = state => state.diffViewType === INLINE_DIFF_VIEW_TYPE; -export const areAllFilesCollapsed = state => state.diffFiles.every(file => file.collapsed); +export const hasCollapsedFile = state => state.diffFiles.some(file => file.collapsed); export const commitId = state => (state.commit && state.commit.id ? state.commit.id : null); |