-
-
Notifications
You must be signed in to change notification settings - Fork 6k
Redirect on project after issue created #17211
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
Changes from 1 commit
1aaa769
0af4e42
34a7201
6849c8c
43b3ad9
11696b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -236,5 +236,6 @@ | |
{{end}} | ||
</div> | ||
</div> | ||
<input type="hidden" name="redirect_on_project" value="{{.redirect_on_project}}"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we can call this variable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes good idea, it's done 👍 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think it can be even shorter, what do you think about |
||
</div> | ||
</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.
Is is necessary to introduce
redirect_on_project
? Can we just check ifform.ProjectID > 0
?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 don't think it's possible, when form is submitted we can't know if user click on "new issue" button from project view, maybe he creates issue from issue list view.
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.
On which page besides
projects/view.tmpl
the new issue link usesproject_id=xxx
in query 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.
No one, but when you submit the new issue form with a project, the project_id is also filled ?
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 haven't read the source code carefully, just a feeling and curiosity: if there is no project_id, how can the newly created issue be added into current project?
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.
There is two cases :
If the project is not selected when the form is submitted the user is redirected to issue view
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.
For the first case, the
project_id
is in POST body. Soctx.Req.URL.Query().Get("project_id")
will work likeredirect_on_project
, Query().Get("project_id") only presents when the issue is created from the page view button.For me, I prefer to use use existing and simple mechanism as long as it doesn't introduce ambiguity.
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.
Ok I didn't understand what do you mean, sorry. So I removed
redirect_on_project
in URL and I usedctx.Req.URL.Query().Get("project")
to know if we should redirect on project page or notThere 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 wasn't saying clearly. 😂