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)
Ability to assign groups.
To assign group, user must have a right to send a message to that group.
In addition, 2 jobs were introduced, - AssignNotification and UnassignNotification to inform interested users in the background about the new assignment.
Currently if you try to assign a PM to a user who can't see it, you get an error message that says "@{user} can't be assigned since they don't belong to assigned allowed groups". This commit improves the message and now it tells you the user doesn't have access to the PM and that you need to invite the user before you can assign them.
Signed-off-by: OsamaSayegh <asooomaasoooma90@gmail.com>
* 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.
Remove any quoted text and code blocks before matching the "assign self" or "assign other" regexps.
Added tests to ensure it does not regress.
Also cleaned up some TODOs.
* DEV: use group ids to allow assign on groups (#38) [Undo Revert]
This reverts commit 8f92c5f9bd.
* Set the default inside a migration based on the core migration. Improve migration check to work against tests-passed/beta/stable.
* Update db/migrate/20190718144722_set_assign_allowed_on_groups_default.rb
Co-Authored-By: Robin Ward <robin.ward@gmail.com>
* Feature: Allow assign on groups
* Use type: group_list option
* Track group changes and update the setting accordingly. Restrict reminders frequency to assign allowed users instead of staff
* FEATURE: Limit the amount of assigned topics an user can have.
* Do not enfore the limit when self-assigning
* Avoid computing the query when self-assigning. Do not count self-assigns when enforcing the limit
Previously we would rely on a quirk in core where whisper small actions
would get a notification, this behavior was removed and now we must
be explicit, it provides a much more consistent assign notification