human-essentials icon indicating copy to clipboard operation
human-essentials copied to clipboard

Deactivated partners should not appear in the dropdown when producing a new distribution.

Open cielf opened this issue 1 year ago • 4 comments

Summary

Limit the partners in the partner dropdown when producing a new distribution to active partners.

Why

Reduction of possible errors, just makes it easier for the banks.

Details

On new distributions only, the partners in the partner dropdown should include only active partners. They can be any other status than "Deactivated". We still need to be able to access the deactivated partners when editing.

Criteria for completion

  • [ ] Deactivated partners do not appear in the partner dropdown on new distributions - though they do on editing a distribution. (You might be editing a distribution from an inactive partner)
  • [ ] Tests to confirm that behaviour

cielf avatar Jul 14 '24 14:07 cielf

Hi, I'd like to take a shot at this issue if no one has started working on it yet.

ewoknock avatar Aug 24 '24 22:08 ewoknock

Sure thing!

cielf avatar Aug 25 '24 01:08 cielf

I've written code to modify the query for the dropdown found in the distributions/form partial and have also manually tested it by deactivating some partners and visually checking that the new view does filter out deactivated partners while the edit view keeps them in. I did have a question about writing tests for this. Where do we write rspec tests for views? and how exactly would you write one to test if the dropdown is populated correctly?

ewoknock avatar Aug 26 '24 02:08 ewoknock

@dorner Could you field the above question? Thanks.

cielf avatar Aug 26 '24 04:08 cielf

I was able to figure out my question about the tests and have created a pull request. Sorry about the double pull requests. I forgot to rebase first and the first pull request pulled in a bunch of other commits so I cleaned up my branch and then made a new pull request.

ewoknock avatar Sep 04 '24 00:09 ewoknock