Skip to content

feat: Add v2 lib components content tags support - #771

Merged
xitij2000 merged 1 commit into
openedx:masterfrom
open-craft:yusuf-musleh/support-library-components-content-tags
Jan 8, 2024
Merged

feat: Add v2 lib components content tags support#771
xitij2000 merged 1 commit into
openedx:masterfrom
open-craft:yusuf-musleh/support-library-components-content-tags

Conversation

@yusuf-musleh

@yusuf-musleh yusuf-musleh commented Dec 27, 2023

Copy link
Copy Markdown
Member

Description

Add support for fetching content data for Library V2 components in content tags drawer.

Supporting Information

Related Tickets:

Testing Instructions


Private-ref: FAL-3599

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Dec 27, 2023
@openedx-webhooks

openedx-webhooks commented Dec 27, 2023

Copy link
Copy Markdown

Thanks for the pull request, @yusuf-musleh! 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.

@codecov

codecov Bot commented Dec 27, 2023

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6c0fc09) 89.62% compared to head (6ed9650) 89.62%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #771   +/-   ##
=======================================
  Coverage   89.62%   89.62%           
=======================================
  Files         499      499           
  Lines        8085     8089    +4     
  Branches     1705     1708    +3     
=======================================
+ Hits         7246     7250    +4     
  Misses        812      812           
  Partials       27       27           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@yusuf-musleh
yusuf-musleh force-pushed the yusuf-musleh/support-library-components-content-tags branch from 34c4a8b to ef06857 Compare December 28, 2023 13:24
@yusuf-musleh
yusuf-musleh marked this pull request as ready for review December 29, 2023 13:20

@rpenido rpenido left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

@yusuf-musleh
yusuf-musleh force-pushed the yusuf-musleh/support-library-components-content-tags branch from ef06857 to cfef80e Compare January 8, 2024 07:54
@yusuf-musleh

Copy link
Copy Markdown
Member Author

@xitij2000 This is ready for CC review.

@xitij2000 xitij2000 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks good. One small minor suggestion.

Comment thread src/content-tags-drawer/data/api.js Outdated
Comment on lines +32 to +37
export const getContentDataApiUrl = (contentId) => (
// Check if the contentId belongs to a V2 library component
contentId.startsWith('lb:')
? new URL(`/api/libraries/v2/blocks/${contentId}/`, getApiBaseUrl()).href
: new URL(`/xblock/outline/${contentId}`, getApiBaseUrl()).href
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is not a huge deal, but I feel it might be better to keep the URL function "dumb" and keep this if elsewhere.

i.e. have two function getXBlockContentDataApiURL and getLibraryContentDataApiUrl and the decision of which to be used can be elsewhere.

Does that make sense?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point, yup I agree it would be cleaner to remove the logic from the URL function and keep it simple. I've updated it with your suggestion and put the logic where the URL functions are called in getContentData.

@yusuf-musleh
yusuf-musleh force-pushed the yusuf-musleh/support-library-components-content-tags branch from cfef80e to c145b9f Compare January 8, 2024 09:20
@yusuf-musleh
yusuf-musleh force-pushed the yusuf-musleh/support-library-components-content-tags branch from c145b9f to 6ed9650 Compare January 8, 2024 09:26
@xitij2000
xitij2000 merged commit 138f1d2 into openedx:master Jan 8, 2024
@openedx-webhooks

Copy link
Copy Markdown

@yusuf-musleh 🎉 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 yusuf-musleh/support-library-components-content-tags branch January 8, 2024 09:42
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.

4 participants