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

Show offence ID on check your answers and full referral pages #665

Merged
merged 1 commit into from
Oct 4, 2023

Conversation

libuk
Copy link
Contributor

@libuk libuk commented Oct 4, 2023

Context

This is a redo of a previous PR which was approved but failed CI. This PR is exactly the same, bar a fix to the e2e test to prevent it failing.

HPTs currently have no way of knowing which index offence a referral belongs to and are having to ask the CPP, therefore, we want to show the offence ID on the referral page under the 'sentence information' section.

To achieve this we are adding the offence ID to the response of the first page of the 'sentence information' task. As there is no way to change the offence ID without starting a new referral, we hide the "change" action on the check your answers page.

This isn't an ideal solution as it doesn't follow the conventions of the other form pages, but here is some rationale:

  • Offence ID is fetched by the server without the need for user input. We only ask the user to choose an offence ID if more than one offence is retrieved from the API. This means making a TaskListPage for offence ID non-trivial and would require a different approach to what we have now. Given there are limited dev days left on CAS3, taking on this work isn't feasible.

  • I thought about adding a new type of TaskListPage which wouldn't be visible to the user, but changing the existing domain model for this one instance felt a bit premature, and would still be a good chunk of work.

  • The solution in this commit is a hack but is fairly non-invasive and easy to change in the future.

Let me know if this is something you've encountered in CAS1/CAS2. Alternative solutions are welcome!

Changes in this PR

Screenshots of UI changes

Before

referral_before
check_your_answers_before

After

referral_after
check_your_answers_after

Release checklist

Release process documentation.

Pre-merge checklist

  • Are any changes required to dependent services for this change to work?
    (eg. CAS API)
  • Have they been released to production already?

Post-merge checklist

@libuk libuk force-pushed the change/1595-show-index-offence-id-in-referral branch from e7ac526 to 428fed9 Compare October 4, 2023 14:35
HPTs currently have no way of knowing which index offence a referral
belongs to and are having to ask the CPP, therefore, we want to show the
offence ID on the referral page under the 'sentence information' section.

To achieve this we are adding the offence ID to the response of the
first page of the 'sentence information' task. As there is no way to
change the offence ID without starting a new referral, we hide the
"change" action on the check your answers page.

This isn't an ideal solution as it doesn't follow the conventions of the
other form pages, but here is some rationale:

* Offence ID is fetched by the server without the need for user input.
  We only ask the user to choose an offence ID if more than one offence
  is retrieved from the API. This means making a TaskListPage for
  offence ID non-trivial and would require a different approach to what we
  have now. Given there are limited dev days left on CAS3, taking on this
  work isn't feasible.

* I thought about adding a new type of TaskListPage which wouldn't be
  visible to the user, but changing the existing domain model for this
  one instance felt a bit premature, and would still be a good chunk of
  work.

* The solution in this commit is a hack, but is fairly non-invasive and
  easy to change in the future.
@libuk libuk force-pushed the change/1595-show-index-offence-id-in-referral branch from 428fed9 to 15e8c13 Compare October 4, 2023 15:35
@libuk libuk marked this pull request as ready for review October 4, 2023 16:37
Copy link
Contributor

@edavey edavey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@edavey
Copy link
Contributor

edavey commented Oct 4, 2023

@libuk sorry I thought this was for a rollback. You might want some CAS3 eyes on this!

@libuk
Copy link
Contributor Author

libuk commented Oct 4, 2023

Thanks @edavey. @richpjames approved it initially, but it failed on CI due to an e2e test. This PR just adds a fix to stop it failing.

Given it was approved and merged before, I'm going to go ahead and merge, but I've updated the PR description for clarity.

@libuk libuk merged commit de419d8 into main Oct 4, 2023
3 checks passed
@libuk libuk deleted the change/1595-show-index-offence-id-in-referral branch October 4, 2023 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants