-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create views for claim activity #1347
base: main
Are you sure you want to change the base?
Conversation
app/views/claims/support/claims/claim_activities/_manual_activities.html.erb
Outdated
Show resolved
Hide resolved
app/views/claims/support/claims/claim_activities/_payment_and_clawback_activities.html.erb
Outdated
Show resolved
Hide resolved
app/views/claims/support/claims/claim_activities/_sampling_activities.html.erb
Outdated
Show resolved
Hide resolved
Includes addition of new mailers, services and updated test logic
Deployments
|
app/controllers/claims/support/claims/claim_activities_controller.rb
Outdated
Show resolved
Hide resolved
|
||
<h2 class="govuk-heading-m"><%= t(".providers") %></h2> | ||
|
||
<% claim_activity.record.claims.group_by(&:provider).each do |provider, provider_claims| %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personal preference: I'm not a fan of seeing group_by
in a view. Could we extract this to the Claims::ClaimActivity
model?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd normally agree but in this case it's specific to certain types claim activity so it would error when used outside this particular scope, any suggestions for where it should live based on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would still argue it belongs in the model. Even with a try
or guard clause for the cases when it `shouldn't (but probably should) work.
ee57128
to
8d7e50b
Compare
8d7e50b
to
5ed56bb
Compare
case claim_activity.action | ||
when "payment_request_delivered" | ||
Claims::Payment::ResendEmail.call(payment: claim_activity.record) | ||
when "clawback_request_delivered" | ||
Claims::Clawback::ResendEmail.call(clawback: claim_activity.record) | ||
else | ||
raise "Unknown action: #{claim_activity.action}" | ||
end | ||
|
||
authorize [:claims, claim_activity] | ||
redirect_to claims_support_claims_claim_activity_path(claim_activity), flash: { success: true, heading: t(".success") } | ||
end | ||
|
||
def resend_provider_email | ||
Claims::Sampling::ResendEmails.call(provider_sampling:) | ||
|
||
authorize [:claims, claim_activity] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still a couple of authorize
calls need to be moved. Otherwise you send emails they might not be allowed to.
9da9ac1
to
82153d1
Compare
Context
The activity log was not particularly useful for our users, so we have expanded the information available on the page.
Changes proposed in this pull request
Guidance to review
Link to Trello card
Create audit log screens
Screenshots