diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index cd9d6c0d4f..11460eab78 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -6,13 +6,20 @@ def base_notifiable_url_params(notification) { controller: 'evaluations', action: 'overview', id: notification.notifiable_id } if notification.notifiable_type == 'Evaluation' end - def notifiable_url(notification) + def notifiable_path(notification) return exports_path(highlighted: notification.notifiable_id) if notification.notifiable_type == 'Export' return submission_path(notification.notifiable_id, anchor: 'code') if notification.notifiable_type == 'Submission' overview_evaluation_path(notification.notifiable_id) if notification.notifiable_type == 'Evaluation' end + def notifiable_url(notification) + return exports_url(highlighted: notification.notifiable_id, format: :json) if notification.notifiable_type == 'Export' + return submission_url(notification.notifiable_id, anchor: 'code', format: :json) if notification.notifiable_type == 'Submission' + + overview_evaluation_url(notification.notifiable_id, format: :json) if notification.notifiable_type == 'Evaluation' + end + def notifiable_icon(notification) return 'mdi-file-download-outline' if notification.notifiable_type == 'Export' return 'mdi-comment-account-outline' if notification.notifiable_type == 'Submission' diff --git a/app/views/notifications/_notification.json.jbuilder b/app/views/notifications/_notification.json.jbuilder index 9a8e3b9491..a8e4da0079 100644 --- a/app/views/notifications/_notification.json.jbuilder +++ b/app/views/notifications/_notification.json.jbuilder @@ -1,3 +1,4 @@ json.extract! notification, :id, :message, :read, :created_at, :updated_at json.url notification_url(notification, format: :json) +json.notifiable_path notifiable_path(notification) json.notifiable_url notifiable_url(notification) diff --git a/app/views/notifications/_notifications_table.html.erb b/app/views/notifications/_notifications_table.html.erb index 5a81e34e03..4ada17a4d6 100644 --- a/app/views/notifications/_notifications_table.html.erb +++ b/app/views/notifications/_notifications_table.html.erb @@ -14,7 +14,7 @@