* Fixes an issue where Form Switch was unexpectedly getting wrong width from its parent.
* style: add discussion topics UI
* feat: Add section for general discussion topic in legacy form
* style: improve style according to Figma and add name uniqueness validation
1- Improve styling for General discussion topics section
2- Add discussion topic name uniqueness validation using yup test
3- Add internationalisation for discussion topic section
* test: Update LegacyForm test cases
Update LegacyForm test cases according to new requirements. Add mock store in test cases as we are using redux in DiscussionTopic and manipulating the redux store.
* refactor: update variables name and add async type in thunk function
Co-authored-by: Awais Ansari <awais.ansari63@gmail.com>
* feat: added new messages for new discussion providers
* fix: changed styles and minor test update
* refactor: refactored feature id names
* fix: Update messages.js
The application was expecting a different API shape than the server was sending. I have _no_ idea how this made it through, as it’s blatantly broken. I don’t see any changes in this code in the past few weeks.
Anyway, the client was expecting a “features” array inside an app (provider), which simply didn’t exist. The app itself is the array. This PR udpates the shape in `normalizeApps` and also the associated test, which was also equally as wrong. Somehow.
* 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.
* fix: internationalize some strings that got left behind
- General
- Questions for the TAs
* fix: making the questions for TAs field consistent with the general topic one
* fix: improving i18n descriptions as per review feedback