dbad0f6aac54805c97cf33db3e1b14e6861e6f7f
* 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.
|Build Status| |Codecov| |license| frontend-app-course-authoring ============================= Please tag `@edx/teaching-and-learning <https://github.com/orgs/edx/teams/teaching-and-learning>`_ on any PRs or issues. Thanks. Prerequisite ------------ `Devstack <https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/installation/index.html>`_. If you start Devstack with ``make dev.up.studio`` that should give you everything you need as a companion to this frontend. Installation and Startup ------------------------ 1. Clone the repo: ``git clone https://github.com/edx/frontend-app-course-authoring.git`` 2. Install npm dependencies: ``cd frontend-app-course-authoring && npm install`` 3. Start the dev server: ``npm start`` The dev server is running at `http://localhost:2001 <http://localhost:2001>`_. If your devstack includes the default Demo course, you can visit the following URLs to see content: - `Proctored Exam Settings <http://localhost:2001/course/course-v1:edX+DemoX+Demo_Course/proctored-exam-settings>`_ - `Pages and Resources <http://localhost:2001/course/course-v1:edX+DemoX+Demo_Course/pages-and-resources>`_ (work in progress) Production Build ---------------- The production build is created with ``npm run build``. .. |Build Status| image:: https://api.travis-ci.com/edx/frontend-app-course-authoring.svg?branch=master :target: https://travis-ci.com/edx/frontend-app-course-authoring .. |Codecov| image:: https://codecov.io/gh/edx/frontend-app-course-authoring/branch/master/graph/badge.svg :target: https://codecov.io/gh/edx/frontend-app-course-authoring .. |license| image:: https://img.shields.io/npm/l/@edx/frontend-app-course-authoring.svg :target: @edx/frontend-app-course-authoring
Languages
TypeScript
56.6%
JavaScript
42%
SCSS
1.4%