Commit Graph

29 Commits

Author SHA1 Message Date
Régis Hanol 8c52b9a31c
FEATURE: new "notification level when assigned" user preference (#626)
This adds a new user preference allowed users to control how the
notification level of the topic they're assigned to changes.

Internal ref - t/141162
2025-01-16 17:59:16 +01:00
Gabriel Grubba 0f4a1fcdd3
FIX: Not send notifications when it should never notify assignment (#620)
* 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
2024-12-12 11:28:11 -03:00
Natalie Tay 7019ff7ac6
DEV: Promote historical post-deploy migrations (#583) 2024-07-30 01:10:41 +08:00
Loïc Guitaut be53c06e5a DEV: Rewrite post-migration in pure SQL 2023-11-15 09:50:54 +01:00
Loïc Guitaut 80604e9012 FIX: Display assignments in user menu properly
Currently, we display a mix of topics and notifications in the user menu
assignments tab. This has a number of issues like having to maintain
hard to understand code instead of simply relying on the notifications
system we have, we can’t display more than one assignment per topic and
it’s not clear if an assignment is for a topic or a post nor if it’s a
group assignment or an individual one.

This patch addresses those issues by relying on the notifications system
we’re using for most of the other user menu tabs instead of a custom
implementation. This led to some heavy refactoring but it was
worthwhile as things are a bit more normalized and easier to reason
about. Instead of serializing topics with different attributes to access
various assignments, we now simply return a notification for each
existing assignment.

The UI changed a bit: tooltips are now explaining if the assignment is
for a topic or a post and if it’s for an individual or a group. Icons
are also properly set (so no more individual icon for group assignments)
and the assigned group name is displayed.

The background jobs signatures changed a bit (`assignment_id` is now
needed for the unassign job) so when deploying this patch, it’s expected
to have some jobs failing. That’s why a post-migration has been written
to handle the creation of missing notifications and the deletion of
extra notifications too.
2023-11-08 15:26:57 +01:00
Krzysztof Kotlarek c036d030dc
FIX: reassign when assignment limit is fulfilled (#419)
Previously, when topic was already assigned 5 times, reassign was not possible. User had to first unassign topic and then assign to someone else.
2023-01-20 13:34:22 +11:00
Selase Krakani 803f73f837
FIX: Deactivate active assignments attached to deleted targets (#428)
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.
2023-01-18 19:53:20 +00:00
Bianca Nenciu d8821aa16d
DEV: Promote historic post_deploy migrations (#402)
This commit promotes all post_deploy migrations which existed in
Discourse v2.8.0 (timestamp <= 20220107014925)
2022-12-19 17:28:09 +02:00
Rafael dos Santos Silva 7a2fde72c6
FEATURE: Assign Status (#363)
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>
2022-08-04 14:50:18 -03:00
Rafael dos Santos Silva 6116f26642 DEV: Apply syntax_tree formatting 2022-07-27 13:48:51 -03:00
Natalie Tay 1ac2dfbae2
FEATURE: Add assign note (#326) 2022-05-05 13:21:14 +08:00
Krzysztof Kotlarek 1a1dffc5e8
FEATURE: active flag for assignments (#264)
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
2021-12-13 08:36:14 +01:00
Krzysztof Kotlarek 2d1f5668a5
FIX: rename action_code_href to action_code_path (#234)
We should use relative paths, therefore name change is necessary to avoid confusions. Post migration is added to fix existing data.
2021-11-08 14:32:21 +11:00
Krzysztof Kotlarek c396605d2f
FEATURE: assign to post (#224)
Ability to assign an individual post to a user or group
2021-11-01 09:27:13 +11:00
Krzysztof Kotlarek dc8f43fbb1
FEATURE: Assignment target is polymorphic (#218)
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)
2021-10-14 09:22:29 +11:00
Krzysztof Kotlarek 5124ba0f67
FIX: assignment table migration when SKIP_POST_DEPLOYMENT_MIGRATIONS (#217)
We need two branches of that migration. One when `assigned_to_type` is missing and another when `assigned_to_type` exists.

https://meta.discourse.org/t/db-migration-version-20210714173022-fails-when-having-skipped-post-deployment-migrations-before/204660
2021-09-29 18:33:45 +10:00
Krzysztof Kotlarek 62d87f0084
FEATURE: better UI for group assignments (#197)
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
2021-09-09 12:18:18 +10:00
Krzysztof Kotlarek 375f7ba78d
FEATURE: new assignable group option instead of messageable (#195)
V1 of group assign was using "who can message" to determine if group can be assigned.

This PR is introducing new separate setting "who can assign"
2021-09-08 10:30:13 +10:00
Jarek Radosz d807491df2
FEATURE: Assign to group (#182)
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.
2021-08-27 09:25:38 +10:00
Jarek Radosz 09b7655206
FIX: Handle invalid source data in CF migration (#172) 2021-07-14 22:02:27 +02:00
Jarek Radosz b0a480fd35
FIX: CF to table migration was incorrect (#171)
The order of values in the `INSERT` query was invalid (`assigned_to_id` and `topic_id` were swapped)

Co-authored-by: David Taylor <david@taylorhq.com>
2021-07-14 20:45:31 +02:00
Jarek Radosz 470dd939aa
DEV: Move assignments from custom fields to a table (#169) 2021-07-14 10:48:19 +02:00
Jarek Radosz 573c608057
DEV: Avoid nil custom fields (#154)
Included:

* DEV: Topic#custom_fields is always truthy
* DEV: Delete custom fields instead of setting nil
* DEV: Delete existing nil custom fields
2021-05-05 11:15:50 +02:00
David Taylor 60f7aa62bd
FIX: Make migration compatible with stable branch 2019-12-02 14:01:39 +00:00
Dan Ungureanu f2074f256e
FEATURE: Improve assign mailer site setting (#57) 2019-11-26 11:41:52 +02:00
Roman Rizzi 64324ce9db
DEV: use group ids to allow assign on groups [Undo Revert] (#41)
* 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>
2019-07-19 10:30:44 -03:00
Roman Rizzi abe8142038
FEATURE: Users can override reminders frequency (#30)
* 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
2019-05-27 10:53:37 -03:00
Guo Xiang Tan 8fca0f61e8 Add frozen string literal comment to files. 2019-05-13 10:30:21 +08:00
Roman Rizzi 7b7432990a FEATURE: Remind users of assigned tasks. (#28)
* 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
2019-04-30 10:02:26 +10:00