Commit Graph

65817 Commits

Author SHA1 Message Date
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
Zachary Hancock
ab3d322bc9 feat: update edx-proctoring JS library (#32668) 2023-07-06 10:25:15 -04:00
alangsto
6f00f63da6 feat: add course waffle flag for learner assistant (#32657) 2023-07-06 10:19:58 -04:00
Yagnesh1998
a68a1ed434 feat: Removed JWT_AUTH_REFRESH_COOKIE in depr. (#32664) 2023-07-06 09:14:30 -04:00
Awais Qureshi
516ad77985 Upgrade drf (#32667)
* chore: upgrading drf.

* feat: Upgrade Python dependency djangorestframework (#32563)

Upgrading drf to latest version.

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

Co-authored-by: awais786 <awais786@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: awais786 <awais786@users.noreply.github.com>
2023-07-06 18:02:21 +05:00
Nawfal Ahmed
139d0b2392 feat: sort subscription programs in program dashboard (#32651) 2023-07-06 09:01:40 +00:00
Ahtisham Shahid
b477a20ad2 Added notifications for discussions events (#32432)
* feat: added notifications for discussions app

* feat: added unit tests for handler

* feat: updated openedx-events package

* fix: updated notification creation logic and tests

* refactor: updated openedx-event version and event name

* refactor: moved logic to separate methods
2023-07-06 13:33:20 +05:00
Awais Ansari
67b97705c8 refactor: update non-editable into snake case non_editable (#32654) 2023-07-06 12:17:29 +05:00
Jenkins
5ccdd2126f chore: geoip2: update maxmind geolite country database 2023-07-05 16:59:02 -04:00
Diana Huang
171255860f feat: Unpin SAML for upgrade. (#32443)
https://github.com/openedx/edx-platform/issues/32327
2023-07-05 15:52:41 -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
Ejaz Ahmad
810bf97431 Merge pull request #32650 from openedx/eahmadjaved/ENT-7266
chore: bumping enterprise package version to 3.68.1
2023-07-05 14:03:01 +05:00
Ejaz Ahmad
29f451a94c Merge pull request #32649 from openedx/jajjibhai008/upgrade-edx-enterprise-5b7afab
feat: Upgrade Python dependency edx-enterprise
2023-07-05 13:23:50 +05:00
jajjibhai008
7ad48a3bca feat: Upgrade Python dependency edx-enterprise
Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
2023-07-05 08:21:07 +00:00
jajjibhai008
5b7afab0e4 chore: bumping enterprise package version to 3.68.1 2023-07-05 13:17:12 +05:00
Edward Zarecor
9e5f7bb782 Merge branch 'master' into edx-depr31 2023-07-05 09:53:55 +02:00
Jody Bailey
02084fa372 feat: added endpoint for context needed for recommendations experiment (#32645)
* feat: added endpoint for context needed for recommendations experiment

* chore: Removed unnecessary decorator
2023-07-04 16:38:58 +02:00
Muhammad Adeel Tajamul
ac5b0870db feat: added support for translation in notifications (#32626) 2023-07-04 15:13:14 +05:00
github-actions[bot]
117539de3f feat: Upgrade Python dependency django (#32643)
security patch

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

Co-authored-by: awais786 <awais786@users.noreply.github.com>
2023-07-04 12:28:08 +05:00
Muhammad Adeel Tajamul
a71c34a969 feat: added management command to delete expired notifications (#32556) 2023-07-04 11:59:54 +05:00
Edward Zarecor
aff9d82b7d Merge branch 'master' into edx-depr31 2023-07-04 08:39:10 +02:00
Robert Raposa
65fc388d71 Revert "test: remove unused helper functions from test_views.py"
This reverts commit ad3b5610f1.

Follow-up commit will convert these helpers to actual
tests so they are run.
2023-07-03 13:36:07 -04:00
Feanil Patel
567704cc3a Merge pull request #32608 from openedx/feanil/small_fix
fix: Don't assume there is a context.
2023-07-03 11:29:16 -04:00
Feanil Patel
286a9cddaf Merge pull request #32559 from raju249/31696-unused-helper-functions
test: remove unused helper functions from test_views.py
2023-07-03 10:36:20 -04:00
Feanil Patel
82ee4cd4c3 Merge pull request #32611 from openedx/feanil/platform-docs
feanil/platform docs
2023-07-03 10:28:12 -04:00
Awais Ansari
e543a68990 feat: add pagination in course enrollment list API (#32546)
* feat: add pagination in course enrollment list API

* refactor: enrollment course list API

* refactor: follow best practice in course enrollment list API
2023-07-03 13:52:15 +05:00
Jenkins
dab865c4ee chore(i18n): update translations 2023-07-02 17:04:33 -04:00
Braden MacDonald
83f54aeebe refactor: Split base.in into kernel.in (required) and bundled.in (optional) (#32552)
Plus remove a few unused and indirect dependencies
2023-06-30 09:51:43 -07: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
John Nagro
6d5dcdf77a fix: improve username generation (#32613) 2023-06-30 09:47:02 -04:00
Piotr Surowiec
5c424b42af Merge pull request #32420 from open-craft/agrendalath/fc-0026-cache_runtime_services_and_wrappers
feat: reuse runtime services and wrappers between XBlocks [FC-0026]
2023-06-30 15:29:52 +02:00
Agrendalath
6a8e695a0e refactor: remove redundant masquerade handling from runtime initialization
This part was added in 3d7246ecc8.
Then, 0dd4978f37 refactored the approach, but
did not remove these lines.
2023-06-30 15:06:43 +02: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
Edward Zarecor
462e8bef36 Merge branch 'master' into 31696-unused-helper-functions 2023-06-30 12:57:43 +02:00
Navin Karkera
93006b476d feat: configure acceptable language codes for youtube transcripts 2023-06-30 11:02:58 +05:30
Tim McCormack
437418d367 feat: Switch Dockerfile from npm install to npm ci; some cleanup (#32590)
Otherwise we're not really respecting the package-lock file and won't get
repeatable results.

Also:

- Clean up old error handling for npm<3. Were on npm 8 now. Probably
  can get rid of this.
- Use the shorthand `npm ci` rather than `npm clean-install` just for
  consistency with code elsewhere.
- Update comments in tests to be explicit about use of ci rather than
  install
2023-06-29 21:55:23 +00:00
Feanil Patel
7a0f2682ac docs: Add feature toggle and settings to the guide.
With this move we don't need the existing separate `edx-platform
Technical` sphinx project.  In the future we can remove it and just
redirect to the content in this project but I won't be doing that as a
part of this change because that involves adding redirects over there to
the new content and I'm not yet done organizing the destination.

The docs in the `guide` project might move around as we make the project
follow diataxis more closely.
2023-06-29 16:10:42 -04:00
connorhaugh
57fd22ba58 feat: ignore v2 xblocks in independence contract (#32602)
* feat: ignore v2 xblocks in independance contract

* docs: add documentation as to failure point
2023-06-29 16:08:14 -04:00
Feanil Patel
8c43868b52 docs: Rename swagger.yaml to lms-openapi.yaml
* Swagger was renamed to OpenAPI at some point so use the new name for
  clarity.

* Prefix with `lms` to make it clear that these are the APIs from the
  LMS and may not all be available in the CMS.
2023-06-29 15:37:10 -04:00
Feanil Patel
26262131ae docs: Remove the api docs sphinx project.
* This project was not being published anywhere.
* The previous commit that adds openapi generation capabilities to the
  `docs/guides` replaces what this was doing.
2023-06-29 15:37:10 -04:00
Feanil Patel
56cad59e97 docs: Generate rst from the existing swagger docs.
Use an existing 3rd party library to generate RST docs from the existing
swagger.yaml file.
2023-06-29 15:37:10 -04:00
Kristin Aoki
08e633d57e fix: missing and broken waffle flag links (#32587) 2023-06-29 13:21:18 -04:00
Feanil Patel
cf9c4e83bf fix: Don't assume there is a context.
Don't assume that there will be an extra `context` kwarg when using the
bookmark serializer.  We use it this way in the current code but that's
specific to us and not comon to all serializers.  There are a lot of API
documentation tools that automate introspecting serializers but they
won't know  that they have to send in a `context` to the serializer.

To make this serializer behave more like other serializers without
changing the behavior, we just need to check that the `context` value is
defined before we dig into it.  In the case that there is no `context`
we just treat it the same as if there is no `request` in the `context`.
2023-06-29 13:01:18 -04:00
Alexander J Sheehan
79a4339278 Merge pull request #32607 from openedx/asheehan-edx/bumping-enterprise-version-3.67.7
chore: bumping enterprise package version to 3.67.7
2023-06-29 12:56:20 -04:00
Jesper Hodge
799c0bf8a8 fix: problem dropdown does not cover text anymore (#32605) 2023-06-29 12:51:26 -04:00
Jansen Kantor
17c4fc03d4 feat: add course field for ORA flex peer override (#32594)
* feat: add course field for ORA flex peer override

* style: quality

* style: remove auto import
2023-06-29 12:48:33 -04:00
Alexander J Sheehan
85d06704b8 chore: bumping enterprise package version to 3.67.7 2023-06-29 16:27:36 +00:00