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

Show Org-level Project in Repo-projects list #33830

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jerryyummy
Copy link

fix #33378

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Mar 9, 2025
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Mar 9, 2025
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Mar 9, 2025
return
}

closeOrgProjects, closeCountForOrgProjects, err := db.FindAndCount[project_model.Project](ctx, project_model.SearchOptions{
Copy link
Member

Choose a reason for hiding this comment

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

Is it necessary to load both open and closed org projects?

Copy link
Author

Choose a reason for hiding this comment

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

it maybe necessary, you need to get the number of open projects and closed projects, in previous logic you can just get repo level projects other than org level projects.

Copy link
Member

Choose a reason for hiding this comment

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

You can use db.Count for those non-current selected org level projects rather than db.FindAndCount.

Copy link
Author

Choose a reason for hiding this comment

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

Screenshot 2025-03-10 at 10 05 22 AM i mean even if you use db.count, still need to get the number of open projects and closed projects

Copy link
Member

Choose a reason for hiding this comment

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

yes, I mean. For open state, you can use db.FindAndCount get opened projects and use db.Count for closed number. For close state, you can use db.FindAndCount get closed projects and use db.Count for opened.

@lunny lunny added the type/enhancement An improvement of existing functionality label Mar 10, 2025
@lunny lunny added this to the 1.24.0 milestone Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show Org-level Project in Repo-projects list if issues from Repo are assigned to it
3 participants