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

[Refactor] Unify repo search order by logic #30876

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

6543
Copy link
Member

@6543 6543 commented May 6, 2024

have repo OrderBy definitions defined in one place and use a single type for OrderBy database options

@6543 6543 added the type/refactoring Existing code has been cleaned up. There should be no new functionality. label May 6, 2024
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label May 6, 2024
@pull-request-size pull-request-size bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 6, 2024
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label May 6, 2024
// SearchOrderByFlatMap is similar to SearchOrderByMap but use human language keywords
// to decide between asc and desc
var SearchOrderByFlatMap = map[string]db.SearchOrderBy{
"newest": SearchOrderByMap["desc"]["created"],
Copy link
Member Author

Choose a reason for hiding this comment

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

this make it easyer to match human keywords with api options ... but if prefered I could also use the const directly ...

models/repo/search.go Outdated Show resolved Hide resolved
@github-actions github-actions bot added the modifies/api This PR adds API routes or modifies them label May 6, 2024
@6543
Copy link
Member Author

6543 commented May 7, 2024

I would say this refactor is ready ;)

@6543 6543 requested a review from lunny May 7, 2024 12:16
@lunny
Copy link
Member

lunny commented May 7, 2024

I would say this refactor is ready ;)

I will review and merge after v1.22 stable is released since it's a refactor PR.

6543 added a commit that referenced this pull request May 7, 2024
similar to #30784 but only for the repo explore page

is covered by #30876 for the main branch
@6543 6543 added this to the 1.23.0 milestone May 7, 2024
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/api This PR adds API routes or modifies them modifies/go Pull requests that update Go code size/L Denotes a PR that changes 100-499 lines, ignoring generated files. type/refactoring Existing code has been cleaned up. There should be no new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants