* FIX: Not send notifications when it should never notify assignment
- Added silenced_assignments table and migration to store silenced assignments
- Added tests for silenced assignments
* DEV: Add annotation to model
* DEV: add empty line after early return
* DEV: lint file
Before the implementation of the `post_destroyed` event handler in
the plugin, soft deleting assigned posts/topics did not deactivate the
assignment.
This left sites which assigned and deleted posts/topics before the
introduction of the event handler with 'orphaned' assignments in the UI.
This change deactivates these orphaned assignments.
Adds a new plugin setting that when enabled adds a status field for every assignment. This setting defaults to off.
The possible status for an assignment are customizable via yet another new setting, and the first one on this list will be the default status for new assignments.
The status is not yet show anywhere except the assign modal and the small action posts in topics at the moment. Adding status to the assignment list for users and groups will be handled in the near future.
Co-authored-by: Penar Musaraj <pmusaraj@gmail.com>
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
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)
On the group assignment page, we should be able to display
- all topics assigned to that group + to user belonging to that group
- all topics assigned directly to group
- all topics assigned to individual user
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.
* 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: Users can override reminders frequency
* Changes:
- Avoid creating a user custom field when the used didn't override the frequency
- Sanitize frequency value using coercion
- Minor fixes
* Sanitize query and user query single
* FEATURE: Remind users of assigned tasks.
* User an user custom field instead of adding a new column
* Improve tests. fix assigns count and display oldest assigned topics correctly. Do not remind about recently assigned tasks