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 committed Feb 6, 2024
1 parent c6087e1 commit b221855
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 @@ -132,3 +132,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 @@ -226,7 +226,8 @@ def get(self, request: Request, usage_key_string: str):
}
},
],
"is_published": false
"is_published": false,
"can_paste_component": true,
}
```
"""
Expand All @@ -250,6 +251,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 b221855

Please sign in to comment.