Commit aee1b3f3 authored by Martin Wortschack's avatar Martin Wortschack

Merge branch 'cwoolley-commit-sidebar-actions-fix' into 'master'

Web IDE commit sidebar should preserve action

Closes #212276

See merge request gitlab-org/gitlab!27876
parents b120d2da 5dee6983
...@@ -36,7 +36,9 @@ export default { ...@@ -36,7 +36,9 @@ export default {
}, },
}, },
mounted() { mounted() {
if (!this.commitAction) {
this.updateSelectedCommitAction(); this.updateSelectedCommitAction();
}
}, },
methods: { methods: {
...mapCommitActions(['updateCommitAction']), ...mapCommitActions(['updateCommitAction']),
......
export default () => ({ export default () => ({
commitMessage: '', commitMessage: '',
commitAction: '1', commitAction: null,
newBranchName: '', newBranchName: '',
submitCommitLoading: false, submitCommitLoading: false,
shouldCreateMR: true, shouldCreateMR: true,
......
...@@ -85,6 +85,13 @@ describe('IDE commit sidebar actions', () => { ...@@ -85,6 +85,13 @@ describe('IDE commit sidebar actions', () => {
expect(vm.$store.dispatch).not.toHaveBeenCalled(); expect(vm.$store.dispatch).not.toHaveBeenCalled();
}); });
it('is not called on mount if there is already a selected commitAction', () => {
store.state.commitAction = '1';
createComponent({ currentBranchId: null });
expect(vm.$store.dispatch).not.toHaveBeenCalled();
});
it('calls again after staged changes', done => { it('calls again after staged changes', done => {
createComponent({ currentBranchId: null }); createComponent({ currentBranchId: null });
......
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