Commit Graph

12 Commits

Author SHA1 Message Date
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
Bianca Nenciu d8821aa16d
DEV: Promote historic post_deploy migrations (#402)
This commit promotes all post_deploy migrations which existed in
Discourse v2.8.0 (timestamp <= 20220107014925)
2022-12-19 17:28:09 +02:00
Rafael dos Santos Silva 6116f26642 DEV: Apply syntax_tree formatting 2022-07-27 13:48:51 -03: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 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 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 5124ba0f67
FIX: assignment table migration when SKIP_POST_DEPLOYMENT_MIGRATIONS (#217)
We need two branches of that migration. One when `assigned_to_type` is missing and another when `assigned_to_type` exists.

https://meta.discourse.org/t/db-migration-version-20210714173022-fails-when-having-skipped-post-deployment-migrations-before/204660
2021-09-29 18:33:45 +10:00
Jarek Radosz 09b7655206
FIX: Handle invalid source data in CF migration (#172) 2021-07-14 22:02:27 +02:00
Jarek Radosz b0a480fd35
FIX: CF to table migration was incorrect (#171)
The order of values in the `INSERT` query was invalid (`assigned_to_id` and `topic_id` were swapped)

Co-authored-by: David Taylor <david@taylorhq.com>
2021-07-14 20:45:31 +02:00
Jarek Radosz 470dd939aa
DEV: Move assignments from custom fields to a table (#169) 2021-07-14 10:48:19 +02:00
Jarek Radosz 573c608057
DEV: Avoid nil custom fields (#154)
Included:

* DEV: Topic#custom_fields is always truthy
* DEV: Delete custom fields instead of setting nil
* DEV: Delete existing nil custom fields
2021-05-05 11:15:50 +02:00