Fixed fluid layout preference not being respected in diffs
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52916
This commit is contained in:
parent
39aa68b20c
commit
45ef6fd777
|
@ -64,6 +64,11 @@ export default {
|
||||||
required: false,
|
required: false,
|
||||||
default: '',
|
default: '',
|
||||||
},
|
},
|
||||||
|
isFluidLayout: {
|
||||||
|
type: Boolean,
|
||||||
|
required: false,
|
||||||
|
default: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const treeWidth =
|
const treeWidth =
|
||||||
|
@ -116,7 +121,7 @@ export default {
|
||||||
return this.treeWidth <= TREE_HIDE_STATS_WIDTH;
|
return this.treeWidth <= TREE_HIDE_STATS_WIDTH;
|
||||||
},
|
},
|
||||||
isLimitedContainer() {
|
isLimitedContainer() {
|
||||||
return !this.showTreeList && !this.isParallelView;
|
return !this.showTreeList && !this.isParallelView && !this.isFluidLayout;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|
|
@ -71,6 +71,7 @@ export default function initDiffsApp(store) {
|
||||||
helpPagePath: dataset.helpPagePath,
|
helpPagePath: dataset.helpPagePath,
|
||||||
currentUser: JSON.parse(dataset.currentUserData) || {},
|
currentUser: JSON.parse(dataset.currentUserData) || {},
|
||||||
changesEmptyStateIllustration: dataset.changesEmptyStateIllustration,
|
changesEmptyStateIllustration: dataset.changesEmptyStateIllustration,
|
||||||
|
isFluidLayout: parseBoolean(dataset.isFluidLayout),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -97,6 +98,7 @@ export default function initDiffsApp(store) {
|
||||||
helpPagePath: this.helpPagePath,
|
helpPagePath: this.helpPagePath,
|
||||||
shouldShow: this.activeTab === 'diffs',
|
shouldShow: this.activeTab === 'diffs',
|
||||||
changesEmptyStateIllustration: this.changesEmptyStateIllustration,
|
changesEmptyStateIllustration: this.changesEmptyStateIllustration,
|
||||||
|
isFluidLayout: this.isFluidLayout,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -82,7 +82,8 @@
|
||||||
help_page_path: suggest_changes_help_path,
|
help_page_path: suggest_changes_help_path,
|
||||||
current_user_data: UserSerializer.new(project: @project).represent(current_user, {}, MergeRequestUserEntity).to_json,
|
current_user_data: UserSerializer.new(project: @project).represent(current_user, {}, MergeRequestUserEntity).to_json,
|
||||||
project_path: project_path(@merge_request.project),
|
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
|
.mr-loading-status
|
||||||
= spinner
|
= spinner
|
||||||
|
|
|
@ -75,6 +75,14 @@ describe('diffs/components/app', () => {
|
||||||
expect(wrapper.contains('.container-limited.limit-container-width')).toBe(false);
|
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', () => {
|
it('displays loading icon on loading', () => {
|
||||||
createComponent({}, ({ state }) => {
|
createComponent({}, ({ state }) => {
|
||||||
state.diffs.isLoading = true;
|
state.diffs.isLoading = true;
|
||||||
|
|
Loading…
Reference in New Issue