When topic is closed, we mark assignments as "inactive". Then when it is reopen and setting reassign_on_open is enabled, we bring back previous assignments.
We were already using custom fields for archive message and move to inbox. I changed custom fields solution to use active flag on Assignment model
When post is already assigned to user/group then don't allow assigning a topic to that user/group.
Similarly, right now when topic is already assigned we are not allowing to assign a post that that user.
When an assigned post is moved to the new topic, it becomes topic assignment.
When an assigned post is moved to an existing topic it stays post assignment
Change `topic_id` to polymorphic approach (In the next step we will allow assigning to individual post)
`topic_id` column is still used for efficient display of assigned users on topic list (to avoid scanning posts)
* FEATURE: Trigger webhook when assigning and unassigning topics
This PR creates a custom webhook event that you can now select when
creating a webhook to trigger only when a topic has been assigned or
unassigned.
* removed unused file
* Removed functionality that was added to core
This PR into discourse core:
https://github.com/discourse/discourse/pull/9110
adds what was removed in this commit.
It is better to have this logic in core so that it is discoverable and
future webhooks won't end up accidentally using the same ID.