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
Boxiang Sun
gitlab-ce
Commits
a769e1ed
Commit
a769e1ed
authored
6 years ago
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed none merge request files not being openable in the web IDE
parent
f667bbce
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
2 deletions
+27
-2
app/assets/javascripts/ide/components/repo_editor.vue
app/assets/javascripts/ide/components/repo_editor.vue
+1
-1
app/assets/javascripts/ide/stores/utils.js
app/assets/javascripts/ide/stores/utils.js
+1
-0
spec/javascripts/ide/components/repo_editor_spec.js
spec/javascripts/ide/components/repo_editor_spec.js
+25
-1
No files found.
app/assets/javascripts/ide/components/repo_editor.vue
View file @
a769e1ed
...
...
@@ -140,7 +140,7 @@ export default {
this
.
file
.
staged
&&
this
.
file
.
key
.
indexOf
(
'
unstaged-
'
)
===
0
?
head
:
null
,
);
if
(
this
.
viewer
===
viewerTypes
.
mr
)
{
if
(
this
.
viewer
===
viewerTypes
.
mr
&&
this
.
file
.
mrChange
)
{
this
.
editor
.
attachMergeRequestModel
(
this
.
model
);
}
else
{
this
.
editor
.
attachModel
(
this
.
model
);
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/ide/stores/utils.js
View file @
a769e1ed
...
...
@@ -44,6 +44,7 @@ export const dataStructure = () => ({
size
:
0
,
parentPath
:
null
,
lastOpenedAt
:
0
,
mrChange
:
null
,
});
export
const
decorateData
=
entity
=>
{
...
...
This diff is collapsed.
Click to expand it.
spec/javascripts/ide/components/repo_editor_spec.js
View file @
a769e1ed
...
...
@@ -24,7 +24,7 @@ describe('RepoEditor', () => {
f
.
active
=
true
;
f
.
tempFile
=
true
;
vm
.
$store
.
state
.
openFiles
.
push
(
f
);
vm
.
$store
.
state
.
entries
[
f
.
path
]
=
f
;
Vue
.
set
(
vm
.
$store
.
state
.
entries
,
f
.
path
,
f
)
;
vm
.
monaco
=
true
;
vm
.
$mount
();
...
...
@@ -215,6 +215,30 @@ describe('RepoEditor', () => {
expect
(
vm
.
editor
.
attachModel
).
toHaveBeenCalledWith
(
vm
.
model
);
});
it
(
'
attaches model to merge request editor
'
,
()
=>
{
vm
.
$store
.
state
.
viewer
=
'
mrdiff
'
;
vm
.
file
.
mrChange
=
true
;
spyOn
(
vm
.
editor
,
'
attachMergeRequestModel
'
);
Editor
.
editorInstance
.
modelManager
.
dispose
();
vm
.
setupEditor
();
expect
(
vm
.
editor
.
attachMergeRequestModel
).
toHaveBeenCalledWith
(
vm
.
model
);
});
it
(
'
does not attach model to merge request editor when not a MR change
'
,
()
=>
{
vm
.
$store
.
state
.
viewer
=
'
mrdiff
'
;
vm
.
file
.
mrChange
=
false
;
spyOn
(
vm
.
editor
,
'
attachMergeRequestModel
'
);
Editor
.
editorInstance
.
modelManager
.
dispose
();
vm
.
setupEditor
();
expect
(
vm
.
editor
.
attachMergeRequestModel
).
not
.
toHaveBeenCalledWith
(
vm
.
model
);
});
it
(
'
adds callback methods
'
,
()
=>
{
spyOn
(
vm
.
editor
,
'
onPositionChange
'
).
and
.
callThrough
();
...
...
This diff is collapsed.
Click to expand it.
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