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
d5a24021
Commit
d5a24021
authored
Nov 21, 2018
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "Merge branch 'ide-open-all-mr-files' into 'master'"
This reverts merge request !23234
parent
5ba820ad
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
40 deletions
+6
-40
app/assets/javascripts/ide/stores/actions/file.js
app/assets/javascripts/ide/stores/actions/file.js
+3
-6
app/assets/javascripts/ide/stores/actions/merge_request.js
app/assets/javascripts/ide/stores/actions/merge_request.js
+0
-1
changelogs/unreleased/ide-open-all-mr-files.yml
changelogs/unreleased/ide-open-all-mr-files.yml
+0
-5
spec/javascripts/ide/stores/actions/merge_request_spec.js
spec/javascripts/ide/stores/actions/merge_request_spec.js
+3
-28
No files found.
app/assets/javascripts/ide/stores/actions/file.js
View file @
d5a24021
...
@@ -56,10 +56,7 @@ export const setFileActive = ({ commit, state, getters, dispatch }, path) => {
...
@@ -56,10 +56,7 @@ export const setFileActive = ({ commit, state, getters, dispatch }, path) => {
dispatch
(
'
scrollToTab
'
);
dispatch
(
'
scrollToTab
'
);
};
};
export
const
getFileData
=
(
export
const
getFileData
=
({
state
,
commit
,
dispatch
},
{
path
,
makeFileActive
=
true
})
=>
{
{
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
();
...
@@ -74,8 +71,8 @@ export const getFileData = (
...
@@ -74,8 +71,8 @@ export const getFileData = (
const
normalizedHeaders
=
normalizeHeaders
(
headers
);
const
normalizedHeaders
=
normalizeHeaders
(
headers
);
setPageTitle
(
decodeURI
(
normalizedHeaders
[
'
PAGE-TITLE
'
]));
setPageTitle
(
decodeURI
(
normalizedHeaders
[
'
PAGE-TITLE
'
]));
if
(
data
)
commit
(
types
.
SET_FILE_DATA
,
{
data
,
file
});
commit
(
types
.
SET_FILE_DATA
,
{
data
,
file
});
if
(
openFil
e
)
commit
(
types
.
TOGGLE_FILE_OPEN
,
path
);
if
(
makeFileActiv
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 @
d5a24021
...
@@ -161,7 +161,6 @@ export const openMergeRequest = (
...
@@ -161,7 +161,6 @@ 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
deleted
100644 → 0
View file @
5ba820ad
---
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 @
d5a24021
...
@@ -262,28 +262,16 @@ describe('IDE store merge request actions', () => {
...
@@ -262,28 +262,16 @@ describe('IDE store merge request actions', () => {
bar
:
{},
bar
:
{},
};
};
const
originalDispatch
=
store
.
dispatch
;
spyOn
(
store
,
'
dispatch
'
).
and
.
callFake
(
type
=>
{
spyOn
(
store
,
'
dispatch
'
).
and
.
callFake
((
type
,
payload
)
=>
{
switch
(
type
)
{
switch
(
type
)
{
case
'
getMergeRequestData
'
:
case
'
getMergeRequestData
'
:
return
Promise
.
resolve
(
testMergeRequest
);
return
Promise
.
resolve
(
testMergeRequest
);
case
'
getMergeRequestChanges
'
:
case
'
getMergeRequestChanges
'
:
return
Promise
.
resolve
(
testMergeRequestChanges
);
return
Promise
.
resolve
(
testMergeRequestChanges
);
case
'
getFiles
'
:
case
'
getMergeRequestVersions
'
:
case
'
getBranchData
'
:
case
'
setFileMrChange
'
:
return
Promise
.
resolve
();
default
:
default
:
return
originalDispatch
(
type
,
payload
);
return
Promise
.
resolve
(
);
}
}
});
});
spyOn
(
service
,
'
getFileData
'
).
and
.
callFake
(()
=>
Promise
.
resolve
({
headers
:
{},
}),
);
});
});
it
(
'
dispatch actions for merge request data
'
,
done
=>
{
it
(
'
dispatch actions for merge request data
'
,
done
=>
{
...
@@ -315,17 +303,7 @@ describe('IDE store merge request actions', () => {
...
@@ -315,17 +303,7 @@ describe('IDE store merge request actions', () => {
});
});
it
(
'
updates activity bar view and gets file data, if changes are found
'
,
done
=>
{
it
(
'
updates activity bar view and gets file data, if changes are found
'
,
done
=>
{
store
.
state
.
entries
.
foo
=
{
testMergeRequestChanges
.
changes
=
[{
new_path
:
'
foo
'
},
{
new_path
:
'
bar
'
}];
url
:
'
test
'
,
};
store
.
state
.
entries
.
bar
=
{
url
:
'
test
'
,
};
testMergeRequestChanges
.
changes
=
[
{
new_path
:
'
foo
'
,
path
:
'
foo
'
},
{
new_path
:
'
bar
'
,
path
:
'
bar
'
},
];
openMergeRequest
(
store
,
mr
)
openMergeRequest
(
store
,
mr
)
.
then
(()
=>
{
.
then
(()
=>
{
...
@@ -343,11 +321,8 @@ describe('IDE store merge request actions', () => {
...
@@ -343,11 +321,8 @@ 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
,
});
});
});
});
expect
(
store
.
state
.
openFiles
.
length
).
toBe
(
testMergeRequestChanges
.
changes
.
length
);
})
})
.
then
(
done
)
.
then
(
done
)
.
catch
(
done
.
fail
);
.
catch
(
done
.
fail
);
...
...
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