Skip to content
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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open

Create views for claim activity #1347

wants to merge 11 commits into from

Conversation

Kizr
Copy link
Contributor

@Kizr Kizr commented Jan 27, 2025

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

  • Add new titles via a decorator for all activity log actions
  • Add a show page for different types of activity to provide the user with more information
  • Add missed activity log creation for payment actions

Guidance to review

  • Log in as Colin
  • Go through the entire flow end-to-end including rejection flows and then review the history that was created
  • Ensure that you can download the CSV's, re-send emails and view the claims via the links

Link to Trello card

Create audit log screens

Screenshots

image
image
image
image
image
image
image
image
image
image

@Kizr Kizr self-assigned this Jan 27, 2025
@Kizr Kizr added the deploy A Review App will be created for PRs with this label label Jan 31, 2025
@Kizr Kizr marked this pull request as ready for review January 31, 2025 12:12
@Kizr Kizr requested review from a team as code owners January 31, 2025 12:12
Copy link


<h2 class="govuk-heading-m"><%= t(".providers") %></h2>

<% claim_activity.record.claims.group_by(&:provider).each do |provider, provider_claims| %>
Copy link
Contributor

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?

Copy link
Contributor Author

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?

Copy link
Contributor

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.

@Kizr Kizr force-pushed the ba/add-audit-screens branch from 8d7e50b to 5ed56bb Compare January 31, 2025 14:48
@dp-daly dp-daly requested review from dp-daly and removed request for dp-daly January 31, 2025 15:15
Comment on lines 21 to 37
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]
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy A Review App will be created for PRs with this label
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants