Commit Graph

100 Commits

Author SHA1 Message Date
Kyle McCormick
e800ae7622 feat: provisionally support V2 libraries in LibraryContentBlock (randomized only) (#33263)
Refactors and reworks the LibraryContentBlock so that its
sync-from-library operations are asynchronous and work with
V2 content libraries. This also required us to make
library_content block duplication asynchronous, as that
involves syncing from the source library.

For the sake of clarity, this PR includes two major method renames:

* update_children(...) -> sync_from_library(...)
* refresh_library(...) -> sync_from_library(upgrade_to_latest=True, ...)

an an XBlock HTTP handler rename:

  /refresh_children -> /upgrade_and_sync

There are still a couple issues with import or duplication
of library_content blocks referencing V2 libraries other than
latest. These will be resolved in an upcoming PR.

Part of: https://openedx.atlassian.net/wiki/spaces/COMM/pages/3820617729/Spec+Memo+Content+Library+Authoring+Experience+V2
Follow-up work: https://github.com/openedx/edx-platform/issues/33640

Co-authored-by: Connor Haugh <chaugh@2u.com>
Co-authored-by: Eugene Dyudyunov <evgen.dyudyunov@raccoongang.com>
2023-11-20 15:58:10 +00:00
Kyle McCormick
265701c01d feat!: remove library_sourced block (#33257)
Originally, we planned to add support for V2 libraries and for static
(hand-selected) library block reference via new block type: library_sourced.

We have since decided that it would be better to add those capabilities
in-place to the existing library_content block. This will ease V1->V2
library migration and make adoption of the new features easier for current
library users. It will also avoid duplication of logic between two block types,
we we fear would be error-prone. For details, see this ADR:
 https://github.com/openedx/edx-platform/pull/33231

So, we are removing the library_sourced block.
This block has existed in edx-platform for a few years now, but was not
enabled by default and never officially supported. It was only usable via the
experimental V2 content library feature. Operators who added library_sourced
blocks to their course will now see them render as `HiddenBlock` instances, i.e.:

> ERROR: "library_sourced" is an unknown component type...

This should not impact other component types in such courses and should not
impact import/export.
2023-09-15 10:04:38 -04:00
Syed Ali Abbas Zaidi
8480dbc228 chore: apply amnesty on existing not fixable issues (#32215)
* fix: eslint operator-linebreak issue

* fix: eslint quotes issue

* fix: react jsx indent and props issues

* fix: eslint trailing spaces issues

* fix: eslint line around directives issue

* fix: eslint semi rule

* fix: eslint newline per chain rule

* fix: eslint space infix ops rule

* fix: eslint space-in-parens issue

* fix: eslint space before function paren issue

* fix: eslint space before blocks issue

* fix: eslint arrow body style issue

* fix: eslint dot-location issue

* fix: eslint quotes issue

* fix: eslint quote props issue

* fix: eslint operator assignment issue

* fix: eslint new line after import issue

* fix: indent issues

* fix: operator assignment issue

* fix: all autofixable eslint issues

* fix: all react related fixable issues

* fix: autofixable eslint issues

* chore: remove all template literals

* fix: remaining autofixable issues

* chore: apply amnesty on all existing issues

* fix: failing xss-lint issues

* refactor: apply amnesty on remaining issues

* refactor: apply amnesty on new issues

* fix: remove file level suppressions

* refactor: apply amnesty on new issues
2023-08-07 19:13:19 +05:00
Kyle McCormick
355779983e build: commit builtinblocks Webpack config and stub out xmodule_assets (#32685)
The Webpack configuration file for built-in XBlock JS used to be
generated at build time and git-ignored. It lived at
common/static/xmodule/webpack.xmodule.config.js. It was generated
because the JS that it referred to was also generated at build-time, and
the filenames of those JS modules were not static.

Now that its contents have been made entirely static [1], there is no
reason we need to continue generating this Webpack configuration file.
So, we check it into edx-platform under the name
./webpack.builtinblocks.config.js. We choose to put it in the repo's
root directory because the paths contained in the config file are
relative to the repo's root.

This allows us to behead both the xmodule/static_content.py
(`xmodule_assets`) script andthe  `process_xmodule_assets` paver task, a
major step in removing the need for Python in the edx-platform asset
build [2]. It also allows us to delete the `HTMLSnippet` class and all
associated attributes, which were exclusively used by
xmodule/static_content.py..

We leave `xmodule_assets` and  `process_xmodule_assets` in as stubs for
now in order to avoid breaking external code (like Tutor) which calls
Paver; the entire pavelib/assets.py function will be eventually removed
soon anyway [3]. Further, to avoid extraneous refactoring, we keep one
method of `HTMLSnippet` around on a few of its former subclasses:
`get_html`. This method was originally part of the XModule framework;
now, it is left over on a few classes as a simple internal helper
method.

References:
1. https://github.com/openedx/edx-platform/pull/32480
2. https://github.com/openedx/edx-platform/issues/31800
3. https://github.com/openedx/edx-platform/issues/31895

Part of: https://github.com/openedx/edx-platform/issues/32481
2023-07-27 14:32:29 +00:00
Kyle McCormick
9d4163d31f build: include built-in XBlock JS directly rather than copying it (#32480)
As part of the static asset build, JS modules for most built-in XBlocks were
unnecessarily copied from the original locations (under xmodule/js and
common/static/js) to a git-ignored location (under common/static/xmodule), and
then included into the Webpack builld via
common/static/xmodule/webpack.xmodule.config.js.

With this commit, we stop copying the JS modules. Instead, we have
common/static/xmodule/webpack.xmodule.config.js just reference the original
source under xmodule/js and common/static/js.

This lets us us radically simplify the xmodule/static_content.py build script.
It also sets the stage for the next change, in which we will check
webpack.xmodule.config.js into the repository, and delete
xmodule/static_content.py entirely.

common/static/xmodule/webpack.xmodule.config.js before:

    module.exports = {
        "entry": {
            "AboutBlockDisplay": [
                "./common/static/xmodule/modules/js/000-b82f6c436159f6bc7ca2513e29e82503.js",
                "./common/static/xmodule/modules/js/001-3ed86006526f75d6c844739193a84c11.js",
                "./common/static/xmodule/modules/js/002-3918b2d4f383c04fed8227cc9f523d6e.js",
                "./common/static/xmodule/modules/js/003-b3206f2283964743c4772b9d72c67d64.js",
                "./common/static/xmodule/modules/js/004-274b8109ca3426c2a6fde9ec2c56e969.js",
                "./common/static/xmodule/modules/js/005-26caba6f71877f63a7dd4f6796109bf6.js"
            ],
            "AboutBlockEditor": [
                "./common/static/xmodule/descriptors/js/000-b82f6c436159f6bc7ca2513e29e82503.js",
                "./common/static/xmodule/descriptors/js/001-19c4723cecaa5a5a46b8566b3544e732.js"
            ],
            // etc
        }
    };

common/static/xmodule/webpack.xmodule.config.js after:

    module.exports = {
        "entry": {
            "AboutBlockDisplay": [
                "./xmodule/js/src/xmodule.js",
                "./xmodule/js/src/html/display.js",
                "./xmodule/js/src/javascript_loader.js",
                "./xmodule/js/src/collapsible.js",
                "./xmodule/js/src/html/imageModal.js",
                "./xmodule/js/common_static/js/vendor/draggabilly.js"
            ],
            "AboutBlockEditor": [
                "./xmodule/js/src/xmodule.js",
                "./xmodule/js/src/html/edit.js"
            ],
            // etc
        }
    };

Part of: https://github.com/openedx/edx-platform/issues/32481
2023-07-26 13:27:38 -04:00
Kyle McCormick
3e67719a24 build: npm run build (experimental) (#32823)
This PR implements much of the static assets rework ADR [1], including:

* `npm run build[-dev]`, and its subcommands,
* `npm run webpack[-dev]` and
* `npm run compile-sass[-dev]`.

This is backwards-compatible. `paver update_assets` should not be affected.
The new command warns that it is "experimental" for a few reasons:

* `npm run build` will fail in the webpack phase unless you first
run  `xmodule_assets`. This will be changed soon [2].

* We have tested the new build, but not quite so thoroughly that we'd
recommend it as the production default yet. Once the xmodule_assets
work lands, we'll share this on the forums so early adopters can try it
out.

* The commands lack some top-level documentation. Once they stabilize more,
we'll add a section to the README that explains how and when to use `npm run
build` and its subcommands and its env vars.

* `npm run watch` is not yet implemented.

References:
1. https://github.com/openedx/edx-platform/blob/master/docs/decisions/0017-reimplement-asset-processing.rst
2. https://github.com/openedx/edx-platform/pull/32685

Part of: https://github.com/openedx/edx-platform/issues/31604
2023-07-26 08:04:45 -04:00
Syed Ali Abbas Zaidi
adf879e8b2 Revert "fix: all auto fixable eslint issues (#31900)" (#32203)
This reverts commit 228180b1ef.
2023-05-09 13:53:54 +05:00
Syed Ali Abbas Zaidi
228180b1ef fix: all auto fixable eslint issues (#31900)
* fix: eslint operator-linebreak issue

* fix: eslint quotes issue

* fix: react jsx indent and props issues

* fix: eslint trailing spaces issues

* fix: eslint line around directives issue

* fix: eslint prefer template issue

* fix: eslint semi rule

* fix: eslint newline per chain rule

* fix: eslint space infix ops rule

* fix: eslint space-in-parens issue

* fix: eslint space before function paren issue

* fix: eslint space before blocks issue

* fix: eslint arrow body style issue

* fix: eslint dot-location issue

* fix: eslint quotes issue

* fix: eslint quote props issue

* fix: eslint operator assignment issue

* fix: eslint new line after import issue

* fix: indent issues

* fix: operator assignment issue
2023-05-09 11:57:15 +05:00
Syed Ali Abbas Zaidi
f1fb38ed83 fix: multi lines and spaces issues (#31885)
* fix: multi lines and spaces issues

* fix: eslint operator-linebreak issue

* fix: eslint quotes issue

* fix: remaining quotes issues

* fix: eslint object curly newline issue

* fix: eslint object curly spacing issue

* fix: eslint brace-style issues

* fix: react jsx indent and props issues

* fix: eslint trailing spaces issues

* fix: eslint linbreak style issue

* fix: eslint space unary operator issue

* fix: eslint line around directives issue

* fix: void and typeof space unary ops issue
2023-05-03 12:22:46 +05:00
Zachary Hancock
89e308e45e feat: add JS env config to workers (#31851) 2023-03-03 09:29:18 -05:00
Syed Sajjad Hussain Shah
96f6174d9e feat: Add 2U recommendations in dashboard [VAN-1094] (#31026) 2022-09-22 13:01:10 +05:00
Sandeep Dubey
51b5e624b3 feat: upgrade TinyMCE v4.0.20 to TinyMCE v5.5.1 (#30335)
Co-authored-by: Arunmozhi <arunmozhi@opencraft.com>
2022-09-19 12:43:19 +02:00
Zainab Amir
ef9361ccfe feat: add recommendation panel
- added a waffle flag to control recommendation panel
- add react code for the panel

VAN-984
2022-07-01 11:52:08 +05:00
Muhammad Umar Khan
a389a9ff10 Revert "Revert "refactor: move xmodule folder to root"" 2022-06-20 18:20:06 +05:00
Muhammad Umar Khan
d890f06507 Revert "refactor: move xmodule folder to root" 2022-06-20 16:03:48 +05:00
M Umar Khan
a91df0c40f refactor: move xmodule folder to root
- Moving xmodule folder to root as we're dissolving sub-projects of common folder in edx-platform
    - More info: https://openedx.atlassian.net/browse/BOM-2579
- -e common/lib/xmodule has been removed from the requirements as xmodule has itself become the part of edx-platform and not being installed through requirements
- The test files common/lib/xmodule/test_files/ have been removed as they are not being used anymore
2022-06-20 14:33:45 +05:00
Michael Terry
ce5f1bb343 feat!: drop legacy course home view and related code
This was the "outline tab" view of the course. Preceded by the
course info view, succeeded by the MFE outline tab.

In addition to the course home view itself, this drops related
features:
- Legacy version of Course Goals (MFE has a newer implementation)
- Course home in-course search (MFE has no search)

The old course info view and course about views survive for now.

This also drops a few now-unused feature toggles:
- course_experience.latest_update
- course_experience.show_upgrade_msg_on_course_home
- course_experience.upgrade_deadline_message
- course_home.course_home_use_legacy_frontend

With this change, just the progress and courseware tabs are still
supported in legacy form, if you opt-in with waffle flags. The
outline and dates tabs are offered only by the MFE.

AA-798

(This is identical to previous commit be5c1a6, just reintroduced
now that the e2e tests have been fixed)
2022-04-14 15:18:31 -04:00
Michael Terry
a515c2e992 Revert "Drop legacy outline tab in favor of the MFE's version" 2022-04-14 14:16:29 -04:00
Michael Terry
be5c1a64d5 feat!: drop legacy course home view and related code
This was the "outline tab" view of the course. Preceded by the
course info view, succeeded by the MFE outline tab.

In addition to the course home view itself, this drops related
features:
- Legacy version of Course Goals (MFE has a newer implementation)
- Course home in-course search (MFE has no search)

The old course info view and course about views survive for now.

This also drops a few now-unused feature toggles:
- course_experience.latest_update
- course_experience.show_upgrade_msg_on_course_home
- course_experience.upgrade_deadline_message
- course_home.course_home_use_legacy_frontend

With this change, just the progress and courseware tabs are still
supported in legacy form, if you opt-in with waffle flags. The
outline and dates tabs are offered only by the MFE.

AA-798
2022-04-14 09:12:01 -04:00
Adam Stankiewicz
31f66a4f2c feat: enterprise learner portal access modal (#27736)
* feat: enterprise learner portal access modal

* fix: quality

* fix: remove log.info
2021-05-27 15:31:27 -04:00
David Ormsbee
9d1f5e1224 fix: reduce the size of the commons.js asset. (#26462)
The size of commons.js has gradually grown until it is now 4 MB in
dev mode. This change brings it back down to 880 KB. This does
cause the size of some other JS assets to increase, some by as much
as 500 KB. This still seemed like a worthwhile tradeoff.
2021-02-10 09:34:18 -05:00
sarina
b8bd4f6310 DEPR-48 Remove CourseTalk integration & Course Reviews functionality 2020-11-17 13:11:54 -05:00
Sid Verma
09c24be35e Add UI for "library sourced block" letting users browse and select xblocks (#24816) 2020-10-14 13:29:52 -04:00
Thomas Tracy
0151b80ab7 A modal used to collect demographics information (#24956)
* A modal used to collect demographics information

Add checkmark to final page (#24957)

Remove themeing to get ready for staging

MICROBA-574 | Dismiss CTA after learner finishes answering modal questions (#24965)

[MICROBA-574]
- Dismiss CTA after learner finishes answering demographics questions
- Cleanup comments

* Various initial bugfixes

- fixes 2 issues with the multiselect dropdown erasing state
- prevents input higher than 255 characters in the self describe
- fixes 400 errors when the user selects a default option
- Removes additional page count section

- Re-adding deleted JS file. Can't clean this up until after we cutover to using the new Demographics modal

* Add translatable string to clear button

* Remove extra page counter from the header for the third time

* Remove unneeded template context

Co-authored-by: Matt Tuchfarber <mtuchfarber@edx.org>
Co-authored-by: Justin Hynes <jhynes@edx.org>
2020-09-14 09:28:06 -04:00
Adam Stankiewicz
6d942bc94d revert learner portal links blocking juniper release 2020-05-04 14:55:06 -04:00
Simon Chen
b34af45393 MST-157 Create a new program enrollments inspector support tool to help edX support members to inspect the existing states of program enrollees
This reverts commit 37f3c3f829.
2020-03-13 11:28:16 -04:00
David Ormsbee
37f3c3f829 Revert "MST-157 Create a new program enrollments inspector support tool to help edX support members to inspect the existing states of program enrollees"
This reverts commit 9bdcb9c5f5.
2020-03-12 17:28:58 -04:00
Simon Chen
9bdcb9c5f5 MST-157 Create a new program enrollments inspector support tool to help edX support members to inspect the existing states of program enrollees 2020-03-12 15:47:26 -04:00
Robert Raposa
2202545aec remove studio signin and signup pages
This completes the work started in https://github.com/edx/edx-platform/pull/19453
to use the LMS login and registration for Studio, rather than Studio
providing its own implementation.

LMS login/registration are being used for the following reasons:
1. LMS logistration properly handles all SSO integrations.
2. A single logistration is simpler to maintain and understand.
3. Allows Studio to work more like all other IDAs that use LMS
logistration.

The original switch to use LMS logistration for Studio also added the
toggle `DISABLE_STUDIO_SSO_OVER_LMS` to provide the community some
additional time for switching. This commit removes this toggle, which
at this point means all deployments will use the LMS logistration.

This change requires sharing cookies across LMS and Studio. Should that
prove to be a problem for certain Open edX instances, there are
discussions of possible alternative solutions.
See https://github.com/edx/edx-platform/pull/19845#issuecomment-559154256

Detailed changes:
* Fix some Studio links that still went to old Studio signin and signup.
* Remove DISABLE_STUDIO_SSO_OVER_LMS feature toggle.
* Remove old studio signin and signup pages and templates.
* Fix url name "login", which had different meanings for Studio and LMS.
* Use the following settings: LOGIN_URL, FRONTEND_LOGIN_URL,
FRONTEND_LOGOUT_URL, and FRONTEND_REGISTER_URL.
* Redirect /signin and /signup to the LMS logistration.
* Add custom metric `uses_pattern_library`.
* Add custom metric `student_activate_account`.
* Add Django Settings to allow /signin, /signup, and /login_post to be
disabled once ready.

This work also relates to ARCH-218 and DEPR-6.

ARCH-1253
2019-12-04 02:36:36 -05:00
Brittney Exline
6e2887f851 Add enterprise portal links to user dropdown menu and dashboard alerts. (#21833) 2019-10-09 16:01:41 -04:00
Jansen Kantor
4988999697 Jkantor/support (#21541)
* refactor link_program_enrollments into it's own file, add support page
2019-09-05 13:35:43 -04:00
Diana Huang
c6a89b03b9 Remove Diff Paid experimental features. 2019-05-03 15:09:20 -04:00
Josh McLaughlin
4d4b040517 Add dashboard announcements feature
- Add announcements view using JSX to the dashboard sidebar
- Create a new maintenance interface to edit and manage announcements
- Adds an override to main.html template to include new skip links
- Add plugins required for announcements to TinyMCE

This is motivated by a desire to have system wide messages for students
that show on the dashboard. Enabled with FEATURES['ENABLE_ANNOUNCEMENTS'].
Global staff are allowed to edit from the studio maintenance view.
2019-03-10 19:25:13 -07:00
Matt Hughes
19265ad6e4 apply babel more liberally to webworker js 2018-12-21 11:16:28 -05:00
Dave St.Germain
b3a85aeb38 Webpack config will pull in available workers dynamically from edx-proctoring 2018-12-21 11:16:27 -05:00
Matt Hughes
72a2e191fd Set up new proctoring service JS
also move mockprock (dev only proctoring service)'s JS to
devDependencies
2018-12-21 11:14:37 -05:00
Matt Hughes
6264d75f49 Fix some eslint errors on touched files
Also package lock was tricky in how specifically it wanted to be
updated
2018-12-21 11:07:58 -05:00
Matt Hughes
0a33fb6bb6 Fixed karma setup bug with new webpack config 2018-12-21 10:54:51 -05:00
Matt Hughes
6430dc42a6 [WIP]: reverse order of npm dependencies
also ensures that our proctoring JS will run through babel, even while
we have npm dependencies installed on a local-only basis
2018-12-21 10:54:51 -05:00
Matt Hughes
658fd6c139 Consolidate worker-targetting webpack config in common
This changes the production config. Spooky scary!
2018-12-21 10:54:51 -05:00
Michael Youngstrom
4feaee2bd8 Fix some eslint warnings 2018-12-18 12:52:45 -05:00
noraiz-anwar
ce41896deb add babel-polyfill in commons 2018-11-12 18:13:51 +05:00
Calen Pennington
9c32073e9b fixup! Load all webpack chunks into fragments as correctly-typed resources 2018-09-11 13:56:05 -04:00
Kshitij Sobti
bf6af13ed1 Add UI to browse and browse course structure and select the course/chapter/section... to generate a report of 2018-07-18 00:37:29 +05:30
Calen Pennington
df67288a3b Use the tinymce from vendor without modification 2018-06-27 22:27:07 -04:00
Calen Pennington
07a15c681f Reapply the XBlock RequireJS -> Webpack changes
This reverts commit 105db2cf59, reversing
changes made to 447457594f.
2018-06-27 22:27:07 -04:00
Usman Khalid
8b1aad080a Add complete on view support to render_xblock view. 2018-06-22 14:46:03 -04:00
Eric Fischer
e72549cdbe Revert "Merge pull request #18340 from cpennington/fix-studio-xblock-rendering"
This reverts commit 9a70ca78a5, reversing
changes made to efd5b9abbd.

Hopefully fixes EDUCATOR-3053
2018-06-15 13:18:27 -04:00
Calen Pennington
be3c7e05c5 Reapply "Switch container factory to webpack"
This reverts commit 18d93b00ba.
2018-06-07 15:52:05 -04:00
Calen Pennington
18d93b00ba Revert "Switch container factory to webpack" 2018-06-07 13:46:47 -04:00