From 58bffc5c6671fa7c751bbe5c76bb0ad4675c683e Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 1 Jun 2021 18:08:03 +0200 Subject: [PATCH] WIP notification settings Signed-off-by: Thomas Citharel --- js/src/components/Comment/Comment.vue | 47 +-- js/src/components/Comment/CommentTree.vue | 49 ++-- js/src/graphql/comment.ts | 3 + js/src/graphql/user.ts | 32 ++ js/src/registerServiceWorker.ts | 4 +- js/src/types/comment.model.ts | 4 + js/src/types/current-user.model.ts | 7 + js/src/views/Settings/Notifications.vue | 275 +++++++++++++++++- .../activity_stream/converter/comment.ex | 6 +- .../resolvers/users/activity_settings.ex | 26 ++ lib/graphql/schema.ex | 2 + lib/graphql/schema/discussions/comment.ex | 8 + lib/graphql/schema/user.ex | 6 + lib/graphql/schema/users/activity_setting.ex | 23 ++ lib/mobilizon/activities/activities.ex | 2 +- lib/mobilizon/discussions/comment.ex | 2 + lib/mobilizon/users/activity_setting.ex | 34 +++ lib/mobilizon/users/users.ex | 44 ++- lib/service/activity/comment.ex | 150 ++++++++-- lib/service/activity/renderer/comment.ex | 111 +++++++ lib/service/activity/renderer/renderer.ex | 13 +- lib/service/notifier/email.ex | 36 ++- lib/service/notifier/filter.ex | 60 ++++ lib/service/notifier/push.ex | 43 ++- .../workers/legacy_notifier_builder.ex | 71 +++++ lib/web/email/activity.ex | 53 +++- .../activity/_comment_activity_item.html.eex | 31 ++ .../activity/_comment_activity_item.text.eex | 15 +- .../email/email_direct_activity.html.eex | 66 +++-- .../email/email_direct_activity.text.eex | 2 + ...on_and_last_notification_date_settings.exs | 4 +- ...10526203337_add_user_activity_settings.exs | 15 + ...082412_add_is_announcement_to_comments.exs | 9 + ...2613_fix_user_settings_nullable_fields.exs | 10 + 34 files changed, 1127 insertions(+), 136 deletions(-) create mode 100644 lib/graphql/resolvers/users/activity_settings.ex create mode 100644 lib/graphql/schema/users/activity_setting.ex create mode 100644 lib/mobilizon/users/activity_setting.ex create mode 100644 lib/service/activity/renderer/comment.ex create mode 100644 lib/service/notifier/filter.ex create mode 100644 lib/service/workers/legacy_notifier_builder.ex create mode 100644 priv/repo/migrations/20210526203337_add_user_activity_settings.exs create mode 100644 priv/repo/migrations/20210601082412_add_is_announcement_to_comments.exs create mode 100644 priv/repo/migrations/20210601082613_fix_user_settings_nullable_fields.exs diff --git a/js/src/components/Comment/Comment.vue b/js/src/components/Comment/Comment.vue index 63cfd50aa..ea904c129 100644 --- a/js/src/components/Comment/Comment.vue +++ b/js/src/components/Comment/Comment.vue @@ -6,32 +6,26 @@ :id="commentId" >
- +
- +
@@ -39,19 +33,21 @@ {{ comment.actor.name }} - @{{ usernameWithDomain(comment.actor) }} - - {{ - formatDistanceToNow(new Date(comment.updatedAt), { - locale: $dateFnsLocale, - addSuffix: true, - }) - }} - + {{ + usernameWithDomain(comment.actor) + }} {{ $t("[deleted]") }} + + {{ + formatDistanceToNow(new Date(comment.updatedAt), { + locale: $dateFnsLocale, + addSuffix: true, + }) + }} +