Commit Graph

188 Commits

Author SHA1 Message Date
Krzysztof Kotlarek 9ac8b70b14
FIX: refresh topic when topic or post is deleted or recovered (#269)
Additional check was added to only refresh if there were affected assignments
2021-12-15 07:53:12 +01:00
Krzysztof Kotlarek a9ef43e12f
FIX: indirect assigned to in search (#266)
Search similarly to topic list should return a hash with post_number
2021-12-13 15:47:09 +01: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
Mark VanLandingham cb0a65b844
FIX: current_user serializer not throwing error (#253) 2021-11-18 13:33:14 -06:00
Natalie Tay 3d2a9d1e87
Show custom topic tracking message when the user 'never' automatically tracks topics and gets assigned (#249)
* Show more precise topic tracking message when the user never tracks any topics and gets assigned
2021-11-18 09:44:53 +08:00
Krzysztof Kotlarek 677d6a9aed
FIX: no error when assigned post is deleted (#244)
When an assigned post is deleted, we should not error. For now, assignment object is left untouched to not lose information when post is `undeleted`.

We can change that behaviour later if we decide that assignments should be deleted as well.
2021-11-16 09:12:51 +11:00
Krzysztof Kotlarek a876821ab1
FIX: missing assignee icon in search (#230)
Change serializer to include icon path
2021-11-04 08:32:25 +11:00
Krzysztof Kotlarek fcd4532c76
FIX: move post assignment when move post (#229)
When an assigned post is moved to the new topic, it becomes topic assignment.

When an assigned post is moved to an existing topic it stays post assignment
2021-11-04 08:22:53 +11:00
Krzysztof Kotlarek a4b1847eff
FEATURE: display indirect assignments in the first post (#227)
A link in the first post will allow going to a specific post assigned to a user or group.
2021-11-03 10:35:10 +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 95cd224898
FIX: deprecate TopicAssigner (#221)
Delegate to assigner and add deprecation note
2021-10-27 15:42:51 +11:00
Joffrey JAFFEUX 7747bb81a0
FIX: more accurate and flexible random assign automation (#222)
- allows to define the number of days within which a user is considered recently assigned
- more correct by now using post custom fields
2021-10-19 17:31:17 +02: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 3a58df219c
FIX: n+1 query on list of private messages assigned (#216)
When getting a list of private messages assigned to groups/users, we should include :allowed_users to avoid n+1
2021-09-29 09:01:15 +08:00
Penar Musaraj dd37f66f5d
DEV: Fix dev plugin reloading issue (#215) 2021-09-23 12:56:35 -04:00
Krzysztof Kotlarek b172ca604c
FIX: n+1 assignment (#205)
We are preloading assigned_to for topic list https://github.com/discourse/discourse-assign/blob/main/plugin.rb#L214

Therefore instead of checking assignment, we should use assigned_to directly on topics for serializers
2021-09-15 08:24:37 +10:00
Krzysztof Kotlarek f58b78e027
FIX: add assigned fields to suggested topic serializer (#199)
With hard refresh, information about assigned user disappeared from suggested topics.
2021-09-09 16:59:06 +10:00
Krzysztof Kotlarek ab9e6f0684
FIX: unassign/assign when group pm is archived (#192)
Send correct messages and correctly unassign/assign to user/group if group PM is archived or moved back to inbox.
2021-09-09 14:22:04 +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
Joffrey JAFFEUX da0a6ce219
DEV: adds log warning if assign is not enabled (#202) 2021-09-08 16:46:41 +02:00
Joffrey JAFFEUX 0881b638bd
DEV: adds an option to check for working hours (#201) 2021-09-08 16:46:33 +02:00
Joffrey JAFFEUX cfc25d9ac2
DEV: removes default for minimum time (#203) 2021-09-08 16:46:17 +02: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
Krzysztof Kotlarek b42ec9f779
FIX: correct group icons and notification message (#193)
* New group icon
* Group assignment notification displays group name instead of who assigned
2021-08-31 08:17:43 +10:00
David Taylor 978f3d74a1
FIX: Ensure move_to_inbox does not raise error when unassigned (#190) 2021-08-27 15:22:24 +01: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
Joffrey JAFFEUX 0046041e9e
FEATURE: improves random assign automation (#166)
- Makes a best attempt at being random and assigning people who haven’t been assigned for a long time
- Uses timezones and holidays
- Allows to define a minimum delay between assignments
- Creates a post if no one is available
2021-08-20 12:22:37 +02:00
Arpit Jalan 4024eb078c
FIX: filter by "nobody" was broken (#176)
Meta ref: https://meta.discourse.org/t/filter-by-nobody-seems-broken/197770/
2021-07-22 15:00:27 +05:30
Jarek Radosz 470dd939aa
DEV: Move assignments from custom fields to a table (#169) 2021-07-14 10:48:19 +02:00
Joffrey JAFFEUX f559fc9557
FIX: automation fields now all use the same value property (#170) 2021-07-12 18:34:13 +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
Joffrey JAFFEUX 954e908e24
FEATURE: adds support for a random assign automation (#162) 2021-06-24 16:51:49 +02:00
Roman Rizzi 65be8fe69d
FIX: Unassign users after removing them from an assign allowed group. (#134)
Users that aren't members of an assign allowed group can no longer use the feature. Automatically unassign all their topics.
2021-01-25 14:59:42 -03:00
Arpit Jalan 6da6f525f2
FEATURE: show assigned user on search results (#123)
This commit allows discourse-assign plugin to show assigned users on
search result topic list.
2020-12-17 21:58:35 +05:30
Rafael dos Santos Silva d08497c308
Revert "FEATURE: show assigned user on search results (#121)" (#122)
This reverts commit ed51dcef10.

Plugin triggers a N+1, and the N+1 protection breaks search
everywhere

StandardError (Attempted to access the non preloaded custom field
  'assigned_to_id'. This is disallowed to prevent N+1 queries.)
2020-12-08 13:18:02 -03:00
Arpit Jalan ed51dcef10
FEATURE: show assigned user on search results (#121) 2020-12-08 19:57:19 +05:30
David Taylor c4aefd5917
REFACTOR: Use core `default_results` function (#111)
This significantly reduces the amount of logic we need to carry in the discourse-assign plugin. One side effect is that I had to rename the 'q' parameter to 'search', so that it matches core's implementation.
2020-09-16 12:18:14 +01:00
Ahmed Gagan 303274eae3
FEATURE: Advanced search filters for assigned topics (#102)
Adds three new search modifiers:

- in:assigned for assigned topics
- in:unassigned for unassigned topics
- assigned:{username} to list topics assigned to a specific user

These modifiers are all made available in the advanced search sidebar
2020-09-11 12:15:50 +01:00
Ahmed Gagan 3e3dc3815b
FEATURE: Assign bulk actions for topics lists (#110)
- Allows unassigning and reassigning topics using bulk actions
- Adds bulk actions UI to the group assigned page
2020-09-11 11:49:25 +01:00
Ahmed Gagan cd31a821fc
UX: Only show assigned tab for groups where all users can assign (#103) 2020-08-28 15:18:25 +01:00
Ahmed Gagan 069adc1af7
FEATURE: Allow searching topics in group assigned tab (#97) 2020-08-12 23:40:04 +01:00
Ahmed Gagan 8a77c932a7
PERF: Avoid tags N+1 in assigned topic lists 2020-08-04 16:25:38 +01:00
Ahmed Gagan 6dbf3e2bcb
FEATURE: Allow sorting assigned topic lists 2020-08-04 15:48:33 +01:00
Ahmed Gagan 301be24c13
UX: Rename group tab from Assignments to Assigned (#88) 2020-07-27 12:26:12 +01:00
Ahmed Gagan 190681cdd1
FIX: Exclude deleted topics from assignment counts (#84) 2020-07-22 17:31:52 +01:00
David Taylor e31454e014
FIX: Restore join to user_emails for backwards compatibility
Followup to a8310b4b
2020-07-21 20:41:21 +01:00
Ahmed Gagan 816f3c0e97
FEATURE: Per-member counts in group assignment summary (#80) 2020-07-21 12:55:34 +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
Ahmed Gagan 43759bd8ef
FIX: Group name with capital letter throws 404 error (#73) 2020-07-10 11:33:48 +01:00
Ahmed Gagan ae83f70e21
FEATURE: Assignments summary tab for groups (#70) 2020-07-10 09:45:18 +01:00
Martin Brennan e2057ca27b
FIX: Preload assigned users for BookmarkQuery (#63)
* Preload assigned users for BookmarkQuery

* Ensure bookmark query exists + responds to new methods
2020-03-19 15:48:49 +10:00
Martin Brennan baba785b44 Fix UserBookmarkSerializer topic references 2020-03-13 11:10:48 +10:00
Martin Brennan e7d5c88c8b
FEATURE: Add assigned to user to bookmark serializers (#62)
Add assigned to user to bookmark serializers, and also add to JS bookmark model for the route to assigned user.
2020-03-12 15:21:48 +10:00
Blake Erickson 32653be260
FEATURE: Trigger webhook when assigning and unassigning topics (#61)
* FEATURE: Trigger webhook when assigning and unassigning topics

This PR creates a custom webhook event that you can now select when
creating a webhook to trigger only when a topic has been assigned or
unassigned.

* removed unused file

* Removed functionality that was added to core

This PR into discourse core:

https://github.com/discourse/discourse/pull/9110

adds what was removed in this commit.

It is better to have this logic in core so that it is discoverable and
future webhooks won't end up accidentally using the same ID.
2020-03-06 11:57:46 -07:00
romanrizzi 2adcd9a832 DEV: Remove backward-compatibility code now that 2.4 is the new stable 2020-03-02 10:53:39 -03:00
Roman Rizzi 3593f9ef67
FEATURE: Filter reviewables by assigned user (#58) 2019-11-25 13:48:09 -03:00
Sam Saffron e0de9238a1 FEATURE: new category setting to add "Unassigned" navigation menu
When a category is used exclusively for managing topic assignments it can
be very useful to list all the unassigned topics. This introduces a new
category setting that allows admins to opt for this new navigation item.

It works both on mobile and desktop.

This uses an amended nav item API, to experience this fully you need latest
versions of Discourse.
2019-11-01 14:15:28 +11:00
Sam Saffron bc5469c6c6 Revert "FEATURE: new category setting to add "Unassigned" navigation menu"
This reverts commit 600e1b6544.

The level of hack here is just to high, this destabilizes tests. We need a
proper pattern.
2019-10-30 18:16:12 +11:00
Sam Saffron 600e1b6544 FEATURE: new category setting to add "Unassigned" navigation menu
When a category is used exclusively for managing topic assignments it can
be very useful to list all the unassigned topics. This introduces a new
category setting that allows admins to opt for this new navigation item.

It works both on mobile and desktop.

Unfortunately Discourse is lacking internal APIs for cleanly adding NavItems

We will look at improving this soon.
2019-10-30 16:37:13 +11:00
Vinoth Kannan eb02ac1ef5 FIX: always include admins in 'assign' allowed users list. 2019-10-25 17:27:38 +05:30
Jeff Wong e96e67bfbb Add support for unicode usernames 2019-09-20 14:12:23 -07: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
Roman Rizzi dc6041abcb
DEV: Remove dreprecated review queue code (#47) 2019-09-11 09:51:23 -03:00
Penar Musaraj 2ddc5c5bef Make Rubocop happy 2019-07-29 21:33:25 -04: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 8f92c5f9bd
Revert "DEV: use group ids to allow assign on groups (#38)" (#40)
This reverts commit b256d462bf.
2019-07-16 11:59:33 -03:00
Roman Rizzi b256d462bf
DEV: use group ids to allow assign on groups (#38)
* DEV: use group ids to allow assign on groups

* FIX: Dinamically sets the default value to support older versions
2019-07-16 11:33:04 -03:00
Sam Saffron e4be0f02b7 Revert "Staff is always allowed to assign (#36)"
This reverts commit bb200f5fbd.
Unfortunately that commit broke assign
2019-06-18 16:00:10 +10:00
Roman Rizzi bb200f5fbd
Staff is always allowed to assign (#36) 2019-06-17 10:11:00 -03:00
Sam Saffron fe746fefc0 PERF: remove N+1 query from assign
Also makes looking for allowed groups much more
efficient
2019-06-05 11:03:29 +10: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
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
romanrizzi 8ca446eeed Make rubocop happy and use defined? when checking for reviewable_api_enabled 2019-05-15 16:18:24 -03:00
romanrizzi c882b097f8 Remove 'Unassign All' feature 2019-05-15 15:57:28 -03:00
Régis Hanol 615ad7c5c3
FIX: don't 'return' in 'flag_reviewed' block 2019-05-15 12:50:52 +02:00
Roman Rizzi 4b7a99f017
Disable flagging behaviour in favor of the new reviewable API (#34) 2019-05-14 16:29:50 -03:00
Guo Xiang Tan 8fca0f61e8 Add frozen string literal comment to files. 2019-05-13 10:30:21 +08:00
Roman Rizzi f330120f90
Assigned topics are now ordered by topics.bumped_at (#32) 2019-05-07 12:43:47 -03:00
Roman Rizzi e3b2e5bdb6 FEATURE: Display PMs in assigned activity and differentiate them. (#27)
* FEATURE: Display PMs in assigned activity and differentiate them.

* FEATURE: Unassign/Re-assign tasks from the activity view

* Remove bulkAssign. Reuse assign/unassign with a service. Change PM icon position

* Reuse ListItemDefaults instead of duplicating code.

* Conditionally show/hide feature if list items defaults is present in core
2019-05-07 16:30:47 +10: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
Bianca Nenciu 801b1cd48c FIX: Check if topic is assigned before assigning again. (#25) 2019-03-15 18:49:22 +01:00
Gerhard Schlager 5527457ce2 FIX: Do not unassign on topic open 2019-01-10 20:58:20 +01:00
Bianca Nenciu 89f794cf83 FEATURE: Add events for assigning and unassigning topics. (#24) 2019-01-09 16:59:26 +11:00
Bianca Nenciu 0299deaf25 FIX: Unassign on autoclose. 2018-11-21 15:49:07 +02:00
Penar Musaraj c6f21b667a Support FA5 SVG icons 2018-11-07 09:27:15 -05:00
Vinoth Kannan bb44fd469c FIX: Do not raise error if topic not exist 2018-09-21 09:52:21 +05:30
Sam 8ad7304bdd FIX: can now correctly unassign corrupt topics
if a topic is somehow assigned to an array we can correctly unassign
2018-09-04 15:10:17 +10:00
Régis Hanol 5800f768f5 FIX: properly unassign topics if there are no **more** flags to handle 2018-08-14 18:20:00 +02:00
Joshua Rosenfeld 962c4bf836
URL was missing from plugin.rb 2018-06-11 11:47:43 -04:00
Guo Xiang Tan fe68b6cc88 FIX: Don't unassign topic on flag reviewed if topic has been deleted.
* Should have a test for this.
2018-05-25 16:40:00 +08:00
Guo Xiang Tan e1c7869969 UX: Add margin to assign-controls on mobile. 2018-05-24 14:44:13 +08:00
Guo Xiang Tan 4e53bf1962 FIX: Include `assigned_messages_count` only when viewing assigned list. 2018-05-24 11:49:49 +08:00
Guo Xiang Tan e48ed99dfe Show assigned messages count as long as assigns is enabled. 2018-05-24 10:51:04 +08:00
Andrew Schleifer 863de29e1d FIX Extra blank line detected 2018-05-23 11:11:24 -05:00
Guo Xiang Tan 22108df6be FEATURE: Display link with count to user's assigned messages page. 2018-05-23 18:16:36 +08:00
Robin Ward 754209ce58 Add "Unassign All" button to user's assigned topics view 2018-05-04 13:41:04 -04:00
Arpit Jalan c24083df5c Remove 'archive' tab for assigned topics. 2018-03-26 22:49:34 +05:30
Guo Xiang Tan 463f77bb2a FEATURE: Add live updates for "assigned" private messages. 2018-03-07 23:02:13 +08:00
Robin Ward 8ee1cbd697 FIX: Unassign topics if there are no more flags to handle 2018-02-26 16:15:22 -05:00
Robin Ward 569a87b136 FEATURE: New site setting to ensure flags are claimed 2018-01-12 16:09:46 -05:00