Commit Graph

51 Commits

Author SHA1 Message Date
Andrei Prigorshnev a1686e1ca9
DEV: Stop using FoundUserWithStatusSerializer (#546)
Starting from b3a1199493 we stop using deprecated "WithStatus" serializers. Instead we'll be passing an 'include_status' option to serilaizers, for example:

```ruby
# before
BasicUserWithStatusSerializer.new(user)
ArraySerializer.new(users, each_serializer: BasicUserWithStatusSerializer)

# now
BasicUserSerializer.new(user, include_status: true)
ArraySerializer.new(users, each_serializer: BasicUserSerializer, include_status: true)
```
2024-03-14 17:44:48 +04: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
Natalie Tay 59fa9d7dbf
FIX: Sum assignments for group and group users (#482)
Use the assignment count rather than the number of topics assigned for the number of assignments in the nav
2023-07-03 10:58:46 +08:00
Bianca Nenciu d8ad876368
DEV: Update plugin to match latest guidelines (#446)
- Define extension modules
- Use different files instead of plugin.rb
- Make sure the plugin is disabled according to the setting
2023-02-17 17:35:41 +02:00
Bianca Nenciu a9b44a973c
FIX: Use same limit as default for user search (#437) 2023-01-26 16:28:30 +02:00
Bianca Nenciu 1268048874
FEATURE: Show user status when search assignees (#426)
The suggestions are displayed in email-group-user-chooser and user
status is displayed if it exists.
2023-01-12 22:31:48 +02:00
Rafael dos Santos Silva 700dfe551b
DEV: Ruby 3.1 compat (#406) 2022-12-20 23:17:15 -03:00
Andrei Prigorshnev 31d1a798f4
FEATURE: do not suggest users on vacation (#395) 2022-12-14 12:42:17 +04:00
Bianca Nenciu 4046c9fb40
FIX: Find better users for automatic assignment (#370)
There were two problems with the way current automation script for automatic
assignment works:

- it tried to assign users that were not allowed to be assigned because they
were not part of groups that are allowed to use discourse-assign - fixed by
skipping users that are not a part of assign_allowed_on_groups groups

- it assigned new users - fixed by adding a new user that can skip new users
2022-08-25 15:13:33 +03:00
Osama Sayegh e6e222d8bc
FEATURE: Add assigns tab to the experimental user menu (#366)
This commit adds a tab for assignments in the experimental user menu. The assignments tab behaves very similarly to the bookmarks and messages tab in core: it displays the user's unread assign notifications first and then fills the rest of available space in the menu with assignments (same content that the current user menu displays).

More details of the experimental user menu can be found in https://github.com/discourse/discourse/pull/17379.
2022-08-17 11:57:15 +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
Natalie Tay 1ac2dfbae2
FEATURE: Add assign note (#326) 2022-05-05 13:21:14 +08:00
Bianca Nenciu c8fc42b60f
FIX: Reuse topic query method to find group topics (#292)
The query for counts and list were different and the count did not
match the number of topics from the list.
2022-02-15 19:57:33 +02:00
Bianca Nenciu b4d85bd0ae
FIX: Count and show only active assignments (#286)
After a topic is closed, the assignment is not deleted but becomes
inactive. When this happened, it was not removed from the assignments
count or list.
2022-01-28 11:07:42 +02:00
Krzysztof Kotlarek 5779385d66
FIX: don't display inactive assignments (#283)
There is an active flag for assignments. It is used to bring assignments back when topic is reopened.

However, when assignment is inactive, it should not be displayed on assigned list or search.
2022-01-19 22:20:21 +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 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 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 470dd939aa
DEV: Move assignments from custom fields to a table (#169) 2021-07-14 10:48:19 +02:00
Jarek Radosz 195dcc92cb
DEV: Post-release cleanup (#163)
Included:

* DEV: Post-release cleanup
* DEV: Tests cleanup
* DEV: Import cleanup
* DEV: Drop a compatibility fix
* DEV: Use index_by
* DEV: Use ember imports
* DEV: Use discourseDebounce
* DEV: Use @action
* DEV: Use the optional chaining operator
* DEV: Fix an invalid test
* DEV: Use `discourseModule`
* DEV: Add .prettierrc
* DEV: Sync up the version number
2021-06-28 17:37:27 +02:00
Osama Sayegh c5b549b887
FIX: Improve error message when assigning a PM to a user who doesn't have access to the PM (#137)
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>
2021-01-27 14:57:41 +03:00
Ahmed Gagan f250dca93f
FEATURE: Allow filtering users in group assigned tab (#95) 2020-08-12 23:39:14 +01:00
Ahmed Gagan a844da7656
FIX: Refresh members and tab count when assignments change 2020-08-12 23:07:05 +01:00
Krzysztof Kotlarek 8e7ef2b797 FIX: check if allowed_user_custom_fields exisits 2020-07-27 12:11:35 +10:00
Ahmed Gagan 190681cdd1
FIX: Exclude deleted topics from assignment counts (#84) 2020-07-22 17:31:52 +01:00
Ahmed Gagan 816f3c0e97
FEATURE: Per-member counts in group assignment summary (#80) 2020-07-21 12:55:34 +01:00
David Taylor 4630dab7ac
SECURITY: Improve topic permission checks 2020-07-21 10:12:48 +01:00
David Taylor a8310b4bfa
DEV: Change to use UserLookup for core change (#77)
See https://github.com/discourse/discourse/pull/10253
2020-07-17 10:47:36 +01:00
Krzysztof Kotlarek 2fad44a6a0 FIX: compatibility after allowlist rewording in Discourse 2020-07-15 11:00:22 +10:00
David Taylor 07c13651c6
FIX: Correct assign user autocomplete logic
Previously we were only autocompleting users which were in the same group as the acting user.
2020-04-28 13:55:17 +01:00
Gerhard Schlager c3959f903a FIX: Convert ID into integer before sorting 2020-01-17 23:12:34 +01:00
Sam Saffron 0cea63029c FEATURE: order assigned list by reverse bump date
Previously this list was randomly ordered
2019-11-01 15:35:12 +11:00
Dan Ungureanu 1a041b49e0
FIX: Use TopicList's preloaded_custom_fields. 2019-10-21 19:42:04 +03:00
Bianca Nenciu c46764e804
FEATURE: Add endpoint to list all assignments, sorted by user
Includes a fix to let all admin users to use plugin
2019-09-16 13:41:10 +03:00
Bianca Nenciu 7d4b515524 FIX: Suggest only groups that are visible to current user (#48)
Otherwise, the user would search in groups that were not visible,
operation which resulted in a 403 error.
2019-09-09 15:32:50 +10:00
Roman Rizzi d268d4f817
Fix: Enforce new rules when assigning a topic. (#46)
* assign_to user must be allowed to assign.
* assign_to user must have access to the topic
2019-09-05 10:31:52 -03:00
Penar Musaraj 2ddc5c5bef Make Rubocop happy 2019-07-29 21:33:25 -04:00
romanrizzi 8792cf51bd DEV: Assign allowed groups are sent alongside suggestions. After the migration happens, we'll need to still have access to the allowed group names so we can search users. 2019-07-19 14:49:45 -03:00
Roman Rizzi f312ece4a9
Feature: Allow assign on groups (#31)
* 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
2019-06-04 09:21:33 -03:00
romanrizzi c882b097f8 Remove 'Unassign All' feature 2019-05-15 15:57:28 -03:00
Guo Xiang Tan 8fca0f61e8 Add frozen string literal comment to files. 2019-05-13 10:30:21 +08:00
Roman Rizzi 8583287faf
FEATURE: Limit the amount of assigned topics an user can have. (#29)
* 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
2019-05-02 10:44:11 -03:00
Saurabh Patel b20b4c088d FIX: add translations and check for message and if assignment is successful in spec (#22) 2018-12-06 18:04:31 +11:00
Saurabh Patel a2e7fc4cac FIX: do not assign to same when already assigned 2018-12-06 16:46:08 +11:00
Robin Ward 754209ce58 Add "Unassign All" button to user's assigned topics view 2018-05-04 13:41:04 -04:00