2023-10-19 17:33:40 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-10-12 16:40:01 +08:00
|
|
|
class NotificationExtends
|
|
|
|
NOTIFICATIONS_TYPES = {
|
|
|
|
designate_user_to_my_module_activity: {
|
|
|
|
code: 13,
|
|
|
|
recipients_module: :MyModuleDesignatedRecipients
|
|
|
|
},
|
|
|
|
undesignate_user_from_my_module_activity: {
|
|
|
|
code: 14,
|
|
|
|
recipients_module: :MyModuleDesignatedRecipients
|
|
|
|
},
|
|
|
|
my_module_due_date_reminder: {
|
|
|
|
recipients_module: :MyModuleDesignatedRecipients
|
|
|
|
},
|
|
|
|
add_comment_to_module_activity: {
|
|
|
|
code: 35,
|
|
|
|
recipients_module: :MyModuleDesignatedRecipients
|
|
|
|
},
|
|
|
|
edit_module_comment_activity: {
|
|
|
|
code: 36,
|
|
|
|
recipients_module: :MyModuleDesignatedRecipients
|
|
|
|
},
|
|
|
|
delete_module_comment_activity: {
|
|
|
|
code: 37,
|
|
|
|
recipients_module: :MyModuleDesignatedRecipients
|
|
|
|
},
|
|
|
|
add_comment_to_step_activity: {
|
|
|
|
code: 17,
|
|
|
|
recipients_module: :MyModuleDesignatedRecipients
|
|
|
|
},
|
|
|
|
edit_step_comment_activity: {
|
|
|
|
code: 38,
|
|
|
|
recipients_module: :MyModuleDesignatedRecipients
|
|
|
|
},
|
|
|
|
delete_step_comment_activity: {
|
|
|
|
code: 39,
|
|
|
|
recipients_module: :MyModuleDesignatedRecipients
|
|
|
|
},
|
|
|
|
add_comment_to_result_activity: {
|
|
|
|
code: 24,
|
|
|
|
recipients_module: :MyModuleDesignatedRecipients
|
|
|
|
},
|
|
|
|
edit_result_comment_activity: {
|
|
|
|
code: 40,
|
|
|
|
recipients_module: :MyModuleDesignatedRecipients
|
|
|
|
},
|
|
|
|
delete_result_comment_activity: {
|
|
|
|
code: 41,
|
|
|
|
recipients_module: :MyModuleDesignatedRecipients
|
|
|
|
},
|
|
|
|
assign_user_to_project_activity: {
|
|
|
|
code: 5,
|
|
|
|
recipients_module: :AssignedRecipients
|
|
|
|
},
|
|
|
|
unassign_user_from_project_activity: {
|
|
|
|
code: 7,
|
|
|
|
recipients_module: :AssignedRecipients
|
|
|
|
},
|
|
|
|
project_grant_access_to_all_team_members_activity: {
|
|
|
|
code: 242,
|
|
|
|
recipients_module: :AssignedGroupRecipients
|
|
|
|
},
|
|
|
|
project_remove_access_from_all_team_members_activity: {
|
|
|
|
code: 243,
|
|
|
|
recipients_module: :AssignedGroupRecipients
|
|
|
|
},
|
|
|
|
change_user_role_on_project_activity: {
|
|
|
|
code: 6,
|
|
|
|
recipients_module: :AssignedRecipients
|
|
|
|
},
|
|
|
|
change_user_role_on_experiment_activity: {
|
|
|
|
code: 165,
|
|
|
|
recipients_module: :AssignedRecipients
|
|
|
|
},
|
|
|
|
change_user_role_on_my_module_activity: {
|
|
|
|
code: 166,
|
|
|
|
recipients_module: :AssignedRecipients
|
|
|
|
},
|
|
|
|
item_low_stock_reminder: {
|
2023-11-07 00:25:48 +08:00
|
|
|
recipients_module: :RepositoryRowCreator
|
2023-10-12 16:40:01 +08:00
|
|
|
},
|
|
|
|
item_date_reminder: {
|
2023-11-07 00:25:48 +08:00
|
|
|
recipients_module: :RepositoryRowCreator
|
2023-10-12 16:40:01 +08:00
|
|
|
},
|
|
|
|
smart_annotation_added: {
|
|
|
|
recipients_module: :AnnotatedRecipients
|
|
|
|
},
|
|
|
|
invite_user_to_team_activity: {
|
|
|
|
code: 92,
|
|
|
|
recipients_module: :AssignedRecipients
|
|
|
|
},
|
|
|
|
remove_user_from_team_activity: {
|
|
|
|
code: 93,
|
|
|
|
recipients_module: :AssignedRecipients
|
|
|
|
},
|
|
|
|
change_users_role_on_team_activity: {
|
|
|
|
code: 94,
|
|
|
|
recipients_module: :AssignedRecipients
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
NOTIFICATIONS_GROUPS = {
|
|
|
|
my_module: {
|
2023-10-13 19:54:59 +08:00
|
|
|
my_module_designation: %I[
|
2023-10-12 16:40:01 +08:00
|
|
|
designate_user_to_my_module_activity
|
|
|
|
undesignate_user_from_my_module_activity
|
|
|
|
],
|
2023-10-13 19:54:59 +08:00
|
|
|
my_module_modified: %I[],
|
|
|
|
my_module_due_date: %I[
|
2023-10-12 16:40:01 +08:00
|
|
|
my_module_due_date_reminder
|
|
|
|
],
|
2023-10-13 19:54:59 +08:00
|
|
|
my_module_comments: %I[
|
2023-10-12 16:40:01 +08:00
|
|
|
add_comment_to_module_activity
|
|
|
|
edit_module_comment_activity
|
|
|
|
delete_module_comment_activity
|
|
|
|
add_comment_to_step_activity
|
|
|
|
edit_step_comment_activity
|
|
|
|
delete_step_comment_activity
|
|
|
|
add_comment_to_result_activity
|
|
|
|
edit_result_comment_activity
|
|
|
|
delete_result_comment_activity
|
|
|
|
]
|
|
|
|
},
|
|
|
|
project_experiment: {
|
2023-10-13 19:54:59 +08:00
|
|
|
project_experiment_access: %I[
|
2023-10-12 16:40:01 +08:00
|
|
|
assign_user_to_project_activity
|
|
|
|
unassign_user_from_project_activity
|
|
|
|
project_grant_access_to_all_team_members_activity
|
|
|
|
project_remove_access_from_all_team_members_activity
|
|
|
|
],
|
2023-10-13 19:54:59 +08:00
|
|
|
project_experiment_role_change: %I[
|
2023-10-12 16:40:01 +08:00
|
|
|
change_user_role_on_project_activity
|
|
|
|
change_user_role_on_experiment_activity
|
|
|
|
change_user_role_on_my_module_activity
|
|
|
|
]
|
|
|
|
},
|
|
|
|
repository: {
|
2023-10-13 19:54:59 +08:00
|
|
|
repository_stock: %I[
|
2023-10-12 16:40:01 +08:00
|
|
|
item_low_stock_reminder
|
|
|
|
],
|
2023-10-13 19:54:59 +08:00
|
|
|
repository_date_reminder: %I[
|
2023-10-12 16:40:01 +08:00
|
|
|
item_date_reminder
|
|
|
|
]
|
|
|
|
},
|
|
|
|
other: {
|
2023-10-13 19:54:59 +08:00
|
|
|
other_smart_annotation: %I[
|
2023-10-12 16:40:01 +08:00
|
|
|
smart_annotation_added
|
|
|
|
],
|
2023-10-13 19:54:59 +08:00
|
|
|
other_team_invitation: %I[
|
2023-10-12 16:40:01 +08:00
|
|
|
invite_user_to_team_activity
|
|
|
|
remove_user_from_team_activity
|
|
|
|
change_users_role_on_team_activity
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
end
|