Commit Graph

28 Commits

Author SHA1 Message Date
Brian Smith
0ce0b7526e feat: upgrade to react 18 (#1766) 2025-04-02 12:04:48 -04:00
Chris Chávez
0eda5aec23 feat: Create advanced blocks in libraries [FC-0076] (#1653)
List view to show and create the advanced blocks
2025-03-05 12:46:17 -05:00
Ihor Romaniuk
619ab9a267 feat: [FC-0070] rendering library content in unit page (#1475)
The enables opening a Library Content page within the new Studio unit page. This page displays the xBlocks from the specified library and provides basic configuration options for the library.
2025-01-16 14:06:48 -03:00
Jillian
cfe19894d1 feat: Let Studio Home REST API determine if libraries v1 and/or v2 are enabled (#1329) 2024-10-18 12:03:26 -07:00
Navin Karkera
7fb460019e feat: add an allowlist of for supported blocks in library [FC-0062] (#1378)
* feat: show error msg from server on paste

* feat: add an allowlist of for supported blocks in library

Libraries v2 currently don't support editing blocks other than problem,
text and videos. This commit adds a configuration variable called
`LIBRARY_SUPPORTED_BLOCKS` to setup allowed list of block types users
can paste into libraries. By default it is set to support
'problem,text,video,html`.

* feat: enable add button for blocks based on setting


---------

Co-authored-by: Rômulo Penido <romulo@opencraft.com>
2024-10-15 09:52:35 -05:00
Kristin Aoki
dcf05cde07 fix: tinymce render outside of editors (#1254) 2024-09-05 13:18:26 -07:00
Braden MacDonald
117b4f10e7 chore: remove core-js and regenerator-runtime (#1032) 2024-07-10 05:07:29 -07:00
Yusuf Musleh
088a01d716 feat: Add lib v2/legacy tabs in studio home (#1050)
This PR adds a new configuration flag that shows/hides tabs in studio home along with some new functionality around to V1 and V2 Libraries.

When the new LIBRARY_MODE flag is set to "mixed" (default in dev) it will show "Libraries" and "Legacy Libraries" tabs that correspond to v1 and v2 tabs respectively.

When the new LIBRARY_MODE flag is set to "v1 only" (default in production) or "v2 only", only one tab "Libraries" is shown and only the respective libraries are fetched when the tab is clicked.

In addition to the above changes, the URL/route now updates when clicking on the tabs, and navigating to it directly would open up that tab as well as a new placeholder page that you will be redirected to when clicking on a v2 library if the library authoring MFE is not enabled.
2024-06-20 17:30:57 +05:30
Kristin Aoki
8100281fb4 feat: add checklist page (#870)
* feat: add checklist page

* fix: failing tests

* fix: styling bugs

* fix: lint errors

* feat: add test fro CourseChecklist

* fix: lint errors

* feat: add ChecklistSection tests

* fix: lint error

* fix: missing api reply status
2024-03-07 15:20:33 -05:00
Brian Smith
76bb8e88c1 chore(deps): update paragon and frontend-build to openedx scope 2024-02-16 13:40:03 -03:00
Ihor Romaniuk
51c5f9c4dc refactor: Unit page - refactoring breadcrumbs, view live and preview links buttons (#827) 2024-02-14 13:38:54 -05:00
Ihor Romaniuk
9c52b8b6c5 feat: [FC-0044] Unit page header section (#808)
* feat: create Unit page and add page header functionality

* fix: after code review

---------

Co-authored-by: monteri <lansevermore>
2024-02-05 11:58:35 -05:00
Syed Ali Abbas Zaidi
34fbadfd6a feat: migrate enzyme to RTL (#770) 2024-01-24 16:57:28 -05:00
renovate[bot]
1edc7d3329 fix(deps): update dependency @edx/frontend-lib-content-components to v1.176.0 (#709)
* fix(deps): update dependency @edx/frontend-lib-content-components to v1.176.0

* fix: mock frontend-components-tinymce-advanced-plugins for jest

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ken Clary <kclary@edx.org>
2023-11-23 15:34:29 -05:00
Bilal Qamar
97d0a1ce61 feat: update react & react-dom to v17 (#514)
* feat: update react & react-dom to v17

* refactor: updated package-lock

* refactor: updated failing tests

* refactor: updated FilesAndUploads test to resolve delay issue

* refactor: updated DiscussionSettings tests

* refactor: downgraded frontend-lib-content-components

* refactor: resolved lint issue

* refactor: bumped frontend-lib-content-components version

* refactor: updated CollapsibleStateWithAction test suit

* refactor: update FilesAndUploads test
2023-10-11 11:08:26 +05:00
Ihor Romaniuk
5c0ca7b706 feat: replace hardcoded edx string with site_name from configs (#425)
* feat: replace hardcoded edx string with site_name from configs

* feat: add ability to obtain site name dynamically

* fix: localize overriding createPortal method
2023-03-09 13:38:22 -05:00
Zachary Hancock
f54dc17788 feat: configure lti exam providers (#356)
Allows setting a course exam provider to integrations managed by edx-exams. This option is gated by the CourseWaffleFlag course_apps.exams_ida in edx-platform.
2022-10-11 11:54:33 -04:00
connorhaugh
397f6c5d2e feat: update FLCC + add enzyme (#282)
This releases FLCC to stage.
2022-04-05 14:52:50 -04:00
connorhaugh
42cb63601e feat: remove loading on editor pages (#250)
Because we are moving the v2 editor pages to be "fake" modals, which have no z-index, we need to discard the course authoring "loading" wheel for the header and footer. We also need to bump the version of f-l-c-c to bring in the new editor changes.
2022-02-15 15:06:09 -05:00
David Joy
63444e6861 refactor: use Paragon versions of Stepper and FullscreenModal (#94)
* test: adding @testing-library/user-event

We use this library to simulate user clicks on interactive elements.

* test: adding some test environment mocks

Paragon components tend to use some advanced browser features that aren’t available in node.js/jest’s environment.  This safely mocks those features so that testing can proceed.

* test: Make our API responses reusable

Our future tests for DiscussionsSettings will want to use these API responses, so pull them out into a “factories” directory so multiple tests can re-use them.

The directory is called “factories” because ideally we’d use a test data factory to generate this data if we need a number of varieties of it.  Right now we just need these two, so generating factories for it isn’t really worthwhile.  But we might as well put it in the right place.

* refactor: use new CheckboxControl for AppCards

This replaces our usage of Input for checkboxes with a new CheckboxControl which is made specifically for this sort of use case.

It also adds an aria-label that describes what the checkbox does: “Select <appName>”

* feat: adds aria-label to Next button

The button lacked a label - this also lets us use queryByLabelText in our tests.

* test: favoring getByRole over getByTestId

The testing-library documentation talks about how it’s preferable to write tests that act like screen readers and inspect the DOM in ways that a user would.  Adding “test IDs” is a last resort when no better option is available.  The spinner actually has a “status” role on it, so we can use that instead here.

* feat: adding a spinner to the AppConfigForm

Improves the UX here by giving the user some feedback, and also makes it consistent with how AppList works.

* fix: set the selected app in redux so it’s official

Prior to this, we derived a selected app from the activeAppId if one wasn’t actively selected, but we never sent that decision back to redux.  This closes the loop.

* fix: add the message for selecting an app

Forgot to include this in a prior commit.  Oops.

* refactor: use Paragon Stepper and FullscreenModal

Also deletes our app-specific implementations of Stepper and FullScreenModal.

Note that the routes were pulled up into PagesAndResources.  This is so that we can access the appId param in DiscussionsSettings, and is an artifact of how react-router works.  You can’t access sub-route params in the same component that defines sub-routes.

Related to this, we now decide which step we’re on by examining the appId parameter, rather than having a route per step.  Conceptually it’s the same and each step has its own route, but now DiscussionsSettings just has multiple routes and doesn’t define subroutes.

* test: Adding tests proving that DiscussionsSettings works

This exercises the modal and stepper, proving that they interact with routes properly.  It also exercises the navigation buttons.

* doc: documenting selectedAppId and activeAppId

* fix: removing unnecessary aria-label attributes

aria-label is only necessary on buttons if the button text doesn’t sufficiently label the button, i.e., in the case that the button text is an “X” instead of the word “Close”.  This removes unnecessary button aria-labe attributes and updates the tests not to use them.

* test: adding more DiscussionsSettings tests

- form submission
- loading the ‘legacy’ form

* test: improving coverage for “full support” apps
2021-04-22 12:26:01 -04:00
David Joy
749675c687 test: Use the standard data-testid attribute instead of a custom one (#93)
We don’t have any need for a custom data-testid attribute, so removing it so it matches documentation and doesn’t confuse future testers.
2021-04-22 09:07:29 -04:00
David Joy
b5998a36c1 fix: improve app config forms, refactor LegacyConfigForm, add tests (#62)
* chore: adding jest-dom package and configuring it

Also bumping version of paragon - it’s in this commit because the changes in package-lock.json can’t really be separated from each other.

* fix: improve mocked data in the API layer

Make the mocked data for the app configs closer to reality, using correct shape and better IDs.

* fix: improve layout of FormSwitchGroup and make compatible wit latest paragon

Form.Group needs a controlId, and this layout gives a nice gutter between the text side on the left and the switch itself on the right.

* fix: active vs. displayed apps and app configs

We have a problem in that the app config and app that are _displayed_ in the frontend are not necessarily the same as app and app config that’s _active_ for the course.  I.e., maybe I’m configuring a new one, but a different integration’s already set up.

This commit changes our data model a bit to differentiate between the two - this will let us display information about what’s currently active at the same time as configuring a different integration.

This commit also tweaks a Container size to make the form a bit wider.  Pretty.

* refactor: split LegacyConfigForm parts out into their own components

This is in preparation for needing to share legacy config form fields with the ‘standard’ config form for the new discussions MFE.  In particular, we also need to pull the InContextDiscussionFields out of the legacy form - that component exists but isn’t technically used in this commit.  It will be included in the ‘standard’ form soon.
2021-03-31 13:32:30 -04:00
David Joy
1baecebabb refactor: using initializeMockApp in ProctoredExamSettings tests (#59)
- This uses a new function in frontend-platform 1.9.0 that sets up a mock application for use in test suites.
- The ProctoredExamSettings.test.jsx tests have been refactored to use axios-mock-adapter and initializeMockApp.
- A tweak was made to ProctoredExamSettings to use error.response.status instead of error.customAttributes.httpErrorStatus - the former is a more canonical way of getting at this data, rather than using the customAttributes object we add to our errors.  It also means the code will work with the MockAuthService instead of AxiosJwtAuthService.
- Removing axios dev dependency - we don’t need it anymore!
2021-03-24 10:39:21 -04:00
David Joy
9c63ab8044 Refactoring and organization (#41)
* Updating dependencies and removing unneeded ones.

* Fixing broken IntlProvider attribute in ProctoredExamSettings test.

* package-lock.json was out of sync - checking it in.

* Initializing an empty redux store.

* Adding model-store from frontend-app-learning.

This will let us save data from the server in a normalized way in redux, reducing boilerplate in React components.

* Fixing paragon button usage.

(also just organizing the imports while I was there…)

* Using paragon button instead of an anchor tag.

For the “New Page” button in the pages & resources view.

* Add API, reducers, and thunks to add course detail data into redux.

Subsequent PR will use this to store course detail data for use across different pages in the application.

* Prep work to add CourseAuthoringPage component.

Decided the course-detail sub-directory didn’t make much sense, given component structure, and moved it up to src.

These functions will be used in a CourseAuthoringPage component to load course detail data and display the Header and Footer in one common place, wrapping all the existing course authoring pages (proctoring and pages & resources)

It will also replace LmsApiService.js

* Minor style refactorings.

(This commit had originally made some changes to how courseId was passed in to these two components, but I decided to back it out… but the style stuff is worth adding as a fixed nit.)

* Refactor course detail loading and top-level course authoring components

This commit does a few things:

- Factors course detail data loading out of the Header.
- Loads that data in CourseAuthoringPage instead, adding it to redux and then passing it to the Header from there.
- Deletes LmsApiService, which is no longer used.
- Changes the route paths to be more canonical and entity-oriented, i.e., the first part of the route is the course, followed by the specific page about that course to load, rather than the other way around.  This more naturally allows us to use react-router to extract the common course detail loading code that only depends on the courseId.

* Refactoring routes code a bit to pass courseId into components

Didn’t like how CourseAuthoringPage, LegacyProctoringRoute, and CourseAuthoringRoutes all reached into the parent route to find the courseId, so passed it in instead.

* Updating README with more detail on routes in the MFE.
2021-01-07 13:16:35 -05:00
Simon Chen
d4b50c46a5 Switch from enzyme to testing-library/react (#14) 2020-07-23 21:15:46 -04:00
alangsto
8aef7877d9 Added validation logic for parity (#9)
Removed merge conflict

resolved merge conflict

added validation logic for enforcing proctortrack escalation email

added dependencies for email validator and testing, added code and tests for requiring valid email

added validation for editing proctoring provider field

added validation for editing proctoring provider field

Add error handling code to the Exam settings page. Also include spinners for loading (#10)

updated help text

updated comment

added unit tests

updates for requested changes

removed unnecessary line

trying to see if tests will rerun

testing for travis build

adding another test

adding another test for travis

uncommented last test

updated tests

trying to fix test

removed tests

This change would fix tests so they are actually doing the testing job (#11)

Update the error messages based on copy provided by Deen (#13)
2020-07-23 13:51:02 -04:00
alangsto
3fe529dc12 Add Frontend Proctoring Provider Specific Defaults for Exam Settings (#7)
* added frontend behavior

* added testing

* fixed text to resemble original

* separated unit tests
2020-07-20 09:30:13 -04:00
stv
0e4f8ed2cf Initial commit 2020-05-06 12:40:54 -07:00