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
2dc3d43c
Commit
2dc3d43c
authored
May 01, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
changed which element is hidden
parent
1180b74b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
6 deletions
+48
-6
app/assets/javascripts/ide/components/repo_editor.vue
app/assets/javascripts/ide/components/repo_editor.vue
+21
-6
spec/javascripts/ide/components/repo_editor_spec.js
spec/javascripts/ide/components/repo_editor_spec.js
+27
-0
No files found.
app/assets/javascripts/ide/components/repo_editor.vue
View file @
2dc3d43c
...
...
@@ -3,6 +3,7 @@
import
{
mapState
,
mapGetters
,
mapActions
}
from
'
vuex
'
;
import
flash
from
'
~/flash
'
;
import
ContentViewer
from
'
~/vue_shared/components/content_viewer/content_viewer.vue
'
;
import
{
activityBarViews
}
from
'
../constants
'
;
import
monacoLoader
from
'
../monaco_loader
'
;
import
Editor
from
'
../lib/editor
'
;
import
IdeFileButtons
from
'
./ide_file_buttons.vue
'
;
...
...
@@ -19,7 +20,7 @@ export default {
},
},
computed
:
{
...
mapState
([
'
rightPanelCollapsed
'
,
'
viewer
'
,
'
panelResizing
'
]),
...
mapState
([
'
rightPanelCollapsed
'
,
'
viewer
'
,
'
panelResizing
'
,
'
currentActivityView
'
]),
...
mapGetters
([
'
currentMergeRequest
'
,
'
getStagedFile
'
,
...
...
@@ -45,6 +46,21 @@ export default {
// Compare key to allow for files opened in review mode to be cached differently
if
(
newVal
.
key
!==
this
.
file
.
key
)
{
this
.
initMonaco
();
if
(
this
.
currentActivityView
!==
activityBarViews
.
edit
)
{
this
.
setFileViewMode
({
file
:
this
.
file
,
viewMode
:
'
edit
'
,
});
}
}
},
currentActivityView
()
{
if
(
this
.
currentActivityView
!==
activityBarViews
.
edit
)
{
this
.
setFileViewMode
({
file
:
this
.
file
,
viewMode
:
'
edit
'
,
});
}
},
rightPanelCollapsed
()
{
...
...
@@ -172,13 +188,12 @@ export default {
id=
"ide"
class=
"blob-viewer-container blob-editor-container"
>
<div
v-show=
"!isReviewModeActive && !isCommitModeActive"
class=
"ide-mode-tabs clearfix"
>
<div
class=
"ide-mode-tabs clearfix"
>
<ul
class=
"nav-links pull-left"
v-if=
"!shouldHideEditor"
>
v-if=
"!shouldHideEditor"
v-show=
"!isReviewModeActive && !isCommitModeActive"
>
<li
:class=
"editTabCSS"
>
<a
href=
"javascript:void(0);"
...
...
spec/javascripts/ide/components/repo_editor_spec.js
View file @
2dc3d43c
...
...
@@ -5,6 +5,7 @@ import store from '~/ide/stores';
import
repoEditor
from
'
~/ide/components/repo_editor.vue
'
;
import
monacoLoader
from
'
~/ide/monaco_loader
'
;
import
Editor
from
'
~/ide/lib/editor
'
;
import
{
activityBarViews
}
from
'
~/ide/constants
'
;
import
{
createComponentWithStore
}
from
'
../../helpers/vue_mount_component_helper
'
;
import
setTimeoutPromise
from
'
../../helpers/set_timeout_promise_helper
'
;
import
{
file
,
resetStore
}
from
'
../helpers
'
;
...
...
@@ -295,4 +296,30 @@ describe('RepoEditor', () => {
});
});
});
describe
(
'
show tabs
'
,
()
=>
{
it
(
'
shows tabs in edit mode
'
,
()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.nav-links
'
).
style
.
display
).
toBe
(
''
);
});
it
(
'
hides tabs in review mode
'
,
done
=>
{
vm
.
$store
.
state
.
currentActivityView
=
activityBarViews
.
review
;
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.nav-links
'
).
style
.
display
).
toBe
(
'
none
'
);
done
();
});
});
it
(
'
hides tabs in commit mode
'
,
done
=>
{
vm
.
$store
.
state
.
currentActivityView
=
activityBarViews
.
commit
;
vm
.
$nextTick
(()
=>
{
expect
(
vm
.
$el
.
querySelector
(
'
.nav-links
'
).
style
.
display
).
toBe
(
'
none
'
);
done
();
});
});
});
});
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