feat: basic get/post endpoint for v2 xblocks. TNL-10873#32600
feat: basic get/post endpoint for v2 xblocks. TNL-10873#32600
Conversation
2ea4170 to
e00cda1
Compare
5b4b53f to
350a379
Compare
47b1c70 to
3e03662
Compare
bradenmacdonald
left a comment
There was a problem hiding this comment.
Thanks, looks good! I haven't tested this manually but I'm happy with the code.
There was a problem hiding this comment.
Will it be an issue for the editors if some newlines go inserted here? This test set the data to '<p>test</p>' but we get the data back as '\n<p>test</p>\n'. I'm assuming that's fine but just want to confirm.
There was a problem hiding this comment.
no, in fact I don't think editors can have content without the newlines; it's just an artifact of what I wrote in the test.
There was a problem hiding this comment.
I guess we should rename this function to just serialize_block_for_blockstore since we're already passing in a blockstore block here.
There was a problem hiding this comment.
it is called in a bunch of other places.
3e03662 to
255d58b
Compare
7d58c41 to
99f7cdc
Compare
connorhaugh
left a comment
There was a problem hiding this comment.
Just some comments on comments for clarity. Code looks ok.
There was a problem hiding this comment.
| View to get/edit the field values of an XBlock as JSON (in the v2 runtime) | |
| This class mimics the functionality of xblock_handler in block.py (for v1 xblocks), but for v2 xblocks. | |
| However, it only implements the exact subset of functionality needed to support the v2 editors (from | |
| the frontend-lib-content-components project). As such, it only supports GET and POST, and only the | |
| POSTing of data/metadata fields. | |
| """ | |
| View for the field values of an XBlock, returned as JSON. | |
| This class mimics the functionality of the v1 xblock_handler in block.py. | |
| However, it only implements the exact subset of functionality needed to support xblock editing, for a single xblock which has no children blocks. As such, it only supports GET and POST. | |
| """ |
99f7cdc to
d6f824d
Compare
|
2U Release Notice: This PR has been deployed to the edX staging environment in preparation for a release to production. |
|
2U Release Notice: This PR has been deployed to the edX production environment. |
feat: basic get/post endpoint for v2 xblocks. TNL-10873