Commit Graph

48 Commits

Author SHA1 Message Date
vladislavkeblysh
59071424b3 feat: course outline - sections list
* feat: [2u-259] add components

* feat: [2u-259] fix sidebar

* feat: [2u-259] add tests, fix links

* feat: [2u-259] fix messages

* feat: [2u-159] fix reducer and sidebar

* feat: [2u-259] fix reducer

* feat: [2u-259] remove warning from selectors

* feat: [2u-259] remove indents

---------

Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>

feat: Course Outline  - Sections list (#59)

* feat: [2u-336] add tests

* feat: [2u-271] fix button

* feat: [2u-336] add component, refactor header

* fix: [2u-342] fix translates and indents

* fix: [2u-342] fix constants and expand block

* feat: [2u-336] remove new section from menu

---------

Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>

feat: Course outline - Content empty (#72)

* feat: [2u-324] add component

* feat: [2u-324] add translates

* feat: [2u-324] update tests

* feat: [2u-324] update branch

* fix: [2u-324] fixed empty handler

feat: Course outline - Section Publish (#61)

* feat: [2u-354] add publish modal, api and update tests

* feat: [2u-354] refactor modal

* fix: [2u-354] removed comments

* fix: [2u-354] fix indents

* fix: [2u-354] removed translates duplicates

* fix: [2u-354] rename handlers

feat: Course outline - Update section card (#71)

* feat: [2u-615] update section card

* fix: [2u-615] fix handler names

* fix: [2u-615] fix indents

* fix: [2u-615] add empty handler

* fix: [2u-615] fix data test id name

* fix: [2u-615] fix styles

fix: [2u-696] add saving processing for higlights and enable highlights (#78)

feat: Course outline - Section Edit (#70)

* feat: [2u-336] add tests

* feat: [2u-271] fix button

* feat: [2u-336] add component, refactor header

* feat: [2u-342] add modal

* fix: [2u-342] fix translates and indents

* feat: [2u-342] add modal

* feat: [2u-342] add api

* feat: [2u-342] add tests and translates

* feat: [2u-342] fix indents

* fix: [2u-342] fix indents, variant and utils

* feat: [2u-342] fixed slice, thunks, hooks

* feat: [2u-354] add publish modal, api and update tests

* feat: [2u-615] update section card

* feat: [2u-348] add api, handlers, tests

* feat: [2u-348] add description for api

* fix: [2u-348] fix useEscapeClick

* fix: [2u-348] remove useEffect from CardHeader

* fix: [2u-348] fixed handlers and tests

* fix: [2u-348] fixed handlers and tests

---------

Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>

feat: Course outline - Section Delete (#74)

* feat: [2u-336] add tests

* feat: [2u-271] fix button

* feat: [2u-336] add component, refactor header

* feat: [2u-342] add modal

* fix: [2u-342] fix translates and indents

* feat: [2u-342] add modal

* feat: [2u-342] add api

* feat: [2u-342] add tests and translates

* feat: [2u-342] fix indents

* fix: [2u-342] fix indents, variant and utils

* feat: [2u-342] fixed slice, thunks, hooks

* feat: [2u-354] add publish modal, api and update tests

* feat: [2u-615] update section card

* feat: [2u-348] add api, handlers, tests

* feat: [2u-510] add delete api, add delete modal

* fix: [2u-510] fixed tests

---------

Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>

feat: Course outline - Section duplicate (#88)

* feat: [2u-336] add tests

* feat: [2u-271] fix button

* feat: [2u-336] add component, refactor header

* feat: [2u-342] add modal

* fix: [2u-342] fix translates and indents

* feat: [2u-342] add modal

* feat: [2u-342] add api

* feat: [2u-342] add tests and translates

* feat: [2u-342] fix indents

* fix: [2u-342] fix indents, variant and utils

* feat: [2u-342] fixed slice, thunks, hooks

* feat: [2u-354] add publish modal, api and update tests

* feat: [2u-615] update section card

* feat: [2u-348] add api, handlers, tests

* feat: [2u-510] add delete api, add delete modal

* feat: [2u-360] add api

* feat: [2u-360] add slice

* feat: [2u-360] add tests

* fix: [2u-360] fixed tests

---------

Co-authored-by: Vladislav Keblysh <vladislavkeblysh@Vladislavs-MacBook-Pro.local>

fix: Course outline - Highlights links (#89)

* fix: fixed doc urls

* fix: fixed components

feat: Course outline - Collapse all sections (#75)

* feat: added collapse all section logic

* fix: fixed tests

fix: final revision commits

fix: increase code coverage on the page
2023-12-20 10:20:48 -05:00
Chris Chávez
bf46008878 style: UX Refinements on taxonomy pages [FC-0036] (#723)
This change makes the following updates to the UX of the taxonomy pages:

* On the taxonomies list, display the full name of taxonomies in a tooltip if it's longer than what's displayed
* On the taxonomy detail page, please change the title of the "Value" column to "Tag name"
* On taxonomy detail page, remove the "child tags" column and put it in parentheses instead
* Update tags count color
* Several minor issues brought up here: https://github.com/openedx/modular-learning/issues/105#issuecomment-1829412705. 
* Fix issue with scroll position not being reset on navigation
2023-12-19 09:44:44 +05:30
Braden MacDonald
352ef35ac2 feat: display all child tags in the "bare bones" taxonomy detail page (#703)
Also includes:
- feat: set <title> on taxonomy list page and taxonomy detail page
- fix: display all taxonomies on the list page, even if > 10
- refactor: separate out loading spinner component
2023-11-23 01:44:17 +05:30
Adolfo R. Brandes
a622f8e86e fix: Fix data API URL handling
All configuration calls must handled asynchronously, otherwise they risk
failure in runtime configuration scenarios.
2023-11-21 16:57:04 -03:00
Syed Ali Abbas Zaidi
d497b01c45 feat: upgrade react router to v6 (#519)
## Ticket
[React Router Upgrade to v6](https://github.com/openedx/platform-roadmap/issues/276).

## Description
This PR upgrades React Router from `v5` to `v6`.
2023-10-20 16:52:23 -04:00
Chris Chávez
ad4d9b9c63 Taxonomy list page [FC-0036] (#622) 2023-10-20 11:55:20 -04:00
Kristin Aoki
01ddac380f fix: studio home UI bugs (#611) 2023-09-28 18:36:51 -04:00
Kristin Aoki
887a628c23 fix: export and import UI bugs (#612) 2023-09-27 12:10:45 -04:00
ruzniaievdm
e099243437 feat: create Studio Home Page MFE (#589) 2023-09-19 10:04:43 -04:00
Kyrylo Kholodenko
1888993113 feat: implement export page (#586) 2023-09-14 09:07:24 -04:00
Kristin Aoki
a54d351e9c fix: schedule and details UI bugs (#588) 2023-09-06 12:32:19 -04:00
Kristin Aoki
2bd8037d7b feat: change head title depending on page (#582) 2023-09-06 11:02:16 -04:00
vladislavkeblysh
ffae3bd868 feat: Created Course updates page (#581) 2023-08-31 10:56:45 -04:00
vladislavkeblysh
2e8eed7504 feat: Created Course Team (#564) 2023-08-23 09:21:43 -04:00
Jesper Hodge
9c997ab845 fix: Pass correct prop to TinyMceWidget and update FLCC (#575)
* fix: Pass correct prop to TinyMceWidget

* chore: update flcc

* fix: lockfile
2023-08-22 13:28:30 -04:00
Peter Kulko
f9bc5c4927 feat: created Grading page (#557) 2023-08-14 14:44:01 -04:00
ruzniaievdm
a0e37c0357 feat: Added Schedule and Details MFE page (#547) 2023-08-08 09:49:53 -04:00
Peter Kulko
87ead24e20 feat: added Advanced settings page (#521)
Co-authored-by: sendr <sendr84@gmail.com>
Co-authored-by: ruzniaievdm <ruzniaievdm@gmail.com>
2023-07-19 10:45:50 -04:00
ayesha waris
1b1afcf195 feat: integrated backend discussions restriction with UI (#507)
* feat: integrated backend discussions restriction with UI

* refactor: code refactoring

* test: fixes test cases

* refactor: discussion restriction component

---------

Co-authored-by: ayesha waris <73840786+ayeshoali@users.noreply.github.com>
Co-authored-by: Awais Ansari <awais.ansari63@gmail.com>
2023-06-06 14:55:19 +05:00
sundasnoreen12
0d67c2588d feat: implemented discussion restriction UI (#494)
* feat: implemented discussion restriction UI

* refactor: fixed UI figma design issues

* refactor: fixed 2nd review points

* refactor: fixed review issues regarding confirmation popup

* refactor: changed tab component to button group

* perf: performance improvement changes

* refactor: fixed memorization issues

* refactor: fixed memo issues

---------

Co-authored-by: sundasnoreen12 <sundasnoreen12@ggmail.com>
Co-authored-by: SundasNoreen <sundas.noreen@arbisoft.com>
2023-05-19 17:16:48 +05:00
Bilal Qamar
f8954ef870 refactor: upgraded frontend-build version to v12
PR #322
2023-01-26 09:02:14 -03:00
ayesha waris
8096a389da style: confirmation modal added for in-context discussion toggle (#404)
* style: confirmation modal added for in-context discussion toggle

* refactor: removed duplicate message id

* refactor: function moved to on line direct call
2022-12-09 18:40:21 +05:00
ayesha waris
7527f6c764 Style: Toggle remains Disabled and Link to instructor dashboard show on Disabled Cohorts (#375)
* style: on disabled cohorts toggle remains disabled and link to instructor dashboard shows

* fix: test cases fixed

Co-authored-by: Mehak Nasir <mehaknasir94@gmail.com>
2022-11-21 14:41:40 +05:00
Awais Ansari
9c6f8546cf feat: live app configuration's mockups (#261)
* feat: implement new mockups for live card
2022-03-16 11:48:58 +05:00
Awais Ansari
abc7e018fc chore: upgrade paragon version (#263)
* chore: upgrade paragon version
2022-03-16 11:42:19 +05:00
=Awais Jibran
95fdd378c2 refactor: code for iconbutton usage 2022-02-18 19:35:08 +05:00
Kshitij Sobti
9fd6cbf61b fix: UX feedback suggestions from TNL-8730 [BD-38] [BB-4981] (#201)
* fix: UX feedback suggestions from TNL-8730
2021-10-21 07:20:36 +00:00
Kshitij Sobti
6a2e1ba45f fix: improve styling and behaviour to match mockups [BD-38] [TNL-8730] (#193)
* fix: improve styling and behaviour to match mockups
This fixes the following issues:
TNL-8737: Description field should be larger
TNL-8738: Increase right and left padding in expanded card
TNL-8739: Expand/Collapse icon should have fixed position
TNL-8741: Remove field helper text on field error state
TNL-8742: Use consistent spacing between field and helper text
TNL-8743: Too much spacing above Save button
TNL-8744: remove field error states when re-focusing on field
TNL-8762: Copy changes to team configuration
TNL-8763: Radio button rendering issues
TNL-8764: Use lowercase "M" for "Public managed" and "Private managed" labels
TNL-8766: Match style of labels in collapsed card
2021-10-06 12:58:44 +00:00
Mehak Nasir
0c5ab984a4 fix: transition fix and status fix added 2021-10-05 16:59:55 +05:00
Awais Ansari
6ce280e3e1 feat: add blackout dates new UI and validation (#191)
* feat: implement blackout dates UI and validation

* chore: bump paragon version to 16.14.2

* refactor: blackout dates collapsible card with reusable collapsible component

Co-authored-by: Mehak Nasir <mehaknasir94@gmail.com>
2021-09-29 18:34:19 +05:00
Kshitij Sobti
f4979b4c37 apply review feedback 2021-09-17 14:34:40 +05:00
Mehak Nasir
f0d5589310 style: modal dialog issue 2021-08-10 23:24:16 +05:00
Awais Ansari
3921b8c6b8 fix: calculator switch click issue and save button animation will be … (#169)
* fix: calculator switch click issue and save button animation will be clickable without any changes

* style: remove inline style and fix content display glitch

* style: TNL-8566 add padding top for external link

* style: TNL-8574 fix badge width and height

* fix: resolve console error and remove fix height for modal dialog
2021-08-02 17:26:09 +05:00
Awais Ansari
8eee09a2d0 fix pages and resources content and styling issues (#158)
* fix: TNL-8457 Show field error state on blank discussion provider fields

* fix: TNL-8474 Remove Resources section

* fix: TNL-8473 change pages and resources background color to light-200

* fix: TNL-8476 app card descriptions should be bottom aligned

* fix: TNL-8472 remove Disabled badge from tiles

* fix: TNL-8487 use stateful button for configuration modal
2021-07-16 10:47:22 +05:00
SaadYousaf
b5dc63c21b fix: remove padding from badges to stay consistent with Paragon badges design. 2021-07-15 18:21:16 +05:00
SaadYousaf
b1c0bca386 fix: styling fix to Calculator setting dialog. 2021-07-15 18:20:27 +05:00
Kshitij Sobti
0e7340bdda feat: Hook up course apps API and add base components for app configuration
Hooks up the course apps API so that the data returned by the server is being used.
Adds the base components and infrastructure to enable adding pages for configuring
each app.
2021-07-01 20:58:05 +05:00
Ahtisham Shahid
c20fbbcf79 Updated Discussion UI as per Figma (#92)
* Updated Discussion UI as per Figma
2021-05-03 11:47:31 +05:00
AsadAzam
db98f66b3a Fixed cohorts section step 2 (#84)
* Fixed cohorts section step 2

* Fixed test

* Fixed test

* Added in-context discussions

* Added margin top

* Refactored code

* refactored code
2021-04-24 13:21:24 +05:00
David Joy
904c5d4145 feat: add network connectivity and permission denied alerts (#97)
* refactor: reusable connection error and permission denied alerts

This commit pulls the connection error and permission denied alerts out of ProctoredExamSettings and also makes them Open edX friendly by removing references to “edX” and using the SUPPORT_URL environment variable to supply the support link.

This is in preparation for using these alerts in the Discussions UI.

* refactor: saveAppConfig now responsible for redirect

I’ve moved the redirect to the pages and resources path into the thunk for saveAppConfig.  This is because we only want to do it if the thunk is successful, and it’s easier to do it here than to have `then` and `catch` handlers in the component.  In particular, this is because we can’t stop the `then` from happening unless we throw an error from the thunk, but the component has nothing to do on a thrown error.  This avoids the awkward code in the component and just handles it all here.

* feat: handle access denied by setting DENIED statuses

This takes us one step closer to user messaging for permission denied errors by setting an explicit DENIED status and saveStatus when a request was denied because the user didn’t have permissions.  Note that this is different than a 401, which is unauthorized, meaning the user is logged out.  This doesn’t handle 401s.

Following this, we can then use the DENIED status to give the user feedback on what’s going on.

* feat: adding error alerts

This commit adds friendly error alerts for connection and permission denied errors in the discussions app.

If the initial fetch apps request errors out or is denied, then the entire contents of the modal is replaced with an error message.

If the save app config request errors out, then a message is displayed at the top of the form.

If the sae app config request is denied, the entire contents of the modal is replaced with a permission denied error message, as in the first case.
2021-04-23 14:23:33 -04: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
dbad0f6aac feat: hookup discussions config to POST APIs (#83)
* fix: PageCard should use the pages and resources path from context

This prevents some odd behaviors around changing the URL based on the current path.

* fix: use the correct formRef for AppConfigForm children

Straight up refactoring bug.  This should be using the formRef from the context, but was still defining its own and passing it down.  This ultimately meant that the submit button wasn’t properly hooked up to the form, since the form was given a different ref than the submit button.

* fix: Only validate fields that have been touched

* fix: use the title instead of app.name

app.name doesn’t exist - but the title is the string we’re looking for.  Use it.

* refactor: default appConfig appropriately for both config forms

In subsequent PRs we’re going to start passing null appConfigs to forms sometimes - this uses prop types to set default values for the forms if the component isn’t passed a meaningful appConfig.

* refactor: replace and flesh out discussions data layer

Since we only have one GET endpoint for all the data around discussions, we don’t need two separate slices/thunks/api files.  The API needs to be hit once when the discussions settings load.  This means the app-list and app-config-form share far more state than originally thought.

The AppList and AppConfigForm are no longer responsible for data loading - we’ve moved that back up into DiscussionsSettings.  Now they just read from the redux state and load what they need.

The main change is moving app-list/data/slice.js up to discussions/data/slice.js, renaming the reducer, and adding a saveStatus to it - turns out this is all we need.  The original two slices go away.

The discussions/data/api file gets a proper implementation of postAppConfig which mostly works with the server as of this writing - we have some data shape issues to figure out.

AppConfigForm needed a little help.  It now checks whether our data is loaded and selects an app based on its route.  This allows us to deep link in and keep the selectedAppId correct.

* Adding a loading spinner to AppList

This is only tangentally related to the current PR, admittedly.

* test: adding some title tests to LegacyConfigForm.test.jsx

Needed to add the title prop, then decided I’d test it.

* test: adding a test suite for discussions/data files

This test exercises the thunks, slice, and api parts of the data layer all at once in ‘real’ scenarios with mocked API requests.
2021-04-22 07:49:08 -04:00
Awais Jibran
83bbb06170 build: bump edx paragon to 14.7.0 (#90)
* build: bump edx paragon to 14.7.0

* Fixing test failures

* Fixes an issue where Form Switch was unexpectedly getting wrong width from its parent.
2021-04-21 19:14:57 +05: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
e04e8a5a61 Adds Legacy edX Discussions configuration UI (#55)
* feat: Implement edX forums advanced setting editor

This change implements the UX for the advanced settings editor for the internal edX forums.

* Stepper now intelligently shows/hides drop shadows on the header and footer

Also organized the component into a more Paragon-like organization with the sub-components hanging off the main one.

* Organizing full screen modal in a more Paragon-like way.

Also fixing a few minor styling issues.

* Massaging SettingsEditor into LegacyConfigForm

- Reorganizing into apps/legacy directory from settings/base-forum
- Using Formik and Yup for managing form data
- Refactoring FormSwitchGroup a little and adding data-related properties
- Also moving FormSwitchGroup into ‘generic’
- Some initial attempts at error validation in LegacyConfigForm (a blackout dates regex which doesn’t seem to work yet)
- Sub-sections of config now fold and animate when their parent is toggled.

* Minor naming and refactoring of Discussions component

- Event handlers should be named handle*, not on*.  Oops.  Got over-zealous.
- Organizing paths into some variables at the top of the component.  The pages and resources path should probably be passed in.

* Hooking up and organizing LTI and Legacy forms

- The LTI form moves into app/lti
- Adds in rendering of the legacy discussions form.
- Splits up the messages file a bit (app/lti/messages.js exists now)
- Removing unnecessary h1 in the LtiConfigForm.

* Removing ‘info’ blue coloring from the pages & resources view.

Co-authored-by: Kshitij Sobti <kshitij@sobti.in>
2021-03-16 10:58:37 -04:00
David Joy
6f762edbd3 Discussions config UI part 2 - FullScreenModal and Stepper! (#53)
* Bumping paragon version to latest.

* Modifying event handlers to be named with “on” prefix instead of “Handler” suffix

* Tweaking a message id.

* Removing “Discussion” prefix from discussions components.

Seems unnecessary.

* Backing pages & resources view with data handling.

It still has the list of pages hard coded.

* Adding FullScreenModal and Stepper components.

These components are pretty close to their final form.  They could benefit from some snapshot tests and such; there isn’t much actual functionality in ‘em.

Stepper will get a bit more functionality when we add the dynamic drop shadow behavior.  Depending on whether the stepper body is at the top or bottom, drop shadows on the header and footer should appear or disappear to indicate more content exists above or below the viewport.

* Moving discussions routes inside PagesAndResources

Note that the discussions component has been renamed - that’ll be coming in a subsequent commit.

Also trying to get consistent about calling it “discussions”

* AppList gets less responsibility

The AppList is now a child of the top-level “Discussions” component, so it’s no longer responsible for loading the app list or storing the state for the selected app ID.  It’s also given a handler for when an app is selected, and no longer has a button to configure the app.

* Fleshing out Discussions component

The top-level Discussions component (renamed from DiscussionsRoutes) is now responsible for a lot.

- it loads the app list
- it keeps track of selected app ID
- it has handlers for all the various user actions so they can be coordinated here at the top.
- it uses component composition to create the majority of the UI, folding together FullScreenModal and Stepper with its route-based views.

* Decomposing the app config form

The discussion app config form has been decomposed into a container responsible for loading app data, and a component specifically for the LTI configuration form.

In the future, ConfigFormContainer will get a second possible child for the edX Forums app, and will switch between the two forms based on the app being configured.

Note that I expect that some of the data loading logic from ConfigFormContainer may be better situated in the Discussions component… everything else is happening there, and it may make sense for it to handle loading the app config data as necessary as well.
2021-03-12 10:25:55 -05: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