Skip to content

Commit

Permalink
Add missing title and fix end date in view licence
Browse files Browse the repository at this point in the history
https://eaflood.atlassian.net/browse/WATER-4322

Whilst working on [Add registered user modifier to LicenceModel](#693) we spotted the that the new view licence page is missing its title.

So this PR change was originally intended to fix just that. As part of it we spotted that there was no direct unit test for the `ViewLicencePresenter` so we included adding that as well.

But when doing so we spotted an inconsistency with the end date and the warning. If the licence's `expiredDate` is null or less than today's date then we return `null`. We only want to show the **End date** field when a licence is not yet 'ended' but has an expiry date.

But if the licence has an expired date equal to today then we will return a formatted date string and show the field in the view. The problem is the logic in `_generateWarningMessage()` determines a warning message is needed if a licence's end date is equal to today or less.

Basically, if a licence's `expiredDate` matches the current date (today) we'll show both the **End date** field and the warning message.

So, this change also clears that issue up!
  • Loading branch information
Cruikshanks committed Jan 27, 2024
1 parent 78a665b commit 1a5d8bc
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 1a5d8bc

Please sign in to comment.