Commit Graph

7647 Commits

Author SHA1 Message Date
Feanil Patel
88c7cd7bf3 feat!: Remove Legacy Preview Functionality (#36460)
* feat!: Remove all trivial mentions of PREVIEW_LMS_BASE

There are a few more mentions but these are all the ones that don't need
major further followup.

BREAKING CHANGE: The learning MFE now supports preview functionality
natively and it is no longer necessary to use a different domain on the
LMS to render a preview of course content.

See https://github.com/openedx/frontend-app-learning/issues/1455 for
more details.

* feat: Drop the `in_preview_mode` function.

Since we're no longer using a separate domain, that check always
returned false.  Remove it and update any places/tests where it is used.

* feat: Drop courseware_mfe_is_active function.

With the removal of the preview check this function is also a no-op now
so drop calls to it and update the places where it is called to not
change other behavior.

* feat!: Drop redirect to preview from the legacy courseware index.

The CoursewareIndex view is going to be removed eventually but for now
we're focusing on removing the PREVIEW_LMS_BASE setting.  With this
change, if someone tries to load the legacy courseware URL from the
preview domain it will no longer redirect them to the MFE preview.

This is not a problem that will occur for users coming from existing
studio links because those links have already been updated to go
directly to the new urls.

The only way this path could execute is if someone goes directly to the
old Preview URL that they saved off platform somewhere.  eg. If they
bookmarked it for some reason.

BREAKING CHANGE: Saved links (including bookmarks) to the legacy preview
URLs will no longer redirect to the MFE preview URLs.

* test: Drop the set_preview_mode test helper.

This test helper was setting the preview mode for tests by changing the
hostname that was set while tests were running.  This was mostly not
being used to test preview but to run a bunch of legacy courseware tests
while defaulting to the new learning MFE for the courseware.

This commit updates various tests in the `courseware` app to not rely on
the fact that we're in preview to test legacy courseware behavior and
instead directly patches either the `_redirect_to_learning_mfe` function
or uses the `_get_legacy_courseware_url` or both to be able to have the
tests continue to test the legacy coursewary.

This will hopefully make the tests more accuarte even though hopefully
we'll just be removing many of them soon as a part of the legacy
courseware cleanup.

We're just doing the preview removal separately to reduce the number of
things that are changing at once.

* test: Drop the `_get_urls_function`

With the other recent cleanup, this function is no longer being
referenced by anything so we can just drop it.

* test: Test student access to unpublihsed content.

Ensure that students can't get access to unpublished content.
2025-05-14 08:59:11 -04:00
Muhammad Abdullah Waheed
2d66047f7c feat: added support of multiple course ids in enrollment API and fixed failing case (#36700)
* feat: added support of multiple course ids in enrollment API and fixed failing case

* refactor: handled course IDs along with course run IDs

* refactor: added dosctring and renamed variable

* fix: added temp mixin

* test: added unit tests of added case
2025-05-14 17:22:48 +05:00
Chris Chávez
2ba9b7977f fix: Issues with get container children [FC-0083] (#36686)
* Fix published param to support strings
* Add published_display_name to children response
2025-05-12 09:44:41 -05:00
Usama Sadiq
956a28996a fix: refactor index_together to indexes for Django 5.2 support (#36693) 2025-05-12 11:46:47 +05:00
Eemaan Amir
841efcc9fb feat: update user segment attribute is_disabled when user is disabled/enabled (#36681) 2025-05-09 19:35:16 +05:00
Braden MacDonald
2e91a05112 fix: Bugs with "Publish All Changes" in Library [FC-0083] (#36640)
* fix: "[created] received a naive datetime"
* fix: leaky "isolation" of events was causing test failures
* fix: make lib events more specific, emit them async, handle hierarchy correctly
* chore: bump openedx-events to 10.2.0 for new library PUBLISHED events
2025-05-08 11:57:07 -07:00
Feanil Patel
2d78390f02 chore: Upgrade type stubs and other related packages.
Upgrade typing related packages and update to ignore one new annotation
complaint and drop and older complaint that is no longer relevant.
2025-05-07 14:38:45 -04:00
Taimoor Ahmed
1bed70b73e feat!: remove cs_comments_service support for forums pin API
This will force the use of the new v2 forums API for pinning/unpinning.
2025-05-07 10:41:37 -04:00
Hassan Raza
588840aef5 fix: Resolve group by id max length issue (#36668) 2025-05-07 11:55:00 +05:00
Jillian
5b3caa93e2 feat: store content.child_usage_keys in Container search document [FC-0083] (#36528)
* feat: store content.child_usage_keys in Container search document
  Stores the draft children + published children (if applicable)

Related fixes:
* fix: lib_api.get_container does not take a "user" arg
* refactor: fetch_customizable_fields_from_container does not need a "user" arg
* refactor: moves tags_count into LibraryItem
   because anything that appears in a library may be tagged.
* refactor: remove get_container_from_key from public API
   API users must use get_container and ContainerMetadata.
* refactor: made set_library_item_collections take an entity_key string instead of
  a PublishableEntity instance, so we don't need to fetch a Container object to call it.
* refactor: changed ContainerLink.update_or_create to take the container PK
  instead of a Container object, since this is enough.
  Added container_pk to ContainerMetadata to support this.
2025-05-02 10:47:25 +09:30
Navin Karkera
c2d9e40be4 refactor: update sync model helper function docs and minor cleanup (#36599)
* refactor: update sync model helper function docs

Adds some comments to explain certain confusing sections

* refactor: sync library content method

* feat: use edited_on block field

* test: modified field in course block index

* fix: extract uncommon methods to child class from base
2025-04-30 13:40:52 -07:00
Muhammad Adeel Tajamul
cc4c2c35cf chore: added log in disable user policy (#36622) 2025-04-29 15:11:18 +05:00
Muhammad Adeel Tajamul
47a920d5b9 feat: added a policy to prevent sending ace messages to disabled users (#36584) 2025-04-29 11:29:33 +05:00
github-actions[bot]
725234815f feat: Upgrade Python dependency edx-enterprise (#36616)
* feat: Upgrade Python dependency edx-enterprise

fix: fixing enrollments bug in members endpoint

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`

* fix: spelling fix to trigger tests

---------

Co-authored-by: kiram15 <31229189+kiram15@users.noreply.github.com>
Co-authored-by: Kira Miller <kira.miller15@yahoo.com>
2025-04-28 12:43:49 -06:00
Hassan Raza
1a28a2df3b fix: Get latest existing notification for grouping (#36614) 2025-04-28 20:10:00 +05:00
Hassan Raza
c87a3b721b chore: add temporary info log for notification grouping issue (#36600) 2025-04-25 13:15:12 +05:00
Hassan Raza
2d4defef2c fix: Add info for ORA notifications and fix for account preferences (#36571) 2025-04-25 11:33:02 +05:00
Navin Karkera
1cd73d1b96 feat: support for syncing units from libraries to courses (#36553)
* feat: library unit sync
* feat: create component link only for component xblocks
* feat: container link model
* feat: update downstream api views
* feat: delete extra components in container on sync (not working)
* fix: duplicate definitions of LibraryXBlockMetadata
* test: add a new integration test suite for syncing
* feat: partially implement container+child syncing
* fix: blockserializer wasn't always serializing all HTML block fields
* feat: handle reorder, addition and deletion of components in sync

Updates children components of unit in course based on upstream unit,
deletes removed component, adds new ones and updates order as per
upstream.

* feat: return unit upstreamInfo and disallow edits to units in courses that are sourced from a library (#773)
* feat: Add upstream_info to unit
* feat: disallow edits to units in courses that are sourced from a library (#774)

---------

Co-authored-by: Jillian Vogel <jill@opencraft.com>
Co-authored-by: Rômulo Penido <romulo.penido@gmail.com>

* docs: capitalization of XBlock

Co-authored-by: David Ormsbee <dave@axim.org>

* refactor: (minor) change python property name to reflect type better

* fix: lots of "Tried to inspect a missing...upstream link" warnings

when viewing a unit in Studio

* docs: mention potential REST API for future refactor

* fix: check if upstream actually exists before making unit read-only

* chore: fix camel-case var

* fix: test failure when mocked XBlock doesn't have UpstreamSyncMixin

---------

Co-authored-by: Braden MacDonald <braden@opencraft.com>
Co-authored-by: Chris Chávez <xnpiochv@gmail.com>
Co-authored-by: Jillian Vogel <jill@opencraft.com>
Co-authored-by: Rômulo Penido <romulo.penido@gmail.com>
Co-authored-by: Braden MacDonald <mail@bradenm.com>
Co-authored-by: David Ormsbee <dave@axim.org>
2025-04-24 11:41:47 -07:00
Kyle McCormick
8e9f94424d feat!: Flip Studio MFE Waffle Flags to be On-By-Default (#36495)
This makes nearly all of Studio React-by-default by replacing the
"opt-in-to-React" flags with a set of parallel
"opt-out-of-React-and-use-the-legacy-experience" flags. Here is the
mapping:

* `contentstore.new_studio_mfe.use_new_unit_page` ->
  `!legacy_studio.unit_editor`
* `new_core_editors.use_new_problem_editor` ->
  `!legacy_studio.problem_editor`
* `new_core_editors.use_new_text_editor` ->
  `!legacy_studio.text_editor`
* `new_core_editors.use_new_video_editor` ->
  `!legacy_studio.video_editor`
* `new_studio_mfe.use_new_home_page` ->
  `!legacy_studio.home`
* `contentstore.new_studio_mfe.use_new_custom_pages` ->
  `!legacy_studio.custom_pages`
* `contentstore.new_studio_mfe.use_new_schedule_details_page` ->
  `!legacy_studio.schedule_details`
* `contentstore.new_studio_mfe.use_new_advanced_settings_page` ->
  `!legacy_studio.advanced_settings`
* `contentstore.new_studio_mfe.use_new_grading_page` ->
  `!legacy_studio.grading`
* `contentstore.new_studio_mfe.use_new_updates_page` ->
  `!legacy_studio.updates`
* `contentstore.new_studio_mfe.use_new_import_page` ->
  `!legacy_studio.import`
* `contentstore.new_studio_mfe.use_new_export_page` ->
  `!legacy_studio.export`
* `contentstore.new_studio_mfe.use_new_files_uploads_page` ->
  `!legacy_studio.files_uploads`
* `contentstore.new_studio_mfe.use_new_course_outline_page` ->
  `!legacy_studio.course_outline`
* `contentstore.new_studio_mfe.use_new_course_team_page` ->
  `!legacy_studio.course_team`
* `contentstore.new_studio_mfe.use_new_certificates_page` ->
  `!legacy_studio.certificates`
* `contentstore.new_studio_mfe.use_new_textbooks_page` ->
  `!legacy_studio.textbooks`
* `contentstore.new_studio_mfe.use_new_group_configurations_page` ->
  `!legacy_studio.configurations`

Part of: https://github.com/openedx/edx-platform/issues/36275
2025-04-24 12:34:35 -04:00
Muhammad Adeel Tajamul
254167feb6 feat: removed new notification view waffle flag (#36585) 2025-04-24 12:11:36 +05:00
Braden MacDonald
867e246606 chore: bump opaque-keys to v3, update content libraries key usages (#36588)
See https://github.com/openedx/opaque-keys/pull/379
2025-04-23 22:03:01 +00:00
Feanil Patel
8cab446f69 test: Make pytz api related tests more resilient.
Compare the output of our API with the library that backs them so that
we don't have brittle tests that need to be updated when the number of
timezones changes.
2025-04-23 14:29:50 -04:00
Ivan Niedielnitsev
3f67f3c295 feat: Import from modulestore APIs (#36540)
This PR is addressed at adding the functionality to import
modulestore-based content to the learning-core based learning
package.

Partof: https://github.com/openedx/frontend-app-authoring/issues/1681
2025-04-23 14:28:07 -04:00
Braden MacDonald
ce00b16be7 test: Enforce application layering using import linter (#36581)
* test: add import linters to promote clean dependencies

* docs: update a few comments / todos
2025-04-23 00:28:30 -04:00
Kyle McCormick
9d45f855d6 feat: Explicit mapping from container_types to OLX tags (#36580)
This is needed by several aspects of the Teak Libraries Overhaul
(https://github.com/orgs/openedx/projects/66) including:
* copy-paste of containers between courses and V2 libraries
* syncing of containers in courses from V2 libraries
* the import_from_modulestore API
2025-04-23 00:13:28 +00:00
Chris Chávez
54ec998bee fix: Broken CSS styles of ora2 block editor [FC-0076] (#36220)
* It was this error 'Uncaught TypeError: el.timepicker is not a function' while rendering the editor. It's fixed adding the timepicker pluging in xblock_v2/xblock_iframe.html
* Added '.openassessment_cancel_button' and '.openassessment_save_button' as action buttons.
* Use openassessment manifest.json to load css from dist
2025-04-22 21:08:02 +00:00
Chris Chávez
f5e0500854 feat: Add new publish field on container search document (#36551)
* Added publish_display_name and last_published on container search document.
* This change is used in feat: Add unit from library in course [FC-0083] frontend-app-authoring#1829 to show only published units in the unit picker, also to show the published_display_name in the picker, and avoid empty titles.
* Which edX user roles will this change impact? "Developer".
2025-04-22 16:58:57 +00:00
Ahtisham Shahid
1608e8f9b6 Revert "Revert "Revert "Saml redirect mfe (#36197)" (#36550)" (#36554)" (#36569)
This reverts commit 51a48b42a9.
2025-04-22 09:34:20 +00:00
Muhammad Adeel Tajamul
f90c442ad6 fix: unpin thread api calling returning 500 error (#36567) 2025-04-22 12:45:26 +05:00
Ahtisham Shahid
51a48b42a9 Revert "Revert "Saml redirect mfe (#36197)" (#36550)" (#36554)
This reverts commit 447cd796b7.
2025-04-22 11:06:42 +05:00
Braden MacDonald
1ac6de2ec0 chore: libraries - remove usage of deprecated key types / params (#36563) 2025-04-21 18:47:29 -07:00
Ahtisham Shahid
447cd796b7 Revert "Saml redirect mfe (#36197)" (#36550)
This reverts commit 0a05dc292b.
2025-04-18 15:12:22 +00:00
Braden MacDonald
334c0fee51 feat: REST API to publish the changes to a container in a library (#36543)
* feat: REST API to publish the changes to a container

* fix: trigger LIBRARY_CONTAINER_UPDATED when component published
   for components in containers.

---------

Co-authored-by: Jillian Vogel <jill@opencraft.com>
2025-04-17 22:05:44 -07:00
David Ormsbee
fd7ce0e273 feat: record the user for library content writes (#36513)
We were previously not recording who was doing write/delete/reset operations.
Prior to openedx-learning 0.23.0, we didn't have a place to write the user for a
reset-to-publish.

Upgrades the openedx-learning pin, 0.22 -> 0.23
2025-04-16 20:17:05 +00:00
Ahtisham Shahid
af40ac0feb feat: update preference config when version is changed (#36518) 2025-04-16 15:39:22 +05:00
Braden MacDonald
336fb018fb feat: support pasting units from courses into libraries (#36516)
* fix: don't allow pasting xblocks with children into libraries
* fix: IntegrityError: "Column 'md5_hash' cannot be null"
* feat: allow pasting a unit from a course into a library
* feat: auto-generate a nice block_id when pasting into a library
* test: add test for pasting unit from course into library
* fix: better handle potentially missing display_names during paste
* chore: clarifications and import cleanups
2025-04-15 15:25:46 -07:00
Rômulo Penido
1047ed4d5b feat: collections support for containers [FC-0083] (#36504)
Adds support for adding Containers to Collections.
2025-04-15 13:12:51 -05:00
Hassan Raza
694bf77993 fix: Remove code for group new comment notification (#36501) 2025-04-15 12:21:39 +05:00
Muhammad Adeel Tajamul
ee8eeae55c feat: prevent sending course update, recurring nudge and upgrade reminder email to disabled users (#36514) 2025-04-14 18:11:01 +05:00
Hassan Raza
b14ff9ea8d fix: Update ORA notification type for grouper (#36517) 2025-04-14 15:02:25 +05:00
Navin Karkera
b893b23ce9 feat: post component height to parent window [FC-0083] (#36477)
XBlock rendered in an iframe in frontend-app-authoring needs to resize automatically based on component size.

Updates xblock iframe template to post message to parent window on size change.
2025-04-11 18:01:36 +00:00
Jillian
11bab7d2ed refactor!: use LibraryCollectionLocator and LibraryContainerLocator [FC-0083] (#36476)
efactors the content_libraries.api to use LibraryCollectionLocator and LibraryContainerLocator keys, instead of passing separate LibraryUsageKeyV2 keys along with the collection/container locators.

Renames misleading uses of collection_usage_key to collection_locator, including in the content_libraries.api and content.search.api method names and parameters.

This change impacts Developers, but should not affect end users.

This refactoring seems reasonable to do without going through deprecation, given the minimal use of these APIs.
2025-04-11 10:21:58 -05:00
Chris Chávez
dc4144ec95 feat: add restore container API, delete index when deleting container (#36464) 2025-04-10 15:15:53 -07:00
Muhammad Umar Khan
b9556211be chore: fix cache content size calculation error (#36511)
Co-authored-by: M Umar Khan <umar.khan@A006-01609.local>
2025-04-10 15:22:28 +05:00
Hassan Raza
0acc44fbcd fix: Enable ORA new submissions course notification preference (#36449)
* fix: Enable ORA new submissions course notification preference

* fix: update edx-ora2 version
2025-04-10 13:32:54 +05:00
Rômulo Penido
a0d99315ad feat: container support for tags [FC-0083] (#36484)
* feat: container tag support

* fix: fixes from review

* docs: fix typo
2025-04-10 11:14:54 +05:30
Feanil Patel
488891c5ca Merge pull request #36436 from openedx/feanil/remove_courseware_sock
feat!: Remove the course sock and related APIs.
2025-04-09 10:14:09 -04:00
Hassan Raza
40c82c2ff4 feat: Group ora staff notifications (#36440)
* feat: Group ora staff notifications

* fix: Revert default change for ora staff notifications

* fix: update edx-ora2 version
2025-04-09 14:34:07 +05:00
Muhammad Adeel Tajamul
7cb3196a1a feat: prevent sending notification digest email to disabled users (#36498) 2025-04-08 11:24:26 +05:00
Tim McCormack
6c638572a7 test: Delete flaky test test_rate_limiting_registration_view (#36491)
Deleted out of `RegistrationViewTestV1` although the failure was observed
in `RegistrationViewTestV2` which inherits from it.

Deleted according to flaky test process:
https://openedx.atlassian.net/wiki/spaces/AC/pages/4306337795/Flaky+Test+Process

Flaky test ticket:
- https://github.com/openedx/edx-platform/issues/36490
2025-04-07 14:52:39 -04:00