feat: Add blockType to xblockPreview & title to xblock_iframe [FC-0097] (#37362)

- Adds `blockType` and `is_modified` to the `showXBlockLibraryChangesPreview` iframe message.
- Add title to the `xblock_iframe`
- Add `is-modified` to `studio_xblock_wrapper`
- Add `disable_staff_debug_info` as a query param in `render_xblock`
- `downstream_is_modified` added to ComponentLink and ContainerLink
This commit is contained in:
Chris Chávez
2025-09-29 18:27:32 -05:00
committed by GitHub
parent d34a6b9c6f
commit 51bfd3febe
11 changed files with 176 additions and 14 deletions

View File

@@ -18,6 +18,7 @@ from rest_framework import permissions, serializers
from rest_framework.decorators import api_view, permission_classes # lint-amnesty, pylint: disable=unused-import
from rest_framework.exceptions import PermissionDenied, AuthenticationFailed, NotFound
from rest_framework.response import Response
from rest_framework.fields import BooleanField
from rest_framework.views import APIView
from xblock.django.request import DjangoWebobRequest, webob_to_django_response
from xblock.exceptions import NoSuchUsage
@@ -100,6 +101,10 @@ def embed_block_view(request, usage_key: UsageKeyV2, view_name: str):
Unstable - may change after Sumac
"""
# Check if a specific version has been requested. TODO: move this to a URL path param like the other views?
show_title = request.GET.get('show_title', False)
if show_title is not None:
show_title = BooleanField().to_internal_value(show_title)
try:
version = VersionConverter().to_python(request.GET.get("version"))
except ValueError as exc:
@@ -147,6 +152,8 @@ def embed_block_view(request, usage_key: UsageKeyV2, view_name: str):
'view_name': view_name,
'is_development': settings.DEBUG,
'oa_manifest': new_oa_manifest,
'display_name': block.display_name,
'show_title': show_title,
}
response = render(request, 'xblock_v2/xblock_iframe.html', context, content_type='text/html')