-
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: add export course tags menu #830
feat: add export course tags menu #830
Conversation
Thanks for the pull request, @rpenido! 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. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #830 +/- ##
==========================================
+ Coverage 89.13% 89.28% +0.14%
==========================================
Files 548 551 +3
Lines 9647 9740 +93
Branches 2067 2101 +34
==========================================
+ Hits 8599 8696 +97
+ Misses 1001 996 -5
- Partials 47 48 +1 ☔ View full report in Codecov by Sentry. |
@rpenido From this discussion on the issue, I thought we were going to add nested menus here? Please continue the conversation there to ensure that everyone is OK with the solution we're providing. |
{ | ||
href: `${studioBaseUrl}/api/content_tagging/v1/object_tags/${courseId}/export/`, | ||
title: intl.formatMessage(messages['header.links.exportTags']), | ||
}, |
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.
Inclusion of this menu item needs to be gated by the same flags that we gate the other taxonomy menu items, which also means it needs tests added like these.
@pomegranited See https://chat.opencraft.com/opencraft/pl/955fm78zbfyddnzjo6akdyzjhh - I told him it's probably not worth the effort to implement submenus for now given the lack of framework support. |
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.
@rpenido Apologies, I didn't see that discussion about this menu.
This change is working great, but as mentioned, it needs to be gated by the feature flag and tests added. But the rest is great! I'll approve it when that change is made.
d92636e
to
c4c7daa
Compare
No need to apologize! I should have brought the discussion result here.
Fixed 873b902 |
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 @rpenido ! This works great.
👍 with one request for your tests. I also have one question, but it doesn't have to block this moving to upstream review.
- I tested this on my devstack while running feat: export tagged course as csv edx-platform#34091.
- I checked that with
ENABLE_TAGGING_TAXONOMY_PAGES
enabled, the "Export Course" and "Export Tags" menu items display, and work as expected. - I checked that with
ENABLE_TAGGING_TAXONOMY_PAGES
disabled, only the "Export" (course) is displayed, and still works as expected.
- I checked that with
- I read through the code
- I checked for accessibility issues by using my keyboard to navigate.
-
Includes documentationN/A - User-facing strings are extracted for translation
src/header/utils.js
Outdated
title: intl.formatMessage( | ||
getConfig().ENABLE_TAGGING_TAXONOMY_PAGES === 'true' | ||
? messages['header.links.exportCourse'] | ||
: messages['header.links.export'], |
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.
Hmm.. I'm not sure we need to do this? But I'm not sure who to ask..
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 did this to avoid changing the menu for everyone without ENABLE_TAGGING_TAXONOMY_PAGES. But I'm also not sure if we need this. Let's see if we have some comments in the Upstream/CC review.
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's fine to change the base menu text ("Export" -> "Export Course"), and I think that's better than having this more complex logic. The "Export Tags" should be gated by the flag though.
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.
Done: 20727dc
src/header/utils.test.js
Outdated
ENABLE_TAGGING_TAXONOMY_PAGES: 'true', | ||
}); | ||
const actualItems = getToolsMenuItems(props); | ||
expect(actualItems).toHaveLength(4); |
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.
Could you please test that the items shown are the items we expect (instead of just checking the length)? It's ok to just check their titles.
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: effca98
src/header/utils.test.js
Outdated
ENABLE_TAGGING_TAXONOMY_PAGES: 'false', | ||
}); | ||
const actualItems = getToolsMenuItems(props); | ||
expect(actualItems).toHaveLength(3); |
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.
Same here.
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.
Looks good! Just one issue with the export link.
src/header/utils.js
Outdated
href: `${studioBaseUrl}/export/${courseId}`, | ||
title: intl.formatMessage(messages['header.links.export']), | ||
}, { | ||
href: `${studioBaseUrl}/import/${courseId}`, |
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 path seems to point to import
, however the title seems to be for export.
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.
Thank you @xitij2000 !
Fixed here: d0b1bec
@rpenido 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future. |
Description
This PR adds an item in the
Tools
menu to allow a call of the function that exports the course tags to a CSV file.Supporting Information
Testing instructions
Manage Tags
option:Export Tags
menu from an existing taxonomy cardPrivate-ref: