Added activity when attribute gets changed#992
Conversation
…enhancement/YN-0316_attribute_change_event
|
Not completely sure, if this is actually solving requested use case. I followed existing event trigger in |
|
I think I misunderstood the use case. I reverted commits which triggered event IF attribute definition was changed. I implemented creating of activity when attribute changes, in similar fashion as But there will be need to update frontend a bit as right this changes is breaking display of entity with newly created activity. I'll try to experiment with FE for a bit if I could figure it out myself, but if not, I'll punt it FE team way. |
|
I am REALLY concerned about this running when a project uses calculated attributes tbh. |
|
You mean it will be spawning a too many activities? Can we separate attribute changes of calculated attributes? |
|
Maybe. It will require a changes both in calculated attributes and the server. I'll take a look how that could be done. I don't assume it is necessary to track changes of calc attrs anyways. Edit: This is now available |
| origin_link = f"[{entity.name}]({entity_type}:{entity.id})" | ||
| body = f"{origin_link} attrib changed from {old_value} to {new_value}" | ||
|
|
||
| await create_activity( |
There was a problem hiding this comment.
Similarly to assignee activities, split the event to individual attributes, throw away calculated attributes (available since #995 ) and create an activity for each attribute. with data like:
{
"key": "priority",
"oldValue": "low",
"newValue": "high",
}
(i'd use generic name "key" rather than "attrib" or "attrib name" since we can then add a simple index that will cover data->'key' that could be useful for more activity types)
…enhancement/YN-0316_attribute_change_event
Skip keys in 'calculated_attributes' which denote dynamically calculated ones from real attribute change.

Description of changes
This PR adds activity creation after attribute gets changed to log it of posterity.
This should be used in production to backtrack changes to attributes as
fps,width,height