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
5c0c345a
Commit
5c0c345a
authored
Oct 26, 2017
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
various different performance improvements
[ci skip]
parent
4d18e200
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
24 additions
and
37 deletions
+24
-37
app/assets/javascripts/repo/components/repo.vue
app/assets/javascripts/repo/components/repo.vue
+5
-5
app/assets/javascripts/repo/components/repo_edit_button.vue
app/assets/javascripts/repo/components/repo_edit_button.vue
+1
-1
app/assets/javascripts/repo/components/repo_editor.vue
app/assets/javascripts/repo/components/repo_editor.vue
+3
-2
app/assets/javascripts/repo/components/repo_file.vue
app/assets/javascripts/repo/components/repo_file.vue
+0
-1
app/assets/javascripts/repo/components/repo_preview.vue
app/assets/javascripts/repo/components/repo_preview.vue
+1
-1
app/assets/javascripts/repo/index.js
app/assets/javascripts/repo/index.js
+8
-5
app/assets/javascripts/repo/stores/actions.js
app/assets/javascripts/repo/stores/actions.js
+3
-3
app/assets/stylesheets/pages/repo.scss
app/assets/stylesheets/pages/repo.scss
+2
-16
app/views/projects/tree/_tree_header.html.haml
app/views/projects/tree/_tree_header.html.haml
+1
-1
app/views/shared/repo/_editable_mode.html.haml
app/views/shared/repo/_editable_mode.html.haml
+0
-2
No files found.
app/assets/javascripts/repo/components/repo.vue
View file @
5c0c345a
...
...
@@ -11,7 +11,6 @@ export default {
computed
:
{
...
mapState
([
'
currentBlobView
'
,
'
editMode
'
,
]),
...
mapGetters
([
'
isMini
'
,
...
...
@@ -45,13 +44,14 @@ export default {
<div
class=
"repository-view"
>
<div
class=
"tree-content-holder"
:class=
"
{'tree-content-holder-mini' : isMini}">
<repo-sidebar/>
<div
v-if=
"isMini"
class=
"panel-right"
:class=
"
{'edit-mode': editMode}">
<div
v-if=
"isMini"
class=
"panel-right"
>
<repo-tabs/>
<component
:is=
"currentBlobView"
class=
"blob-viewer-container"
/>
/>
<repo-file-buttons/>
</div>
</div>
...
...
app/assets/javascripts/repo/components/repo_edit_button.vue
View file @
5c0c345a
...
...
@@ -28,7 +28,7 @@ export default {
</
script
>
<
template
>
<div>
<div
class=
"editable-mode"
>
<button
v-if=
"canEditFile"
class=
"btn btn-default"
...
...
app/assets/javascripts/repo/components/repo_editor.vue
View file @
5c0c345a
...
...
@@ -52,12 +52,13 @@ export default {
},
setupEditor
()
{
if
(
!
this
.
activeFile
)
return
;
const
content
=
this
.
activeFile
.
content
!==
''
?
this
.
activeFile
.
content
:
this
.
activeFile
.
raw
;
const
foundLang
=
this
.
languages
.
find
(
lang
=>
lang
.
extensions
&&
lang
.
extensions
.
indexOf
(
this
.
activeFileExtension
)
===
0
,
);
const
newModel
=
this
.
monaco
.
editor
.
createModel
(
this
.
activeFile
.
raw
,
foundLang
?
foundLang
.
id
:
'
plaintext
'
,
content
,
foundLang
?
foundLang
.
id
:
'
plaintext
'
,
);
this
.
monacoInstance
.
setModel
(
newModel
);
...
...
@@ -91,5 +92,5 @@ export default {
</
script
>
<
template
>
<div
id=
"ide"
v-if=
'!shouldHideEditor'
></div>
<div
id=
"ide"
v-if=
'!shouldHideEditor'
class=
"blob-viewer-container blob-editor-container"
></div>
</
template
>
app/assets/javascripts/repo/components/repo_file.vue
View file @
5c0c345a
...
...
@@ -34,7 +34,6 @@
},
methods
:
{
...
mapActions
([
'
getTreeData
'
,
'
clickedTreeRow
'
,
]),
},
...
...
app/assets/javascripts/repo/components/repo_preview.vue
View file @
5c0c345a
...
...
@@ -31,7 +31,7 @@ export default {
</
script
>
<
template
>
<div>
<div
class=
"blob-viewer-container"
>
<div
v-if=
"!activeFile.renderError"
v-html=
"activeFile.html"
>
...
...
app/assets/javascripts/repo/index.js
View file @
5c0c345a
...
...
@@ -5,13 +5,13 @@ import Repo from './components/repo.vue';
import
RepoEditButton
from
'
./components/repo_edit_button.vue
'
;
import
newBranchForm
from
'
./components/new_branch_form.vue
'
;
import
newDropdown
from
'
./components/new_dropdown/index.vue
'
;
import
vS
tore
from
'
./stores
'
;
import
s
tore
from
'
./stores
'
;
import
Translate
from
'
../vue_shared/translate
'
;
function
initRepo
(
el
)
{
return
new
Vue
({
el
,
store
:
vStore
,
store
,
components
:
{
repo
:
Repo
,
},
...
...
@@ -53,17 +53,20 @@ function initRepo(el) {
function
initRepoEditButton
(
el
)
{
return
new
Vue
({
el
,
store
:
vStore
,
store
,
components
:
{
repoEditButton
:
RepoEditButton
,
},
render
(
createElement
)
{
return
createElement
(
'
repo-edit-button
'
);
},
});
}
function
initNewDropdown
(
el
)
{
return
new
Vue
({
el
,
store
:
vStore
,
store
,
components
:
{
newDropdown
,
},
...
...
@@ -83,7 +86,7 @@ function initNewBranchForm() {
components
:
{
newBranchForm
,
},
store
:
vStore
,
store
,
render
(
createElement
)
{
return
createElement
(
'
new-branch-form
'
);
},
...
...
app/assets/javascripts/repo/stores/actions.js
View file @
5c0c345a
...
...
@@ -10,9 +10,7 @@ export const setInitialData = ({ commit }, data) => commit(types.SET_INITIAL_DAT
export
const
closeDiscardPopup
=
({
commit
})
=>
commit
(
types
.
TOGGLE_DISCARD_POPUP
,
false
);
export
const
discardAllChanges
=
({
state
,
commit
,
getters
,
dispatch
})
=>
{
if
(
state
.
editMode
)
return
;
export
const
discardAllChanges
=
({
commit
,
getters
,
dispatch
})
=>
{
const
changedFiles
=
getters
.
changedFiles
;
changedFiles
.
forEach
((
file
)
=>
{
...
...
@@ -82,6 +80,8 @@ export const commitChanges = ({ commit, state, dispatch }, { payload, newMr }) =
dispatch
(
'
discardAllChanges
'
);
dispatch
(
'
closeAllFiles
'
);
dispatch
(
'
toggleEditMode
'
);
window
.
scrollTo
(
0
,
0
);
}
})
.
catch
(()
=>
flash
(
'
Error committing changes. Please try again.
'
));
...
...
app/assets/stylesheets/pages/repo.scss
View file @
5c0c345a
...
...
@@ -72,10 +72,6 @@
text-decoration
:
underline
;
}
}
.cursor
{
display
:
none
!
important
;
}
}
.blob-no-preview
{
...
...
@@ -85,18 +81,8 @@
}
}
&
.edit-mode
{
.blob-viewer-container
{
overflow
:
hidden
;
}
.monaco-editor.vs
{
.cursor
{
background
:
$black
;
border-color
:
$black
;
display
:
block
!
important
;
}
}
&
.blob-editor-container
{
overflow
:
hidden
;
}
.blob-viewer-container
{
...
...
app/views/projects/tree/_tree_header.html.haml
View file @
5c0c345a
...
...
@@ -9,7 +9,7 @@
.tree-controls
-
if
show_new_repo?
=
render
'shared/repo/editable_mode'
.editable-mode
-
else
=
link_to
s_
(
'Commits|History'
),
project_commits_path
(
@project
,
@id
),
class:
'btn'
...
...
app/views/shared/repo/_editable_mode.html.haml
deleted
100644 → 0
View file @
4d18e200
.editable-mode
%repo-edit-button
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