Skip to content

Commit

Permalink
feat: [AXIMST-338] add context for Copy/Paste state
Browse files Browse the repository at this point in the history
  • Loading branch information
ruzniaievdm authored and monteri committed Apr 10, 2024
1 parent 96ee6d5 commit 7bd15a1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,4 @@ class VerticalContainerSerializer(serializers.Serializer):

children = ChildVerticalContainerSerializer(many=True)
is_published = serializers.BooleanField()
can_paste_component = serializers.BooleanField()
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ def get(self, request: Request, usage_key_string: str):
"render_error": "Unterminated control keyword: 'if' in file '../problem.html'",
},
],
"is_published": false
"is_published": false,
"can_paste_component": true,
}
```
"""
Expand Down Expand Up @@ -259,6 +260,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)

0 comments on commit 7bd15a1

Please sign in to comment.