feat: remove legacy library user access, import, and export pages#38719
feat: remove legacy library user access, import, and export pages#38719salman2013 wants to merge 10 commits into
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Thanks for the pull request, @salman2013! 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. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…iews Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
These templates were only ever rendered by the library branch of import_handler and export_handler. Both handlers now unconditionally redirect to the MFE, so the templates are dead code.
This reverts commit 4d0fc72.
There was a problem hiding this comment.
Pull request overview
Removes legacy Studio (CMS) UI surfaces specific to legacy (v1) content libraries, including library user-access management and library import/export pages, and simplifies import/export codepaths to be course-only.
Changes:
- Removed the legacy “Library User Access” route/view/template and its JS factory/spec mocks.
- Removed library-specific navigation items (User Access / Import / Export) from the library header UI.
- Simplified import/export templates and JS factories/views to remove
librarybranching and parameters.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| cms/urls.py | Removes the manage_library_users URL route for libraries. |
| cms/templates/widgets/header.html | Removes library header dropdown links for User Access / Import / Export. |
| cms/templates/manage_users_lib.html | Deletes the legacy library user-access management page template. |
| cms/templates/js/mock/mock-manage-users-lib.underscore | Deletes mock fixture for library user-access page (RW). |
| cms/templates/js/mock/mock-manage-users-lib-ro.underscore | Deletes mock fixture for library user-access page (RO). |
| cms/templates/import.html | Removes library-specific import copy/logic; makes template course-only. |
| cms/templates/export.html | Removes library-specific export copy/logic; makes template course-only. |
| cms/static/js/views/export.js | Removes isLibrary state and library-specific error messaging paths. |
| cms/static/js/spec/views/pages/library_users_spec.js | Deletes Jasmine spec for legacy library user-access page. |
| cms/static/js/features/import/factories/import.js | Removes library parameter handling; now course-only import messaging. |
| cms/static/js/factories/manage_users_lib.js | Deletes legacy JS factory for library user-access page. |
| cms/static/js/factories/export.js | Updates factory signature and calls to match course-only export behavior. |
| cms/static/cms/js/spec/main.js | Removes deleted library_users_spec from the spec bundle. |
| cms/djangoapps/contentstore/views/tests/test_library.py | Removes test coverage tied specifically to the deleted legacy user-access page. |
| cms/djangoapps/contentstore/views/library.py | Removes manage_library_users view and related imports/exports. |
| cms/djangoapps/contentstore/views/import_export.py | Removes legacy library export rendering; redirects export HTML to MFE; import HTML redirect remains. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -45,9 +41,8 @@ | |||
| from ..toggles import libraries_v1_enabled | |||
| from ..utils import add_instructor, reverse_library_url | |||
There was a problem hiding this comment.
reverse_library_url is still imported here but its only caller — manage_library_users — was deleted in this PR. This will produce a linter warning. Safe to remove from the import line.
There was a problem hiding this comment.
reverse_library_url is still in use at library.py:267 for the library_handler URL, so it can't be removed.
|
No test coverage for library key behavior in The test plan checks that course import/export pages still work, but there are no tests asserting what happens when either handler receives a
These two paths now diverge (one redirects incorrectly, one 404s), and neither outcome is tested. Even a simple test asserting the expected status code/redirect for each handler when passed a library key would prevent regressions if the behavior needs to change later. |
Summary
This PR removes three legacy v1 content library UI pages from Studio (CMS) and cleans up all associated dead code.
Changes
1. Remove the legacy library user access page
manage_library_usersview fromlibrary.py/library/<key>/team/fromcms/urls.pymanage_users_lib.htmlmanage_users_lib.jslibrary_users_spec.jsand mock templatesheader.html2. Remove the legacy library import page
import_handlerinimport_export.pyimport.htmlimport.jsfactory3. Remove the legacy library export page
export_handlerinimport_export.pyexport.htmlisLibraryand library branches fromexport.jsandfactories/export.js4. Search and destroy unused REST APIs and utility code
LibraryUserRole) from_course_team_userREST API inuser.pyis_librarycheck andnot is_libraryauto-enrollment guard fromuser.pyLibraryLocator,LibraryUserRolefromuser.py;render_to_response,reverse_library_urlfromimport_export.pyTest plan