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

Add "Additional Information" Field to Items for Bank Use Only

Open TheFaizanAnwar opened this issue 1 year ago • 5 comments

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.

TheFaizanAnwar avatar Sep 08 '24 14:09 TheFaizanAnwar

Also a bunch of failing tests :(

dorner avatar Sep 12 '24 00:09 dorner

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 avatar Sep 12 '24 19:09 TheFaizanAnwar

@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.

cielf avatar Sep 28 '24 17:09 cielf

Sure I will fix it asap.

TheFaizanAnwar avatar Sep 29 '24 03:09 TheFaizanAnwar

@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. image

TheFaizanAnwar avatar Sep 30 '24 07:09 TheFaizanAnwar

Hey @dorner -- I think this one is in your court.

cielf avatar Nov 13 '24 16:11 cielf

@TheFaizanAnwar the tests are still failing. There are also conflicts now that have to be resolved.

dorner avatar Nov 16 '24 23:11 dorner

@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 avatar Nov 29 '24 13:11 coalest

@coalest I think we've lost @TheFaizanAnwar -- You've looked at this - do you think you could take it across the line?

cielf avatar Dec 14 '24 02:12 cielf

@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.

coalest avatar Feb 18 '25 08:02 coalest

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 avatar Feb 18 '25 09:02 coalest

@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 avatar Feb 18 '25 20:02 cielf

@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.

coalest avatar Feb 19 '25 10:02 coalest

There is an issue with the formatting of validation errors, but I think that is a separate issue: image

coalest avatar Feb 19 '25 10:02 coalest

I agree that's a separate issue. Added it to the inbox to be written up (might be a GFI)

cielf avatar Feb 19 '25 14:02 cielf

LGTM -- over to @dorner for a final technical look-see.

cielf avatar Feb 19 '25 14:02 cielf

@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!

github-actions[bot] avatar Mar 02 '25 15:03 github-actions[bot]