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
a0e53bcb
Commit
a0e53bcb
authored
Feb 09, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correctly sets URL when closing a file
adds tempFiles into list
parent
2a2373c9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
17 additions
and
21 deletions
+17
-21
app/assets/javascripts/ide/components/new_dropdown/index.vue
app/assets/javascripts/ide/components/new_dropdown/index.vue
+3
-2
app/assets/javascripts/ide/components/new_dropdown/upload.vue
...assets/javascripts/ide/components/new_dropdown/upload.vue
+1
-1
app/assets/javascripts/ide/components/repo_file.vue
app/assets/javascripts/ide/components/repo_file.vue
+2
-1
app/assets/javascripts/ide/stores/actions/file.js
app/assets/javascripts/ide/stores/actions/file.js
+1
-1
app/assets/javascripts/ide/stores/actions/tree.js
app/assets/javascripts/ide/stores/actions/tree.js
+9
-4
app/assets/javascripts/ide/stores/utils.js
app/assets/javascripts/ide/stores/utils.js
+1
-12
No files found.
app/assets/javascripts/ide/components/new_dropdown/index.vue
View file @
a0e53bcb
...
...
@@ -34,6 +34,7 @@
createNewItem
(
type
)
{
this
.
modalType
=
type
;
this
.
openModal
=
true
;
this
.
dropdownOpen
=
false
;
},
hideModal
()
{
this
.
openModal
=
false
;
...
...
@@ -75,7 +76,7 @@
<a
href=
"#"
role=
"button"
@
click.prevent=
"createNewItem('blob')"
@
click.
stop.
prevent=
"createNewItem('blob')"
>
{{
__
(
'
New file
'
)
}}
</a>
...
...
@@ -91,7 +92,7 @@
<a
href=
"#"
role=
"button"
@
click.prevent=
"createNewItem('tree')"
@
click.
stop.
prevent=
"createNewItem('tree')"
>
{{
__
(
'
New directory
'
)
}}
</a>
...
...
app/assets/javascripts/ide/components/new_dropdown/upload.vue
View file @
a0e53bcb
...
...
@@ -73,7 +73,7 @@
<a
href=
"#"
role=
"button"
@
click.prevent=
"startFileUpload"
@
click.
stop.
prevent=
"startFileUpload"
>
{{
__
(
'
Upload file
'
)
}}
</a>
...
...
app/assets/javascripts/ide/components/repo_file.vue
View file @
a0e53bcb
...
...
@@ -91,10 +91,11 @@
<tr
class=
"file"
:class=
"fileClass"
@
click=
"clickFile(file)"
>
>
<td
class=
"multi-file-table-name"
:colspan=
"submoduleColSpan"
@
click=
"clickFile(file)"
>
<a
class=
"repo-file-name str-truncated"
...
...
app/assets/javascripts/ide/stores/actions/file.js
View file @
a0e53bcb
...
...
@@ -21,7 +21,7 @@ export const closeFile = ({ commit, state, dispatch }, file) => {
const
nextIndexToOpen
=
indexOfClosedFile
===
0
?
0
:
indexOfClosedFile
-
1
;
const
nextFileToOpen
=
state
.
openFiles
[
nextIndexToOpen
];
dispatch
(
'
setFileActive
'
,
nextFileToOpen
);
router
.
push
(
`/project
${
nextFileToOpen
.
url
}
`
);
}
else
if
(
!
state
.
openFiles
.
length
)
{
router
.
push
(
`/project/
${
file
.
projectId
}
/tree/
${
file
.
branchId
}
/`
);
}
...
...
app/assets/javascripts/ide/stores/actions/tree.js
View file @
a0e53bcb
...
...
@@ -38,7 +38,7 @@ export const getTreeData = (
commit
(
types
.
SET_ROOT
,
data
.
path
===
'
/
'
);
}
dispatch
(
'
updateDirectoryData
'
,
{
data
,
tree
,
projectId
,
branch
});
dispatch
(
'
updateDirectoryData
'
,
{
data
,
tree
,
projectId
,
branch
,
clearTree
:
false
});
const
selectedTree
=
tree
||
state
.
trees
[
`
${
projectId
}
/
${
branch
}
`
];
commit
(
types
.
SET_PARENT_TREE_URL
,
data
.
parent_tree_url
);
...
...
@@ -85,7 +85,7 @@ export const handleTreeEntryAction = ({ commit, dispatch }, row) => {
commit
(
types
.
TOGGLE_LOADING
,
row
);
visitUrl
(
row
.
url
);
}
else
if
(
row
.
type
===
'
blob
'
&&
(
row
.
opened
||
row
.
changed
))
{
if
(
row
.
changed
)
{
if
(
row
.
changed
&&
!
row
.
opened
)
{
commit
(
types
.
TOGGLE_FILE_OPEN
,
row
);
}
...
...
@@ -160,7 +160,7 @@ export const getLastCommitData = ({ state, commit, dispatch, getters }, tree = s
export
const
updateDirectoryData
=
(
{
commit
,
state
},
{
data
,
tree
,
projectId
,
branch
},
{
data
,
tree
,
projectId
,
branch
,
clearTree
=
true
},
)
=>
{
if
(
!
tree
)
{
const
existingTree
=
state
.
trees
[
`
${
projectId
}
/
${
branch
}
`
];
...
...
@@ -173,7 +173,6 @@ export const updateDirectoryData = (
const
level
=
selectedTree
.
level
!==
undefined
?
selectedTree
.
level
+
1
:
0
;
const
parentTreeUrl
=
data
.
parent_tree_url
?
`
${
data
.
parent_tree_url
}${
data
.
path
}
`
:
state
.
endpoints
.
rootUrl
;
const
createEntry
=
(
entry
,
type
)
=>
createOrMergeEntry
({
tree
:
selectedTree
,
projectId
:
`
${
projectId
}
`
,
branchId
:
branch
,
entry
,
...
...
@@ -189,5 +188,11 @@ export const updateDirectoryData = (
...
data
.
blobs
.
map
(
b
=>
createEntry
(
b
,
'
blob
'
)),
];
if
(
!
clearTree
)
{
formattedData
.
push
(
state
.
changedFiles
.
filter
(
f
=>
f
.
tempFile
&&
f
.
path
===
`
${
tree
.
path
}
/
${
f
.
name
}
`
),
);
}
commit
(
types
.
SET_DIRECTORY_DATA
,
{
tree
:
selectedTree
,
data
:
formattedData
});
};
app/assets/javascripts/ide/stores/utils.js
View file @
a0e53bcb
...
...
@@ -155,8 +155,7 @@ export const createTemp = ({
});
};
export
const
createOrMergeEntry
=
({
tree
,
projectId
,
export
const
createOrMergeEntry
=
({
projectId
,
branchId
,
entry
,
type
,
...
...
@@ -179,16 +178,6 @@ export const createOrMergeEntry = ({ tree,
}
}
const
found
=
findEntry
(
tree
.
tree
||
tree
,
type
,
entry
.
name
);
if
(
found
)
{
return
Object
.
assign
({},
found
,
{
id
:
entry
.
id
,
url
:
entry
.
url
,
tempFile
:
false
,
});
}
return
decorateData
({
...
entry
,
projectId
,
...
...
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