-
-
Notifications
You must be signed in to change notification settings - Fork 629
Added category filter and unified sorting to Projects search component #4168
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
Open
anurag2787
wants to merge
16
commits into
OWASP:main
Choose a base branch
from
anurag2787:feature/search-filter-implementation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
dc3c3c2
Added category filter and unified sorting to Projects search component
anurag2787 469c844
fixed review
anurag2787 3bbbd35
Merge branch 'main' of github.com:anurag2787/Nest into feature/search…
anurag2787 18081b7
fixed review
anurag2787 b3997a2
fixed coderabbit review
anurag2787 4425706
Merge branch 'main' into feature/search-filter-implementation
anurag2787 686ff76
Added test for the changes
anurag2787 59ddf1e
Merge branch 'main' into feature/search-filter-implementation
anurag2787 90a51f2
fixed review
anurag2787 bc6de7a
fixed review
anurag2787 370d866
Merge branch 'main' of github.com:anurag2787/Nest into feature/search…
anurag2787 b96c1a0
Added Category model
anurag2787 26da777
Fix sonarqube warning
anurag2787 128f0ba
fixed review
anurag2787 ce2e2d9
Merge branch 'main' of github.com:anurag2787/Nest into feature/search…
anurag2787 ef3d842
code rabbit review
anurag2787 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| """Filters for OWASP Project.""" | ||
|
|
||
| import strawberry_django | ||
| from django.db.models import Q | ||
|
|
||
| from apps.owasp.models.enums.project import ProjectType | ||
| from apps.owasp.models.project import Project | ||
|
|
||
|
|
||
| @strawberry_django.filter_type(Project, lookups=True) | ||
| class ProjectFilter: | ||
| """Filter for Project.""" | ||
|
|
||
| @strawberry_django.filter_field | ||
| def type(self, value: ProjectType, prefix: str): | ||
| """Filter by project type (category).""" | ||
| return Q(type=ProjectType(value)) if value else Q() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| """OWASP Project Ordering.""" | ||
|
|
||
| import strawberry | ||
| from strawberry_django import order_type | ||
|
|
||
| from apps.owasp.models.project import Project | ||
|
|
||
|
|
||
| @order_type(Project) | ||
| class ProjectOrder: | ||
| """Ordering for Project.""" | ||
|
|
||
| contributors_count: strawberry.auto | ||
| created_at: strawberry.auto | ||
| forks_count: strawberry.auto | ||
| level: strawberry.auto | ||
| name: strawberry.auto | ||
| stars_count: strawberry.auto | ||
| updated_at: strawberry.auto |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.