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
0fd3fda8
Commit
0fd3fda8
authored
Nov 02, 2017
by
Filipa Lacerda
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'multi-file-editor-binary-editor' into 'master'
Fix binary files not showing anything in edit mode See merge request gitlab-org/gitlab-ce!15124
parents
9b27d754
984f3b7d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
repo_editor.vue
app/assets/javascripts/repo/components/repo_editor.vue
+7
-1
repo_editor_spec.js
spec/javascripts/repo/components/repo_editor_spec.js
+13
-5
No files found.
app/assets/javascripts/repo/components/repo_editor.vue
View file @
0fd3fda8
...
@@ -27,6 +27,8 @@ export default {
...
@@ -27,6 +27,8 @@ export default {
'changeFileContent'
,
'changeFileContent'
,
]),
]),
initMonaco
()
{
initMonaco
()
{
if
(
this
.
shouldHideEditor
)
return
;
if
(
this
.
monacoInstance
)
{
if
(
this
.
monacoInstance
)
{
this
.
monacoInstance
.
setModel
(
null
);
this
.
monacoInstance
.
setModel
(
null
);
}
}
...
@@ -94,8 +96,12 @@ export default {
...
@@ -94,8 +96,12 @@ export default {
<
template
>
<
template
>
<div
<div
id=
"ide"
id=
"ide"
v-if=
'!shouldHideEditor'
class=
"blob-viewer-container blob-editor-container"
class=
"blob-viewer-container blob-editor-container"
>
>
<div
v-if=
"shouldHideEditor"
v-html=
"activeFile.html"
>
</div>
</div>
</div>
</
template
>
</
template
>
spec/javascripts/repo/components/repo_editor_spec.js
View file @
0fd3fda8
...
@@ -17,6 +17,7 @@ describe('RepoEditor', () => {
...
@@ -17,6 +17,7 @@ describe('RepoEditor', () => {
f
.
active
=
true
;
f
.
active
=
true
;
f
.
tempFile
=
true
;
f
.
tempFile
=
true
;
vm
.
$store
.
state
.
openFiles
.
push
(
f
);
vm
.
$store
.
state
.
openFiles
.
push
(
f
);
vm
.
$store
.
getters
.
activeFile
.
html
=
'testing'
;
vm
.
monaco
=
true
;
vm
.
monaco
=
true
;
vm
.
$mount
();
vm
.
$mount
();
...
@@ -31,18 +32,25 @@ describe('RepoEditor', () => {
...
@@ -31,18 +32,25 @@ describe('RepoEditor', () => {
it
(
'renders an ide container'
,
(
done
)
=>
{
it
(
'renders an ide container'
,
(
done
)
=>
{
Vue
.
nextTick
(()
=>
{
Vue
.
nextTick
(()
=>
{
expect
(
vm
.
shouldHideEditor
).
toBeFalsy
();
expect
(
vm
.
shouldHideEditor
).
toBeFalsy
();
expect
(
vm
.
$el
.
textContent
.
trim
()).
toBe
(
''
);
done
();
done
();
});
});
});
});
describe
(
'when open file is binary and not raw'
,
()
=>
{
describe
(
'when open file is binary and not raw'
,
()
=>
{
it
(
'does not render the IDE'
,
(
done
)
=>
{
beforeEach
(
(
done
)
=>
{
vm
.
$store
.
getters
.
activeFile
.
binary
=
true
;
vm
.
$store
.
getters
.
activeFile
.
binary
=
true
;
Vue
.
nextTick
(()
=>
{
Vue
.
nextTick
(
done
);
expect
(
vm
.
shouldHideEditor
).
toBeTruthy
();
});
done
();
});
it
(
'does not render the IDE'
,
()
=>
{
expect
(
vm
.
shouldHideEditor
).
toBeTruthy
();
});
it
(
'shows activeFile html'
,
()
=>
{
expect
(
vm
.
$el
.
textContent
.
trim
()).
toBe
(
'testing'
);
});
});
});
});
});
});
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