-
Notifications
You must be signed in to change notification settings - Fork 575
Add Entity and Search pages #3799
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
base: main
Are you sure you want to change the base?
Add Entity and Search pages #3799
Conversation
Codecov Report❌ Patch coverage is 🚀 New features to boost your workflow:
|
pontoon/search/views.py
Outdated
| from pontoon.base.models.entity import Entity | ||
|
|
||
|
|
||
| BASE_URL = "http://localhost:8000/api/v2" |
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.
Is there anywhere we have a macro that includes the BASE_URL, irrespective of production or local environment?
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.
We have SITE_URL, but I'm not sure you mean that. Irrespective or respective?
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.
If the DRF endpoint is part of the same Django project, you don’t need to make an actual HTTP request — you can just invoke the view logic directly, which should be faster and doesn’t require the network stack.
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 might need to make this happen - for some endpoints like /new-search/?search=fi&locale=en-CA, the fetching is quite slow(around 5 seconds), which could signify a problem with the implementation, but will also be sped up with this.
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 sounds more like a DB rather than a network latency issue.
pontoon/search/views.py
Outdated
| from pontoon.base.models.entity import Entity | ||
|
|
||
|
|
||
| BASE_URL = "http://localhost:8000/api/v2" |
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.
We have SITE_URL, but I'm not sure you mean that. Irrespective or respective?
pontoon/search/views.py
Outdated
| from pontoon.base.models.entity import Entity | ||
|
|
||
|
|
||
| BASE_URL = "http://localhost:8000/api/v2" |
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.
If the DRF endpoint is part of the same Django project, you don’t need to make an actual HTTP request — you can just invoke the view logic directly, which should be faster and doesn’t require the network stack.
You are 100% right |
This comment was marked as outdated.
This comment was marked as outdated.
The URL change sounds like a low hanging fruit, so I suggest just doing it. Re clipboard: note that we already have it implemented in Machinery. |
As per the Slack "spec" we're missing the source string metadata on the entity page, as well as the Link to translate view. |
pontoon/search/views.py
Outdated
| from pontoon.base.models.entity import Entity | ||
|
|
||
|
|
||
| BASE_URL = "http://localhost:8000/api/v2" |
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 sounds more like a DB rather than a network latency issue.
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.
Thanks for the update.
A general note: It's hard to follow the changes if not all comments are addressed. We either need to keep track of the exact list of things to do, or (preferable) address all review comments before requesting a new review.
We should:
- Investigate why is the initial page load of the /search page rather slow
- Require explicit
truevalue for all boolean query parameters - Use semantic elements and class names in markup
- Keep entity.key in /search and /entities unless it's just a reformated string (e.g. in PO files)
- Add keyboard shortcut to trigger search with
Enter - Add ability to copy search results to clipboard
eea8361 to
297688f
Compare
Updates translation search page with checkboxes, project/locale selectors with jQuery. Adds backend view, URL routing, and project selector macro to support searching by locale, project, and various options. Update settings pipeline.
4c90308 to
9568466
Compare
Creates 2 pages, one which conducts entity translation search, the other displays the entity with all translations.
Inspired by the functionality of Tranvision.