Commit 5dee6983 authored by Chad Woolley's avatar Chad Woolley

Web IDE commit sidebar should preserve action

When changing to a different view tab and back,
the Web IDE commit sidebar should preserve
the radio button
which was last selected.
parent 438e0332
...@@ -36,7 +36,9 @@ export default { ...@@ -36,7 +36,9 @@ export default {
}, },
}, },
mounted() { mounted() {
this.updateSelectedCommitAction(); if (!this.commitAction) {
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