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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
4924e4ed
Commit
4924e4ed
authored
Apr 20, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added review mode to new IDE sidebar
#44846
parent
34d5d1fa
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
98 additions
and
56 deletions
+98
-56
app/assets/javascripts/ide/components/activity_bar.vue
app/assets/javascripts/ide/components/activity_bar.vue
+14
-0
app/assets/javascripts/ide/components/ide_review.vue
app/assets/javascripts/ide/components/ide_review.vue
+64
-0
app/assets/javascripts/ide/components/ide_side_bar.vue
app/assets/javascripts/ide/components/ide_side_bar.vue
+2
-0
app/assets/javascripts/ide/components/ide_tree.vue
app/assets/javascripts/ide/components/ide_tree.vue
+7
-1
app/assets/javascripts/ide/components/repo_editor.vue
app/assets/javascripts/ide/components/repo_editor.vue
+1
-10
app/assets/javascripts/ide/components/repo_file.vue
app/assets/javascripts/ide/components/repo_file.vue
+8
-5
app/assets/javascripts/ide/components/repo_tabs.vue
app/assets/javascripts/ide/components/repo_tabs.vue
+0
-17
app/assets/javascripts/ide/constants.js
app/assets/javascripts/ide/constants.js
+1
-0
app/assets/javascripts/ide/lib/editor.js
app/assets/javascripts/ide/lib/editor.js
+0
-3
app/assets/javascripts/ide/stores/actions/file.js
app/assets/javascripts/ide/stores/actions/file.js
+0
-1
app/assets/stylesheets/pages/repo.scss
app/assets/stylesheets/pages/repo.scss
+1
-19
No files found.
app/assets/javascripts/ide/components/activity_bar.vue
View file @
4924e4ed
...
...
@@ -50,6 +50,20 @@ export default {
/>
</button>
</li>
<li>
<button
type=
"button"
class=
"ide-sidebar-link js-ide-review-mode"
:class=
"
{
active: currentActivityView === $options.ActivityBarViews.review
}"
@click.prevent="updateActivityBarView($options.ActivityBarViews.review)"
>
<icon
name=
"file-modified"
/>
</button>
</li>
<li>
<button
type=
"button"
...
...
app/assets/javascripts/ide/components/ide_review.vue
0 → 100644
View file @
4924e4ed
<
script
>
import
{
mapActions
,
mapGetters
,
mapState
}
from
'
vuex
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
SkeletonLoadingContainer
from
'
~/vue_shared/components/skeleton_loading_container.vue
'
;
import
RepoFile
from
'
./repo_file.vue
'
;
import
NewDropdown
from
'
./new_dropdown/index.vue
'
;
export
default
{
components
:
{
Icon
,
RepoFile
,
SkeletonLoadingContainer
,
NewDropdown
,
},
computed
:
{
...
mapState
([
'
currentBranchId
'
]),
...
mapGetters
([
'
currentProject
'
,
'
currentTree
'
]),
},
mounted
()
{
this
.
updateViewer
(
'
diff
'
);
},
methods
:
{
...
mapActions
([
'
updateViewer
'
]),
},
};
</
script
>
<
template
>
<div
class=
"ide-file-list"
>
<template
v-if=
"!currentTree || currentTree.loading"
>
<div
class=
"multi-file-loading-container"
v-for=
"n in 3"
:key=
"n"
>
<skeleton-loading-container
/>
</div>
</
template
>
<
template
v-else
>
<header
class=
"ide-tree-header ide-review-header"
>
{{
__
(
'
Review
'
)
}}
<div
class=
"prepend-top-5 clgray"
>
{{
__
(
'
Lastest changed
'
)
}}
</div>
</header>
<repo-file
v-for=
"file in currentTree.tree"
:key=
"file.key"
:file=
"file"
:level=
"0"
:disable-action-dropdown=
"true"
/>
</
template
>
</div>
</template>
<
style
>
.ide-review-header
{
flex-direction
:
column
;
align-items
:
flex-start
;
}
</
style
>
app/assets/javascripts/ide/components/ide_side_bar.vue
View file @
4924e4ed
...
...
@@ -9,6 +9,7 @@ import IdeTree from './ide_tree.vue';
import
ResizablePanel
from
'
./resizable_panel.vue
'
;
import
ActivityBar
from
'
./activity_bar.vue
'
;
import
CommitSection
from
'
./repo_commit_section.vue
'
;
import
IdeReview
from
'
./ide_review.vue
'
;
export
default
{
components
:
{
...
...
@@ -21,6 +22,7 @@ export default {
Identicon
,
CommitSection
,
IdeTree
,
IdeReview
,
},
computed
:
{
...
mapState
([
'
loading
'
,
'
currentBranchId
'
,
'
currentActivityView
'
]),
...
...
app/assets/javascripts/ide/components/ide_tree.vue
View file @
4924e4ed
<
script
>
import
{
mapGetters
,
mapState
}
from
'
vuex
'
;
import
{
map
Actions
,
map
Getters
,
mapState
}
from
'
vuex
'
;
import
Icon
from
'
~/vue_shared/components/icon.vue
'
;
import
SkeletonLoadingContainer
from
'
~/vue_shared/components/skeleton_loading_container.vue
'
;
import
RepoFile
from
'
./repo_file.vue
'
;
...
...
@@ -16,6 +16,12 @@ export default {
...
mapState
([
'
currentBranchId
'
]),
...
mapGetters
([
'
currentProject
'
,
'
currentTree
'
]),
},
mounted
()
{
this
.
updateViewer
(
'
editor
'
);
},
methods
:
{
...
mapActions
([
'
updateViewer
'
]),
},
};
</
script
>
...
...
app/assets/javascripts/ide/components/repo_editor.vue
View file @
4924e4ed
...
...
@@ -19,7 +19,7 @@ export default {
},
},
computed
:
{
...
mapState
([
'
rightPanelCollapsed
'
,
'
viewer
'
,
'
delayViewerUpdated
'
,
'
panelResizing
'
]),
...
mapState
([
'
rightPanelCollapsed
'
,
'
viewer
'
,
'
panelResizing
'
]),
...
mapGetters
([
'
currentMergeRequest
'
,
'
getStagedFile
'
]),
shouldHideEditor
()
{
return
this
.
file
&&
this
.
file
.
binary
&&
!
this
.
file
.
content
;
...
...
@@ -77,7 +77,6 @@ export default {
'
setFileViewMode
'
,
'
setFileEOL
'
,
'
updateViewer
'
,
'
updateDelayViewerUpdated
'
,
]),
initMonaco
()
{
if
(
this
.
shouldHideEditor
)
return
;
...
...
@@ -89,14 +88,6 @@ export default {
baseSha
:
this
.
currentMergeRequest
?
this
.
currentMergeRequest
.
baseCommitSha
:
''
,
})
.
then
(()
=>
{
const
viewerPromise
=
this
.
delayViewerUpdated
?
this
.
updateViewer
(
this
.
file
.
pending
?
'
diff
'
:
'
editor
'
)
:
Promise
.
resolve
();
return
viewerPromise
;
})
.
then
(()
=>
{
this
.
updateDelayViewerUpdated
(
false
);
this
.
createEditorInstance
();
})
.
catch
(
err
=>
{
...
...
app/assets/javascripts/ide/components/repo_file.vue
View file @
4924e4ed
...
...
@@ -27,6 +27,11 @@ export default {
type
:
Number
,
required
:
true
,
},
disableActionDropdown
:
{
type
:
Boolean
,
required
:
false
,
default
:
false
,
},
},
computed
:
{
isTree
()
{
...
...
@@ -55,16 +60,14 @@ export default {
}
},
methods
:
{
...
mapActions
([
'
toggleTreeOpen
'
,
'
updateDelayViewerUpdated
'
]),
...
mapActions
([
'
toggleTreeOpen
'
]),
clickFile
()
{
// Manual Action if a tree is selected/opened
if
(
this
.
isTree
&&
this
.
$router
.
currentRoute
.
path
===
`/project
${
this
.
file
.
url
}
`
)
{
this
.
toggleTreeOpen
(
this
.
file
.
path
);
}
return
this
.
updateDelayViewerUpdated
(
true
).
then
(()
=>
{
router
.
push
(
`/project
${
this
.
file
.
url
}
`
);
});
},
},
};
...
...
@@ -110,7 +113,7 @@ export default {
/>
</span>
<new-dropdown
v-if=
"isTree"
v-if=
"isTree
&& !disableActionDropdown
"
:project-id=
"file.projectId"
:branch=
"file.branchId"
:path=
"file.path"
...
...
app/assets/javascripts/ide/components/repo_tabs.vue
View file @
4924e4ed
...
...
@@ -32,16 +32,6 @@ export default {
default
:
''
,
},
},
data
()
{
return
{
showShadow
:
false
,
};
},
updated
()
{
if
(
!
this
.
$refs
.
tabsScroller
)
return
;
this
.
showShadow
=
this
.
$refs
.
tabsScroller
.
scrollWidth
>
this
.
$refs
.
tabsScroller
.
offsetWidth
;
},
methods
:
{
...
mapActions
([
'
updateViewer
'
,
'
removePendingTab
'
]),
openFileViewer
(
viewer
)
{
...
...
@@ -71,12 +61,5 @@ export default {
:tab=
"tab"
/>
</ul>
<editor-mode
:viewer=
"viewer"
:show-shadow=
"showShadow"
:has-changes=
"hasChanges"
:merge-request-id=
"mergeRequestId"
@
click=
"openFileViewer"
/>
</div>
</
template
>
app/assets/javascripts/ide/constants.js
View file @
4924e4ed
...
...
@@ -5,4 +5,5 @@ export const MAX_BODY_LENGTH = 72;
export
const
ActivityBarViews
=
{
edit
:
'
ide-tree
'
,
commit
:
'
commit-section
'
,
review
:
'
ide-review
'
,
};
app/assets/javascripts/ide/lib/editor.js
View file @
4924e4ed
...
...
@@ -64,11 +64,8 @@ export default class Editor {
this
.
disposable
.
add
(
(
this
.
instance
=
this
.
monaco
.
editor
.
createDiffEditor
(
domElement
,
{
...
defaultEditorOptions
,
readOnly
:
true
,
quickSuggestions
:
false
,
occurrencesHighlight
:
false
,
renderLineHighlight
:
'
none
'
,
hideCursorInOverviewRuler
:
true
,
renderSideBySide
:
Editor
.
renderSideBySide
(
domElement
),
})),
);
...
...
app/assets/javascripts/ide/stores/actions/file.js
View file @
4924e4ed
...
...
@@ -29,7 +29,6 @@ export const closeFile = ({ commit, state, dispatch }, file) => {
keyPrefix
:
nextFileToOpen
.
staged
?
'
staged
'
:
'
unstaged
'
,
});
}
else
{
dispatch
(
'
updateDelayViewerUpdated
'
,
true
);
router
.
push
(
`/project
${
nextFileToOpen
.
url
}
`
);
}
}
else
if
(
!
state
.
openFiles
.
length
)
{
...
...
app/assets/stylesheets/pages/repo.scss
View file @
4924e4ed
...
...
@@ -153,24 +153,6 @@
border-bottom-color
:
$white-light
;
}
}
.dropdown
{
display
:
flex
;
margin-left
:
auto
;
margin-bottom
:
1px
;
padding
:
0
$grid-size
;
border-left
:
1px
solid
$white-dark
;
background-color
:
$white-light
;
&
.shadow
{
box-shadow
:
0
0
10px
$dropdown-shadow-color
;
}
.btn
{
margin-top
:
auto
;
margin-bottom
:
auto
;
}
}
}
.multi-file-tab
{
...
...
@@ -298,7 +280,7 @@
opacity
:
0
.4
;
}
.cursors-layer
{
.
editor.original
.
cursors-layer
{
display
:
none
;
}
}
...
...
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