Skip to content

feat: add topic element activities#3439

Merged
maudetes merged 7 commits intoopendatateam:masterfrom
ecolabdata:feat/topic-elements-activities
Sep 23, 2025
Merged

feat: add topic element activities#3439
maudetes merged 7 commits intoopendatateam:masterfrom
ecolabdata:feat/topic-elements-activities

Conversation

@abulte
Copy link
Copy Markdown
Contributor

@abulte abulte commented Sep 17, 2025

This adds TopicRelatedActivity activities for TopicElement:

  • topic:element:created
  • topic:element:deleted
  • topic:element:updated

It supports changed field names in changes[] on updated.

Related ecolabdata/ecospheres#601

Comment thread udata/core/topic/apiv2.py Outdated
if not TopicEditPermission(topic).can():
apiv2.abort(403, "Forbidden")

# TODO: should we ignore activity creation here?
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will create a lot of deleted activities (and probably crash since it is synchronous) if we empty a universe Topic. I'm not sure we should introduce an exception here to prevent that, WDYT?

Emptying a universe crashes anyway 😬 #3423

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I think it can be dealt at the same time as #3423 indeed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the TODO wording.

@abulte abulte marked this pull request as ready for review September 17, 2025 16:24
Copy link
Copy Markdown
Contributor

@maudetes maudetes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I think the implementation is clean 👏

Comment thread udata/core/topic/apiv2.py
Comment thread udata/core/topic/apiv2.py Outdated
if not TopicEditPermission(topic).can():
apiv2.abort(403, "Forbidden")

# TODO: should we ignore activity creation here?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm... I think it can be dealt at the same time as #3423 indeed?

@maudetes maudetes merged commit 8bb9d4e into opendatateam:master Sep 23, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants