-
Notifications
You must be signed in to change notification settings - Fork 81
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
feat: display all child tags in the "bare bones" taxonomy detail page [FAL-3529] [FC-0036] #703
feat: display all child tags in the "bare bones" taxonomy detail page [FAL-3529] [FC-0036] #703
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. |
9f4d892
to
ea4df3b
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #703 +/- ##
==========================================
+ Coverage 88.62% 88.69% +0.06%
==========================================
Files 446 446
Lines 6851 6875 +24
Branches 1465 1469 +4
==========================================
+ Hits 6072 6098 +26
+ Misses 754 752 -2
Partials 25 25 ☔ View full report in Codecov by Sentry. |
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.
LGTM 👍
- I read through the code
- I followed the test instructions and ran the code locally
- I checked for accessibility issues by navigating using the keyboard only
- User-facing strings are extracted for translation
I added a nit suggestion about the Title, but to me, it is ok to leave it as it is.
Also, when we click Expand all
and have a tag without children, we have an empty row drawn. This is from the DataTable
, not our SubTagsExpanded
component. We could try to hide this row using CSS, but I wonder if we should put time into this.
To meet the coverage criteria, we need to add tests to the SubTagsExpanded
and the new temporary hook.
@@ -35,6 +38,9 @@ const TaxonomyListPage = () => { | |||
|
|||
return ( | |||
<> | |||
<Helmet> |
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.
Good catch!
@@ -74,6 +79,9 @@ const TaxonomyDetailPage = () => { | |||
|
|||
return ( | |||
<> | |||
<Helmet> | |||
<title>{getPageHeadTitle('', taxonomy.name)}</title> |
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.
Feel free to push back on this, but what do you think about adding the Taxonomy header to give some context?
<title>{getPageHeadTitle('', taxonomy.name)}</title> | |
<title>{getPageHeadTitle(taxonomy.name, intl.formatMessage(taxonomyMessages.headerTitle))}</title> | |
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.
Sure, done! Though I did it slightly differently. You always want the most specific information to come first in the <title>
as that's what users can see most easily.
<ul style={{ listStyleType: 'none' }}> | ||
{subTagsData.data.results.map(tagData => ( | ||
<li key={tagData.id} style={{ paddingLeft: `${(tagData.depth - 1) * 30}px` }}> | ||
{tagData.value} <span className="text-light-900">{tagData.childCount > 0 ? `(${tagData.childCount})` : null}</span> | ||
</li> | ||
))} | ||
</ul> |
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 this date is nested, instead of using padding perhaps it can do the following:
const TagList = ({subTagData}) => (
<ul style={{ listStyleType: 'none' }}>
{subTagsData.data.results.map(tagData => (
<li key={tagData.id}>
{tagData.value} <span className="text-light-900">{tagData.childCount > 0 ? `(${tagData.childCount})` : null}</span>
{tagData.children && <TagList subTagData={tagData} />}
</li>
))}
</ul>
)
I don't know if the data is structured that way or can be accessed that way. It will avoid the need to use padding to denote hierarchy.
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.
Yes, I think that's what we'll do eventually. We're basically going to be re-building this whole table in openedx/modular-learning#130 so I didn't bother doing anything too fancy for now. Right now we're just trying to get the basic read-only functionality out the door. The data is currently just in a single array, though the tags are in "tree order" in that array, which is why we can display them this way and why I went with the simplest option.
Yeah, it's not worth spending time on for now. This is just a very temporary solution. We're going to have to build this datatable quite differently to implement tickets like openedx/modular-learning#130 and openedx/modular-learning#128 . |
@@ -7,6 +7,7 @@ const getApiBaseUrl = () => getConfig().STUDIO_BASE_URL; | |||
export const getTaxonomyListApiUrl = (org) => { | |||
const url = new URL('api/content_tagging/v1/taxonomies/', getApiBaseUrl()); | |||
url.searchParams.append('enabled', 'true'); | |||
url.searchParams.append('page_size', '500'); // For the tagging MVP, we don't paginate the taxonomy list |
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.
@ChrisChV FYI - I included a quick fix here for the pagination issue on the taxonomy list page.
c821d2d
to
61de124
Compare
@bradenmacdonald Is this PR complete and ready to merge from your side? |
@xitij2000 Yes, thanks! |
@bradenmacdonald Could you squish the commits and add a commit description? |
Also includes: - feat: set <title> on taxonomy list page and taxonomy detail page - fix: display all taxonomies on the list page, even if > 10 - refactor: separate out loading spinner component
61de124
to
eb1ea74
Compare
@xitij2000 Sure, done. Is the "Squash and Merge" feature not enabled for this repo? |
@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. |
@bradenmacdonald Is this PR complete and ready to merge from your side?
It is, however it doesn't generate a good commit message, it merely squishes together all the messages, often adding unnecessary temporary commit messages. It's best for the original author to do this since they'll have best context on what all to include in the message. |
…#703) Also includes: - feat: set <title> on taxonomy list page and taxonomy detail page - fix: display all taxonomies on the list page, even if > 10 - refactor: separate out loading spinner component
…#703) Also includes: - feat: set <title> on taxonomy list page and taxonomy detail page - fix: display all taxonomies on the list page, even if > 10 - refactor: separate out loading spinner component
…#703) Also includes: - feat: set <title> on taxonomy list page and taxonomy detail page - fix: display all taxonomies on the list page, even if > 10 - refactor: separate out loading spinner component
…#703) Also includes: - feat: set <title> on taxonomy list page and taxonomy detail page - fix: display all taxonomies on the list page, even if > 10 - refactor: separate out loading spinner component
…#703) Also includes: - feat: set <title> on taxonomy list page and taxonomy detail page - fix: display all taxonomies on the list page, even if > 10 - refactor: separate out loading spinner component
Ticket: openedx/modular-learning#138
This PR has some minor improvements to the "Taxonomy Detail Page".
This is not the final UI design and all of this can/will be changed - this just makes sure that users can see all the tags in the taxonomy during our initial round of testing.
Before:
After:
Test Instructions
Note that you need to have openedx/openedx-learning#119 checked out locally or you may see duplicate results in the tag tree.
Private ref: FAL-3529