Commit Graph

41 Commits

Author SHA1 Message Date
Juan David Martínez Cubillos 261a47d119
DEV: Temporarily revert prioritize_username_in_ux for prioritize_full_name_in_ux (#656) 2025-04-10 13:44:55 -05:00
Juan David Martínez Cubillos 0437516309
FIX: Incorrect ussage of prioritize_full_name_in_ux replaced by prioritize_username_in_ux (#645)
* FIX: Incorrect usssage of prioritize_full_name_in_ux replaced by prioritize_username_in_ux

* fixed failing test
2025-03-14 19:09:43 -05:00
benj ec8a785df9
FIX: Ensure assign plugin respects `prioritize_full_name_in_ux` site setting (#632)
* WIP

* more messing around

* undos, notes to self

* WIP notes

* completed logic and added tests for existing  code and implemented code

* fixed failing tests

* fixed failing tests

* added suggested changes

* added suggested changes

* fix merge

* fix linting issues

* possible flaky test

* removed comment

* further user name display changes

* implemented suggested change

* fixed bug in small action post when assigning or unassigning

* fixed breaking tests

* refactored test

---------

Co-authored-by: Juan David Martinez <juan@discourse.org>
2025-03-14 18:08:28 -05:00
David Battersby 6a83db6a46
FIX: allow user to be assigned to post and topic (#638)
This change makes it possible to assign the same user to both posts and the original topic.
2025-03-07 13:14:07 +04:00
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
Gabriel Grubba 6101ecdba5
FEATURE: Add `should_notify` option to `Assigner#assign` (#604)
* FEATURE: Add `should_notify` option to `Assigner#assign`

This option let's you control whether the added user within a group assignment should be notified or not.

* DEV: stree assign_controller file

* Update app/controllers/discourse_assign/assign_controller.rb

Co-authored-by: David Taylor <david@taylorhq.com>

---------

Co-authored-by: David Taylor <david@taylorhq.com>
2024-11-14 15:01:02 -03:00
Andrei Prigorshnev 51920a99c0
FIX: Assignments limit shouldn't prevent from reassigning a post (#556)
At the moment, it's possible to have maximum 5 assignments per topic 
(that includes topic and post assignments). When trying to assign more, 
a message "Limit of 5 assignments per topic has been reached" appears.

One possible edge case here is _reassigning_ a topic or a post. Reassignment 
doesn't lead to exceeding the limit, and therefore it should be possible. But 
at the moment we handle correctly only _topic_  reassignments, while when 
reassigning a _post_, we show the error message "the limit has been reached".

This commit makes post reassignments work correctly too.
2024-03-29 15:50:02 +04:00
Jarek Radosz 5888025dec
FIX: Various assignment status issues (#536) 2023-12-08 11:48:34 +01:00
Loïc Guitaut cac9a763dd FEATURE: Allow to reassign to same user
Currently, when only one user is available for the random auto-assign
and if that user was already assigned, then the assign will fail.

This patch addresses this issue by allowing to reassign a user who’s
already assigned. A new parameter (`allow_self_reassign`) has been added
to `Assigner#assign` with a default value of `false`.
2023-11-27 16:17:25 +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
Jarek Radosz 6ed4a13fe7
DEV: Update ruby linting (#518) 2023-10-20 17:04:03 +02:00
Natalie Tay e434be7969
UX: Don't change topic notification level when unassigning (#513)
* UX: Don't change topic notification level when unassigning

* Update test
2023-10-16 04:41:44 +00:00
Krzysztof Kotlarek 0c01e8fdfd
FIX: granular webhooks (#498)
After those core changes we need additional translations

https://github.com/discourse/discourse/pull/23070
2023-10-09 03:26:40 +00:00
Vinoth Kannan fb89a23530
FEATURE: skip group invite if all members can see topic already. (#474)
We don't want to invite a group when all of its members are part of another group that is already allowed to the topic.
2023-05-27 22:29:38 +05:30
Vinoth Kannan f97da59dee
FIX: don't invite user when already a member of an allowed group. (#473)
Otherwise, when an allowed group member is assigned to the PM it invites the user (which is unnecessary) and creates a public small post for the invite.
2023-05-24 11:45:50 +05:30
Vinoth Kannan dcaadb75dc
FEATURE: invite user/group to PM if not a participant already. (#471)
When a group or user is assigned to a personal message, if they are not already a participant, invite them to the PM before assignment.
2023-05-22 14:48:08 +05:30
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
Jan Cernik 896d0e3445
FIX: Broken posts when assigning a closed topic (#425)
The previous behavior was:
1. Assign a topic to someone
2. Close the topic with the setting unassign_on_close enabled
3. Assign the topic to the same user as before

This caused small broken or empty posts to be displayed.

This commit also introduces system specs
2023-01-17 08:09:35 -03:00
Penar Musaraj 4b8afc301a
FEATURE: Cleanup notifications when reassigning (#394)
If a topic is initially assigned to user A then reassigned to user B,
this change will make it so that notifications sent to user A are
removed. This matches the plugin's behaviour when unassigning a topic.
2022-11-24 10:42:19 -05:00
Bianca Nenciu 1dfbc84896
FIX: Count only active assignments when checking limits (#375)
Only 5 assignments can exist simultaneously for a topic or its post.
The code that counted the assignments did not ignore the inactive
assignments which made the limit check more strict than it should have
been.
2022-08-30 19:56:03 +03:00
Bianca Nenciu acb9025ede
FIX: Check if assignment has same user and details (#368)
The check existed, but its implementation was incorrect and it did not
work when the target was a post.
2022-08-18 18:16:20 +03:00
Osama Sayegh d9a750d306
DEV: Add assignment ID to assign notification data (#365)
This change makes it possible to associate an assign notification with the `assignments` record that creates the notification. It'll be needed for the assignments tab in the new experimental user menu, see https://github.com/discourse/discourse/pull/17379.
2022-08-11 06:43:49 +03: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
Krzysztof Kotlarek 0b5f688451
FIX: ensure that assignee is participant of pm (#349)
We are already checking that assignee has access to the private message. However, admin still can be assigned as technically they have access.

We should ensure that assignee has direct access to the message.
2022-06-16 10:08:22 +10:00
Natalie Tay 43a3030707
FEATURE: Shows note in moderator post (#335) 2022-05-12 23:55:57 +08:00
Natalie Tay fbdfb7143b
DEV: Small refactors for future work (#332) 2022-05-11 14:03:54 +08:00
Natalie Tay b314882a6b
FEATURE: Show note in tooltip (#327) 2022-05-05 15:04:57 +08:00
Natalie Tay 1ac2dfbae2
FEATURE: Add assign note (#326) 2022-05-05 13:21:14 +08:00
jbrw 44dd73e151
FIX: Exclude inactive assigns from assigned_total count (#288)
If `SiteSetting.unassign_on_close` is enabled, an Assignment record can still exist, but be set to inactive, when a Topic is closed.

Inactivement Assignments should be ignored when comparing to the maximum number of assigned topics.
2022-01-31 15:26:58 -05:00
communiteq 43f93d9611
Fix: set these fields in condition below only (#273)
Co-authored-by: Richard <richard@communiteq.com>
2021-12-24 11:24:57 +11: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 3eaefb60dd
FIX: dont allow assigning user to topic when post assigned (#259)
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.
2021-12-06 06:09:04 +01:00
janzenisaac 5910fd5569
FIX: Refactor assign / reassign to combine logic (#250)
* Refactor and combine assign / reassign logic
2021-12-02 13:12:00 -06:00
janzenisaac 98103586b2
FEATURE: Reassign workflow (#231)
Build a new workflow that adds a dropdown in place of the old assign button with the ability to

Re-assign a new user / group to an assigned topic
Re-assign yourself to an assigned topic
Unassign a user / group from an assigned topic
2021-11-12 10:09:47 -06:00
Krzysztof Kotlarek 69dac06a82
FIX: correctly update UI when post is assigned/unassigned (#233)
Update topic title, first post and related post
2021-11-09 08:40:43 +11: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 22025b35b8
FEATURE: small post action with link to post (#232)
When a post is assigned/unassigned, we want small action to have a link to the specific post.
2021-11-08 08:25:13 +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