-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add file tree to file view page #32721
base: main
Are you sure you want to change the base?
Add file tree to file view page #32721
Conversation
7229b60
to
59e46d4
Compare
e45940d
to
c4e7f0c
Compare
32346a0
to
3bc3cd8
Compare
resp: | ||
[{ | ||
"name": "d1", | ||
"isFile": false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is isFile
?
} | ||
|
||
// Check that the path given in opts.treePath is valid (not a git path) | ||
cleanTreePath := CleanUploadFileName(treePath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not "uploading", why CleanUploadFileName
?
return nil, err | ||
} | ||
|
||
// If the entry is a file, we return a FileContentResponse object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is FileContentResponse
object?
subTreePath := path.Join(treePath, e.Name()) | ||
|
||
if strings.Contains(e.Name(), "/") { | ||
mapTree[path.Dir(e.Name())] = append(mapTree[path.Dir(e.Name())], &TreeViewNode{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate call to path.Dir
// GetTreeInformation returns the first level directories and files and all the trees of the path to treePath. | ||
// If treePath is a directory, list all subdirectories and files of treePath. | ||
/* | ||
Example 1: (path: /) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference from GetTreeList
? The code is almost the same and the examples are copied?
} | ||
var entries git.Entries | ||
if recursive { | ||
entries, err = gitTree.ListEntriesRecursiveFast() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is inefficient for large repo
Resolve #29328
This pull request introduces a file tree on the left side when reviewing files of a repository.