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 Apr 4, 2024
1 parent 988fdc9 commit 2a14c85
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 @@ -128,3 +128,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 @@ -217,7 +217,8 @@ def get(self, request: Request, usage_key_string: str):
}
},
],
"is_published": false
"is_published": false,
"can_paste_component": true,
}
```
"""
Expand All @@ -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)

0 comments on commit 2a14c85

Please sign in to comment.