Skip to content
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

Implement the feature that close issuse as archived/merged/resolved #23522

Closed
wants to merge 29 commits into from

Conversation

sillyguodong
Copy link
Contributor

@sillyguodong sillyguodong commented Mar 16, 2023

Close #22793
Implement the feature of "Close as archived / resolved / merged"

  1. Create a new issues, open the dropdown, user can select what they want to do.
    image

  2. click the left button, submit with a comment.
    image
    image

  3. in the issue list, we can see what kind of closed status in the tooltip
    image

@delvh delvh added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Mar 16, 2023
@delvh delvh added this to the 1.20.0 milestone Mar 16, 2023
// IssueStateOpen
IssueStateOpen IssueCloseState = iota
// IssueStateLocked
IssueStateLocked
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure whether this is the final design (I see this PR is WIP), but I'd like to have quick comment about this design: I guess the "Locked" should be a separate state. For example: Merged, Merged+Locked

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 16, 2023
{{.locale.Tr "repo.issues.close_issue"}}
</button>
{{end}}

<div id="state-dropdown" class="ui dropdown jump item tooltip gt-px-3" tabindex="-1" data-content="">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you need this https://fomantic-ui.com/modules/dropdown.html#floating , instead of re-inventing wheels

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, that's exactly what i need😂

// for menu, when the popup is hidden, no need to keep the aria-activedescendant, and clear the active/selected item
} else if (!isComboBox && !needKeepAtive) {
// for menu in most cases, when the popup is hidden, no need to keep the aria-activedescendant, and clear the active/selected item
// if you really need to keep the aria-activedescendant, plz add a className 'keep-active' to the dropdown
Copy link
Contributor

@wxiaoguang wxiaoguang Mar 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

menu doesn't keep last selected item, and it would break some screen readers IIRC.

You need to make it a combobox.

For example: class=js-aria-comobox, then isCombobox=true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow, a quick comment~That's exactly what I wanted to ask you.

@@ -38,6 +38,8 @@ function attachOneDropdownAria($dropdown) {
const listPopupRole = isComboBox ? 'listbox' : 'menu';
const listItemRole = isComboBox ? 'option' : 'menuitem';

const needKeepAtive = $dropdown.hasClass('keep-active');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wxiaoguang hi, in this case, i need to keep check icon active even if the menu is hidden and reopened.
So, I add a classname 'keep-active' to the dropdown. But I'm not sure that's a good idea. Do you have better one?
image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have commented above 😂

@codecov-commenter

This comment was marked as off-topic.

@sillyguodong sillyguodong changed the title WIP: implement the feature that close issuse as archived/merged/resolved Implement the feature that close issuse as archived/merged/resolved Mar 22, 2023

const (
// IssueClosedStatusOpen
IssueClosedStatusOpen IssueClosedStatus = iota
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks meanless, can check it by Issue.IsClosed

// IssueClosedStatusResolved
IssueClosedStatusResolved
// IssueClosedStatusMerged
IssueClosedStatusMerged
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about add duplicate and stale status?

// 37
CommentTypeCloseAsResolved
// 38
CommentTypeCloseAsMerged
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess it's better to extend the CommentTypeClose , instead of adding too many new comment types.

@sillyguodong
Copy link
Contributor Author

This PR is not good enough, I am trying to rewrite this in a new branch, and will create a new PR replace this when it was done. So close it for now.

@GiteaBot GiteaBot removed this from the 1.20.0 milestone Jun 2, 2023
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 31, 2023
@sillyguodong sillyguodong deleted the feature/issue_22793 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 2 This PR needs two approvals by maintainers to be considered for merging. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue State Description
6 participants