Skip to content

feat: create section and subsection in library - #2013

Merged
ChrisChV merged 11 commits into
openedx:masterfrom
open-craft:navin/fal-4170/create-section-subsection
May 28, 2025
Merged

feat: create section and subsection in library#2013
ChrisChV merged 11 commits into
openedx:masterfrom
open-craft:navin/fal-4170/create-section-subsection

Conversation

@navinkarkera

@navinkarkera navinkarkera commented May 21, 2025

Copy link
Copy Markdown
Contributor

Description

Adds create section and subsection buttons in sidebar.

Useful information to include:

  • Which edX user roles will this change impact? Common user roles are "Course Author"

image

image

Supporting information

Testing instructions

  • Use New button in library authoring page.
  • Verify that new section, subsection and unit buttons work.
  • Verify that the above buttons work as expected in collections as well, i.e., after creating container, it should be linked with the collection.

Other information

Include anything else that will help reviewers and consumers understand the change.

  • Does this change depend on other changes elsewhere?
  • Any special concerns or limitations? For example: deprecations, migrations, security, or accessibility.

@openedx-webhooks openedx-webhooks added open-source-contribution PR author is not from Axim or 2U core contributor PR author is a Core Contributor (who may or may not have write access to this repo). labels May 21, 2025
@openedx-webhooks

openedx-webhooks commented May 21, 2025

Copy link
Copy Markdown

Thanks for the pull request, @navinkarkera!

This repository is currently maintained by @bradenmacdonald.

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 approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To 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:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.

Details
Where 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:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@codecov

codecov Bot commented May 21, 2025

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.98%. Comparing base (01243af) to head (dd49ded).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #2013    +/-   ##
========================================
  Coverage   93.98%   93.98%            
========================================
  Files        1155     1155            
  Lines       24146    24176    +30     
  Branches     5116     5222   +106     
========================================
+ Hits        22693    22723    +30     
+ Misses       1385     1376     -9     
- Partials       68       77     +9     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@navinkarkera
navinkarkera force-pushed the navin/fal-4170/create-section-subsection branch from c5cf00a to 54ada1b Compare May 22, 2025 06:37
@navinkarkera
navinkarkera marked this pull request as ready for review May 22, 2025 06:47
@navinkarkera
navinkarkera requested review from ChrisChV and rpenido May 22, 2025 06:48

@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 👍
Thank you for your work, @navinkarkera!

  • I tested this using the instructions from the PR
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation

I just added some nits.

Comment thread src/generic/key-utils.ts Outdated
Comment thread src/library-authoring/add-content/AddContent.test.tsx Outdated
Comment on lines +44 to +58
createUnitModalNamePlaceholder: {
id: 'course-authoring.library-authoring.modals.create-unit.form.name.placeholder',
defaultMessage: 'Give a descriptive title',
description: 'Placeholder of the Name field of the Create Unit modal form',
},
createSubsectionModalNamePlaceholder: {
id: 'course-authoring.library-authoring.modals.create-subsection.form.name.placeholder',
defaultMessage: 'Give a descriptive title',
description: 'Placeholder of the Name field of the Create Subsection modal form',
},
createSectionModalNamePlaceholder: {
id: 'course-authoring.library-authoring.modals.create-section.form.name.placeholder',
defaultMessage: 'Give a descriptive title',
description: 'Placeholder of the Name field of the Create Section modal form',
},

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.

What do you think about removing the common strings here?

Suggested change
createUnitModalNamePlaceholder: {
id: 'course-authoring.library-authoring.modals.create-unit.form.name.placeholder',
defaultMessage: 'Give a descriptive title',
description: 'Placeholder of the Name field of the Create Unit modal form',
},
createSubsectionModalNamePlaceholder: {
id: 'course-authoring.library-authoring.modals.create-subsection.form.name.placeholder',
defaultMessage: 'Give a descriptive title',
description: 'Placeholder of the Name field of the Create Subsection modal form',
},
createSectionModalNamePlaceholder: {
id: 'course-authoring.library-authoring.modals.create-section.form.name.placeholder',
defaultMessage: 'Give a descriptive title',
description: 'Placeholder of the Name field of the Create Section modal form',
},
createContainerModalNamePlaceholder: {
id: 'course-authoring.library-authoring.modals.create-container.form.name.placeholder',
defaultMessage: 'Give a descriptive title',
description: 'Placeholder of the Name field of the Create Container modal form',
},

@navinkarkera navinkarkera May 23, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@rpenido Kept them separate for translators to provide different translations if required for section, subsection and units.

Comment thread src/library-authoring/add-content/AddContent.tsx Outdated
Comment thread src/library-authoring/add-content/AddContent.tsx Outdated
Comment thread src/library-authoring/add-content/AddContent.tsx Outdated
@mphilbrick211 mphilbrick211 added the FC Relates to an Axim Funded Contribution project label May 22, 2025
@mphilbrick211 mphilbrick211 moved this from Needs Triage to Waiting on Author in Contributions May 22, 2025
@mphilbrick211 mphilbrick211 moved this from Waiting on Author to In Eng Review in Contributions May 22, 2025
@navinkarkera
navinkarkera force-pushed the navin/fal-4170/create-section-subsection branch from 54ada1b to 0f3a45d Compare May 23, 2025 09:44
Comment thread src/generic/key-utils.ts Outdated
Comment thread src/generic/key-utils.ts Outdated
Comment on lines 43 to 53
// "Create New Section" modal
isCreateSectionModalOpen: boolean;
openCreateSectionModal: () => void;
closeCreateSectionModal: () => void;
// "Create New Subsection" modal
isCreateSubsectionModalOpen: boolean;
openCreateSubsectionModal: () => void;
closeCreateSubsectionModal: () => void;
// "Create New Unit" modal
isCreateUnitModalOpen: boolean;
openCreateUnitModal: () => void;

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.

@navinkarkera what do you think about merging these values and functions? All are containers and open the same modal

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hmm, was not so sure about it. Is this better: f6e3a83?

@ChrisChV ChrisChV May 26, 2025

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.

Looks good for me. What are your concerns?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@ChrisChV No, it looks good now. Initially, I did not want to replace toggle with state, but it looks fine.

Comment thread src/library-authoring/LibraryAuthoringPage.test.tsx
@navinkarkera
navinkarkera force-pushed the navin/fal-4170/create-section-subsection branch from 75cc038 to f6e3a83 Compare May 24, 2025 06:43
@navinkarkera
navinkarkera requested a review from ChrisChV May 24, 2025 07:14
@navinkarkera
navinkarkera force-pushed the navin/fal-4170/create-section-subsection branch from 666a80f to 0683ad2 Compare May 26, 2025 14:21
@navinkarkera
navinkarkera force-pushed the navin/fal-4170/create-section-subsection branch from 0683ad2 to a147170 Compare May 27, 2025 11:14
@navinkarkera
navinkarkera force-pushed the navin/fal-4170/create-section-subsection branch from a147170 to dd49ded Compare May 28, 2025 13:25
@ChrisChV
ChrisChV merged commit afd6afd into openedx:master May 28, 2025
@github-project-automation github-project-automation Bot moved this from In Eng Review to Done in Contributions May 28, 2025
@ChrisChV
ChrisChV deleted the navin/fal-4170/create-section-subsection branch May 28, 2025 21:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core contributor PR author is a Core Contributor (who may or may not have write access to this repo). FC Relates to an Axim Funded Contribution project 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