Skip to content

Commit

Permalink
Add anchor to ActivityLog ApplicationForm link
Browse files Browse the repository at this point in the history
  • Loading branch information
inulty-dfe committed Oct 23, 2023
1 parent 7214f77 commit b0c0d30
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/components/provider_interface/activity_log/application_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@ def initialize(event:)
def event_description
"#{section.humanize} edited"
end

def link
application_link("#{section.tr('_', '-')}-section")
end

def application_link(anchor = nil)
{
url: routes.provider_interface_application_choice_path(event.application_choice, anchor:),
text: 'View application',
}
end

def routes
@_routes ||= Rails.application.routes.url_helpers
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ def link
feedback_link
elsif event.audit.auditable.is_a?(Interview)
interview_link(event.audit)
elsif event.audit.auditable.is_a?(ApplicationForm)
auditable_adapter(@event.audit.auditable_type).link
else
application_link
end
Expand Down

0 comments on commit b0c0d30

Please sign in to comment.