-
-
Notifications
You must be signed in to change notification settings - Fork 46
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
Added Project Page Sorting #552
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't checked out and tested this yet locally, but from the video you posted I'm thinking it would be good to show which sorting is currently applied even when the sorting dropdown is collapsed.
What do you think?
Yeah, we can do that. Currently, I show a tick mark next to the sorting attribute which is applied. If I display the component value, it might increase the size too much and look weird, since each component has a different value length. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also have some suggestions on how the search bar + sorting should look like. Let's deal with that later.
f"{env}_projects_forks_desc": ["desc(idx_forks_count)"], | ||
} | ||
|
||
client.set_settings(f"{env}_projects", {"replicas": list(replicas.keys())}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems replicas can be created in index/projects.py
backend/apps/owasp/index/project.py
Outdated
@@ -91,4 +92,26 @@ def get_queryset(self): | |||
@staticmethod | |||
def update_synonyms(): | |||
"""Update synonyms.""" | |||
ProjectIndex.configure_project_replicas() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a separate flow just similar to update_synonyms
.
Name it def configure_replicas
backend/apps/owasp/index/project.py
Outdated
replicas = { | ||
f"{env}_projects_name_asc": ["asc(idx_name)"], | ||
f"{env}_projects_name_desc": ["desc(idx_name)"], | ||
f"{env}_projects_stars_asc": ["asc(idx_stars_count)"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use full name for a new index (stars_asc -> stars_count_asc)
Resolves #73
Task Progress
sortBy
component (reusable in future)api
andsearchPageLayout
componentsMedia
sortby.mp4