Commit Graph

10517 Commits

Author SHA1 Message Date
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
Maria Grimaldi
1c835eb643 fix: return empty list when no courses are found for request (#35942)
This change addresses an issue reported while testing Sumac, where the API V2 is on by default in the authoring MFE: openedx/wg-build-test-release#428. It fails when retrieving an empty list of courses with the queryparams api/contentstore/v2/home/courses?page=1&order=display_name. When this was implemented, the course authoring MFE rendered the empty lists only with page=1 query param (didn't do any filtering/ordering by default), which was later changed to page=1&order=display_name which now ordered by default.

This issue occurs because all the filtering and ordering are done under the assumption that course_overviews is always a query set. However, that's only true when there are courses available and CourseOverview.get_all_courses is used. When not, an empty list is returned instead, raising a 500 error in Studio.
2024-12-05 15:52:57 +01:00
Muhammad Farhan Khan
f9126bfdd9 Add Django settings flags to roll out the extracted XBlocks (#35549)
chore: Add Django settings flags to roll out the extracted XBlocks
2024-12-02 20:38:40 +05:00
Braden MacDonald
919cc78be1 fix: Don't add 'x-is-pointer-node' to capa problems on paste 2024-11-29 00:27:43 +05:30
Kyle McCormick
9274852f2d fix: Remove pointless Maintenance and Announcement apps (#35852)
The Studio Maintenance app had two features:

* "Force Course Publish", which literally doesn't do anything. All it
  does is tell you what version *would* be seen by users *if* the course
  were to be published--no publishing actually occurs via this feature.

* "Announcements", which writes to the announcements_announcement
  database table, but doesn't actually display anywhere.

Having these pages in the platform is actively misleading and creates a
maintenance burden for edx-platform developers, so we remove them.

Note that this commit does not include a migration for the announcements
Django app. So, announcements_announcement table will not be deleted.
Given the small expected size of any past-authored announcements, we are
not worried about leaving them in the database perpetually.
2024-11-26 15:15:27 +00:00
Navin Karkera
73ba58ae11 feat: iframe messaging for component picker in problem bank (#35888) 2024-11-22 11:44:13 -05:00
Jesper Hodge
38e5745e06 feat: add course optimizer waffle flag (#35884)
Description
Add a waffle flag to toggle on or off the new Course Optimizer feature per course.

Impact
Course Author

Context
Course Optimizer is a much-requested feature that has been aligned with the OpenEdx community. The only component for now is a broken link checker that will return a list of all broken links in a course to the frontend. There will be a new page for this that is a bit similar to the export page.

This PR only deals with adding a waffle flag.

Supporting information
Internal Ticket (2U):
https://2u-internal.atlassian.net/browse/TNL-11808
2024-11-20 20:51:46 +00:00
Navin Karkera
49330a222a feat: post message on preview library block changes (#35861)
Posts message with library xblock changes info instead of displaying a modal if the unit is rendered in an iframe.
2024-11-19 19:07:28 +00:00
ihor-romaniuk
a34a54d29f feat: [FC-0070] add message events to the unit page container 2024-11-18 11:23:33 -03:00
Rômulo Penido
cb1e6eeb3f fix: error while loading iframe on mfe Unit Outline [FC-0062] (#35828)
On the Course unit page after merging the PR with new iframe for xblocks, an issue with infinite loading of the iframe appeared if the unit/xblock has tags. This PR solves the problem with the error that appeared. Addition and processing of the tagging functionality is planned in future PRs.
2024-11-15 17:54:56 +00:00
Navin Karkera
d9f6afa264 feat: add beta flag to component templates (#35802)
Mark components like libraryv2 and problem bank beta in API to be used by both legacy templates and new authoring mfe.

Also updates order of components.
2024-11-13 18:27:54 +00:00
Alison Langston
e50490da88 feat: add optional inclusion date arg to course reindex command (#35830)
* feat: add optional inclusion date arg to course reindex command

* fix: pylint
2024-11-12 15:34:04 -05:00
Navin Karkera
68739ce73c fix: hide library_v2 and itembank in legacy library page (#35772)
Hide options to add library_v2 and itembank blocks in legacy library
page.
2024-11-12 20:36:41 +05:30
Rodrigo Martin
4e6c3dc598 fix(AU-2269): Add logs to get_course_youtube_edx_video_ids (#35804) 2024-11-07 15:40:42 -03:00
Navin Karkera
d82aadab51 fix: set upstream link for re-copied block from course originally from library (#35784)
Sets upstream link to library block for blocks that were copied from a course block which were originally copied/imported from a library.
2024-11-07 09:54:53 -05:00
Jillian
9bfdfeb313 fix: remove the "Legacy Library" button if libraries v1 are disabled (#35736)
Removes the "Legacy Library" button from the legacy Studio "new block" button array if Libraries v1 are disabled, either via waffle flag or via the ENABLE_CONTENT_LIBRARIES feature flag.
2024-11-06 11:00:04 -05: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
Jillian
689feba172 fix: allow non-Elasticsearch search engines when reindexing courses [FC-0062] (#35743) 2024-11-06 18:49:45 +05:30
Jillian
952ba95992 fix: bump MAX_BLOCKS_PER_CONTENT_LIBRARY default to 100,000 (#35768) 2024-11-05 11:10:05 -08:00
Feanil Patel
80ed5ee2a4 fix: Send the course publish signal on course import. 2024-11-05 10:44:17 -05:00
Sagirov Evgeniy
f730276263 feat: Add API endpoint to manage course waffle flags (#35622)
Co-authored-by: Sagirov Eugeniy <evhenyj.sahyrov@raccoongang.com>
2024-11-04 15:13:37 -03:00
Kaustav Banerjee
e18b1c8d53 feat: in-context discussion for units can be disabled by default (#35414)
This PR, adds to the ability to keep the in-context discussions disabled by default. That way all new units which are added will have the discussions sidebar disabled and can be individually enabled by the course instructors.
2024-11-02 20:22:35 +05:30
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
Muhammad Anas
fb5e26952b fix: removed all the usage of useV2CertDisplaySettings 2024-10-30 17:41:16 +05:00
Muhammad Anas
051eacb024 fix: certificate display behaiviour not showing date-picker for end-with-date 2024-10-30 17:41:16 +05:00
Navin Karkera
949378f63f fix: do not open MFE editors automatically on block paste (#35728) 2024-10-28 11:34:53 -07:00
Kristin Aoki
afd1394112 Revert "feat: update preview url to direct to mfe (#35687)" (#35732)
This reverts commit 2373dd02f9.
2024-10-28 17:26:29 +00:00
Kristin Aoki
2373dd02f9 feat: update preview url to direct to mfe (#35687)
* feat: update preview url to direct to mfe

* fix: use url builder instead of string formatter

* fix: url redirect for never published units
2024-10-28 10:31:53 -04:00
Muhammad Adeel Tajamul
ebe3dc5e12 fix: fixed course update notification UI in notification tray (#35715) 2024-10-28 15:47:08 +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
Muhammad Farhan Khan
0c91b625bd Merge pull request #35506 from openedx/farhan/sass-to-css-video-block
feat! Dropping Sass support from builtin video block

https://github.com/openedx/edx-platform/issues/35570
2024-10-24 12:50:26 +05:00
Navin Karkera
e2a9a37d68 feat: show alert while editing v2 library content [FC-0062] (#35700)
Adds warning alert in edit modal for library v2 content in both legacy and new
MFE editors. For the Libraries Relaunch Beta.

Part of: https://github.com/openedx/frontend-app-authoring/issues/1340

Co-authored-by: Chris Chávez <xnpiochv@gmail.com>
2024-10-23 16:03:26 +00:00
Muhammad Farhan Khan
6259520651 Merge branch 'master' into farhan/sass-to-css-video-block 2024-10-23 18:52:43 +05:00
farhan
8fb5b778c3 feat!: Dropping Sass support from builtin video block, replacing with vanilla CSS 2024-10-23 18:40:30 +05: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
Daniel Valenzuela
085b15a014 feat: itembank green button (#35706)
Adds Problem Bank to the main New Components buttons.

For the Libraries Relaunch Beta [FC-0062]

Part of: https://github.com/openedx/frontend-app-authoring/issues/1415

Co-authored-by: Jillian Vogel <jill@opencraft.com>
2024-10-23 08:33:05 -04:00
Kyle McCormick
af21100939 fix: Improve messaging, logging when adding Beta Library Content fails (#35707)
We have user-oriented messaging stuffed into the BadUpstream exception. We may
as well use it rather than just giving an opaque error about xblock references.

We also want to log this situation, since we'd expect that the library block
usage key that Studio provides should generally be valid. If it consistently
isn't, then that's an issue that operators are going to want to look into.
2024-10-23 08:31:29 -04:00
Braden MacDonald
4158a44307 feat: multi-select when adding blocks to problem bank (#35705)
This implements basic multi-select for adding components to a problem bank,
for the Libraries Relaunch Beta [FC-0062].

Part of: https://github.com/openedx/frontend-app-authoring/issues/1385
2024-10-23 08:29:16 -04:00
Braden MacDonald
9e28ba92ec feat: minimal UI for the Problem Bank block 2024-10-22 17:27:04 -07:00
Jillian
784b2b8c3c feat: add "beta" label to libraries v2 content + item bank buttons (#35690) 2024-10-22 09:18:45 -07: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
Braden MacDonald
e2d6765637 feat: expand support for versioned URLs in v2 XBlock runtime (#35676)
* fix: problem block could not be used with versioned handler URls

* refactor: simplify REST API handling of usage keys

* feat: add more version awareness and update tests

* fix: make the preview changes modal bigger as requested

* refactor: parse version at the urlconf layer too
2024-10-21 09:14:17 -07:00
Chris Chávez
9e14566f90 feat: Copy tags when sync library [FC-0062] (#35596)
* feat: Copy tags when sync library

* feat: Avoid delete object tag if is copied

* chore: Bump version of openedx-learning to 0.16.0

* test: Tests for copy paste library blocks

* feat: Sync tags when sync upstream
2024-10-21 15:24:46 +00:00
José Ignacio Palma
123ad8d82c feat: adds CourseAboutPageURLRequested and LMSPageURLRequested filters (#35142) 2024-10-21 10:35:00 -04:00
Muhammad Adeel Tajamul
968f4f716b feat: removed styling from course update notification (#35680) 2024-10-21 16:04:44 +05:00
Braden MacDonald
83827a3dc2 feat: Confirmation modal to preview and accept v2 library updates (#35669) 2024-10-18 12:21:16 -07:00
Jillian
96811d6452 feat: adds waffle flags for legacy libraries v1 and new libraries v2 (#35576)
* refactor: rename CourseHomeSerializer to StudioHomeSerializer

to better reflect how this serializer/API is used in the Authoring MFE

* feat: adds waffle flags for legacy libraries v1 and new libraries v2 in new Studio Home

These waffle flags replace the MFE env flag LIBRARY_MODE.

* refactor: use contentstore.toggles.libraries_v1_enabled()

and ENABLE_CONTENT_LIBRARIES feature toggle where possible.

ENABLE_CONTENT_LIBRARIES has been incorporated into both the
libraries_v1_enabled() and libraries_v2_enabled() toggles:
FEATURES['ENABLE_CONTENT_LIBRARIES'] must be true for either version of
libraries to be "enabled".
2024-10-18 09:43:01 -07:00
Sagirov Evgeniy
e4a1e41367 feat: new Studio view for rendering a Unit in an iframe [FC-0070]
The first attempt at creating a new MFE-driven page for Studio Unit
rendering involved rendering each XBlock separately in its own iframe.
This turned out to be prohibitively slow because of the many redundant
assets and JavaScript processing (e.g. MathJax) that happens for each
XBlock component.

In order to mitigate some of these issues, we decided to try a hybrid
approach where we render the entire Unit's worth of XBlocks at once on
the server side in a Studio view + template, and then invoke that from
frontend-app-authoring as an iframe. The frontend-app-authoring MFE
would still be responsible for displaying most of the interactive UI,
but the per-component actions like "edit" would be triggered by buttons
on the server-rendered Unit display. When one of those buttons is
pressed, the server-rendered UI code in the iframe would use
postMessage to communicate to the frontend-app-authoring MFE, which
would then display the appropriate actions.

To make this work, we're making a new view and template that copies
a lot of existing code used to display the Unit in pre-MFE Studio, and
then modifying that to remove things like the header/footer so that it
can be invoked from an iframe.

This entire design is a compromise in order to do as much of the UI
development in frontend-app-authoring as possible while keeping
XBlock rendering performance tolerable. We hope that we can find
better solutions for this later.

Authored-by: Sagirov Eugeniy <evhenyj.sahyrov@raccoongang.com>
2024-10-18 10:03:07 -04:00
Kyle McCormick
795d039581 feat: Upstream Sync with Content Library Blocks (#34925)
This introdues the idea of "upstream" and "downstream" content,
where downstreams (like course components) can pull content updates from
upstreams (like learning core-backed content library blocks). This
supports the upcoming Content Libraries Relaunch Beta for Sumac.
New features include:

* A new XBlockMixin: UpstreamSyncMixin.
* A new CMS Python API: cms.lib.xblock.upstream_sync
* A new CMS JSON API: /api/contentstore/v2/downstreams
* A temporary, very basic UI for syncing from Content Library blocks

Implements:
https://github.com/kdmccormick/edx-platform/blob/kdmccormick/upstream-proto/docs/decisions/0020-upstream-block.rst

Co-authored-by: Braden MacDonald <braden@opencraft.com>
2024-10-17 16:02:26 +00:00
David Ormsbee
77e683d5b6 feat: new view & API calls to serve content library assets (#35639)
This commit adds a new view to serve static assets for content
libraries, along with Content Library API calls to add, delete, and get
metadata about these assets. These assets come from Learning Core and
should ONLY BE ACCESSED FROM STUDIO. Users must have read access to the
library in order to see an asset in that library.

This also re-implements video transcript support for content libraries
and re-enables some previously disabled tests around it.
2024-10-16 11:12:11 -04:00