Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cf22366d
Commit
cf22366d
authored
Jun 12, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Resets state correctly when switching to merge request in IDE
Closes #47763
parent
35f1455a
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
9 deletions
+50
-9
app/assets/javascripts/ide/components/repo_editor.vue
app/assets/javascripts/ide/components/repo_editor.vue
+10
-1
app/assets/javascripts/ide/stores/modules/merge_requests/actions.js
.../javascripts/ide/stores/modules/merge_requests/actions.js
+2
-1
app/assets/javascripts/ide/stores/modules/pipelines/actions.js
...ssets/javascripts/ide/stores/modules/pipelines/actions.js
+3
-1
spec/javascripts/ide/components/repo_editor_spec.js
spec/javascripts/ide/components/repo_editor_spec.js
+11
-0
spec/javascripts/ide/stores/modules/merge_requests/actions_spec.js
...scripts/ide/stores/modules/merge_requests/actions_spec.js
+7
-6
spec/javascripts/ide/stores/modules/pipelines/actions_spec.js
.../javascripts/ide/stores/modules/pipelines/actions_spec.js
+17
-0
No files found.
app/assets/javascripts/ide/components/repo_editor.vue
View file @
cf22366d
...
...
@@ -18,7 +18,13 @@ export default {
},
},
computed
:
{
...
mapState
([
'
rightPanelCollapsed
'
,
'
viewer
'
,
'
panelResizing
'
,
'
currentActivityView
'
]),
...
mapState
([
'
rightPanelCollapsed
'
,
'
viewer
'
,
'
panelResizing
'
,
'
currentActivityView
'
,
'
rightPane
'
,
]),
...
mapGetters
([
'
currentMergeRequest
'
,
'
getStagedFile
'
,
...
...
@@ -77,6 +83,9 @@ export default {
this
.
editor
.
updateDimensions
();
}
},
rightPane
()
{
this
.
editor
.
updateDimensions
();
},
},
beforeDestroy
()
{
this
.
editor
.
dispose
();
...
...
app/assets/javascripts/ide/stores/modules/merge_requests/actions.js
View file @
cf22366d
...
...
@@ -31,15 +31,16 @@ export const openMergeRequest = ({ commit, dispatch }, { projectPath, id }) => {
commit
(
rootTypes
.
CLEAR_PROJECTS
,
null
,
{
root
:
true
});
commit
(
rootTypes
.
SET_CURRENT_MERGE_REQUEST
,
`
${
id
}
`
,
{
root
:
true
});
commit
(
rootTypes
.
RESET_OPEN_FILES
,
null
,
{
root
:
true
});
dispatch
(
'
pipelines/resetLatestPipeline
'
,
null
,
{
root
:
true
});
dispatch
(
'
setCurrentBranchId
'
,
''
,
{
root
:
true
});
dispatch
(
'
pipelines/stopPipelinePolling
'
,
null
,
{
root
:
true
})
.
then
(()
=>
{
dispatch
(
'
pipelines/resetLatestPipeline
'
,
null
,
{
root
:
true
});
dispatch
(
'
pipelines/clearEtagPoll
'
,
null
,
{
root
:
true
});
})
.
catch
(
e
=>
{
throw
e
;
});
dispatch
(
'
setRightPane
'
,
null
,
{
root
:
true
});
router
.
push
(
`/project/
${
projectPath
}
/merge_requests/
${
id
}
`
);
};
...
...
app/assets/javascripts/ide/stores/modules/pipelines/actions.js
View file @
cf22366d
...
...
@@ -106,7 +106,9 @@ export const fetchJobTrace = ({ dispatch, state }) => {
.
catch
(()
=>
dispatch
(
'
receiveJobTraceError
'
));
};
export
const
resetLatestPipeline
=
({
commit
})
=>
export
const
resetLatestPipeline
=
({
commit
})
=>
{
commit
(
types
.
RECEIVE_LASTEST_PIPELINE_SUCCESS
,
null
);
commit
(
types
.
SET_DETAIL_JOB
,
null
);
};
export
default
()
=>
{};
spec/javascripts/ide/components/repo_editor_spec.js
View file @
cf22366d
...
...
@@ -315,6 +315,17 @@ describe('RepoEditor', () => {
done
();
});
});
it
(
'
calls updateDimensions when rightPane is updated
'
,
done
=>
{
vm
.
$store
.
state
.
rightPane
=
'
testing
'
;
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
editor
.
updateDimensions
).
toHaveBeenCalled
();
expect
(
vm
.
editor
.
updateDiffView
).
toHaveBeenCalled
();
done
();
});
});
});
describe
(
'
show tabs
'
,
()
=>
{
...
...
spec/javascripts/ide/stores/modules/merge_requests/actions_spec.js
View file @
cf22366d
...
...
@@ -208,18 +208,19 @@ describe('IDE merge requests actions', () => {
expect
(
commit
.
calls
.
argsFor
(
1
)).
toEqual
([
'
SET_CURRENT_MERGE_REQUEST
'
,
'
1
'
,
{
root
:
true
}]);
expect
(
commit
.
calls
.
argsFor
(
2
)).
toEqual
([
'
RESET_OPEN_FILES
'
,
null
,
{
root
:
true
}]);
expect
(
dispatch
.
calls
.
argsFor
(
0
)).
toEqual
([
'
pipelines/resetLatestPipeline
'
,
expect
(
dispatch
.
calls
.
argsFor
(
0
)).
toEqual
([
'
setCurrentBranchId
'
,
''
,
{
root
:
true
}]);
expect
(
dispatch
.
calls
.
argsFor
(
1
)).
toEqual
([
'
pipelines/stopPipelinePolling
'
,
null
,
{
root
:
true
},
]);
expect
(
dispatch
.
calls
.
argsFor
(
1
)).
toEqual
([
'
setCurrentBranchId
'
,
''
,
{
root
:
true
}]);
expect
(
dispatch
.
calls
.
argsFor
(
2
)).
toEqual
([
'
pipelines/
stopPipelinePolling
'
,
expect
(
dispatch
.
calls
.
argsFor
(
2
)).
toEqual
([
'
setRightPane
'
,
null
,
{
root
:
true
}]);
expect
(
dispatch
.
calls
.
argsFor
(
3
)).
toEqual
([
'
pipelines/
resetLatestPipeline
'
,
null
,
{
root
:
true
},
]);
expect
(
dispatch
.
calls
.
argsFor
(
3
)).
toEqual
([
expect
(
dispatch
.
calls
.
argsFor
(
4
)).
toEqual
([
'
pipelines/clearEtagPoll
'
,
null
,
{
root
:
true
},
...
...
spec/javascripts/ide/stores/modules/pipelines/actions_spec.js
View file @
cf22366d
...
...
@@ -18,6 +18,7 @@ import actions, {
receiveJobTraceError
,
receiveJobTraceSuccess
,
fetchJobTrace
,
resetLatestPipeline
,
}
from
'
~/ide/stores/modules/pipelines/actions
'
;
import
state
from
'
~/ide/stores/modules/pipelines/state
'
;
import
*
as
types
from
'
~/ide/stores/modules/pipelines/mutation_types
'
;
...
...
@@ -416,4 +417,20 @@ describe('IDE pipelines actions', () => {
});
});
});
describe
(
'
resetLatestPipeline
'
,
()
=>
{
it
(
'
commits reset mutations
'
,
done
=>
{
testAction
(
resetLatestPipeline
,
null
,
mockedState
,
[
{
type
:
types
.
RECEIVE_LASTEST_PIPELINE_SUCCESS
,
payload
:
null
},
{
type
:
types
.
SET_DETAIL_JOB
,
payload
:
null
},
],
[],
done
,
);
});
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment