gitea
gitea copied to clipboard
Close issue as archived/resolved/stale
replace #23522 close #22793 close #14893
Changes
- Add a dropdown next to the close/reopen button. The dropdown has the following options: close as archived/resolved/stale.
- Modify the default email template of the Issue.
- The API of "EditIssue" accepts new parameter:
closed_status.
Screenshot
Close issue dropdown & button:
The comment of "close as xxx":
The default email content of the Issue:
Video record
https://github.com/go-gitea/gitea/assets/33891828/003603d8-b5da-463e-ba30-203242401172
Run make lint-js-fix to fix the lint issues.
There are still problem which I can't understand, for example, why you need a form in duplicate-issue-modal and why it should be submitted. If I understand correctly, you just want to choose an issue and pass the ID to the "comment form".
So I do not know how to review, sorry
If I understand correctly, you just want to choose an issue and pass the ID to the "comment form".
I have removed the form in the duplicate-issue-modal and trigger the form submit manually after clicking confirm .
@techknowlogick please tell me if the functionality of this PR now deviates from what is expected in the issue. If it does, i will keep fixing.
Some tests for new functionality would be good.
If merged, we have to extend the api type also, update the go-sdk and add it to the migrator
@sillyguodong a couple of notes:
- when closing as duplicate, etc.. and a comment is made "#X is closed as dupe of #Y", could you also ensure that the linked issue also has a message linking back?
- the "close as x,y,z" dropdown still shows when the issue is closed.
I'm going to make some changes to the UI.
- After clicking "close as duplicate" in the dropdown, the dialog of "select duplicate issue" will display.
- And after clicking "confirm" in dialog, the dialog will hidden, and no submit form any more. The text of the close button will change to "close as duplicate {repo_name}/#{issue_index}"(issue name may be too long).
After clicking "close as duplicate" in the dropdown, the dialog of "select duplicate issue" will display.
Is is really need? On GitHub I usually comment "Duplicate of #1234" and close as "Not planned" and I think that is sufficient as well and we woudn't need extra UI. See https://github.com/go-gitea/gitea/issues/25867 for an example.
Is is really need? On GitHub I usually comment "Duplicate of #1234" and close as "Not planned" and I think that is sufficient as well and we woudn't need extra UI. See #25867 for an example.
@silverwind Since markdown editor haven't implemented # search function, and the keyword of "Duplicate of" also needs to be configurable to support multiple languages. It needs more work. So I think maybe dialog could be a temporary solution. what do you think about?
I'm going to simplify this PR and just keep the functionality of "close as archived/resolved/stale". And I will create a new PR to complete the functionality of "close as duplicate".
I will take a look and test it
Well, TBH, I think there are still many problems ....
- Is the changed code
initIssueSearchDropdownrelated to this PR? I don't see how it works - For closed issue, the dropdown menu still exists? Then choose "Close as xxx", a no-op?
- UI misalignment
I haven't done a full test, just a quick look, I guess there might be more problems .....
@wxiaoguang for 2 that is what I mentioned in my feedback above, but in exploring how github does it, they have the dropdown show even for closed items to change the closed status. So I think it is ok if we keep it this way.
@wxiaoguang for 2 that is what I mentioned in my feedback above, but in exploring how github does it, they have the dropdown show even for closed items to change the closed status. So I think it is ok if we keep it this way.
That's different. GitHub's "close" can re-mark the close state as another again. But, this PR's behavior is buggy, it is a no-op (at least, during my test it is a no-op, nothing happened when I click it)
But, this PR's behavior is buggy, it is a no-op (at least, during my test it is a no-op, nothing happened when I click it)
I made a mistake when resolving confilcts, it should be fixed in 5bf1e17.
- UI misalignment
Misalignment fixed in ef2318a and e93ece6
Fix
Can you explain why this is deleted? I think it causes bugs.
Is this screenshot up to date?

For resolved, the issue state color for resolved should go purple, not red. For other states, please check on GitHub. I think stale/archived could go grey maybe. At least on GitHub "not planned" goes gray.
See comment in https://github.com/go-gitea/gitea/issues/22793#issuecomment-1676290692, I think we should only have two closed states and not split into archived/stale.
We will need to adapt issueicon.tmpl as per https://github.com/go-gitea/gitea/issues/22793#issuecomment-1685317256.
The only reason I can think to need an 'archived' status is if you had a bug report that couldn't be verified - you could archive it to indicate that you couldn't find it rather than that it was a bug that you didn't plan to fix. Then again, I think the difference between 'we fixed this' and 'we couldn't/didn't fix this' in complete and not planned is probably sufficient to indicate that, and anyone particularly interested could just look through the issue comments.
I think it is also useful for when an issue was closed as stale, because the reporting user did not respond to a question in a long time. In that case the issue was not resolved, and I think "not planned" is not appropriate either because to me that would mean that the maintainers are not open to such a change.