-
Notifications
You must be signed in to change notification settings - Fork 178
feat: New align sidebar for Course Outline [FC-0114] #2812
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
base: master
Are you sure you want to change the base?
Conversation
|
Thanks for the pull request, @ChrisChV! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2812 +/- ##
==========================================
- Coverage 94.99% 94.96% -0.03%
==========================================
Files 1256 1257 +1
Lines 28800 28841 +41
Branches 6538 6353 -185
==========================================
+ Hits 27358 27390 +32
- Misses 1384 1393 +9
Partials 58 58 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rpenido
left a comment
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 👍
Thank you for your work, @ChrisChV!
- I tested this using the instructions from the PR
- I read through the code
- I checked for accessibility issues
- Includes documentation
Left some non-blocking comments.
Also, we need to fix the conflicts and improve the coverage.
Let me know if you want me to test/review it again after that!
| queryFn: () => getContentData(contentId!), | ||
| enabled: enabled || !!contentId, |
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 is better to use the react-query skipToken here.
Also, this condition should be and &&, right?
| queryFn: () => getContentData(contentId!), | |
| enabled: enabled || !!contentId, | |
| queryFn: (enabled && contentId) ? () => getContentData(contentId) : skipToken, |
| * @param props - The component props. | ||
| * @param props.tags - Array of taxonomy tags that are applied to the content. | ||
| * @param props.rootDepth - Depth of the parent tag (root), used to render tabs for the tree. | ||
| * @param props.parentKey - Key of the parent tag. | ||
| * @param props.lineage - Lineage of the tag. | ||
| * @param props.removeTagHandler - Function that is called when removing tags from the tree. | ||
| * @param props.afterTagsComponent - Optional component to render after the tags components. | ||
| */ | ||
| const TagsTree = ({ | ||
| tags, | ||
| rootDepth, | ||
| rootDepth = 0, | ||
| parentKey, | ||
| lineage, | ||
| lineage = [], | ||
| removeTagHandler, | ||
| }) => { | ||
| afterTagsComponent, | ||
| }: TagsTreeProps) => { |
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.
You can move the JSDoc annotations to the destructured parameters to get a more compact view.
| * @param props - The component props. | |
| * @param props.tags - Array of taxonomy tags that are applied to the content. | |
| * @param props.rootDepth - Depth of the parent tag (root), used to render tabs for the tree. | |
| * @param props.parentKey - Key of the parent tag. | |
| * @param props.lineage - Lineage of the tag. | |
| * @param props.removeTagHandler - Function that is called when removing tags from the tree. | |
| * @param props.afterTagsComponent - Optional component to render after the tags components. | |
| */ | |
| const TagsTree = ({ | |
| tags, | |
| rootDepth, | |
| rootDepth = 0, | |
| parentKey, | |
| lineage, | |
| lineage = [], | |
| removeTagHandler, | |
| }) => { | |
| afterTagsComponent, | |
| }: TagsTreeProps) => { | |
| */ | |
| const TagsTree = ({ | |
| /** Array of taxonomy tags that are applied to the content. */ | |
| tags, | |
| /** Depth of the parent tag (root), used to render tabs for the tree. */ | |
| rootDepth = 0, | |
| /** Key of the parent tag. */ | |
| parentKey, | |
| /** Lineage of the tag. */ | |
| lineage = [], | |
| /** Function that is called when removing tags from the tree. */ | |
| removeTagHandler, | |
| /** Optional component to render after the tags components. */ | |
| afterTagsComponent, | |
| }: TagsTreeProps) => { |
| import { useCourseDetails } from '@src/data/apiHooks'; | ||
| import { SidebarTitle } from '@src/generic/sidebar'; | ||
|
|
||
| export const OutlineAlignSidebar = ({ contentId }: { contentId?: string }) => { |
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.
Can we move the contentId to the OutlineSidebarContext? I think we would need the selected content in other components, and keeping it in context would avoid passing it all down the chain with props.
|
|
||
| const { | ||
| data: contentData, | ||
| } = useContentData(contentId, true); |
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.
nit
| } = useContentData(contentId, true); | |
| } = useContentData(contentId); |
Description
Supporting information
ObjectTag.is_copiedfield added to serializer [FC-0114] edx-platform#37855Testing instructions
ObjectTag.is_copiedfield added to serializer [FC-0114] edx-platform#37855Manage tagsin the Card menu.Manage tags.Other information
N/A
Best Practices Checklist
We're trying to move away from some deprecated patterns in this codebase. Please
check if your PR meets these recommendations before asking for a review:
.ts,.tsx).propTypesanddefaultPropsin any new or modified code.src/testUtils.tsx(specificallyinitializeMocks)apiHooks.tsin this repo for examples.messages.tsfiles have adescriptionfor translators to use.../in import paths. To import from parent folders, use@src, e.g.import { initializeMocks } from '@src/testUtils';instead offrom '../../../../testUtils'