Commit 8fde2b45 authored by Illya Klymov's avatar Illya Klymov

Merge branch 'fe-ide-clean-resiable-panel' into 'master'

Remove unused collapsible props from IDE

See merge request gitlab-org/gitlab!31950
parents 1bf90917 519b20ab
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
</script> </script>
<template> <template>
<resizable-panel :collapsible="false" :initial-width="340" side="left" class="flex-column"> <resizable-panel :initial-width="340" side="left" class="flex-column">
<template v-if="loading"> <template v-if="loading">
<div class="multi-file-commit-panel-inner"> <div class="multi-file-commit-panel-inner">
<div v-for="n in 3" :key="n" class="multi-file-loading-container"> <div v-for="n in 3" :key="n" class="multi-file-loading-container">
......
...@@ -103,7 +103,6 @@ export default { ...@@ -103,7 +103,6 @@ export default {
> >
<resizable-panel <resizable-panel
v-show="isOpen" v-show="isOpen"
:collapsible="false"
:initial-width="width" :initial-width="width"
:min-size="width" :min-size="width"
:class="`ide-${side}-sidebar-${currentView}`" :class="`ide-${side}-sidebar-${currentView}`"
......
...@@ -17,13 +17,7 @@ export default { ...@@ -17,13 +17,7 @@ export default {
tooltip, tooltip,
}, },
computed: { computed: {
...mapState([ ...mapState(['changedFiles', 'stagedFiles', 'lastCommitMsg', 'unusedSeal']),
'changedFiles',
'stagedFiles',
'rightPanelCollapsed',
'lastCommitMsg',
'unusedSeal',
]),
...mapState('commit', ['commitMessage', 'submitCommitLoading']), ...mapState('commit', ['commitMessage', 'submitCommitLoading']),
...mapGetters(['lastOpenedFile', 'hasChanges', 'someUncommittedChanges', 'activeFile']), ...mapGetters(['lastOpenedFile', 'hasChanges', 'someUncommittedChanges', 'activeFile']),
...mapGetters('commit', ['discardDraftButtonDisabled']), ...mapGetters('commit', ['discardDraftButtonDisabled']),
......
...@@ -31,7 +31,6 @@ export default { ...@@ -31,7 +31,6 @@ export default {
rightPaneIsOpen: 'isOpen', rightPaneIsOpen: 'isOpen',
}), }),
...mapState([ ...mapState([
'rightPanelCollapsed',
'viewer', 'viewer',
'panelResizing', 'panelResizing',
'currentActivityView', 'currentActivityView',
...@@ -118,9 +117,6 @@ export default { ...@@ -118,9 +117,6 @@ export default {
}); });
} }
}, },
rightPanelCollapsed() {
this.refreshEditorDimensions();
},
viewer() { viewer() {
if (!this.file.pending) { if (!this.file.pending) {
this.createEditorInstance(); this.createEditorInstance();
......
<script> <script>
import { mapActions, mapState } from 'vuex'; import { mapActions } from 'vuex';
import PanelResizer from '~/vue_shared/components/panel_resizer.vue'; import PanelResizer from '~/vue_shared/components/panel_resizer.vue';
export default { export default {
...@@ -7,10 +7,6 @@ export default { ...@@ -7,10 +7,6 @@ export default {
PanelResizer, PanelResizer,
}, },
props: { props: {
collapsible: {
type: Boolean,
required: true,
},
initialWidth: { initialWidth: {
type: Number, type: Number,
required: true, required: true,
...@@ -31,11 +27,6 @@ export default { ...@@ -31,11 +27,6 @@ export default {
}; };
}, },
computed: { computed: {
...mapState({
collapsed(state) {
return state[`${this.side}PanelCollapsed`];
},
}),
panelStyle() { panelStyle() {
if (!this.collapsed) { if (!this.collapsed) {
return { return {
...@@ -47,33 +38,17 @@ export default { ...@@ -47,33 +38,17 @@ export default {
}, },
}, },
methods: { methods: {
...mapActions(['setPanelCollapsedStatus', 'setResizingStatus']), ...mapActions(['setResizingStatus']),
toggleFullbarCollapsed() {
if (this.collapsed && this.collapsible) {
this.setPanelCollapsedStatus({
side: this.side,
collapsed: !this.collapsed,
});
}
},
}, },
maxSize: window.innerWidth / 2, maxSize: window.innerWidth / 2,
}; };
</script> </script>
<template> <template>
<div <div :style="panelStyle" class="multi-file-commit-panel">
:class="{
'is-collapsed': collapsed && collapsible,
}"
:style="panelStyle"
class="multi-file-commit-panel"
@click="toggleFullbarCollapsed"
>
<slot></slot> <slot></slot>
<panel-resizer <panel-resizer
:size.sync="width" :size.sync="width"
:enabled="!collapsed"
:start-size="initialWidth" :start-size="initialWidth"
:min-size="minSize" :min-size="minSize"
:max-size="$options.maxSize" :max-size="$options.maxSize"
......
...@@ -24,14 +24,6 @@ export const closeAllFiles = ({ state, dispatch }) => { ...@@ -24,14 +24,6 @@ export const closeAllFiles = ({ state, dispatch }) => {
state.openFiles.forEach(file => dispatch('closeFile', file)); state.openFiles.forEach(file => dispatch('closeFile', file));
}; };
export const setPanelCollapsedStatus = ({ commit }, { side, collapsed }) => {
if (side === 'left') {
commit(types.SET_LEFT_PANEL_COLLAPSED, collapsed);
} else {
commit(types.SET_RIGHT_PANEL_COLLAPSED, collapsed);
}
};
export const setResizingStatus = ({ commit }, resizing) => { export const setResizingStatus = ({ commit }, resizing) => {
commit(types.SET_RESIZING_STATUS, resizing); commit(types.SET_RESIZING_STATUS, resizing);
}; };
......
...@@ -2,8 +2,6 @@ export const SET_INITIAL_DATA = 'SET_INITIAL_DATA'; ...@@ -2,8 +2,6 @@ export const SET_INITIAL_DATA = 'SET_INITIAL_DATA';
export const TOGGLE_LOADING = 'TOGGLE_LOADING'; export const TOGGLE_LOADING = 'TOGGLE_LOADING';
export const SET_LAST_COMMIT_DATA = 'SET_LAST_COMMIT_DATA'; export const SET_LAST_COMMIT_DATA = 'SET_LAST_COMMIT_DATA';
export const SET_LAST_COMMIT_MSG = 'SET_LAST_COMMIT_MSG'; export const SET_LAST_COMMIT_MSG = 'SET_LAST_COMMIT_MSG';
export const SET_LEFT_PANEL_COLLAPSED = 'SET_LEFT_PANEL_COLLAPSED';
export const SET_RIGHT_PANEL_COLLAPSED = 'SET_RIGHT_PANEL_COLLAPSED';
export const SET_RESIZING_STATUS = 'SET_RESIZING_STATUS'; export const SET_RESIZING_STATUS = 'SET_RESIZING_STATUS';
export const SET_EMPTY_STATE_SVGS = 'SET_EMPTY_STATE_SVGS'; export const SET_EMPTY_STATE_SVGS = 'SET_EMPTY_STATE_SVGS';
export const SET_LINKS = 'SET_LINKS'; export const SET_LINKS = 'SET_LINKS';
......
...@@ -29,16 +29,6 @@ export default { ...@@ -29,16 +29,6 @@ export default {
}); });
} }
}, },
[types.SET_LEFT_PANEL_COLLAPSED](state, collapsed) {
Object.assign(state, {
leftPanelCollapsed: collapsed,
});
},
[types.SET_RIGHT_PANEL_COLLAPSED](state, collapsed) {
Object.assign(state, {
rightPanelCollapsed: collapsed,
});
},
[types.SET_RESIZING_STATUS](state, resizing) { [types.SET_RESIZING_STATUS](state, resizing) {
Object.assign(state, { Object.assign(state, {
panelResizing: resizing, panelResizing: resizing,
......
...@@ -15,8 +15,6 @@ export default () => ({ ...@@ -15,8 +15,6 @@ export default () => ({
parentTreeUrl: '', parentTreeUrl: '',
trees: {}, trees: {},
projects: {}, projects: {},
leftPanelCollapsed: false,
rightPanelCollapsed: false,
panelResizing: false, panelResizing: false,
entries: {}, entries: {},
viewer: viewerTypes.edit, viewer: viewerTypes.edit,
......
...@@ -21,8 +21,6 @@ describe('Multi-file editor commit sidebar list', () => { ...@@ -21,8 +21,6 @@ describe('Multi-file editor commit sidebar list', () => {
keyPrefix: 'staged', keyPrefix: 'staged',
}); });
vm.$store.state.rightPanelCollapsed = false;
vm.$mount(); vm.$mount();
}); });
......
...@@ -36,7 +36,6 @@ describe('RepoCommitSection', () => { ...@@ -36,7 +36,6 @@ describe('RepoCommitSection', () => {
}), }),
); );
store.state.rightPanelCollapsed = false;
store.state.currentBranch = 'master'; store.state.currentBranch = 'master';
store.state.changedFiles = []; store.state.changedFiles = [];
store.state.stagedFiles = [{ ...files[0] }, { ...files[1] }]; store.state.stagedFiles = [{ ...files[0] }, { ...files[1] }];
......
...@@ -55,30 +55,6 @@ describe('Multi-file store mutations', () => { ...@@ -55,30 +55,6 @@ describe('Multi-file store mutations', () => {
}); });
}); });
describe('SET_LEFT_PANEL_COLLAPSED', () => {
it('sets left panel collapsed', () => {
mutations.SET_LEFT_PANEL_COLLAPSED(localState, true);
expect(localState.leftPanelCollapsed).toBeTruthy();
mutations.SET_LEFT_PANEL_COLLAPSED(localState, false);
expect(localState.leftPanelCollapsed).toBeFalsy();
});
});
describe('SET_RIGHT_PANEL_COLLAPSED', () => {
it('sets right panel collapsed', () => {
mutations.SET_RIGHT_PANEL_COLLAPSED(localState, true);
expect(localState.rightPanelCollapsed).toBeTruthy();
mutations.SET_RIGHT_PANEL_COLLAPSED(localState, false);
expect(localState.rightPanelCollapsed).toBeFalsy();
});
});
describe('CLEAR_STAGED_CHANGES', () => { describe('CLEAR_STAGED_CHANGES', () => {
it('clears stagedFiles array', () => { it('clears stagedFiles array', () => {
localState.stagedFiles.push('a'); localState.stagedFiles.push('a');
......
...@@ -62,11 +62,6 @@ describe('RepoEditor', () => { ...@@ -62,11 +62,6 @@ describe('RepoEditor', () => {
}); });
const findEditor = () => vm.$el.querySelector('.multi-file-editor-holder'); const findEditor = () => vm.$el.querySelector('.multi-file-editor-holder');
const changeRightPanelCollapsed = () => {
const { state } = vm.$store;
state.rightPanelCollapsed = !state.rightPanelCollapsed;
};
it('sets renderWhitespace to `all`', () => { it('sets renderWhitespace to `all`', () => {
vm.$store.state.renderWhitespaceInCode = true; vm.$store.state.renderWhitespaceInCode = true;
...@@ -319,17 +314,6 @@ describe('RepoEditor', () => { ...@@ -319,17 +314,6 @@ describe('RepoEditor', () => {
spyOn(vm.editor, 'updateDiffView'); spyOn(vm.editor, 'updateDiffView');
}); });
it('calls updateDimensions when rightPanelCollapsed is changed', done => {
changeRightPanelCollapsed();
vm.$nextTick(() => {
expect(vm.editor.updateDimensions).toHaveBeenCalled();
expect(vm.editor.updateDiffView).toHaveBeenCalled();
done();
});
});
it('calls updateDimensions when panelResizing is false', done => { it('calls updateDimensions when panelResizing is false', done => {
vm.$store.state.panelResizing = true; vm.$store.state.panelResizing = true;
...@@ -407,17 +391,6 @@ describe('RepoEditor', () => { ...@@ -407,17 +391,6 @@ describe('RepoEditor', () => {
expect(findEditor()).toHaveCss({ display: 'none' }); expect(findEditor()).toHaveCss({ display: 'none' });
}); });
it('should not update dimensions', done => {
changeRightPanelCollapsed();
vm.$nextTick()
.then(() => {
expect(vm.editor.updateDimensions).not.toHaveBeenCalled();
})
.then(done)
.catch(done.fail);
});
describe('when file view mode changes to editor', () => { describe('when file view mode changes to editor', () => {
beforeEach(done => { beforeEach(done => {
vm.file.viewMode = FILE_VIEW_MODE_EDITOR; vm.file.viewMode = FILE_VIEW_MODE_EDITOR;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment