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
2020-05-06 12:40:54 -07:00
2020-05-06 12:40:54 -07:00
2020-05-06 12:40:54 -07:00
2021-02-26 13:45:56 -05:00
2020-05-06 12:40:54 -07:00
2020-05-06 12:40:54 -07:00
2020-05-06 14:34:52 -04:00
2020-05-12 08:43:45 -07:00
2021-04-06 10:16:18 -04:00
2020-05-06 12:40:54 -07:00

|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
Description
No description provided
Readme AGPL-3.0 88 MiB
Languages
TypeScript 56.6%
JavaScript 42%
SCSS 1.4%