Skip to content

record previous create org operation info when return to error page #22834

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
wants to merge 7 commits into from

Conversation

sillyguodong
Copy link
Contributor

Fixes: #22833
Put user's previous operation params into context, for the page can get these params when re-rendering

@sillyguodong sillyguodong changed the title record previous operation info when return to error page record previous create org operation info when return to error page Feb 9, 2023
@codecov-commenter
Copy link

codecov-commenter commented Feb 9, 2023

Codecov Report

Merging #22834 (b5614ec) into main (90cf07a) will increase coverage by 47.33%.
The diff coverage is n/a.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

@@            Coverage Diff            @@
##           main   #22834       +/-   ##
=========================================
+ Coverage      0   47.33%   +47.33%     
=========================================
  Files         0     1113     +1113     
  Lines         0   150073   +150073     
=========================================
+ Hits          0    71032    +71032     
- Misses        0    70614    +70614     
- Partials      0     8427     +8427     
Impacted Files Coverage Δ
modules/git/notes_nogogit.go 63.07% <0.00%> (ø)
modules/context/auth.go 19.42% <0.00%> (ø)
modules/generate/generate.go 0.00% <0.00%> (ø)
models/issues/issue_user.go 81.63% <0.00%> (ø)
modules/queue/queue_channel.go 87.35% <0.00%> (ø)
models/activities/user_heatmap.go 87.17% <0.00%> (ø)
routers/api/v1/repo/label.go 82.53% <0.00%> (ø)
cmd/web_https.go 0.00% <0.00%> (ø)
modules/httpcache/httpcache.go 79.48% <0.00%> (ø)
models/actions/run_list.go 0.00% <0.00%> (ø)
... and 1103 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Feb 9, 2023
@lunny lunny added the type/bug label Feb 9, 2023
@lunny lunny added this to the 1.19.0 milestone Feb 9, 2023
@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Feb 10, 2023
@zeripath
Copy link
Contributor

hmm...

  1. is .visibility always set? I have a feeling not and if so this is likely to cause an NPE unless gotemplate have got round to changing the or to short-circuit (which as far as I know was still only in discussion)
  2. If .visibility is not always set we should use its presence or not to determine whether to use the last submitted form value or not.
    i.e.
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="0" {{if .visibility}}{{if  .visibility.IsPublic}}checked{{end}}{{else if .DefaultOrgVisibilityMode.IsPublic}}checked{{end}}/>
  1. Or better just change the rendering code to always set ctx.Data["visibility"] with the correct default environment variables and simplify to:
<input class="hidden enable-system-radio" tabindex="0" name="visibility" type="radio" value="0" {{if  .visibility.IsPublic}}checked{{end}}/>

@lunny lunny removed this from the 1.19.0 milestone Feb 20, 2023
@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
@sillyguodong sillyguodong deleted the bugfix/issue_22833 branch February 29, 2024 03:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 1 This PR needs approval from one additional maintainer to be merged. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Holding the values in form when the post request is failed with error
6 participants