-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix registered to link in view licence (#1291)
https://eaflood.atlassian.net/browse/WATER-4650 The new view licence page went live in the [release today](https://github.com/DEFRA/water-abstraction-system/releases/tag/v0.20.0). But users have found if a licence has a registered user, and you click the link to see their status, it results in a 'page not found'. After looking at the issue, we thought that we had lost the ability to add the user ID to the link at some point. Having dug into the `registeredToAndLicenceName()` modifier, we see it pulls out the correct name to display. However, the view is expecting something to set `primaryUser.userId`. After double-checking the existing code and the original PR, we found no other reference to this. To pull out the user ID for the 'registered to' user, you need to be able to link `public.licence_entities` to `public.users`. However, this is impossible because we are not including `idm.users.external_id` in our `public.users` view! So, this isn't a bug that's crept in; this has been here since day 1! Doh! 😱🤦 This means this minor fix ended up exploding in size. We started by modifying the users view migration to include the critical field. We then needed to update a series of models to add the missing relationships that take us from licence to user. After doing that, we realized the existing `registeredToAndLicenceName()` modifier was doing too much and not returning what we needed. So, we replaced it with 2 new modifiers and associated instance methods. This meant updating the fetch licence service to apply the new modifiers, updating the presenter to use the latest data being returned, and then the service and view that backs the top content in the view licence page. Each time we touched a module, we found either dead or redundant code or tests that covered things already tested elsewhere. So, we've done a bunch of cleanup as we've worked through the fix. In short, this change fixes the issue, plus _a lot_ of housekeeping! 😁
- Loading branch information
1 parent
c913761
commit 4ab7c20
Showing
31 changed files
with
981 additions
and
941 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.