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
724cca8d
Commit
724cca8d
authored
6 years ago
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes the web IDE link in tree list opening the wrong URL
Closes #44477
parent
aa2a97b5
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
95 additions
and
46 deletions
+95
-46
app/assets/javascripts/ide/components/repo_file.vue
app/assets/javascripts/ide/components/repo_file.vue
+1
-0
app/assets/javascripts/ide/ide_router.js
app/assets/javascripts/ide/ide_router.js
+53
-33
app/assets/javascripts/ide/stores/workers/files_decorator_worker.js
.../javascripts/ide/stores/workers/files_decorator_worker.js
+20
-10
app/assets/javascripts/vue_shared/components/file_icon.vue
app/assets/javascripts/vue_shared/components/file_icon.vue
+1
-2
app/views/projects/tree/_tree_header.html.haml
app/views/projects/tree/_tree_header.html.haml
+1
-1
changelogs/unreleased/ide-folder-button-path.yml
changelogs/unreleased/ide-folder-button-path.yml
+5
-0
spec/features/projects/tree/tree_show_spec.rb
spec/features/projects/tree/tree_show_spec.rb
+14
-0
No files found.
app/assets/javascripts/ide/components/repo_file.vue
View file @
724cca8d
...
...
@@ -43,6 +43,7 @@ export default {
'
file-open
'
:
this
.
isBlob
&&
this
.
file
.
opened
,
'
file-active
'
:
this
.
isBlob
&&
this
.
file
.
active
,
folder
:
this
.
isTree
,
'
is-open
'
:
this
.
file
.
opened
,
};
},
},
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/ide/ide_router.js
View file @
724cca8d
...
...
@@ -54,41 +54,61 @@ const router = new VueRouter({
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
if
(
to
.
params
.
namespace
&&
to
.
params
.
project
)
{
store
.
dispatch
(
'
getProjectData
'
,
{
namespace
:
to
.
params
.
namespace
,
projectId
:
to
.
params
.
project
,
})
.
then
(()
=>
{
const
fullProjectId
=
`
${
to
.
params
.
namespace
}
/
${
to
.
params
.
project
}
`
;
store
.
dispatch
(
'
getProjectData
'
,
{
namespace
:
to
.
params
.
namespace
,
projectId
:
to
.
params
.
project
,
})
.
then
(()
=>
{
const
fullProjectId
=
`
${
to
.
params
.
namespace
}
/
${
to
.
params
.
project
}
`
;
if
(
to
.
params
.
branch
)
{
store
.
dispatch
(
'
getBranchData
'
,
{
projectId
:
fullProjectId
,
branchId
:
to
.
params
.
branch
,
});
if
(
to
.
params
.
branch
)
{
store
.
dispatch
(
'
getBranchData
'
,
{
projectId
:
fullProjectId
,
branchId
:
to
.
params
.
branch
,
});
store
.
dispatch
(
'
getFiles
'
,
{
projectId
:
fullProjectId
,
branchId
:
to
.
params
.
branch
,
})
.
then
(()
=>
{
if
(
to
.
params
[
0
])
{
const
treeEntry
=
store
.
state
.
entries
[
to
.
params
[
0
]];
if
(
treeEntry
)
{
store
.
dispatch
(
'
handleTreeEntryAction
'
,
treeEntry
);
}
}
})
.
catch
((
e
)
=>
{
flash
(
'
Error while loading the branch files. Please try again.
'
,
'
alert
'
,
document
,
null
,
false
,
true
);
throw
e
;
});
}
})
.
catch
((
e
)
=>
{
flash
(
'
Error while loading the project data. Please try again.
'
,
'
alert
'
,
document
,
null
,
false
,
true
);
throw
e
;
});
store
.
dispatch
(
'
getFiles
'
,
{
projectId
:
fullProjectId
,
branchId
:
to
.
params
.
branch
,
})
.
then
(()
=>
{
if
(
to
.
params
[
0
])
{
const
path
=
to
.
params
[
0
].
slice
(
-
1
)
===
'
/
'
?
to
.
params
[
0
].
slice
(
0
,
-
1
)
:
to
.
params
[
0
];
const
treeEntry
=
store
.
state
.
entries
[
path
];
if
(
treeEntry
)
{
store
.
dispatch
(
'
handleTreeEntryAction
'
,
treeEntry
);
}
}
})
.
catch
(
e
=>
{
flash
(
'
Error while loading the branch files. Please try again.
'
,
'
alert
'
,
document
,
null
,
false
,
true
,
);
throw
e
;
});
}
})
.
catch
(
e
=>
{
flash
(
'
Error while loading the project data. Please try again.
'
,
'
alert
'
,
document
,
null
,
false
,
true
,
);
throw
e
;
});
}
next
();
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/ide/stores/workers/files_decorator_worker.js
View file @
724cca8d
import
{
decorateData
,
sortTree
,
}
from
'
../utils
'
;
import
{
decorateData
,
sortTree
}
from
'
../utils
'
;
self
.
addEventListener
(
'
message
'
,
(
e
)
=>
{
const
{
data
,
projectId
,
branchId
,
tempFile
=
false
,
content
=
''
,
base64
=
false
}
=
e
.
data
;
self
.
addEventListener
(
'
message
'
,
e
=>
{
const
{
data
,
projectId
,
branchId
,
tempFile
=
false
,
content
=
''
,
base64
=
false
,
}
=
e
.
data
;
const
treeList
=
[];
let
file
;
...
...
@@ -15,7 +19,9 @@ self.addEventListener('message', (e) => {
if
(
pathSplit
.
length
>
0
)
{
pathSplit
.
reduce
((
pathAcc
,
folderName
)
=>
{
const
parentFolder
=
acc
[
pathAcc
[
pathAcc
.
length
-
1
]];
const
folderPath
=
`
${(
parentFolder
?
`
${
parentFolder
.
path
}
/`
:
''
)}${
folderName
}
`
;
const
folderPath
=
`
${
parentFolder
?
`
${
parentFolder
.
path
}
/`
:
''
}${
folderName
}
`
;
const
foundEntry
=
acc
[
folderPath
];
if
(
!
foundEntry
)
{
...
...
@@ -25,9 +31,11 @@ self.addEventListener('message', (e) => {
id
:
folderPath
,
name
:
folderName
,
path
:
folderPath
,
url
:
`/
${
projectId
}
/tree/
${
branchId
}
/
${
folderPath
}
`
,
url
:
`/
${
projectId
}
/tree/
${
branchId
}
/
${
folderPath
}
/
`
,
type
:
'
tree
'
,
parentTreeUrl
:
parentFolder
?
parentFolder
.
url
:
`/
${
projectId
}
/tree/
${
branchId
}
/`
,
parentTreeUrl
:
parentFolder
?
parentFolder
.
url
:
`/
${
projectId
}
/tree/
${
branchId
}
/`
,
tempFile
,
changed
:
tempFile
,
opened
:
tempFile
,
...
...
@@ -62,7 +70,9 @@ self.addEventListener('message', (e) => {
path
,
url
:
`/
${
projectId
}
/blob/
${
branchId
}
/
${
path
}
`
,
type
:
'
blob
'
,
parentTreeUrl
:
fileFolder
?
fileFolder
.
url
:
`/
${
projectId
}
/blob/
${
branchId
}
`
,
parentTreeUrl
:
fileFolder
?
fileFolder
.
url
:
`/
${
projectId
}
/blob/
${
branchId
}
`
,
tempFile
,
changed
:
tempFile
,
content
,
...
...
This diff is collapsed.
Click to expand it.
app/assets/javascripts/vue_shared/components/file_icon.vue
View file @
724cca8d
...
...
@@ -62,8 +62,7 @@
return
`
${
gon
.
sprite_file_icons
}
#
${
iconName
}
`
;
},
folderIconName
()
{
// We don't have a open folder icon yet
return
this
.
opened
?
'
folder
'
:
'
folder
'
;
return
this
.
opened
?
'
folder-open
'
:
'
folder
'
;
},
iconSizeClass
()
{
return
this
.
size
?
`s
${
this
.
size
}
`
:
''
;
...
...
This diff is collapsed.
Click to expand it.
app/views/projects/tree/_tree_header.html.haml
View file @
724cca8d
...
...
@@ -77,7 +77,7 @@
=
render
'projects/find_file_link'
=
succeed
" "
do
=
link_to
ide_edit_path
(
@project
,
@id
),
class:
'btn btn-default'
do
=
link_to
ide_edit_path
(
@project
,
@id
,
""
),
class:
'btn btn-default'
do
=
_
(
'Web IDE'
)
=
render
'projects/buttons/download'
,
project:
@project
,
ref:
@ref
This diff is collapsed.
Click to expand it.
changelogs/unreleased/ide-folder-button-path.yml
0 → 100644
View file @
724cca8d
---
title
:
Fixed IDE button opening the wrong URL in tree list
merge_request
:
author
:
type
:
fixed
This diff is collapsed.
Click to expand it.
spec/features/projects/tree/tree_show_spec.rb
View file @
724cca8d
...
...
@@ -25,4 +25,18 @@ feature 'Projects tree' do
expect
(
page
).
to
have_selector
(
'.label-lfs'
,
text:
'LFS'
)
end
end
context
'web IDE'
,
:js
do
before
do
visit
project_tree_path
(
project
,
File
.
join
(
'master'
,
'bar'
))
click_link
'Web IDE'
find
(
'.ide-file-list'
)
end
it
'opens folder in IDE'
do
expect
(
page
).
to
have_selector
(
'.is-open'
,
text:
'bar'
)
end
end
end
This diff is collapsed.
Click to expand it.
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