From 2a14c85fe0fa323d8e96ea0a8981d46d2d500870 Mon Sep 17 00:00:00 2001 From: ruzniaievdm Date: Tue, 6 Feb 2024 20:08:39 +0200 Subject: [PATCH] feat: [AXIMST-338] add context for Copy/Paste state --- .../rest_api/v1/serializers/vertical_block.py | 1 + .../contentstore/rest_api/v1/views/vertical_block.py | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cms/djangoapps/contentstore/rest_api/v1/serializers/vertical_block.py b/cms/djangoapps/contentstore/rest_api/v1/serializers/vertical_block.py index 20c01b3695a7..fad5799b5d39 100644 --- a/cms/djangoapps/contentstore/rest_api/v1/serializers/vertical_block.py +++ b/cms/djangoapps/contentstore/rest_api/v1/serializers/vertical_block.py @@ -128,3 +128,4 @@ class VerticalContainerSerializer(serializers.Serializer): children = ChildVerticalContainerSerializer(many=True) is_published = serializers.BooleanField() + can_paste_component = serializers.BooleanField() diff --git a/cms/djangoapps/contentstore/rest_api/v1/views/vertical_block.py b/cms/djangoapps/contentstore/rest_api/v1/views/vertical_block.py index a084886cf344..04ef3e99a30f 100644 --- a/cms/djangoapps/contentstore/rest_api/v1/views/vertical_block.py +++ b/cms/djangoapps/contentstore/rest_api/v1/views/vertical_block.py @@ -217,7 +217,8 @@ def get(self, request: Request, usage_key_string: str): } }, ], - "is_published": false + "is_published": false, + "can_paste_component": true, } ``` """ @@ -241,6 +242,10 @@ def get(self, request: Request, usage_key_string: str): }) is_published = not modulestore().has_changes(current_xblock) - container_data = {"children": children, "is_published": is_published} + container_data = { + "children": children, + "is_published": is_published, + "can_paste_component": True, + } serializer = VerticalContainerSerializer(container_data) return Response(serializer.data)