Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Display assignments in user menu properly #507

Merged
merged 1 commit into from
Nov 8, 2023
Merged

Conversation

Flink
Copy link
Contributor

@Flink Flink commented Sep 7, 2023

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 PR 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.

@Flink Flink self-assigned this Sep 7, 2023
@Flink Flink force-pushed the loic-fix-user-menu branch from 615d464 to bc44425 Compare September 7, 2023 14:26
@Flink Flink force-pushed the loic-fix-user-menu branch from 3874e57 to 4317de9 Compare October 10, 2023 09:49
@Flink Flink force-pushed the loic-fix-user-menu branch 2 times, most recently from 722951a to 6503fc7 Compare October 23, 2023 15:27
@Flink Flink force-pushed the loic-fix-user-menu branch from 288c28d to 6125595 Compare October 26, 2023 16:10
@Flink Flink marked this pull request as ready for review October 26, 2023 16:17
@rishabhnambiar
Copy link
Member

I'll wave to @nlalonde / @heymarkreeves for a review when they have space 👋

@Flink Flink force-pushed the loic-fix-user-menu branch 3 times, most recently from 7824f24 to 2f998ab Compare November 8, 2023 10:31
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.
@Flink Flink force-pushed the loic-fix-user-menu branch from 2f998ab to b75a0d3 Compare November 8, 2023 13:11
@Flink Flink merged commit 80604e9 into main Nov 8, 2023
5 checks passed
@Flink Flink deleted the loic-fix-user-menu branch November 8, 2023 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants