Skip to content
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

Conversation

rpenido
Copy link
Contributor

@rpenido rpenido commented Feb 9, 2024

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.

image

Supporting Information

Testing instructions

  1. Use https://github.com/open-craft/taxonomy-sample-data/ to create some taxonomies.
  2. Go to the course page in Studio and add some tags to the units in the course using the Manage Tags option:
    image
  3. Go to the course authoring MFE (i.e http://apps.local.edly.io:2001/course-authoring/course/course-v1:edX+DemoX+Demo_Course using tutor)
  4. Click on the Export Tags menu from an existing taxonomy card
  5. Check if a CSV file is downloaded with the Course structure and the tags applied to its blocks.

Private-ref:

@openedx-webhooks
Copy link

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:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

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.

Copy link

codecov bot commented Feb 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1555e9f) 89.13% compared to head (d0b1bec) 89.28%.
Report is 4 commits behind head on master.

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.
📢 Have feedback on the report? Share it here.

@rpenido rpenido requested a review from pomegranited February 9, 2024 22:09
@pomegranited
Copy link
Contributor

@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']),
},
Copy link
Contributor

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.

@bradenmacdonald
Copy link
Contributor

bradenmacdonald commented Feb 13, 2024

@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.

@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.

Copy link
Contributor

@pomegranited pomegranited left a 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.

@rpenido rpenido force-pushed the rpenido/fal-3610-add-export-course-tags-menu branch from d92636e to c4c7daa Compare February 15, 2024 13:24
@rpenido
Copy link
Contributor Author

rpenido commented Feb 15, 2024

@rpenido Apologies, I didn't see that discussion about this menu.

No need to apologize! I should have brought the discussion result here.

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.

Fixed 873b902

Copy link
Contributor

@pomegranited pomegranited left a 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 read through the code
  • I checked for accessibility issues by using my keyboard to navigate.
  • Includes documentation N/A
  • User-facing strings are extracted for translation

title: intl.formatMessage(
getConfig().ENABLE_TAGGING_TAXONOMY_PAGES === 'true'
? messages['header.links.exportCourse']
: messages['header.links.export'],
Copy link
Contributor

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..

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: 20727dc

ENABLE_TAGGING_TAXONOMY_PAGES: 'true',
});
const actualItems = getToolsMenuItems(props);
expect(actualItems).toHaveLength(4);
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! Done: effca98

ENABLE_TAGGING_TAXONOMY_PAGES: 'false',
});
const actualItems = getToolsMenuItems(props);
expect(actualItems).toHaveLength(3);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Copy link
Contributor

@xitij2000 xitij2000 left a 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.

href: `${studioBaseUrl}/export/${courseId}`,
title: intl.formatMessage(messages['header.links.export']),
}, {
href: `${studioBaseUrl}/import/${courseId}`,
Copy link
Contributor

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.

Copy link
Contributor Author

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

@xitij2000 xitij2000 merged commit 0fc0ce0 into openedx:master Feb 21, 2024
6 checks passed
@openedx-webhooks
Copy link

@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.

@xitij2000 xitij2000 deleted the rpenido/fal-3610-add-export-course-tags-menu branch February 21, 2024 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants