mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-12 07:06:16 +08:00
Merge pull request #8608 from andrej-scinote/aj_SCI_11960
Add notifications for user groups [SCI-11960]
This commit is contained in:
commit
34bedcd9ad
5 changed files with 54 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
import { createApp } from 'vue/dist/vue.esm-bundler.js';
|
||||
import PerfectScrollbar from 'vue3-perfect-scrollbar';
|
||||
import { PerfectScrollbar } from 'vue3-perfect-scrollbar';
|
||||
import UserGroupShow from '../../vue/user_groups/show.vue';
|
||||
import { mountWithTurbolinks } from './helpers/turbolinks.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { createApp } from 'vue/dist/vue.esm-bundler.js';
|
||||
import PerfectScrollbar from 'vue3-perfect-scrollbar';
|
||||
import { PerfectScrollbar } from 'vue3-perfect-scrollbar';
|
||||
import UserGroupsTable from '../../vue/user_groups/index.vue';
|
||||
import { mountWithTurbolinks } from './helpers/turbolinks.js';
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
module Recipients
|
||||
class AssignedUserGroupRecipients
|
||||
def initialize(params)
|
||||
@params = params
|
||||
end
|
||||
|
||||
def recipients
|
||||
activity = Activity.find(@params[:activity_id])
|
||||
UserGroup.find_by(id: activity.values.dig('message_items', 'user_group', 'id'))&.users
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -108,6 +108,34 @@ class NotificationExtends
|
|||
code: 94,
|
||||
recipients_module: :UserChangedRecipient
|
||||
},
|
||||
add_group_user_member_activity: {
|
||||
code: 382,
|
||||
recipients_module: :AssignedRecipients
|
||||
},
|
||||
remove_group_user_member_activity: {
|
||||
code: 383,
|
||||
recipients_module: :AssignedRecipients
|
||||
},
|
||||
project_access_granted_user_group_activity: {
|
||||
code: 390,
|
||||
recipients_module: :AssignedUserGroupRecipients
|
||||
},
|
||||
project_access_changed_user_group_activity: {
|
||||
code: 391,
|
||||
recipients_module: :AssignedUserGroupRecipients
|
||||
},
|
||||
project_access_revoked_user_group_activity: {
|
||||
code: 392,
|
||||
recipients_module: :AssignedUserGroupRecipients
|
||||
},
|
||||
experiment_access_changed_user_group_activity: {
|
||||
code: 393,
|
||||
recipients_module: :AssignedUserGroupRecipients
|
||||
},
|
||||
my_module_access_changed_user_group_activity: {
|
||||
code: 394,
|
||||
recipients_module: :AssignedUserGroupRecipients
|
||||
},
|
||||
delivery: {
|
||||
recipients_module: :DirectRecipient
|
||||
}
|
||||
|
|
@ -140,12 +168,17 @@ class NotificationExtends
|
|||
unassign_user_from_project_activity
|
||||
project_grant_access_to_all_team_members_activity
|
||||
project_remove_access_from_all_team_members_activity
|
||||
project_access_granted_user_group_activity
|
||||
project_access_revoked_user_group_activity
|
||||
],
|
||||
project_experiment_role_change: %I[
|
||||
change_user_role_on_project_activity
|
||||
change_user_role_on_experiment_activity
|
||||
change_user_role_on_my_module_activity
|
||||
project_access_changed_all_team_members_activity
|
||||
project_access_changed_user_group_activity
|
||||
experiment_access_changed_user_group_activity
|
||||
my_module_access_changed_user_group_activity
|
||||
],
|
||||
project_due_date: %I[
|
||||
projects_due_date_reminder
|
||||
|
|
@ -171,6 +204,10 @@ class NotificationExtends
|
|||
remove_user_from_team
|
||||
change_users_role_on_team_activity
|
||||
],
|
||||
other_user_group_member: %I[
|
||||
add_group_user_member_activity
|
||||
remove_group_user_member_activity
|
||||
],
|
||||
always_on: %I[
|
||||
delivery
|
||||
]
|
||||
|
|
|
|||
|
|
@ -4342,6 +4342,7 @@ en:
|
|||
other_team_invitation: "You were invited or removed from the team"
|
||||
experiment_due_date: "Due date reminder if you have Owner or User access role on a Experiment"
|
||||
project_due_date: "Due date reminder if you have Owner access role on a Project"
|
||||
other_user_group_member: "You were added or removed from the group"
|
||||
content:
|
||||
my_module_due_date_reminder:
|
||||
title_html: "Task due date reminder"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue