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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
ac8895b7
Commit
ac8895b7
authored
Nov 20, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Open first 10 merge request files in IDE
Closes
https://gitlab.com/gitlab-org/gitlab-ce/issues/51635
parent
117fb448
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
2 deletions
+12
-2
app/assets/javascripts/ide/stores/actions/file.js
app/assets/javascripts/ide/stores/actions/file.js
+5
-2
app/assets/javascripts/ide/stores/actions/merge_request.js
app/assets/javascripts/ide/stores/actions/merge_request.js
+1
-0
changelogs/unreleased/ide-open-all-mr-files.yml
changelogs/unreleased/ide-open-all-mr-files.yml
+5
-0
spec/javascripts/ide/stores/actions/merge_request_spec.js
spec/javascripts/ide/stores/actions/merge_request_spec.js
+1
-0
No files found.
app/assets/javascripts/ide/stores/actions/file.js
View file @
ac8895b7
...
@@ -56,7 +56,10 @@ export const setFileActive = ({ commit, state, getters, dispatch }, path) => {
...
@@ -56,7 +56,10 @@ export const setFileActive = ({ commit, state, getters, dispatch }, path) => {
dispatch
(
'
scrollToTab
'
);
dispatch
(
'
scrollToTab
'
);
};
};
export
const
getFileData
=
({
state
,
commit
,
dispatch
},
{
path
,
makeFileActive
=
true
})
=>
{
export
const
getFileData
=
(
{
state
,
commit
,
dispatch
},
{
path
,
makeFileActive
=
true
,
openFile
=
makeFileActive
},
)
=>
{
const
file
=
state
.
entries
[
path
];
const
file
=
state
.
entries
[
path
];
if
(
file
.
raw
||
(
file
.
tempFile
&&
!
file
.
prevPath
))
return
Promise
.
resolve
();
if
(
file
.
raw
||
(
file
.
tempFile
&&
!
file
.
prevPath
))
return
Promise
.
resolve
();
...
@@ -72,7 +75,7 @@ export const getFileData = ({ state, commit, dispatch }, { path, makeFileActive
...
@@ -72,7 +75,7 @@ export const getFileData = ({ state, commit, dispatch }, { path, makeFileActive
setPageTitle
(
decodeURI
(
normalizedHeaders
[
'
PAGE-TITLE
'
]));
setPageTitle
(
decodeURI
(
normalizedHeaders
[
'
PAGE-TITLE
'
]));
commit
(
types
.
SET_FILE_DATA
,
{
data
,
file
});
commit
(
types
.
SET_FILE_DATA
,
{
data
,
file
});
if
(
makeFileActiv
e
)
commit
(
types
.
TOGGLE_FILE_OPEN
,
path
);
if
(
openFil
e
)
commit
(
types
.
TOGGLE_FILE_OPEN
,
path
);
if
(
makeFileActive
)
dispatch
(
'
setFileActive
'
,
path
);
if
(
makeFileActive
)
dispatch
(
'
setFileActive
'
,
path
);
commit
(
types
.
TOGGLE_LOADING
,
{
entry
:
file
});
commit
(
types
.
TOGGLE_LOADING
,
{
entry
:
file
});
})
})
...
...
app/assets/javascripts/ide/stores/actions/merge_request.js
View file @
ac8895b7
...
@@ -161,6 +161,7 @@ export const openMergeRequest = (
...
@@ -161,6 +161,7 @@ export const openMergeRequest = (
dispatch
(
'
getFileData
'
,
{
dispatch
(
'
getFileData
'
,
{
path
:
change
.
new_path
,
path
:
change
.
new_path
,
makeFileActive
:
ind
===
0
,
makeFileActive
:
ind
===
0
,
openFile
:
true
,
});
});
}
}
}
}
...
...
changelogs/unreleased/ide-open-all-mr-files.yml
0 → 100644
View file @
ac8895b7
---
title
:
Open first 10 merge request files in IDE
merge_request
:
author
:
type
:
fixed
spec/javascripts/ide/stores/actions/merge_request_spec.js
View file @
ac8895b7
...
@@ -321,6 +321,7 @@ describe('IDE store merge request actions', () => {
...
@@ -321,6 +321,7 @@ describe('IDE store merge request actions', () => {
expect
(
store
.
dispatch
).
toHaveBeenCalledWith
(
'
getFileData
'
,
{
expect
(
store
.
dispatch
).
toHaveBeenCalledWith
(
'
getFileData
'
,
{
path
:
change
.
new_path
,
path
:
change
.
new_path
,
makeFileActive
:
i
===
0
,
makeFileActive
:
i
===
0
,
openFile
:
true
,
});
});
});
});
})
})
...
...
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