* 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>
We were sometimes visiting latest before the request happens, the solution is to wait for the modal to have automatically closed as it indicates the request has finished and the state should be the one we expect.
This fix addresses an issue if a group is deleted topics will remain
assigned to all group members with no way to un-assign those users from
the original group assignment.
Now if a group is deleted any group assignments are also deleted.
The PR https://github.com/discourse/discourse/pull/28003 in core
removes the experimental status of new topic bulk actions, we
can now use it for everything from now on. After this and the
core PR is merged we can reintroduce the specs.
* FEATURE: Add pending assign reminder threshold setting
User can define a threshold for the pending assign reminder.
* DEV: rename REMINDER_THRESHOLD with SiteSetting
This adds a new dropdown to the topic level assign modal. A topic may contain several assignments, the topic itself may be assigned and also some of the replies may be assigned. With this new dropdown, it's possible to edit all the assignments from this modal.
Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
The label touches the avatar when a topic has several assignments,
and those contain assignments to users _and_ to groups. We don't show
avatars for groups, but the code sees there are several assignees and
applies overlapping styling.
This commit corrects the logic and fixes the issue.
Here is how avatars on the button behave:
1. If there are from one to many assignments on the topic, but all
the assignees are groups, we don't show avatars, only label.
2. If there are from one to many assignments to the same user, we show
the avatar of that user.
3. And if there are from two to many assignments to different users, we
show avatars of first two users.
Prior to this fix the state change was not reflected in the UI when changing the "who can assign" preference of a group.
This was actually saved in the backend but would require a full page refresh to see the updated state on the group preferences page.
We've noticed that when unassigning a topic on the `activity/assigned` one of
two incorrect things happens when pressing this button:
1. The first topic on the page gets unassigned instead of the selected one
2. No topics get unassigned (that happens when the first topic on the list is
not assigned and only has assigned _posts_)
That happens because this handler for all buttons somehow always use the
same state - the state of the first topic on the page:
f2906e0885/assets/javascripts/discourse/components/assign-actions-dropdown.js (L55-L68)
There seem to be some nuances in select-kit and I'm not sure whether
this should be qualified as a bug in select-kit. However, I've noticed that in other cases when we use `DropdownSelectBoxComponent` we use the `onChange` handler rather
than `onSelect`.
So I switched this code to using `onChange` and that resolved the issue,
the `onChange` handler has access to correct state.
Tests will be in a follow-up.
Before, we only had buttons for assigning and unassigning topic on
the topic level assign menu. This commit adds dynamic buttons for
unassigning posts to the menu.
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.