Commit Graph

10630 Commits

Author SHA1 Message Date
Jenkins
b70e3dc6ae chore(i18n): update translations 2023-07-10 18:04:53 -04:00
connorhaugh
00b1ce28b9 feat: add library copy management command (#32598)
This PR introduces the "copy" management command, which copies v1 libraries into v2 libraries.
2023-07-10 15:45:18 -04:00
Robert Raposa
6b19eab038 temp: remove flaky tests video/transcripts/test_views.py (#32697)
The JS tests for CMS.Views.Metadata.VideoList are
flaky and failing, often on Initialize, so the entire
file is being removed.

More details on the flakiness can be found here:
https://github.com/openedx/edx-platform/issues/32690

Private ticket for fixing:
https://2u-internal.atlassian.net/browse/CR-5904
2023-07-10 14:50:00 -04:00
Braden MacDonald
162175f0c4 chore: get rid of edx_six - not needed anymore (#32555)
* chore: get rid of edx_six - not needed anymore
* chore: remove reference to TODO that was completed.
2023-07-10 11:16:57 -07:00
Braden MacDonald
7a89f2e5d3 fix: remove deprecated django-debug-toolbar Logging Panel (#32553) 2023-07-10 11:16:16 -07:00
Navin Karkera
051ecb4dc7 feat: temporary setting to configure topic name for xblock events 2023-07-10 19:54:35 +05:30
leangseu-edx
9dac65a35a Revert "fix: mathjax resize on sindow resize (#32606)"
This reverts commit a68fd49103.
2023-07-07 15:20:47 -04:00
Braden MacDonald
e705820d0d refactor: Remove unneeded filter from static asset copy/paste code. (#32660) 2023-07-07 09:47:06 -07:00
Nathan Sprenkle
452433a731 feat: configurable roll-forward of flex grading (#32584)
Add ability to roll-forward ORA flex peer grading feature. Where enabled
for an Organization or course, flex peer grading will be turned on at the
course level for new course runs and course reruns. Where disabled,
a new course or course rerun will preserve existing / default setting
value.
2023-07-07 10:42:58 -04:00
Kyle McCormick
f4540c30e8 fix: flow ?site_theme down through Studio container preview
In ~Palm and earlier, all built-in XBlock Sass was included into CMS
(and LMS) styles before being compiled. So, if a site theme was meant to
affect built-in XBlock styling, those changes would be manifested
directly in the base CMS CSS that is included into every single Studio
page. When the user provided the `?site_theme` querystring parameter,
which is intended to allow devs & admins to view Studio through a given
theme, CMS would look up the given theme and serve the corresponding
base CMS CSS, which would affect the built-in XBlocks views (as
expected).

After ~Palm, built-in XBlocks styles are handled more similarly to to
pure XBlock styles, in that they are only requested when CMS tries to
render the block. In Studio, blocks are not rendered by the original
request, but by a subsequent AJAX request to the `/container_preview`
enpoint. Thus, passing the `?site_theme` query parameter to the original
request will apply the given theme to Studio's chrome, but the theme
will _not_ apply to built-in XBlock views, whose CSS is now loaded via
async request.

To fix this, we simply pass Studio's querystring parameters (including
`?site_theme`) along to the `/container_view` AJAX request. This will
cause CMS to correctly serve the built-in XBlock CSS from the theme
specified by `?site_theme`, rather than whatever the current theme is.

Part of: https://github.com/openedx/edx-platform/issues/32292
2023-07-06 11:58:06 -04:00
Kyle McCormick
127c5c1ce2 fix: make built-in XBlock Sass theme-aware again
In ~Palm and earlier, all built-in XBlock Sass was included into LMS and CMS
styles before being compiled. The generated CSS was coupled together with
broader LMS/CMS CSS. This means that comprehensive themes have been able to
modify built-in XBlock appearance by setting certain Sass variables. We say that
built-in XBlock Sass was, and is expected to be, "theme-aware".

Shortly after Palm, we decoupled XBlock Sass from LMS and CMS Sass [1]. Each
built-in block's Sass is now compiled into two separate CSS targets, one for
block editing and one for block display. The CSS, now located at
`common/static/css/xmodule`, is injected into the running Webpack context with
the new `XModuleWebpackLoader`. Built-in XBlocks already used
`add_webpack_to_fragment` in order to add JS Webpack bundles to their view
fragments, so when CSS was added to Webpack, it Just Worked.

This unlocked a slieu of simplifications for static asset processing [2];
however, it accidentally made XBlock Sass theme-*unaware*, or perhaps
theme-confused, since the CSS was targeted at `common/static/css/xmodule`
regardless of the theme. The result of this is that **built-in XBlock views will
use CSS based on the Sass variables _last theme to be compiled._** Sass
variables are only used in a handful of places in XBlocks, so the bug is subtle,
but it is there for those running off of master. For example, using edX.org's
theme on master, we can see that there is a default blue underline in the Studio
sequence nav [3]. With this bugfix, it becomes the standard edX.org
greenish-black [4].

This commit makes several changes, firstly to fix the bug, and secondly to leave
ourselves with a more comprehensible asset setup in the `xmodule/` directory.

* We remove the `XModuleWebpackLoader`, thus taking built-in XBlock Sass back
  out of Webpack.

* We compile XBlock Sass not to `common/static/css/xmodule`, but to:

  * `[lms|cms]/static/css` for the default theme, and
  * `<THEME_ROOT>/[lms|cms]/static/css`, for any custom theme.

  This is where the comprehensive theming system expects to find themable
  assets. Unfortunately, this does mean that the Sass is compiled twice, both
  for LMS and CMS. We would have liked to compile it once to somewhere in the
  `common/`, but comprehensive theming does not consider `common/` assets to be
  themable.

* We split `add_webpack_to_fragment` into two more specialized functions:
  * `add_webpack_js_to_fragment` , for adding *just* JS from a Webpack bundle,
    and
  * `add_sass_to_fragment`, for adding static links to CSS compiled themable
    Sass (not Webpack). Both these functions are moved to a new module
    `xmodule/util/builtin_assets.py`, since the original module
    (`xmodule/util/xmodule_django.py`) didn't make a ton of sense.

* In an orthogonal bugfix, we merge Sass `CourseInfoBlock`, `StaticTabBlock`,
  `AboutBlock` into the `HtmlBlock` Sass files. The first three were never used,
  as their styling was handled by `HtmlBlock` (their shared parent class).

* As a refactoring, we change Webpack bundle names and Sass module names to be
  less misleading:
  * student_view, public_view, and author_view: was `<Name>BlockPreview`, is now
    `<Name>BlockDisplay`.
  * studio_view: was `<Name>BlockStudio`, is now `<Name>BlockEditor`.

* As a refactoring, we move the contents of `xmodule/static` into the existing
  `xmodule/assets` directory, and adopt its simper structure. We now have:
  *  `xmodule/assets/*.scss`: Top-level compiled Sass modules. These could be
     collapsed away in a future refactoring.
  * `xmodule/assets/<blocktype>/*`: Resources for each block, including both JS
    modules and Sass includes (underscore-prefixed so that they aren't
    compiled). This structure maps closely with what externally-defined XBlocks
    do.
  * `xmodule/js` still exists, but it will soon be folded into the
    `xmodule/assets`.

* We add a new README [4] to explain the new structure, and also update a
  docstring in `openedx/lib/xblock/utils` which had fallen out of date with
  reality.

* Side note: We avoid the term "XModule" in all of this, because that's
  (thankfully) become a much less useful/accurate way to describe these blocks.
  Instead, we say "built-in XBlocks".

Refs:
1. https://github.com/openedx/edx-platform/pull/32018
2. https://github.com/openedx/edx-platform/issues/32292
3. https://github.com/openedx/edx-platform/assets/3628148/8b44545d-0f71-4357-9385-69d6e1cca86f
4. https://github.com/openedx/edx-platform/assets/3628148/d0b7b309-b8a4-4697-920a-8a520e903e06
5. https://github.com/openedx/edx-platform/tree/master/xmodule/assets#readme

Part of: https://github.com/openedx/edx-platform/issues/32292
2023-07-06 11:58:06 -04:00
Yagnesh1998
a68a1ed434 feat: Removed JWT_AUTH_REFRESH_COOKIE in depr. (#32664) 2023-07-06 09:14:30 -04:00
Kristin Aoki
6dfd706bca feat: add page redirect when mfe flag enabled (#32637)
Co-authored-by: Jesper Hodge <19345795+jesperhodge@users.noreply.github.com>
2023-07-05 14:39:00 -04:00
Jesper Hodge
96f1397872 Refactor rename contentstore xblock services (#32581)
This PR addresses the renaming of the contentstore/xblock_services folder to contentstore/xblock_storage_handlers as a follow-up to PR #32282. The renaming is done to prevent naming conflicts with xblock runtime services and to make the purpose of the files more understandable. The file xblock_service.py has been renamed to view_handlers.py to better reflect its functionality.

Justification and Future Refactoring Outlook:
The xblock_storage_handlers folder contains service methods that implement the business logic for view endpoints located in contentstore/views/block.py. It is renamed to xblock_storage_handlers to reflect its responsibility of handling storage-related operations of xblocks, such as creation, retrieval, and deletion.

The view_handlers.py file includes business methods called by the view endpoints. These methods, such as handle_xblock, delete_orphans, etc., interact with the required modulestore methods, handle any errors, and aggregate and serialize data for the response.

The term 'handler' in the context of 'view_handlers.py' represents methods that facilitate business logic for view endpoints. It is critical to note the distinction between these 'handler methods' and the xblock_handler method. The xblock_handler is a view endpoint itself, residing in contentstore/views/block.py, and is well known in this context. Although its name might suggest otherwise, it is not a handler in the sense of the 'handler methods' we've defined in 'view_handlers.py'. To maintain consistency with existing naming conventions, it remains as xblock_handler.
2023-07-05 11:24:24 -04:00
Ben Warzeski
a68fd49103 fix: mathjax resize on sindow resize (#32606)
* fix: mathjax resize on sindow resize

* fix: add resize for mathjax in wiki and cms
2023-07-05 14:49:03 +00:00
Edward Zarecor
aff9d82b7d Merge branch 'master' into edx-depr31 2023-07-04 08:39:10 +02:00
Jenkins
dab865c4ee chore(i18n): update translations 2023-07-02 17:04:33 -04:00
kenclary
d6b76c800e Merge pull request #32566 from open-craft/navin/youtube-transcripts-language-codes
feat: configure acceptable language codes for youtube transcripts
2023-06-30 11:10:36 -04:00
Agrendalath
36cc415fc2 refactor: reuse services and wrappers between XBlocks 2023-06-30 15:06:43 +02:00
Piotr Surowiec
80374ed1ce Merge pull request #32357 from open-craft/agrendalath/fc-0026-field-data
feat: remove field-data binding from the runtime [FC-0026]
2023-06-30 15:06:17 +02:00
Navin Karkera
93006b476d feat: configure acceptable language codes for youtube transcripts 2023-06-30 11:02:58 +05:30
Kristin Aoki
08e633d57e fix: missing and broken waffle flag links (#32587) 2023-06-29 13:21:18 -04:00
Braden MacDonald
12a8d99824 feat: Copy/Paste associated static assets along with components (#32346)
* refactor: improve typing of StaticFile named tuple
* feat: copy static asset files into the clipboard
* feat: paste static assets
* feat: show notification in studio about pasted assets
* fix: HTML XBlocks would lose the editor="raw" setting when copy-pasted.
* feat: copy python_lib.zip to the clipboard when it seems to be in use
2023-06-27 12:06:43 -07:00
Agrendalath
6c435bb68c feat: remove field-data service from runtime initialization 2023-06-26 19:21:22 +02:00
Edward Zarecor
0ad7ab30f2 Merge branch 'master' into edx-depr31 2023-06-26 13:02:28 +02:00
Jenkins
22989f4fe8 chore(i18n): update translations 2023-06-22 12:34:48 -04:00
Awais Qureshi
92cba6c71c fix: updating bucket to bucket_name. These are deprecated. (#32533)
* fix: updating bucket to bucket_name. These are deprecated.

https://github.com/jschneier/django-storages/blob/master/CHANGELOG.rst#17-2018-09-03
2023-06-22 16:14:22 +05:00
Agrendalath
71fee4a4a0 feat!: remove block handling from runtime initialization of ReplaceURLService
BREAKING CHANGE: This removes the following deprecated shims from the runtime:
`replace_urls`, `replace_course_urls`, `replace_jump_to_id_urls`. XBlocks need
to use the `replace_urls` service instead.
2023-06-21 20:28:24 +02:00
Usama Sadiq
03489910ba fix: update s3 connection method (#32492)
* fix: update s3 connection method and fixing tests.
2023-06-19 15:15:48 +05:00
Yagnesh
14f90eba96 feat: BLOCK_STRUCTURES_SETTINGS['PRUNING_ACTIVE'] toggle removed depr31 2023-06-17 02:31:07 +05:30
Jesper Hodge
a6c57811cd feat add xblock api endpoint (#32282)
* feat: add xblock endpoint for updating an xblock

fix: remove debugger

feat: make function call more generic

refactor: just use request.json for request data as before

refactor: extract method

fix: revert wrong method change

fix: refactor correct method

feat: use handle_xblock method so that we can do more than update xblocks

fix: usage_key_string defaults to None

add all CRUD operations

fix usage key parameter

refactor: create /views folder

refactor: move xblock view functions to xblock_services

fix: tests

fix: tests

refactor: move xblock API endpoint to contentstore

* docs: add explanatory comment to new xblock_service

* feat: add feature flag for enabling content editing api

* feat: raise 404 if studio content api is disabled

* tests: test xblock endpoint

* test: make all post tests work

* test: check that xblock_handler receives correct args

* refactor: create util mixin for course factories with staff

* refactor: extract course staff authorization tests

* refactor: extract tests to api view testcase class

* test: add get tests

* test: fix tests

* test: fix tests

* test: fix tests

* test: add all crud tests

* fix: refactor to fix tests

* fix: merge conflict

* fix: merge conflict

* fix: tests after merge

* fix: json request decorator

* fix: lint

* fix: lint

* fix: lint

* fix: lint

* fix: new test files

* fix: lint

* fix: lint and apply PR suggestions

* fix: lint

* fix: lint

* fix: lint

* fix: lint

* fix: lint

* fix: lint
2023-06-15 14:17:49 -04:00
Feanil Patel
82dde016f6 Merge pull request #32239 from openedx/feanil/migration_check
Migrate migration checks to `minimal.yml` config.
2023-06-15 11:06:14 -04:00
Jenkins
7a047021b1 chore(i18n): update translations 2023-06-15 07:01:31 -04:00
Kristin Aoki
6f90724fb6 feat: update tab_handler to include blockId (#32392) 2023-06-13 15:41:47 -04:00
Ahtisham Shahid
44d48f63ef refactor: removed notification app urls from cms (#32434) 2023-06-13 15:40:31 +05:00
Feanil Patel
74d1008102 fix: Be able to connect to SQL in containers from CMS
By default if you use `localhost` as the `HOST` value for mysql, it
tries to connect to a file socket on disk rather than trying to connect
to the loopback hostname.  This prevents us from running MySQL in a
container while running the LMS on your local machine.

Setting the host to `127.0.0.1` forces the SQL connection to go over TCP
instead. This allows you to map your container port to your localhost
without any issues.

We did this in lms/envs/common.py in an earlier change but did not
update cms/envs/common.py at that time.
2023-06-12 15:06:15 -04:00
Jenkins
435be23d2b chore(i18n): update translations 2023-06-12 11:41:13 -04:00
ruzniaievdm
dea67f29c4 feat: Create DRF for course grading (#32399) 2023-06-09 10:52:30 -04:00
ruzniaievdm
96b8ba5d6a feat: Create DRF for course settings and course details views out of current Django views (#32397) 2023-06-08 11:07:29 -04:00
Jenkins
8326c19431 chore(i18n): update translations 2023-06-04 17:04:19 -04:00
Braden MacDonald
b70252db94 fix: Update text of new clipboard menu, hide it in libraries (#32339)
* fix: Use clearer name for the new "Copy" action ("Copy to Clipboard")

* fix: Don't show the new copy menu in content libraries (not yet supported)
2023-06-01 11:36:53 -07:00
Kristin Aoki
7816a41b51 fix: conditional rendering of course team link (#32336) 2023-06-01 10:24:02 -04:00
Jenkins
072df9a18b chore(i18n): update translations 2023-06-01 09:59:22 -04:00
ruzniaievdm
a6ce487827 feat: Extending API functionality for proctoring errors (#32331) 2023-05-31 14:00:09 -04:00
connorhaugh
b8de097e1a fix: remove drag and drop from V1 libs (#32325) 2023-05-30 11:25:59 -04:00
Fox Piacenti
aa7370c773 refactor: Duplicate and update primitives made available.
This makes a couple of changes to the xblock handler in the CMS. These changes 
add a handful of utility functions and modify the existing ones to make reuse 
of existing blocks easier. With these changes, it is possible to copy an 
entire section from one course to another, and then later refresh that section, 
and all of its children, without destroying the blocks next to it.

The existing _duplicate_block function was modified to have a shallow keyword 
to avoid copying children, and the update_from_source function was added to 
make it easy to copy attributes over from one block to another. These functions 
can be used alongside copy_from_template in the modulestore to copy over blocks 
and their children without requiring them to be within any particular container 
(other than a library or course root)-- thus allowing library-like inclusion 
without the library content block. This is especially useful for cases like 
copying sections rather than unit content.
2023-05-25 15:58:28 +02:00
Michael Roytman
105260f642 Merge pull request #32250 from openedx/MichaelRoytman/MST-1869-course-end-date
feat: send course end date as due date to exams service if exam has no due date
2023-05-22 11:37:37 -04:00
Kristin Aoki
1fcefc3dd9 feat: add waffle flag check in header (#32264) 2023-05-22 11:18:26 -04:00
Jenkins
689ce64361 chore(i18n): update translations 2023-05-22 11:15:31 -04:00
Ned Batchelder
8e7b0c1c73 fix: oscm@edx.org is not the right email for asking about APIs
We get about one email per month from people looking for access to edX
APIs.  Those emails come to the now almost-defunct oscm@edx.org email
address.  I think that's because of these swagger references.

I suppose someone could find this email address on an Open edX
installation, and people would write to it, but I find in practice this
doesn't happen.

Co-authored-by: Kyle McCormick <kyle@tcril.org>
2023-05-22 07:51:45 -07:00