10885 Commits

Author SHA1 Message Date
Chris Chávez
3f5ac6ddbc fix: Update on_commit_changes_to of modulestore to check MySQL transaction [FC-0097] (#37485)
- `handle_update_xblock_upstream_link` is called asynchronously with celery. In `update_upstream_downstream_link_handler`, the xblock has the updated version, but when calling `handle_update_xblock_upstream_link` inside Celery, the xblock is outdated in a previous version, which is why the error occurs. This happens because `on_commit_changes_to` is executed before the MySQL transaction ends.
- Added `ImmediateOnCommitMixin` to be used in tests that need to call `on_commit_changes_to`. See https://github.com/openedx/edx-platform/pull/37485#issuecomment-3412979170  for more info
2025-10-20 17:02:04 -05:00
Feanil Patel
28ab2ceb67 fix: Drop other references to studiofrontend.
Drop tooling to load studio-frontend components into mako templates and
XSS testing features related to it.
2025-10-20 14:08:45 -04:00
Feanil Patel
fcfa4138fd feat!: Drop the legacy files and uplades page.
The assets page and related tests and settings flags will be removed.
They have been replaced with a new implementation in the
frontend-app-authoring MFE.

BREAKING CHANGE: The legacy_studio.files_uploads flag has been removed
and will no longer allow operators to fall back to the legacy files and
uploads view.  The new MFE version is now the only available veiew.
2025-10-20 11:50:05 -04:00
Feanil Patel
c2d65c9225 Merge pull request #37462 from openedx/feanil/drop_course_outline
feat!: Drop the legacy course_outline page.
2025-10-20 11:49:21 -04:00
Feanil Patel
91010abc17 Merge pull request #37454 from openedx/feanil/drop_course_home
feat!: Drop the legacy studio course home page
2025-10-20 11:45:58 -04:00
Feanil Patel
83cfa1d58b docs: Apply suggestion from @kdmccormick
Co-authored-by: Kyle McCormick <kyle@axim.org>
2025-10-20 10:26:53 -04:00
Feanil Patel
ad4b0541f8 test: Don't test HTML views that no longer exist.
The removed tests either needed to check things on the outline page
which makes them not relevant tests, or they just needed data from the
course_handler which they can get from json now.
2025-10-20 10:26:49 -04:00
Feanil Patel
5b1362fdb1 test: Drop the header menu tests.
The tests were testing a set of menu items that were specifically
available on the old course_outline page.  Since the page is never
rendered we don't need to test to see if those header items are actually
rendered.

As we finish the rest of the studio frontend cleanup, the header itself
should be removed but just removing these tests since they relied on
conditional bits of the header for when it was showing a course outline.
2025-10-20 10:26:48 -04:00
Feanil Patel
e64d4cee8d feat!: Drop the legacy course_outline page.
This page has been replaced with an equivalent page in the authoring MFE
which has been on by default since Teak.  This change removes the
ability to fallback to the old page using waffle flags.

BREAKING CHANGE: The `legacy_studio.course_outline` waffle flag will be removed
and the code will behave as if it's always set to `False`. Preventing
you from falling back to the old Course Outline page.
2025-10-20 10:26:48 -04:00
Feanil Patel
1ca24ee71c docs: Add a link to future cleanup ticket.
Co-authored-by: Kyle McCormick <kyle@axim.org>
2025-10-20 10:24:08 -04:00
Navin Karkera
744cc87ffb feat: follow migrated legacy library content block (#37405)
* feat: show item bank ui for migrated legacy library content

* feat: migrate legacy content block to item bank block on view in studio

* fix: duplicate and copy issues

* refactor: migration location and add tests

* fix: lint issues

* fix: item bank and library content children view add button functionality

Newly added blocks from library in children view page of item bank block
and migrated library content block were not displayed automatically.

* fix: lint issues

* fix: lint issues

* feat: only migrate if same version of library is migrated

* refactor: migrate block on request

* fix: component reload on migration

* fix: tests

* refactor: comments and message wordings

* refactor: update alert text

* docs: add context

* fix: component links not being created on migrating legacy blocks

* fix: api docs and types

* refactor: use inheritance and specific parent method call

* fix: imports

* fix: api typing

* fix: upstream_version check

* refactor: rename variables

* refactor: parsing entity keys to usage_keys
2025-10-20 11:20:37 +05:30
Feanil Patel
7c8020d29d feat: Update the home_library url to redriect to the MFE.
The url previously pointed to the legacy index.html with the libraries
tab loaded.  Now it redirects to the new libraries endpoint in the
authoring MFE.
2025-10-17 10:25:03 -04:00
Feanil Patel
30d219fe71 test: Switch the contentstore tests to use APIs
Since we're trying to drop the underlying page, switch to the equivalent
API views for these contentstore tests.
2025-10-17 10:25:03 -04:00
Feanil Patel
b6b9599f18 test: Drop useless tests.
We had a set of i18n tests that testing basic english is working on a
page that's going away.  It's not necessary. And then we have a skipped
test that tests i18n. It would be good to have actual i18n tests and
there are some other ones in this file at the block level that do test
i18n but since this test isn't actually testing anything novel there's
no need to keep it.
2025-10-17 10:25:03 -04:00
Feanil Patel
63286258ec test: Drop tests related to the legacy course home view.
This view has been replaced with a new courses API endpoint
`/contentstore/v2/home/courses` which has its own tests.
2025-10-17 10:25:03 -04:00
Feanil Patel
0077058e37 feat!: Drop the legacy studio home page.
This is the page that lists the courses in studio.  This has been
replaced by an MFE and the MFE has been on by default since Teak.

BREAKING CHANGE: Setting the `legacy_studio.home` waffle flag will no longer
work.  The code will behave as if this is set to false showing the new
studio authoring MFE experience for the course home page.

This has been the default since Teak.
2025-10-17 10:25:03 -04:00
Feanil Patel
6ac4201604 fix: Drop the image modal on containers.
This is only needed to make the legacy editor work on containers. Added
originally via https://github.com/openedx/edx-platform/pull/17834

However, now that we use the new MFE text editor even on this legacy
page, we don't need to load the old image modal in the old text editor.
2025-10-16 15:01:36 -04:00
Feanil Patel
e50d1cc83b feat: Drop the unused edit view template.
And update the studio-view function to raise a NotImplementedError since
we now rely on the authoring environment to provide the edit view of
this block.

Unfortunately, a copy of the template lives in the lms and relies on the
the underlying JS and CSS to render a tiny-mce editor in the instructor
dashboard. This means we can't remove the CSS and JS until we've dropped
the usage of it in the instructor dash.  The good news is, that the work
to replace the instructor dash is in progress so those assets should get
cleaned up soon.

The places where the JS and CSS is still being used are:

* lms/templates/instructor/instructor_dashboard_2/instructor_dashboard_2.html
* lms/djangoapps/instructor/views/instructor_dashboard.py
2025-10-16 15:01:36 -04:00
Feanil Patel
e68eab9e5b feat: Drop the legacy_studio.text_editor flag.
Remove the flag and update the code paths as if it's always set to true.
2025-10-16 15:01:36 -04:00
Chris Chávez
7e1a17a707 feat: Multiple updates to handle children upstream info [FC-0097] (#37433)
* Which edX user roles will this change impact? "Developer"".
* Added `upstream_ready_to_sync_children_info` in `ContainerChildrenSerializer`
* Now, the `ContainerChildrenView` can return the `upstream_ready_to_sync_children_info`
* Update the child info in `UpstreamLink._check_children_ready_to_sync`
2025-10-15 19:16:51 -05:00
Feanil Patel
2268c5a92f fix: Remove templates which are never used.
The code that renders these was removed some time ago but this got missed I
guess.

This cleanup is part of
https://github.com/openedx/edx-platform/issues/36108 and https://github.com/openedx/studio-frontend/issues/381
2025-10-14 16:20:59 -04:00
Feanil Patel
fc374e7dfa Merge pull request #37474 from openedx/fix-assert-dict-contains-subset-depr
fix: replace deprecated assertDictContainsSubset()
2025-10-14 13:42:51 -04:00
Chris Chávez
3db4399f74 feat: bulk modulestore migration [FC-0097] (#37381)
- Adds the task, python api, and rest api view for bulk migration.
- Refactor the code to share code between single migration and bulk migration.
2025-10-13 21:34:36 +00:00
usamasadiq
8aa2970c51 fix: fix pycodestyle error 2025-10-13 22:53:37 +05:00
usamasadiq
8a2c451439 fix: replace deprecated assertDictContainsSubset() 2025-10-12 11:10:36 +05:00
Kyle McCormick
20bc7113e3 feat!: Remove Studio Maintenance & Announcements (#37432)
The announcements editor was never ported to frontend-app-authoring, and
the announcements display was never ported to frontend-app-learner-dashboard.
This announcements feature is rarely used, undocumented, non-a11y-friendly, and
there were no volunteers to port it to the new frontends. It is the last
remaining part of the legacy Studio "Maintenance" dashboard. So, we are
removing it.

BREAKING CHANGE: This removes...
* Studio Maintenance dashboard legacy frontend
* Studio Edit Announcements legacy frontend
* The snippet of legacy learner dashboard which renders announcements
* openedx/features/announcements djangoapp
* The ENABLE_ANNOUNCEMENTS feature flag

Not removed:
* The announcements_announcement table from openedx/features/announcements .
  The table is most likely very small, as it is only populated by administrators. Removing
  it would be more labor for us and more risk of toil for operators than is worthwhile.

Closes: https://github.com/openedx/edx-platform/issues/36263
2025-10-10 12:48:00 -04:00
Navin Karkera
09e86e24b2 refactor!: use String field instead of Dict field to store top_level_downstream_parent_key (#37448)
* refactor!: use String field instead of Dict field to store top_level_downstream_parent_key

Since this is a new field no production instance should have this field
yet. Developers need to delete their old courses as this change will
raise error in all course pages.

* chore: add `top_level_parent` field in ComponentLink and ContainerLink admin

* refactor: use ":" as separator

* refactor: block key parsing and tests
2025-10-09 22:03:23 +05:30
Abdul-Muqadim-Arbisoft
e5b497cbba fix: prevent None entrance_exam_minimum_score_pct from breaking CourseOverview sync (#37339)
* fix: prevent None entrance_exam_minimum_score_pct from breaking CourseOverview sync

When entrance exams are disabled in Studio, the field
`entrance_exam_minimum_score_pct` was set to `None`. This caused silent failures
when saving `CourseOverview` because the database column requires a float (NOT NULL).

This patch ensures that:
- CourseOverview sanitizes None values by falling back to
  `settings.ENTRANCE_EXAM_MIN_SCORE_PCT` (default=50).
- Studio avoids writing `None` and instead applies the configured default.

Impact:
- Prevents IntegrityErrors and silent failures when updating course settings.
- Restores proper syncing between modulestore (Mongo) and CourseOverview (MySQL).
- Fixes reported issues such as display name changes not persisting and course
  start dates not syncing.

Closes: https://github.com/openedx/edx-platform/issues/37319#

* refactor: clean up entrance_exam_minimum_score_pct handling

- Consolidate logic to avoid repeated assignments
- Centralize None fallback and int/float normalization
- Improve readability with inline comment and consistency with Open edX style

* test: update entrance exam deletion test to expect default min score

- Adjusted `test_entrance_exam_created_updated_and_deleted_successfully` to check for
  `settings.ENTRANCE_EXAM_MIN_SCORE_PCT` instead of `None` after exam deletion
- Added handling for both int and float defaults (`/100` for integer case)
2025-10-08 15:26:00 +05:00
Navin Karkera
718dac1e7b refactor: include container display name in children api (#37429)
This helps us avoid additional API calls just to fetch display name of
the container block that is being previewed.
2025-10-07 14:42:57 -05:00
Rômulo Penido
913598076c fix: add default to target_collection_slug (#37391)
adds a default `None` value to the `target_collection_slug` parameter of the migration rest API endpoint, to prevent a `KeyError`.
2025-10-06 13:53:58 -05:00
Rômulo Penido
815fd443bb fix: fix fork on multiple migrations (#37422)
Fixes a bug where, when running a migration using the fork strategy, it was only looking at the last migration, resulting in a slug reuse, which would cause a component update instead of a new component creation.
2025-10-06 12:30:11 -05:00
Kyle McCormick
8b6a94bc8d fix: Only update downstream_customized for upstream-linked blocks (#37412)
We only need to track field customizations for upstream-linked (i.e.,
library-linked) blocks. Thd downstream_customized field is irrelevant for other
blocks. It would just add a ton of noise to the OLX.

Additionally, we now clear downstream_customized when severing an upstream
link.

Fixes: https://github.com/openedx/edx-platform/issues/37411
2025-10-06 11:33:25 -04:00
Feanil Patel
e4aafc4249 Merge pull request #37361 from mitodl/marslan/6604-configurable-allowed-hosts
fix: make ALLOWED_HOSTS configurable through YAML
2025-10-06 10:35:38 -04:00
Rômulo Penido
1aa862738e feat: adds new fork migration strategy (#37408)
Implements the `fork` strategy, allowing the user to create new copies while migrating courses/legacy libraries to v2 libraries.
2025-10-02 19:35:41 -05:00
Chris Chávez
51bfd3febe feat: Add blockType to xblockPreview & title to xblock_iframe [FC-0097] (#37362)
- Adds `blockType` and `is_modified` to the `showXBlockLibraryChangesPreview` iframe message.
- Add title to the `xblock_iframe`
- Add `is-modified` to `studio_xblock_wrapper`
- Add `disable_staff_debug_info` as a query param in `render_xblock`
- `downstream_is_modified` added to ComponentLink and ContainerLink
2025-09-29 23:27:32 +00:00
Feanil Patel
d34a6b9c6f Merge pull request #37342 from raccoongang/nanai/axm-2166/update-link-generation
feat [FC-86]: update course_about & catalog link generation
2025-09-29 15:28:41 -04:00
Serhii Nanai
b448b0fe69 fix: look up ENABLE_CATALOG_MICROFRONTEND in settings directly, adjust tests 2025-09-29 14:16:46 +03:00
Vivek
86aaf2f4cc fix: update Course Highlights help URL (#37388) 2025-09-26 12:52:41 +05:00
Navin Karkera
dfe9cb8380 feat: updates legacy libraries list API to include migration info [FC-0097] (#37286)
Adds migration info like `migrated_to_title`, `migrated_to_key` and `is_migrated` fields indicating whether the legacy library was migrated to library v2. If yes, it includes the new library name and key.

Users can also filter by migration status using `is_migrated` query param.
2025-09-25 10:46:52 -05:00
Kyle McCormick
7275ce1634 feat!: modulestore_migrator (#36873)
This introduces the modulestore_migrator app, which can be
used to copy content (courses and libraries) from modulestore
into Learning Core. It is currently aimed to work on the legacy
library -> v2 library migration, but it will be used in the future
for course->library and course->course migrations.

This includes an initial REST API, Django admin interface,
and Python API.

Closes: https://github.com/openedx/edx-platform/issues/37211

Requires some follow-up work before this is production-ready:
https://github.com/openedx/edx-platform/issues/37259

Co-authored-by: Andrii <andrii.hantkovskyi@raccoongang.com>
Co-authored-by: Maksim Sokolskiy <maksim.sokolskiy@raccoongang.com>
2025-09-24 11:02:05 -04:00
Navin Karkera
5d9fc2442f refactor: course container children api [FC-0097] (#37375)
* feat: course container children view

* refactor: rename

* refactor: include children info in upstream info of container children

* fix: tests

* fix: test

* refactor: children check
2025-09-24 11:27:31 +05:30
Serhii Nanai
1c1fa1b1a1 refactor: switch to global mfe state check 2025-09-23 20:45:07 +03:00
Serhii Nanai
f018cfe70e feat: update course_about & catalog link generation 2025-09-23 20:45:01 +03:00
Devasia Joseph
ed6aea3aa7 fix: Inconsistent update state in Course Optimizer API (#37369)
* fix: Inconsistent update state in Course Optimizer API

* fix: update re-run link issue
2025-09-23 17:54:11 +05:00
Muhammad Arslan Abdul Rauf
245c76fc1b fix: add '*' wild card in common ALLOWED_HOSTS 2025-09-22 16:38:05 +05:00
Muhammad Arslan Abdul Rauf
83dbf263d7 refactor: move ALLOWED_HOSTS to openedx/envs/common 2025-09-22 16:27:14 +05:00
Muhammad Arslan Abdul Rauf
b39e6ff20e fix: make ALLOWED_HOSTS configurable through YAML 2025-09-22 16:21:22 +05:00
Taylor Payne
c3bc32399f chore: remove outdated JWT auth related settings 2025-09-19 15:18:54 -06:00
Taylor Payne
bf5a399380 Consolidate common settings to platform wide settings module (#37337)
* refactor: lift same settings up to openedx common module
2025-09-19 09:00:02 -04:00
Feanil Patel
36e458d957 fix: Use CI oriented FakeWebpackLoader
This was added in a newer version of django-webpack loader to be used in
CI.  Previously we had some monkey patches to deal with this but they
could break when changes happen to the upstream django-webpack-loader
library.

This should be a more robust solution to keep CI working and to reduce
complexity on future upgrades.
2025-09-18 10:42:26 -04:00