summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKushal Pandya <kushalspandya@gmail.com>2019-04-12 10:11:22 +0000
committerGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-04-12 10:26:57 +0000
commit8130563101d343c19837bc520da6f1109d510cc7 (patch)
treed9a9c2165621eb67085cea73bad9c5d5e738dd6f
parent8e6398a0a1f03d9425ab011df7299fa4ae5e0abd (diff)
downloadgitlab-ce-8130563101d343c19837bc520da6f1109d510cc7.tar.gz
Merge branch 'diff-fluid-layout-fix' into 'master'
Fixed fluid layout preference not being respected in diffs Closes #52916 See merge request gitlab-org/gitlab-ce!27302 (cherry picked from commit ca8c35285eedb0ae6e9a52fe377ec0b3ae9ada1a) 45ef6fd7 Fixed fluid layout preference not being respected in diffs
-rw-r--r--app/assets/javascripts/diffs/components/app.vue7
-rw-r--r--app/assets/javascripts/diffs/index.js2
-rw-r--r--app/views/projects/merge_requests/show.html.haml3
-rw-r--r--spec/javascripts/diffs/components/app_spec.js8
4 files changed, 18 insertions, 2 deletions
diff --git a/app/assets/javascripts/diffs/components/app.vue b/app/assets/javascripts/diffs/components/app.vue
index 5e74998579b..0ed4dcdcd81 100644
--- a/app/assets/javascripts/diffs/components/app.vue
+++ b/app/assets/javascripts/diffs/components/app.vue
@@ -64,6 +64,11 @@ export default {
required: false,
default: '',
},
+ isFluidLayout: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
},
data() {
const treeWidth =
@@ -116,7 +121,7 @@ export default {
return this.treeWidth <= TREE_HIDE_STATS_WIDTH;
},
isLimitedContainer() {
- return !this.showTreeList && !this.isParallelView;
+ return !this.showTreeList && !this.isParallelView && !this.isFluidLayout;
},
},
watch: {
diff --git a/app/assets/javascripts/diffs/index.js b/app/assets/javascripts/diffs/index.js
index 63954d9d412..1d897bca1dd 100644
--- a/app/assets/javascripts/diffs/index.js
+++ b/app/assets/javascripts/diffs/index.js
@@ -71,6 +71,7 @@ export default function initDiffsApp(store) {
helpPagePath: dataset.helpPagePath,
currentUser: JSON.parse(dataset.currentUserData) || {},
changesEmptyStateIllustration: dataset.changesEmptyStateIllustration,
+ isFluidLayout: parseBoolean(dataset.isFluidLayout),
};
},
computed: {
@@ -97,6 +98,7 @@ export default function initDiffsApp(store) {
helpPagePath: this.helpPagePath,
shouldShow: this.activeTab === 'diffs',
changesEmptyStateIllustration: this.changesEmptyStateIllustration,
+ isFluidLayout: this.isFluidLayout,
},
});
},
diff --git a/app/views/projects/merge_requests/show.html.haml b/app/views/projects/merge_requests/show.html.haml
index 5111c9fab8d..79c586eef73 100644
--- a/app/views/projects/merge_requests/show.html.haml
+++ b/app/views/projects/merge_requests/show.html.haml
@@ -82,7 +82,8 @@
help_page_path: suggest_changes_help_path,
current_user_data: UserSerializer.new(project: @project).represent(current_user, {}, MergeRequestUserEntity).to_json,
project_path: project_path(@merge_request.project),
- changes_empty_state_illustration: image_path('illustrations/merge_request_changes_empty.svg') } }
+ changes_empty_state_illustration: image_path('illustrations/merge_request_changes_empty.svg'),
+ is_fluid_layout: fluid_layout.to_s } }
.mr-loading-status
= spinner
diff --git a/spec/javascripts/diffs/components/app_spec.js b/spec/javascripts/diffs/components/app_spec.js
index 3ce69bc3c20..1aabf3c2132 100644
--- a/spec/javascripts/diffs/components/app_spec.js
+++ b/spec/javascripts/diffs/components/app_spec.js
@@ -75,6 +75,14 @@ describe('diffs/components/app', () => {
expect(wrapper.contains('.container-limited.limit-container-width')).toBe(false);
});
+ it('does not add container-limiting classes when isFluidLayout', () => {
+ createComponent({ isFluidLayout: true }, ({ state }) => {
+ state.diffs.isParallelView = false;
+ });
+
+ expect(wrapper.contains('.container-limited.limit-container-width')).toBe(false);
+ });
+
it('displays loading icon on loading', () => {
createComponent({}, ({ state }) => {
state.diffs.isLoading = true;