-
Notifications
You must be signed in to change notification settings - Fork 11
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
Improve the "get object tags" API [FC-0036] #111
Improve the "get object tags" API [FC-0036] #111
Conversation
Thanks for the pull request, @bradenmacdonald! Please note that it may take us up to several weeks or months to complete a review and merge your PR. Feel free to add as much of the following information to the ticket as you can:
All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here. Please let us know once your PR is ready for our review and all tests are green. |
} | ||
], | ||
}, | ||
} |
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.
@yusuf-musleh If I make the "get object tags" API return data like this, it should make the unit tags overlay much simpler, right?
assert response.data == {
"problem15": {
"taxonomies": [
{
"name": "Life on Earth",
"taxonomy_id": 1,
"editable": True,
"tags": [
{
"name": "Life on Earth",
"value": "Mammalia",
"lineage": ["Eukaryota", "Animalia", "Chordata", "Mammalia"],
},
{
"name": "Life on Earth",
"value": "Fungi",
"lineage": ["Eukaryota", "Fungi"],
},
]
},
{
"name": "user AUthors",
"taxonomy_id": 3,
"editable": False,
"tags": [
{
"name": "User Authors",
"value": "test_user_1",
"lineage": ["test_user_1"],
},
],
}
],
},
}
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.
@bradenmacdonald Absolutely! This would make things much simpler. In the currently implementation there's a bunch of stitching stuff together, having this would reduce the API calls needed, especially if the taxonomies returned included taxonomies that are "available" and not only limited to ones that have their tags applied to the object (unit).
ec17ef3
to
a7d00e0
Compare
1f5a4e5
to
58afaff
Compare
58afaff
to
0fb7eb9
Compare
0fb7eb9
to
2858e1b
Compare
@pomegranited I think this is ready for review, though I may need to make some changes once I try to integrate it into edx-platform. Haven't done that side of it yet. |
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.
Couple of nits, but this looks and works great @bradenmacdonald ! 👍
- I tested this using the Django runserver
- I read through the code
-
I checked for accessibility issuesN/A - Includes documentation
- Commit structure follows OEP-0051
@bradenmacdonald 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
openedx/modular-learning#133
This PR updates the "get object tags" API so that it returns the results grouped by taxonomy, and sorted into "tree order" (just like the "get tags" API does).
I've also added a new API that can retrieve the # of tags applied to each unit for every unit on the course, in a single database query.
TODO
Before merging, check how this integrates into edx-platform.
Follow up
I could do a separate PR to allow including "available but unused" taxonomies in the result - those which don't yet have any tags applied to the object, but which the user could use to add additional tags. The permissions of that are somewhat complicated though so it's best as its own PR. Or perhaps it's fine to make the frontend construct this just by querying the list of available taxonomies directly, and appending them to its own list.
Private ref: FAL-3547