Commit Graph

6164 Commits

Author SHA1 Message Date
Daniel Valenzuela
b07464ba2d feat: incremental reindex_studio management command (#35864)
This allows large instances to run an (interruptable, resumable) reindex task that can cover thousands of courses.
2024-12-06 12:30:38 -08:00
Diana Huang
818aa343a2 Revert "feat: Integrate Forum V2 into edx-platform"
This reverts commit 70b60ff256.
2024-12-06 11:19:06 -05:00
Rômulo Penido
8d4909a999 fix: content libraries permissions
This PR changes the permissions for content libraries so that only
people who can create courses should be allowed to create new content
libraries.
2024-12-06 09:18:04 -05:00
Chris Chávez
0bd0e6f4ca refactor: Update get block OLX view to support versions [FC-0062] (#35932)
* Deprecate `get_block_draft_olx`
* Deprecate get olx view in content libraries
* Create `get_block_olx` in xblock API with support of versions
* Create get olx view in xblock
2024-12-05 18:49:23 +00:00
Muhammad Faraz Maqsood
70b60ff256 feat: Integrate Forum V2 into edx-platform
This commit introduces the new Forum V2 application, allowing users to choose between the legacy Forum V1 and the new Forum V2 at the course level.

Key Changes:
- Added waffle flag `discussions.enable_forum_v2` to enable Forum V2 for selected courses, allowing coexistence with Forum V1.
- Default data storage for Forum V2 is set to MongoDB, with an option to switch to MySQL using the waffle flag `forum_v2.enable_mysql_backend`.
- Introduced management command `forum_migrate_course_from_mongodb_to_mysql` for per-course data migration from MongoDB to MySQL.

Note: This PR does not include all unit tests for the Forum V2 native API due to ongoing migration efforts. Further updates will follow to ensure full test coverage before final release.

Co-authored-by: [Muhammad Faraz Maqsood] <faraz.maqsood@arbisoft.com>
Co-authored-by: [Ali Salman] <ali.salman@arbisoft.com>
2024-12-03 11:00:51 -05:00
Muhammad Adeel Tajamul
3d5f4983c5 feat: added anonymous id in edx.bi.user.account.authenticated event (#35934) 2024-12-02 13:22:27 +05:00
Muhammad Adeel Tajamul
0682493b6a chore: added anonymous id in user registered event (#35875) 2024-11-22 06:51:31 +05:00
Muhammad Adeel Tajamul
b55a17a9f7 feat: truncated number of notifications in email (#35738) 2024-11-21 11:55:09 +05:00
Chris Chávez
d5850c812c fix: keep library collection card component count in sync (#35734)
Fixed component counter synchronization in these cases:

* When deleting a component inside a collection.
* With the library published, when adding a new component in a collection and reverting library changes.
* With the library published, when deleting a component inside a collection and reverting library changes.

Also adds a published > num_counts field in collections in the search index.
2024-11-19 15:45:34 -05:00
Irtaza Akram
68a626a938 fix: replace autodoc with autoapi (#35846) 2024-11-18 10:16:09 +05:00
Justin Hynes
7adecb4c6c feat!: remove skill_levels API (#35863)
Resolves issue #35302 (https://github.com/openedx/edx-platform/issues/35302).
2024-11-15 09:37:37 -05:00
Irtaza Akram
ec2a698604 cleanup references of python 2 & <3.11 (#35799)
* chore: cleanup of old python references
2024-11-15 16:58:20 +05:00
Fox Danger Piacenti
b94fe2b17a feat: Allow trusted apps to perform cookie login. 2024-11-14 12:04:35 +05:30
Dima Alipov
15aa04b858 fix: registering new user with a name longer than 255 characters 2024-11-13 19:28:06 +05:30
Ahtisham Shahid
4d23866ae4 feat: added grouping for new post notification (#35761) 2024-11-11 16:37:32 +05:00
Cristhian Garcia
d19707793b fix: remove learner_downloadable field references from libraries (#35788)
Also bumps openedx-learning to v0.17.0, which no longer has this field.
2024-11-08 13:44:46 -05:00
Navin Karkera
ca7da3754f fix: component asset api views (#35765)
Uses drf view to authenticate user before allowing them to access library static assets.
2024-11-07 19:27:22 +05:30
Jillian
db587bdbe0 test: re-enable content libraries runtime tests [FC-0062] (#35783)
* test: run content_libraries runtime tests

* test: fix broken tests

* test: fix lms tests

Co-authored-by: Kyle D. McCormick <kyle@axim.org>
2024-11-07 19:24:26 +05:30
Tim McCormack
22b9ced6c0 feat: Make celery task protocol configurable via Django setting (#35789)
This will allow us to test protocol 2 in a stage environment before
removing the override to make 2 the default.

We may have seen a bug where something in celery (or an
associated library) was adding headers to a v1 message as
if it were a v2 message, which caused a bug in ddtrace; such
things may become more likely over time as code is written
with the assumption of v2 messages. Moving to v2 will avoid
those issues.

See https://github.com/edx/edx-arch-experiments/issues/800 for further details.
2024-11-06 15:54:24 -05:00
Peter Pinch
5d1566c4c2 Merge pull request #35655 from mitodl/asad/bypass-access-checks-when-populating-cache
fix: bypass access checks when populating course blocks cache
2024-11-06 12:22:25 -05:00
Brian Mesick
767e1a2c07 Merge pull request #35779 from openedx/bmtcril/pii_safelist_update
chore: Add missing PII annotations, update safelist
2024-11-06 16:27:09 +00:00
Feanil Patel
5904b54378 Merge pull request #35185 from openedx/feanil/blockstructure_cache
feat!: Drop the block_structure.storage_backing_for_cache WaffleSwitch
2024-11-06 10:52:47 -05:00
Cristhian Garcia
75118f4bc4 refactor: let openedx-learning handle content library asset logic (#35730)
Version 0.16.3 of openedx-learning adds support for calling
create_next_component_version with the bytes data of the files to be
added, instead of just the ID of the Content object. This lets us
simplify the code in edx-platform a bit.
2024-11-06 10:08:19 -05:00
Brian Mesick
e478975105 chore: Add missing PII annotations, update safelist
PII Annotations are very out of date, this commit adds most that were
missing in edx-platform, and some additional annotations to the
safelist. It is not comprehensive, several other upstream Open edX
packages also need to be updated. It also does not include removing
annotations that have been moved upstream, or been removed entirely.
Those are separate follow-on tasks.
2024-11-05 12:58:36 -05:00
Feanil Patel
4768568b5a fixup! feat!: Drop the block_structure.storage_backing_for_cache waffle switch. 2024-11-05 10:44:17 -05:00
Feanil Patel
8741417806 docs: Cross link to wiki docs related to block structures.
Provide a link to more docs from the code in case we need more context
in the future.
2024-11-05 10:44:17 -05:00
Feanil Patel
e5f698a5a7 feat: Remove the unused StubModel class.
Now that the model backed cache is on by default, we don't need to keep
the StubModel object around.
2024-11-05 10:44:16 -05:00
Feanil Patel
e52253d3e1 test: Change call counts with model back as default.
We don't call the modulestore or update the cache here now that we are
backed by the database model.  Previously the cache would change because
the `_encode_root_cache_key` function in `BlockStructureStore` class
used the `BlockstoreBlockData.VERSION` as a part of the cache key when
the data was not being cached in a DB model.
2024-11-05 10:44:16 -05:00
Feanil Patel
9164e92465 test: Update a BlockStructureFactory test mixin.
Previously, we were not caching BlockStructures to the database when we
were adding them to the store by default.  Now that we are doing that,
the BlockStructureFactory test failed because it was taking a shortcut
that would no longer work.  It was just creating a blockstructure that
had relations but not any block information.

Now that we're always persisting updates to the database, this broke
because to persist the structure to the database, we have to look up the
block information from the block_structure which now fails.

This change updates the test mixin to add more data so that the content
can be persisted to the database successfully as a part of this test.
2024-11-05 10:44:16 -05:00
Feanil Patel
fab0267757 feat!: Drop the block_structure.storage_backing_for_cache waffle switch.
This work is part of DEPR https://github.com/openedx/public-engineering/issues/32

Now that we've removed all uses for this switch remove the decleration
as well.

BREAKING CHANGE: The `block_structure.storage_backing_for_cache` will no
longer exist and its value will be ignored. If you have this switch set
in your instance you can remove it. The backing cache is now always ON.
2024-11-05 10:44:16 -05:00
Feanil Patel
261b4985cd feat!: Drop an unnecessary function.
Remove the `enable_storage_backing_for_cache_in_request` function and
its uses in the platform.  The function is no longer needed because the
storage backing for the block_structure cache will be ON by default
moving forward.

BREAKING CHANGE: This `enable_storage_backing_for_cache_in_request`
function no longer exists and any calls to it should be removed.  The
cache it enables is now always ON.
2024-11-05 10:44:16 -05:00
Feanil Patel
57cdbfa013 test: Remove test variants that test without a cache.
Since the cache is now always on, remove test cases that test the case
when it's disabled.
2024-11-05 10:44:16 -05:00
Feanil Patel
16d440a4e9 feat: Turn ON the storage backing for cache by default.
Any places where the storage backing cache for block structures was on
conditionally previously it will be ON by default.
2024-11-05 10:44:16 -05:00
Kristin Aoki
e13d66d1e4 feat: support unit preview in learning MFE (#35747)
* feat: update preview url to direct to mfe

* fix: use url builder instead of string formatter

* fix: url redirect for never published units

* fix: remove 404 error when  not a preview or staff

* feat: update sequence metadata to allow draft branch
2024-11-01 11:03:06 -04:00
Asad Ali
65fd18bdcf refactor: revert imports 2024-10-31 23:26:23 +05:00
Asad Ali
d81c2d8be5 refactor: revert imports 2024-10-31 23:24:40 +05:00
Asad Ali
9ed41b0759 test: add tests for known and unknown user 2024-10-31 23:20:41 +05:00
Asad Ali
d9a27b6ba7 style: pylint 2024-10-31 23:20:40 +05:00
Asad Ali
cf3c10ba34 test: add tests 2024-10-31 23:20:40 +05:00
Asad Ali
1f86786b15 fix: bypass access checks when populating course blocks cache 2024-10-31 23:20:40 +05:00
Fatima Sohail
de55da2170 fix: added font styles for email digest browser compatibility (#35750) 2024-10-31 20:54:17 +05:00
Fatima Sohail
d5a7689647 fix: import font for notification digest email (#35720)
* fix: import font for notification digest email

* fix: font smoothing and size
2024-10-30 14:11:59 +05:00
Deborah Kaplan
97449ef54f feat: add more authentication information to swagger (#35674)
* feat: add more authentication information to swagger
* updates the `docs-settings` to make the generated swagger
  `securityDefinitions` include both JWT and CSRF methods, as well as
  basic. A few linter fixes happened as a side effect.
* Put in wordier descriptions for all three, since we don't have great
  shared documentation about authn/authz.
* Added CSRF to `login_session`, which also serves as a proof of concept
  for other endpoits
* Also regenerated the swagger doc, which picked up some extra changes.

Generated swagger now has help and allows extra auth methods so some
preveiously unusable endpoints can be hit.

FIXES: APER-3554
2024-10-28 16:34:15 -04:00
Muhammad Adeel Tajamul
e1f31fbb45 feat: removed setting email cadence to Never when using one click unsubscribe (#35708) 2024-10-28 15:48:34 +05:00
Cristhian Garcia
e8cdb06410 feat!: remove all references to content library types (#35726)
At one point, we envisioned having different kinds of libraries, e.g.
a "Video" library would be distinct from a "Problem" library. Later on,
we decided on a more generalized form of Libraries, where any given
library can hold any combination of content–which would then be
organized using collections and tagging.

Due to this shift in perspective, these values haven't actually been
used for a long time. This is just getting rid of them altogether.
2024-10-25 14:16:56 -04:00
David Ormsbee
d25e651145 Support static assets when copy/pasting between courses and libraries (#35668)
The biggest challenge is dealing with the mismatch between how Libraries store
assets (per-Component) and how Courses store assets (global Files and Uploads
space). To bridge this, we're going to kludge a component-local namespace in
Files and Uploads by making use of the obscure feature that you can create
folders there at an API level, even if no such UI exists.

In this commit:
* Assets work when copy-pasting between library components.
* Assets work when copy-pasting from a library to a course, with the convention
  being to put that file in a subdirectory of the form:
  components/{block_type}/{block_id}/file.
  Note that the Studio course Files page still just shows the filename.
* Assets work when copy-pasting from a course to a library.
  Top level assets are put into a static folder in the Component, per Learning
  Core conventions.

Limitations:
* Roundtrips don't work properly.
* There's no normalized form, so directories will start nesting if you copy
  from library and paste into course, then copy the pasted thing and paste back
  into library, etc. This was deemed acceptable for Sumac.

Low level stuff:
* XBlockSerializerForLearningCore has been removed, with the url_name stripping
  functionality added as an optional param to XBlockSerializer (the other stuff
  was for children and "vertical" -> "unit" conversion, neither of which are
  relevant now).
* url_name is now stripped out of anything added to the clipboard, so that we
  don't end up writing it in block.xml when it is redundant (and would be
  stripped out with the next write anyway).

For the Libraries Relaunch Beta. This should not affect any site which
has kept New Libraries disabled.

Issue: https://github.com/openedx/frontend-app-authoring/issues/1170
2024-10-23 09:21:27 -04:00
Cristhian Garcia
e67acd459f feat: add endpoint to get draft version of a library component asset (#35681)
Adds a new Studio-only libraries static asset endpoint at
/library_assets/blocks/{usage_key}. This endpoint will serve assets
only from the Draft branch, and is only available to people who have
read permission to the containing library.

This also moves the existing library asset endpoint that did lookups
by Component Version to /library_assets/component_versions/{uuid}

This change was motivated by the desire to make it easier to make the
editor preview work for images by having a single URL that will
consistently point to the latest version of the asset, rather than
having a new URL after every save (which the Component Version lookup
2024-10-22 12:08:26 -04:00
Chris Chávez
fb25a5d635 feat: Store published name and description in studio search index (#35678) 2024-10-21 12:25:49 -07:00
Daniel Valenzuela
a49110b5e1 feat: endpoint to publish single library v2 component (#35677) 2024-10-21 19:20:14 +00:00
Navin Karkera
7e8fb4393e feat: adds Library Content (v2) button to Studio Unit page (#35670)
Requires that v2 libraries are enabled.
2024-10-21 10:32:54 -07:00