Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FC-0040] feat: Add CONTENT_OBJECT_TAGS_CHANGED signal #327

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Change Log

Unreleased
----------
Added
~~~~~
* Added new ``CONTENT_OBJECT_TAGGED`` events in content_authoring.

[9.5.2] - 2024-02-13
--------------------
Expand Down
2 changes: 1 addition & 1 deletion openedx_events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
more information about the project.
"""

__version__ = "9.5.2"
__version__ = "9.6.0"
14 changes: 14 additions & 0 deletions openedx_events/content_authoring/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,17 @@ class LibraryBlockData:

library_key = attr.ib(type=LibraryLocatorV2)
usage_key = attr.ib(type=LibraryUsageLocatorV2)


@attr.s(frozen=True)
class ContentObjectData:
"""
Data about changed content object

Arguments:
object_id (str): identifier of the Content object. This represents the id of the course or library block
as a string. For example:
block-v1:SampleTaxonomyOrg2+STC1+2023_1+type@vertical+block@f8de78f0897049ce997777a3a31b6ea0
"""

object_id = attr.ib(type=str)
12 changes: 12 additions & 0 deletions openedx_events/content_authoring/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from openedx_events.content_authoring.data import (
CertificateConfigData,
ContentLibraryData,
ContentObjectData,
CourseCatalogData,
CourseData,
DuplicatedXBlockData,
Expand Down Expand Up @@ -198,3 +199,14 @@
"library_block": LibraryBlockData,
}
)

# .. event_type: org.openedx.content_authoring.content.object.tags.changed.v1
# .. event_name: CONTENT_OBJECT_TAGS_CHANGED
# .. event_description: emitted when an object's tags are changed
# .. event_data: ContentObjectData
CONTENT_OBJECT_TAGS_CHANGED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.content.object.tags.changed.v1",
data={
"content_object": ContentObjectData
}
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "CloudEvent",
"type": "record",
"doc": "Avro Event Format for CloudEvents created with openedx_events/schema",
"fields": [
{
"name": "content_object",
"type": {
"name": "ContentObjectData",
"type": "record",
"fields": [
{
"name": "object_id",
"type": "string"
}
]
}
}
],
"namespace": "org.openedx.content_authoring.content.object.tags.changed.v1"
}
Loading