Commit Graph

7419 Commits

Author SHA1 Message Date
Ahtisham Shahid
13a5cfc66f fix: use search instead of list for users in notification admin (#32769) 2023-07-18 12:13:03 +05:00
Emily Aquin
134b4bcff6 feat: upgrade course enrollment from audit to verified 2023-07-17 20:11:06 +00:00
Braden MacDonald
9b9b88df52 chore: remove some usages of six (Python2 compat) (#32554)
* get rid of six.text_type(s)
* get rid of six.b()
* get rid of six.string_types
* get rid of six.PY2/six.PY3
* get rid of six.iteritems() and six.viewvalues()
2023-07-17 12:18:43 -07:00
Mohammad Ahtasham ul Hassan
06923c7948 feat: use username for course completion API instead of lms_user_id (#32761) 2023-07-17 20:17:12 +05:00
Yagnesh1998
6e8c10c791 Merge branch 'openedx:master' into edx-depr31 2023-07-17 15:54:46 +05:30
Mohammad Ahtasham ul Hassan
024096a589 temp: add temporary logging for entitlement revocation (#32746)
* temp: add temporary logging for entitlement revocation
2023-07-14 16:04:17 +05:00
Awais Ansari
5d72ba3518 feat: add show_preference flag in course enrollment API response (#32726)
* feat: add show_preference flag in course enrollment API response

* refactor: fix lint issue in get_paginated_response
2023-07-14 12:26:49 +05:00
Ahtisham Shahid
eebd7d236b fix: added correct url in notification content_url (#32725)
* fix: added correct URL in notification content_url
* fix: updated logic to compare user ids
2023-07-14 10:44:14 +05:00
Piotr Surowiec
fa06be106e Revert "feat: remove field-data binding from the runtime [FC-0026]" (#32740)
* Revert "feat: remove `field-data` service from runtime initialization"

This reverts commit 6c435bb68c.

* Revert "feat: remove field data binding from the runtime"

This reverts commit 5f46ea52cd.
2023-07-13 13:04:02 -04:00
Mohammad Ahtasham ul Hassan
00f049b9e9 fix: fix course completion utility (#32734) 2023-07-13 20:12:02 +05:00
Piotr Surowiec
c6bd98e51a Revert "refactor: reuse services and wrappers between XBlocks" (#32730)
This reverts commit 36cc415fc2.
2023-07-13 10:05:34 -04:00
SaadYousaf
51c826f41d feat: add tracking events for notifications app 2023-07-13 16:24:33 +05:00
Mohammad Ahtasham ul Hassan
7fe5229bbb feat: Add new entitlement expiration endpoint (#32677)
* feat: add new entitlements expiration endpoint
2023-07-13 13:38:20 +05:00
Feanil Patel
f60735a4eb Merge pull request #32573 from open-craft/yusuf-musleh/list-courses-details-by-key
feat: list courses details by keys
2023-07-12 16:01:38 -04:00
alangsto
cb3a0e91e9 feat: return lti launch url (#32718) 2023-07-12 14:25:59 -04:00
Yusuf Musleh
4ad8ba1b41 feat: list courses details by keys
This adds the ability to get a list of detailed courses based on their
keys provided in the newly added `keys` query param in the `GET /courses/v1/courses/`
endpoint.
2023-07-12 17:22:38 +03:00
Ahtisham Shahid
cd6c754198 fix: resolved logical issues with notification task (#32724) 2023-07-12 15:21:56 +05:00
Ahtisham Shahid
4921db5995 feat: added logic to handle core notifications (#32708)
* feat: added logic to handle core notifications
2023-07-12 12:06:24 +05:00
Muhammad Adeel Tajamul
89bede4dd6 test: added tests to validate notification preference constant (#32666) 2023-07-12 11:02:51 +05:00
Ahtisham Shahid
cd7e48c5d7 feat: update/create notifiction pref while sending notifications (#32665)
* feat: update user pref while sending notifications

* feat: added flag and bulk create in task
2023-07-11 18:46:41 +05:00
Awais Ansari
aeae341559 feat: add non_editable for core notifications (#32695)
* feat: add non_editable for core notifications

* test: add test case for non_editable in core notification

* refactor: remove breakpoint from test cases
2023-07-11 12:21:04 +05: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
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
Awais Qureshi
b528a27237 fix: upgrading celery version and fixing tests. (#32468)
* fix: upgrading celery version and fixing tests.

---------

Co-authored-by: edX requirements bot <49161187+edx-requirements-bot@users.noreply.github.com>
Co-authored-by: zubairshakoorarbisoft <zubair.shakoor@arbisoft.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-10 18:36:30 +05:00
ayesha waris
c5c52a8f9e fix: changes count_by_app_name in counts api to return apps with zero… (#32629)
* fix: changes count_by_app_name in counts api to return apps with zero unseen count

* refactor: initialised count_by_app_name_dict with zeros
2023-07-10 16:14:02 +05:00
Braden MacDonald
e705820d0d refactor: Remove unneeded filter from static asset copy/paste code. (#32660) 2023-07-07 09:47:06 -07:00
Mohammad Ahtasham ul Hassan
ee871730c8 feat: add course_status utility (#32545)
* feat: add course_status utility
2023-07-07 12:38:05 +05: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
alangsto
6f00f63da6 feat: add course waffle flag for learner assistant (#32657) 2023-07-06 10:19:58 -04: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
Edward Zarecor
9e5f7bb782 Merge branch 'master' into edx-depr31 2023-07-05 09:53:55 +02:00
Muhammad Adeel Tajamul
ac5b0870db feat: added support for translation in notifications (#32626) 2023-07-04 15:13:14 +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
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
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
John Nagro
6d5dcdf77a fix: improve username generation (#32613) 2023-06-30 09:47:02 -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
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
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
Yagnesh1998
751411951d feat: Remove block_structure.invalidate_cache_on_publish waffle flag … (#32517)
* feat: Remove block_structure.invalidate_cache_on_publish waffle flag depr33.

* feat: Update test_signals.py

* feat: Update signals.py

---------

Co-authored-by: Edward Zarecor <ezarecor@tcril.org>
2023-06-29 10:57:41 -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
5f46ea52cd feat: remove field data binding from the runtime 2023-06-26 19:21:22 +02:00
Zainab Amir
2fd3dc1840 feat: add utm_campaign to registration event (#32574) 2023-06-26 17:05:07 +05:00
Edward Zarecor
0ad7ab30f2 Merge branch 'master' into edx-depr31 2023-06-26 13:02:28 +02:00
Nawfal Ahmed
80d151b404 feat: add marketing url to subscription upsell (#32560) 2023-06-23 12:54:15 +00:00
Yagnesh1998
f0112deb2c feat: Update test_models.py 2023-06-22 15:17:09 +05:30