BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
e83a4a2b
Commit
e83a4a2b
authored
May 09, 2018
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch 'fix-ide-empty-editor' into 'master'
Fixed empty editors in the IDE Closes #46153 See merge request gitlab-org/gitlab-ce!18842
parent
0523cf83
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
3 deletions
+25
-3
model.js
app/assets/javascripts/ide/lib/common/model.js
+3
-3
file.js
app/assets/javascripts/ide/stores/actions/file.js
+2
-0
model_spec.js
spec/javascripts/ide/lib/common/model_spec.js
+4
-0
file_spec.js
spec/javascripts/ide/stores/actions/file_spec.js
+16
-0
No files found.
app/assets/javascripts/ide/lib/common/model.js
View file @
e83a4a2b
...
...
@@ -14,12 +14,12 @@ export default class Model {
(
this
.
originalModel
=
this
.
monaco
.
editor
.
createModel
(
head
?
head
.
content
:
this
.
file
.
raw
,
undefined
,
new
this
.
monaco
.
Uri
(
null
,
null
,
`original/
${
this
.
file
.
key
}
`
),
new
this
.
monaco
.
Uri
(
null
,
null
,
`original/
${
this
.
path
}
`
),
)),
(
this
.
model
=
this
.
monaco
.
editor
.
createModel
(
this
.
content
,
undefined
,
new
this
.
monaco
.
Uri
(
null
,
null
,
this
.
file
.
key
),
new
this
.
monaco
.
Uri
(
null
,
null
,
this
.
path
),
)),
);
if
(
this
.
file
.
mrChange
)
{
...
...
@@ -27,7 +27,7 @@ export default class Model {
(
this
.
baseModel
=
this
.
monaco
.
editor
.
createModel
(
this
.
file
.
baseRaw
,
undefined
,
new
this
.
monaco
.
Uri
(
null
,
null
,
`target/
${
this
.
file
.
path
}
`
),
new
this
.
monaco
.
Uri
(
null
,
null
,
`target/
${
this
.
path
}
`
),
)),
);
}
...
...
app/assets/javascripts/ide/stores/actions/file.js
View file @
e83a4a2b
...
...
@@ -196,6 +196,8 @@ export const unstageChange = ({ commit }, path) => {
};
export
const
openPendingTab
=
({
commit
,
getters
,
dispatch
,
state
},
{
file
,
keyPrefix
})
=>
{
if
(
getters
.
activeFile
&&
getters
.
activeFile
.
key
===
`
${
keyPrefix
}
-
${
file
.
key
}
`
)
return
false
;
state
.
openFiles
.
forEach
(
f
=>
eventHub
.
$emit
(
`editor.update.model.dispose.
${
f
.
key
}
`
));
commit
(
types
.
ADD_PENDING_TAB
,
{
file
,
keyPrefix
});
...
...
spec/javascripts/ide/lib/common/model_spec.js
View file @
e83a4a2b
...
...
@@ -28,6 +28,10 @@ describe('Multi-file editor library model', () => {
expect
(
model
.
originalModel
).
not
.
toBeNull
();
expect
(
model
.
model
).
not
.
toBeNull
();
expect
(
model
.
baseModel
).
not
.
toBeNull
();
expect
(
model
.
originalModel
.
uri
.
path
).
toBe
(
'original/path--path'
);
expect
(
model
.
model
.
uri
.
path
).
toBe
(
'path--path'
);
expect
(
model
.
baseModel
.
uri
.
path
).
toBe
(
'target/path--path'
);
});
it
(
'creates model with head file to compare against'
,
()
=>
{
...
...
spec/javascripts/ide/stores/actions/file_spec.js
View file @
e83a4a2b
...
...
@@ -569,6 +569,22 @@ describe('IDE store file actions', () => {
.
catch
(
done
.
fail
);
});
it
(
'returns false when already opened'
,
done
=>
{
store
.
state
.
openFiles
.
push
({
...
f
,
active
:
true
,
key
:
`pending-
${
f
.
key
}
`
,
});
store
.
dispatch
(
'openPendingTab'
,
{
file
:
f
,
keyPrefix
:
'pending'
})
.
then
(
added
=>
{
expect
(
added
).
toBe
(
false
);
})
.
then
(
done
)
.
catch
(
done
.
fail
);
});
it
(
'pushes router URL when added'
,
done
=>
{
store
.
state
.
currentBranchId
=
'master'
;
...
...
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