Commit Graph

37 Commits

Author SHA1 Message Date
Ahtisham Shahid
c287e0a8a8 fix: do not show legacy in case openedx discussion provider is selected (#33906)
* fix: do not show legacy in case openedx discussion provider is selected
2023-12-19 13:18:57 +05:00
AsadAzam
21e9490c66 fix: hide new provider if flag disabled (#30925) 2022-08-31 18:29:53 +05:00
Kshitij Sobti
c2326f0399 fix: change conditions for showing new and legacy discussion providers (#30818)
The current logic for showing discussion providers makes it hard to switch
from the legacy to the new provider. This commit changes the conditions in
which different providers are shown, and which provider is used as default.

Before this commit, the new provider would be hidden if the legacy provider
was in use and vice-versa. So both would only be shown if neither legacy
nor the new provider were in use (i.e. an LTI provider was in use).

Now, all providers are always displayed to global staff. If the waffle
flag for the new provider is set
(`discussions.enable_new_structure_discussions`), then new provider is
always displayed, and the legacy provider is hidden unless it's currently
in use.

If flag is not set, then the new provider is always hidden unless it is
used by a course.

Finally, the default provider now depends on the flag above. If it is
set globally, then the default provider is the new provider, otherwise
the legacy provider remains the default provider.
2022-08-25 04:00:18 -07:00
AsadAzam
60a21ad664 fix: add separate flag for new structure discussions (#29962)
* fix: add separate flag for new structure discussions

* fix: fixed tests
2022-02-23 10:57:19 +05:00
Kshitij Sobti
16881afcad feat: Allow fetching details of inactive providers [BD-38] (#29656)
* feat: Allow fetching details of inactive providers

* squash!: update tests add docs

* squash!: review feedback

* squash!: fix quality issue

* squash!: review feedback
2022-01-31 15:58:27 +05:00
Kshitij Sobti
79cd0b1ef8 feat: Adds discussions settings for new discusions experience [BD-38] [TNL-8621] [BB-4854] (#29131)
* feat: Adds discussions settings for new discusions experience
This commit adds new discussions settings for the new discussions experience. These are stored in the course so they can be a part of course import/export flow.
These are also added to the discussions configuraiton API to allow MFEs to update the settings.
The discussions API is currently available via LMS, however that means it cannot save changes to the modulestore. This also adds the API to the studio config so it can now also be accessed from studio and be used to save course settings.

* fix: tests
2021-10-28 11:56:17 +05:00
Awais Jibran
cfd78455df fix: update discussion API permissions (#29127) 2021-10-27 21:05:34 +05:00
David Ormsbee
5d0132305d Revert "feat: Adds discussions settings for new discusions experience (#28749)"
This reverts commit bb0c03123c.
2021-10-27 10:40:12 -04:00
Kshitij Sobti
bb0c03123c feat: Adds discussions settings for new discusions experience (#28749)
This commit adds new discussions settings for the new discussions experience. These are stored in the course so they can be a part of course import/export flow.
These are also added to the discussions configuraiton API to allow MFEs to update the settings.
The discussions API is currently available via LMS, however that means it cannot save changes to the modulestore. This also adds the API to the studio config so it can now also be accessed from studio and be used to save course settings.
2021-10-27 15:41:27 +05:00
João Cabrita
530e4932bb fix!: Disable changing discussions providers once a course run has started
For authenticated users that are not global staff, changing discussion
providers after a course has started fails with 403 Forbidden.

Related issues:
* [BB-4253](https://tasks.opencraft.com/browse/BB-4253)
* [TNL-8142](https://openedx.atlassian.net/browse/TNL-8142)

BREAKING CHANGE:
Course staff, who were previously allowed to do this operation,
will instead receive a 403 Forbidden response.
2021-07-09 12:14:23 +05:00
Kshitij Sobti
d2c2fcdefe feat: Course Apps API [BD-38] [TNL-8103] [BB-2716] (#27542)
* feat: Course Apps API

This adds a new concept called course apps. These are exposed via a new
"openedx.course_app" entrypoint, which helps the LMS and studio discover such
apps and list them in a new rest api for the same.

These course apps will drive the pages and resources view in the course authoring
MFE. This system will track which apps are enabled and which are disabled. It
also allows third-party apps to be listed here by using the plugin entrypoint.

* Apply feedback from review
2021-06-23 21:51:12 +05:00
Ahtisham Shahid
e025c9bb64 refactor: sorted imports and misc cont renames 2021-05-11 18:20:17 +05:00
Ahtisham Shahid
1a43a4ca29 feat: Added new discussion providers and features
refactor: Fixed linter issues

refactor: Fixed styling issues

refactor: Code refactor and removed conflicts

refactor: Replaced feature dict with enum
2021-05-11 18:20:11 +05:00
Usama Sadiq
4f4be6538a BOM-2477: pylint warnings lint-amnesty (#27585) 2021-05-11 17:22:40 +05:00
stvn
165944c091 fix: Improve validation in Discussions API 2021-05-07 09:23:40 -07:00
stvn
718458115a docs: Remove completed TODO discussions item 2021-04-30 11:47:34 -07:00
stvn
e62705a365 feat: Add support to Discussions API for legacy cohort settings 2021-04-30 11:47:34 -07:00
stvn
eaeec735a9 feat: Add support for legacy discussions settings to API 2021-04-27 12:50:53 -07:00
stvn
a99c95da64 feat: Hide lti_configuration from non-LTI discussions providers 2021-04-17 00:59:17 -07:00
stvn
33e499ea04 fix: Update discussions lti_configuration during provider_type change
Else, we risk updating it when we don't intend to, eg:
- changing from an LTI-backed provider (Piazza) to a non-LTI-backed
  provider (legacy)
  - the settings are no longer relevant
- changing from a non-LTI-backed provider (legacy) to an LTI-backed
  provider (Piazza)
  - the settings _are_ now relevant
2021-04-17 00:59:17 -07:00
stvn
c1742b7b66 feat: Add helper for discussions configuration to indicate feature support 2021-04-17 00:52:51 -07:00
stvn
fb2f8e6291 refactor: Remove superfluous dict comprehension 2021-04-17 00:48:01 -07:00
stvn
49594d92e6 fix: Grant course staff access to discussions API
to match expected behavior.
2021-04-16 11:23:44 -07:00
stvn
5284f397b4 refactor: Make discussions helper method more accessible
so we can use it elsewhere.
2021-04-16 11:23:44 -07:00
stvn
fc39c3e073 fix: Stop using view_auth_classes helper in discussions API
as it conflicts with the manually-assigned `permission_classes`;
the decorator erases them.
2021-04-09 09:38:27 -07:00
stvn
67e045b5e0 refactor: Move discussions api LTI serialization logic 2021-04-08 09:31:48 -07:00
stvn
862ba01208 style: Add more typehints to discussions API 2021-04-07 21:05:33 -07:00
stvn
2053da2a9e fix: Update default provider returned by discussions API 2021-04-07 11:54:21 -07:00
stvn
6eabae0d9e feat: Implement POST endpoint for discussions API 2021-04-07 10:48:59 -07:00
stvn
87e375d627 feat: Implement update helper for discussions API 2021-04-07 10:48:59 -07:00
stvn
342d922034 feat: Implement to_internal_value helper for discussion API 2021-04-07 10:48:59 -07:00
stvn
def644b9aa feat: Add lti_configuration to discussions API payload 2021-04-07 10:48:59 -07:00
stvn
0cce315539 refactor: Base discussions serializer off of ModelSerializer
to make Django operations easier.
2021-04-07 10:48:59 -07:00
stvn
3f6f6e3667 refactor: Remove unused helper from discussions API 2021-04-07 10:48:56 -07:00
stvn
e8163c9161 fix: Use the correct name for serializer to_internal_value
Fortunately, this wasn't being used yet.
2021-04-07 10:48:08 -07:00
David Joy
8c6a06cf5b fix: adjust discussions app APIs to match consuming frontend (#27085)
This commit adjusts a few values in our discussions configuration APIs to make them match what the frontend needs, as well as to more accurately reflect the providers available today.

- The `active` provider ID is expressed as None if it doesn’t exist
- The “cs_comments_service” provider has been renamed “legacy” - when we implement the new discussions micro-frontend, we’ll also have a separate provider for that, so they can’t both be “cs_comments_service”.  Also, cs_comments_service is such a bad name for anything.
- The hard-coded providers list in get_supported_providers now includes ‘legacy’ and ‘piazza’, our two known providers.  This list will be updated as more known providers come online.
- The PROVIDER_FEATURE_MAP has similarly been updated.

Part of this task: TNL-8093
2021-03-23 13:37:16 -04:00
stvn
054f4ac828 feat: Add discussions API endpoint [BD-03] 2021-03-10 01:01:53 -08:00