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

Fix dates in view licence set up tab #1175

Merged
merged 10 commits into from
Jul 9, 2024

Conversation

Cruikshanks
Copy link
Member

@Cruikshanks Cruikshanks commented Jul 9, 2024

https://eaflood.atlassian.net/browse/WATER-4556

Part of the work to replace the legacy view licence page

In testing of the new view licence page, specifically the licence set up tab, it was spotted that when a charge version has a status of REVIEW that the date the record was created rather than the start date is displayed in the charge information table.

This is because the record is not a charge version; it is a workflow record, which, when approved, will become a charge version record. The current presenter logic is not distinguishing between the different types of workflow records, hence the wrong date being displayed.

But hold on. A quick review of the legacy version of the tab shows that when a workflow record does not have a status of REVIEW we don't show any dates at all!

Then we spotted that there is inconsistency about whether we use a dash in the end date column. The charge information table does, but the return requirements and agreements tables don't.

So, this change is a general fix-up of dates in the tab.

  • for workflow records in REVIEW show the start date from the stored charge version details
  • for all tables where a date is not set, stop displaying -
  • do not display any dates for workflow records that have a status other than REVIEW

https://eaflood.atlassian.net/browse/WATER-4556

> Part of the work to replace the legacy view licence page

In testing of the new view licence page, specifically the licence set up tab it was spotted that when a charge version has a status of `REVIEW` that the date the record was created rather than the start date is displayed in the charge information table.

This is because the record is not a charge version; it is a workflow record which when approved will become a charge version record. The current presenter logic is not distinguishing between the different types of workflow record hence the wrong date being displayed.

But hold on. A quick review of the legacy version of the tab shows that when a workflow record does not have a status of `REVIEW` we don't show any dates at all!

Then we spotted that there is inconsistency about whether we use a dash in the end date column. The charge information table does, but the return requirements and agreements tables don't.

So, this change is a general fix up of dates in the tab.

- for workflow records in `REVIEW` show the start date from the stored charge version details
- for all tables, where end date is not set display a `-`
- do not display any dates for workflow records that have a status other than `REVIEW`
@Cruikshanks Cruikshanks added the bug Something isn't working label Jul 9, 2024
@Cruikshanks Cruikshanks self-assigned this Jul 9, 2024
We do a little housekeeping to bring the presenter's tests a little closer to our conventions and deal with some linting issues. We also make the starting data more realistic by aligning the dates and not populating te end dates.

Beyond that we change the assertions in the tests to match how we expect the data to be displayed in the page.
@Cruikshanks Cruikshanks force-pushed the fix-start-date-in-charge-versions-view branch from fd6f388 to 9eb615a Compare July 9, 2024 12:21
@Cruikshanks Cruikshanks marked this pull request as ready for review July 9, 2024 12:51
Copy link
Contributor

@Jozzey Jozzey left a comment

Choose a reason for hiding this comment

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

@Cruikshanks Cruikshanks merged commit 518cee2 into main Jul 9, 2024
6 checks passed
@Cruikshanks Cruikshanks deleted the fix-start-date-in-charge-versions-view branch July 9, 2024 13:21
Cruikshanks added a commit that referenced this pull request Jul 9, 2024
https://eaflood.atlassian.net/browse/WATER-4556

In testing of the new view licence page, specifically the licence set up tab, it was spotted that when a charge version has a status of `REVIEW` that the date the record was created rather than the start date is displayed in the charge information table.

We fixed that in [Fix dates in view licence set up tab](#1175). But hot on its heels someone has pointed out the same applies for a workflow record with a status of `changes_requested`.

So, this change fixes it so we display the charge version start date for a workflow record with a status of `changes_requested` in the charge information table of the Licence setup tab in our new view licence page.
Cruikshanks added a commit that referenced this pull request Jul 9, 2024
https://eaflood.atlassian.net/browse/WATER-4556

In testing of the new view licence page, specifically the licence set up tab, it was spotted that when a charge version has a status of `REVIEW` that the date the record was created rather than the start date is displayed in the charge information table.

We fixed that in [Fix dates in view licence set up tab](#1175). But hot on its heels, someone has pointed out that the same applies for a workflow record with a status of `changes_requested`.

So, this change fixes it, so we display the charge version start date for a workflow record with a status of `changes_requested` in the charge information table of the Licence setup tab in our new view licence page.

---

Because this meant looking at another workflow status, we needed to check that everything was linked up for `changes_requested`. This led us to take another look at how the status for each record type in the tab was being determined. We decided to split the types to give us more flexibility and use the same convention we've used in other tags, i.e. pass the record status through and let the macro handle the display.

So, a change to our tag macros was also made in this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants