Commit Graph

19 Commits

Author SHA1 Message Date
Loïc Guitaut c696e44714 FIX: Recreate notifications on topic reopening
Currently, when reopening a topic that has assignments, the
notifications in the user menu aren’t recreated.

This patch fixes that issue. It also addresses the same type of issue
with posts being destroyed and recovered.
2024-03-18 10:56:08 +01:00
Loïc Guitaut c33297316a
DEV: Fix new Rubocop offenses (#548) 2024-02-29 18:23:48 +01: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
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
David Taylor 4902ba6993
DEV: Bump rubocop-discourse and correct violations (#409) 2022-12-23 19:55:31 +00:00
Rafael dos Santos Silva 6116f26642 DEV: Apply syntax_tree formatting 2022-07-27 13:48:51 -03:00
Jarek Radosz 3a147fcb88
FIX: Broken reviewable filter (#318) 2022-04-23 01:31:36 +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
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
Ahmed Gagan cd31a821fc
UX: Only show assigned tab for groups where all users can assign (#103) 2020-08-28 15:18:25 +01: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 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
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