-
Notifications
You must be signed in to change notification settings - Fork 4.2k
docs: ADR that documents how MFEs can access in-context discussions [BD-38] [TNL-8396] [BB-4367] #28452
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
awaisdar001
merged 3 commits into
openedx:master
from
open-craft:kshitij/tnl-8396/discussions-course-blocks
Sep 17, 2021
Merged
docs: ADR that documents how MFEs can access in-context discussions [BD-38] [TNL-8396] [BB-4367] #28452
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
83 changes: 83 additions & 0 deletions
83
...ngoapps/discussions/docs/decisions/0005-in-context-discussion-course-blocks.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| Making Linked In-Context Discussions Available to MFEs | ||
| ====================================================== | ||
|
|
||
|
|
||
| Status | ||
| ------ | ||
|
|
||
| Proposal | ||
|
|
||
|
|
||
| Context | ||
| ------- | ||
|
|
||
| In the `ADR 0004 <./0004-in-context-discussions-linking.rst>`_ we investigated | ||
| how to link a discussion to a unit. We also need some way to make these linked | ||
| discussions available to the frontend so they can display those in-context | ||
| discussions in the correct view. | ||
|
|
||
|
|
||
| Requirements | ||
| ------------ | ||
|
|
||
| An API to access linked discussions for a Unit. | ||
|
|
||
|
|
||
| Decision | ||
| -------- | ||
|
|
||
| A direct link to the topic that needs to be embedded can be generated | ||
| by edx-platform and provided to MFEs via the course blocks API which is | ||
| already is used by the learning MFE. The learning MFE can then directly | ||
xitij2000 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
xitij2000 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| embed this link in a sidebar. | ||
xitij2000 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| For example, when the discussion link is requested using | ||
| `requested_fields=discussions_embed_url` it will return roughly the | ||
| following: | ||
|
|
||
| .. code-block:: JSON | ||
|
|
||
| { | ||
| ... | ||
| "block-v1:edX+DemoX+Demo_Course+type@vertical+block@vertical_98cf62510471": { | ||
| "id": "block-v1:edX+DemoX+Demo_Course+type@vertical+block@vertical_98cf62510471", | ||
| "block_id": "vertical_98cf62510471", | ||
| "lms_web_url": "http://localhost:18000/courses/course-v1:edX+DemoX+Demo_Course/jump_to/block-v1:edX+DemoX+Demo_Course+type@vertical+block@vertical_98cf62510471", | ||
| "legacy_web_url": "http://localhost:18000/courses/course-v1:edX+DemoX+Demo_Course/jump_to/block-v1:edX+DemoX+Demo_Course+type@vertical+block@vertical_98cf62510471?experience=legacy", | ||
| "student_view_url": "http://localhost:18000/xblock/block-v1:edX+DemoX+Demo_Course+type@vertical+block@vertical_98cf62510471", | ||
| "discussions_embed_url": "http://localhost:2002/discussions/course-v1:edX+DemoX+Demo_Course/topics/zooming-diagrams/" | ||
| "type": "vertical", | ||
| "display_name": "Zooming Diagrams" | ||
| }, | ||
| ... | ||
| } | ||
|
|
||
| For units that don't have a linked discussion, no link will be returned. | ||
|
|
||
| The new discussions experience includes a setting to group discussions at | ||
| the subsection level instead of the unit level. This setting will show all | ||
| threads related to a subsection in the sidebar if enabled. If this setting | ||
| is enabled, then the blocks API will return a link for a the entire | ||
| subsection. The discussions MFE will be responsible for checking that this | ||
| course has the setting enabled, and will show an alternative UI in that case. | ||
xitij2000 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| E.g. | ||
|
|
||
| .. code-block:: JSON | ||
|
|
||
| { | ||
| ... | ||
| "block-v1:edX+DemoX+Demo_Course+type@vertical+block@vertical_98cf62510471": { | ||
| "id": "block-v1:edX+DemoX+Demo_Course+type@vertical+block@vertical_98cf62510471", | ||
| "block_id": "vertical_98cf62510471", | ||
| "lms_web_url": "http://localhost:18000/courses/course-v1:edX+DemoX+Demo_Course/jump_to/block-v1:edX+DemoX+Demo_Course+type@vertical+block@vertical_98cf62510471", | ||
| "legacy_web_url": "http://localhost:18000/courses/course-v1:edX+DemoX+Demo_Course/jump_to/block-v1:edX+DemoX+Demo_Course+type@vertical+block@vertical_98cf62510471?experience=legacy", | ||
| "student_view_url": "http://localhost:18000/xblock/block-v1:edX+DemoX+Demo_Course+type@vertical+block@vertical_98cf62510471", | ||
| "discussions_embed_url": "http://localhost:2002/discussions/course-v1:edX+DemoX+Demo_Course/category/lesson-2-lets-get-interactive/" | ||
| "type": "vertical", | ||
| "display_name": "Zooming Diagrams" | ||
| }, | ||
| ... | ||
| } | ||
|
|
||
| The discussions MFE will then display all the threads in this category. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You said that "a direct link to the topic" will be provided by edx-platform using the course blocks API, but when you access the API using
requested_fields=discussions_embed_url, it returns an object with different kinds of URLs.Can specify which is the embeddable URL among those when you call it "a direct link"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just the standard default response of the course blocks API. It returns some standard fields, and other fields can be requested in addition as needed.
In this case, the idea is to add a new field option as specified above and have that add a new return value called "discussions_embed_url". I've cleaned up some the other URLs so it's easier to focus on this new field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, taking a look.