Skip to content

Support setting the default attribute of the issue template dropdown field #31045

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

Merged
merged 7 commits into from
May 23, 2024

Conversation

Zettat123
Copy link
Contributor

Fix #31044

According to GitHub issue template documentation, the default attribute can be used to specify the preselected option for a dropdown field.

Zettat123 added 3 commits May 22, 2024 17:18
fix
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 22, 2024
@github-actions github-actions bot added modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files labels May 22, 2024
@lunny lunny added the backport/v1.22 This PR should be backported to Gitea 1.22 label May 22, 2024
@lunny lunny added this to the 1.23.0 milestone May 22, 2024
@lunny
Copy link
Member

lunny commented May 22, 2024

Please add tests.

@pull-request-size pull-request-size bot added size/M and removed size/S labels May 23, 2024
Zettat123 added 2 commits May 23, 2024 10:18
@pull-request-size pull-request-size bot added size/L and removed size/M labels May 23, 2024
@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 May 23, 2024
@lunny lunny requested a review from wolfogre May 23, 2024 03:48
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels May 23, 2024
@lunny lunny enabled auto-merge (squash) May 23, 2024 12:33
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label May 23, 2024
@delvh
Copy link
Member

delvh commented May 23, 2024

From the code, I am confused what happens when default hasn't been set:
It looks like it will default to an empty string. Is that the expected behavior?

@lunny lunny merged commit 7ab0988 into go-gitea:main May 23, 2024
26 checks passed
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request May 23, 2024
@GiteaBot GiteaBot added backport/done All backports for this PR have been created and removed reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. labels May 23, 2024
@Zettat123
Copy link
Contributor Author

From the code, I am confused what happens when default hasn't been set: It looks like it will default to an empty string. Is that the expected behavior?

Yes. If there are no preselected options, the value of the dropdown field defaults to empty, meaning no option is selected.

@lunny
Copy link
Member

lunny commented May 24, 2024

From the code, I am confused what happens when default hasn't been set: It looks like it will default to an empty string. Is that the expected behavior?

Sorry, I haven't refresh the page and just merged. :(

lunny pushed a commit that referenced this pull request May 24, 2024
…n field (#31045) (#31059)

Backport #31045 by @Zettat123

Fix #31044

According to [GitHub issue template
documentation](https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema#attributes-for-dropdown),
the `default` attribute can be used to specify the preselected option
for a dropdown field.

Co-authored-by: Zettat123 <zettat123@gmail.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull request May 24, 2024
* giteaofficial/main:
  [skip ci] Updated translations via Crowdin
  Support setting the `default` attribute of the issue template dropdown field (go-gitea#31045)
  Alpine 3.20 has been released (go-gitea#31047)
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created backport/v1.22 This PR should be backported to Gitea 1.22 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue template the first option will be selected by default from the dropdown of type
5 participants