Add "Additional Information" Field to Items for Bank Use Only
Resolves #4527
Description
This PR introduces an additional additional_info text field to the Items module, specifically for bank users. This field is added to the "new", "edit", "view", and "index" pages, and is only visible to users with bank-specific access. The purpose of this field is to allow banks to store/access particular information about items that partners do not need to see.
In the index view, the column header is shortened to "Add. Info" to prevent layout issues. Additionally, the text in this column is truncated to 25 characters to maintain the integrity of the table layout. Tests have been added to ensure this feature functions correctly.
Type of change
- New feature (non-breaking change that adds functionality)
How Has This Been Tested?
- Tests have been added to spec/controllers/items_controller_spec.rb to verify CRUD operations for the additional_info field.
- The truncation functionality in the index view was manually verified to ensure it doesn't affect the table layout.
Also a bunch of failing tests :(
Also a bunch of failing tests :(
I've tested it locally using bundle exec rspec and confirmed that all tests are passing. I will fix those failing test.
Thanks, @dorner and @cielf, for your review. This is my first PR for this repo.
@TheFaizanAnwar FYI: We had an urgent fix that required all the senior contributors this week , so we didn't get to look at this again. Hopefully this week will go better.
Sure I will fix it asap.
@cielf, I hope you're doing well. I have made the necessary changes based on your feedback on PR.
Additionally, all the test cases are passing on my local environment, and I’ve attached a screenshot for your reference. I hope the tests will pass in the remote environment as well.
Hey @dorner -- I think this one is in your court.
@TheFaizanAnwar the tests are still failing. There are also conflicts now that have to be resolved.
@TheFaizanAnwar It looks like you've committed the database migration file, but not the changes that it made to db/schema.rb. During the workflow that runs the tests, migrations aren't run, the database is loaded from that schema file. That may be why you see different behavior when running tests locally vs. CI.
@coalest I think we've lost @TheFaizanAnwar -- You've looked at this - do you think you could take it across the line?
@cielf When I first saw this message of yours, a different contributor had already gotten assigned to this task. But it looks like no one is currently assigned so I will go ahead and finish up this PR.
I fixed the merged conflict and added the schema file changes, so the tests are now passing. So I think this is ready for review again.
@coalest -- Basic functionality is good -- but I'm wondering if we should limit it to 500 characters -- That wasn't specified in the issue, but would be in line with our other notes throughout the system.
@cielf I added the limit to 500 characters. Could you check it once again? I copied the implementation from elsewhere in the app, so you shouldn't be able to input more than 500 characters. And if a user were to manually change the html on the page to allow more than 500 characters, there is a server side validation that will fail.
There is an issue with the formatting of validation errors, but I think that is a separate issue:
I agree that's a separate issue. Added it to the inbox to be written up (might be a GFI)
LGTM -- over to @dorner for a final technical look-see.
@TheFaizanAnwar: Your PR Add "Additional Information" Field to Items for Bank Use Only is part of today's Human Essentials production release: 2025.03.02.
Thank you very much for your contribution!