-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
(Preview) Fix no same naming convention between template and form #22846
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
Closed
yp05327
wants to merge
22
commits into
go-gitea:main
from
yp05327:fix-no-same-naming-convention-between-template-and-form
Closed
Changes from 3 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
f5cd8a9
remove SnakeCase
yp05327 1195121
fix repo create
yp05327 49ea88b
fix org create
yp05327 6dd02cc
Revert "fix org create"
yp05327 add2d3c
Revert "fix repo create"
yp05327 8e4d3c3
Revert "remove SnakeCase"
yp05327 2404441
rewrite AssignForm
yp05327 7c3043a
fix org create
yp05327 9cd9ceb
fix repo create
yp05327 da3b9ac
fix org name in org create
yp05327 d36aa52
Merge branch 'main' into fix-no-same-naming-convention-between-templa…
yp05327 02f156e
fix AdminCreateUserForm
yp05327 aa1584f
fix
yp05327 bf1af92
fix visibility in new user page
yp05327 a64ba42
fix AdminEditUserForm
yp05327 ad6a191
fix AuthenticationForm
yp05327 a205529
fix name conflict
yp05327 d0524a5
fix
yp05327 4df9ec0
Merge branch 'main' into fix-no-same-naming-convention-between-templa…
yp05327 6a2262d
fix
yp05327 d268c40
fix UpdateOrgSettingForm
yp05327 7311821
Merge branch 'main' into fix-no-same-naming-convention-between-templa…
6543 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Maybe the snake_case is done by purpose:
name?
If the form-variables and non-form-variables are mixed together, it would be very difficult to understand what a variable is used for, and may cause uncontrollable overwriting?
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.
@wxiaoguang
Thanks for your review.
You are right, it is difficult to distinguish and may cause uncontrollable overwriting.
How about the following changes.
For non-form variables:
For auto filled form:
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.
I am not sure and I haven't thought about it carefully.
Maybe the Technical Oversight Committee could help.
Uh oh!
There was an error while loading. Please reload this page.
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.
Personally, I like the idea
{{.Form.Variable}}, it's more readable and go-style. And there will be a clear way to check if it's an error page to repost with entered form:{{if .Form}} /* keep the values in .Form */ {{end}}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.
I see the point of the snake_case but using the
{{.Form}}would prevent us from having to do that.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.
So there is one potential issue with the
.Formobject if you're using go code.I'm not certain if there's any code that does this - but I could imagine some code that doesn't have the type of the Form object but would have been able to update the values in the
ctx.Data["some_field"]which by convention was a string.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.
In some pages, there are several forms in one page. Need to consider a new solution to solve this problem.
Uh oh!
There was an error while loading. Please reload this page.
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.
a64ba42 is an example to fix this problem.