-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
My mouse has a |
http://host/owner/symlink-test/src/tag/0.0.1/file-symlink file-symlink not work. |
services/repository/files/tree.go
Outdated
|
||
type TreeEntry struct { | ||
Name string `json:"name"` | ||
IsFile bool `json:"isFile"` |
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.
Besides "file" / "dir", it could also be something like "submodule"
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.
67a749f, need frontend changes. @kerwin612
To make things clear, we need this first: Refactor context repository #33202 |
Next: we need to remove the RefName from code&template: Refactor context RefName #33226 |
Next: Refactor RefName #33234 , fix #32721 (comment) |
…2/gitea into kerwin612-add-file-tree-to-file-view-page
// There are many "cancel button" elements in modal dialogs, Fomantic UI expects they are button-like elements but never submit a form. | ||
// However, Gitea misuses the modal dialog and put the cancel buttons inside forms, so we must prevent the form submission. | ||
// There are a few cancel buttons in non-modal forms, and there are some dynamically created forms (eg: the "Edit Issue Content") | ||
addDelegatedEventListener(document, 'click', 'form button.ui.cancel.button', (_ /* el */, e) => e.preventDefault()); | ||
queryElems(target, 'form button.ui.cancel.button', (el) => el.addEventListener('click', (e) => e.preventDefault())); |
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.
NOOOOOOOOOOOO, do not do that.
It is not right. addDelegatedEventListener
has its own clear purpose.
Please please please fully understand the code before making breaking changes. I can't remember how many regressions this PR would introduce, I do not want to be the poor man to keep saying: this is not right, that is wrong. And do not request my review before you are pretty sure this PR is "almost" right. |
@@ -84,6 +84,19 @@ func RefNameFromCommit(shortName string) RefName { | |||
return RefName(shortName) | |||
} | |||
|
|||
func RefNameFromTypeAndShortName(tp RefType, shortName string) RefName { |
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
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.
If you insist that it is right, you could open a new PR to refactor existing code (for example: /tree-list
) to use the new mechanism first.
This pull request introduces a file tree on the left side when reviewing files of a repository.