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

Filter not activated LPAs 2.0 #1064

Merged

Conversation

lukejolliffe
Copy link
Contributor

@lukejolliffe lukejolliffe commented Sep 1, 2021

Purpose

Change implementation of getUserLpas so only activated LPAs are recieved. This will then stop LPAs from being visible on the dashboard if they are not activated

Fixes UML-1697

Approach

Changing this getUserLPAs method means that we are changing functionality as little as possible. Everywhere that gets LPAs are most likely using this method and will now mirror the existing functionality.

Checklist

  • I have performed a self-review of my own code
  • [ ] I have added relevant logging with appropriate levels to my code
  • [ ] I have updated documentation (Confluence/GitHub wiki/tech debt doc) where relevant
  • I have added tests to prove my work
  • [ ] I have added welsh translation tags and updated translation files
  • [ ] I have run an accessibility tool on any pages I have made changes to and fixed any issues found
  • [ ] The product team have tested these changes

@lukejolliffe lukejolliffe requested a review from a team as a code owner September 1, 2021 10:09
@codecov
Copy link

codecov bot commented Sep 1, 2021

Codecov Report

Merging #1064 (094916f) into master (148cda8) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1064      +/-   ##
============================================
+ Coverage     91.50%   91.51%   +0.01%     
- Complexity     1372     1374       +2     
============================================
  Files           222      222              
  Lines          4190     4198       +8     
  Branches         22       22              
============================================
+ Hits           3834     3842       +8     
  Misses          356      356              
Impacted Files Coverage Δ
...pi/app/src/App/src/Service/Lpa/LpaAlreadyAdded.php 100.00% <100.00%> (ø)
...ice-api/app/src/App/src/Service/Lpa/LpaService.php 98.00% <100.00%> (+0.17%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 148cda8...094916f. Read the comment docs.

Should these have been raised before this change?
Copy link
Contributor

@cooperaj cooperaj left a comment

Choose a reason for hiding this comment

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

Code looks fine, I have a concern with implementation though in that altering a methods return based on boolean parameters is generally seen as bad practice as it can be avoided by restructuring the code itself.

The getAllForUser method is called in 2 locations so, although I appreciate the simplicity of this change, wanting to avoid wider scale changes is not a particularly relevant concern.

Happy to discuss.

@lukejolliffe
Copy link
Contributor Author

Code looks fine, I have a concern with implementation though in that altering a methods return based on boolean parameters is generally seen as bad practice as it can be avoided by restructuring the code itself.

The getAllForUser method is called in 2 locations so, although I appreciate the simplicity of this change, wanting to avoid wider scale changes is not a particularly relevant concern.

Happy to discuss.

That's reasonable, I'll change it into two different methods

@lukejolliffe
Copy link
Contributor Author

This PR is helped by ministryofjustice/opg-data-lpa#51 which will add a requested LPA to the users LPAs which will then either be shown on the dashboard or not depending on the state of this ticket

@lukejolliffe lukejolliffe merged commit 1f9a862 into master Sep 10, 2021
@lukejolliffe lukejolliffe deleted the UML-1697-filter-not-activated-lpa-from-dashboard-2.0 branch September 10, 2021 14:08
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.

3 participants