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

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

TheFaizanAnwar
Copy link

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.

Copy link
Collaborator

@cielf cielf left a comment

Choose a reason for hiding this comment

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

Looks ok on manual testing. @dorner - can you take a look from a technical pov?

@cielf cielf requested a review from dorner September 9, 2024 14:38
Copy link
Collaborator

@dorner dorner left a comment

Choose a reason for hiding this comment

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

One question - otherwise looks good.

@@ -52,6 +52,12 @@
<%= f.input :visible, label: "Item is Visible to Partners?", wrapper: :input_group do %>
<%= f.check_box :visible_to_partners, {class: "input-group-text", id: "visible_to_partners"}, "true", "false" %>
<% end %>

<% if current_user.has_role?(Role::ORG_ADMIN, current_organization) || current_user.has_role?(Role::ORG_USER, current_organization) %>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm pretty sure this check is not necessary because only org users can get to this page. Same with the other partials. @cielf can you confirm?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Only bank users can see this page, so we don't need a finer-grained control at this time.

Copy link
Author

Choose a reason for hiding this comment

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

Noted. I will remove those check.

@dorner
Copy link
Collaborator

dorner commented Sep 12, 2024

Also a bunch of failing tests :(

@TheFaizanAnwar
Copy link
Author

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.

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.

[Feature request] additional information field on items
3 participants