Skip to content

[5086] Rename executive director to contacts #5158

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

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

Conversation

edwinthinks
Copy link
Collaborator

Resolves #5086

Description

I can see that we wanted to change this from saying "Executive Director" since the field inside contains general contact information.

This includes some "scaffold" or temporary code that would be removed once migration goes out. For example, the executive director partials.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Manually testing my migration and clicking through the application. I think this doesn't really need an additional system test since I think this isn't likely to break.

Screenshots

CleanShot 2025-04-20 at 12 23 45@2x

CleanShot 2025-04-20 at 12 23 50@2x

@@ -0,0 +1,27 @@
class MigrateOrganizationPartnerFormFieldsExecutiveDirectorToContacts < ActiveRecord::Migration[8.0]
class Organization < ApplicationRecord
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Unlikely the Organization name would change, but this is a way to allow us to use the model name in the migration.

@@ -34,6 +34,11 @@ def partial_display_name(partial)
'attached_documents' => 'Additional Documents'
}

# TODO: temporary change of name for the contacts partial before migration
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Once this is merged and deployed, we can remove these extra bits of code.

@cielf
Copy link
Collaborator

cielf commented Apr 20, 2025

Hey @edwinthinks -- Thanks for taking this on! I'm busy with family obligations Sunday, so probably won't get to kicking the tires on this until at least Monday. I'll let @dorner make the call on tests, but I did notice that you haven't updated the user guide, and it looks like the linter is failing.

@cielf cielf self-requested a review April 21, 2025 16:55
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.

Hey @edwinthinks -- I see you've marked this WIP in the meantime, but I took a look anyway. Functionally it's close, but I did see a couple of things to adjust.

Summary

I think there's a mismatch between the change in the migration and how the organization view/edits pick up the list of partner profile edits, and that you missed changing the bank's partner view from executive director to contacts

Details/Recreation

For recreating the following, I started with the production branch, ran a fresh bin/setup, then picked Area Served, Executive Director, Pickup Person for the Partner Profile sections. Then I switched to this branch and ran the migration.

1/ "Contacts" is not showing up within the Partner Profile sections in the Organnization view -- but there's a blank entry where Executive Director was:
Screenshot 2025-04-21 at 12 35 09 PM
1a/ If I go into edit, "Contacts" is missing in the Partner Profile sections field
Screenshot 2025-04-21 at 1 01 29 PM

FWIW, I think it's stored -- just not showing up properly, because the partner profile functionality works at this point.

2/ The partner's view of their profile initially looks right, but the bank's view is missing the "Contacts" label:
Screenshot 2025-04-21 at 12 51 58 PM

3/ Next, on your branch, I selected "Area Served, "Contacts" and "Pickup Person" and saved the organization.
The bank's partner profile view now doesn't show the contacts -- I suspect it's still working off of executive_director. The rest seems to be working.

#Thoughts/theories on the weirdness

I'm wondering if a/ the migration removes "executive_director" from a string that contains a comma-separated list, leaving a ",," in it and b/ the organization view and edits' treatment of the Partner Profile section is sensitive to the order of the elements -- so it doesn't pick up on "Contacts" at the end of the list.

Anyway, If you solve those issues, and the user guide, we can pass it to @dorner for any technical input.

@edwinthinks
Copy link
Collaborator Author

Thanks for the review @cielf ; I'll take a look into addressing those.

@edwinthinks
Copy link
Collaborator Author

@cielf fixed everything except that thing you saw when you ran it in production. Any chance you can tell me what the output of that loop value is. In

<% for partner_form_field in @organization.partner_form_fields %>

                    <% for partner_form_field in @organization.partner_form_fields %>
                      <li>
                        <%= partner_form_field %>
                        <%= display_partner_fields_value(partner_form_field) %>
                      </li>
                    <% end %>

I'am looking at the migration and it shouldn't cause a empty ,, that seems strange.

@cielf
Copy link
Collaborator

cielf commented May 4, 2025

Hey @edwinthinks -- Did you try the sequence I specified to recreate it? I have a busier than usual week this week, so I might not be able to get back to this until Friday.

@edwinthinks
Copy link
Collaborator Author

@cielf I don't believe I can since I don't have production data? And sure no rush :)

@cielf
Copy link
Collaborator

cielf commented May 4, 2025

@edwinthinks For clarity, It's not production data -- it's the production branch (though the main branch should work as well). We don't have this situation in the default data, so we need to create it before running the migration to test it.

"For recreating the following, I started with the production branch, ran a fresh bin/setup, then picked Area Served, Executive Director, Pickup Person for the Partner Profile sections. Then I switched to this branch and ran the migration."

@edwinthinks
Copy link
Collaborator Author

For clarity, It's not production data -- it's the production branch

Ahh thanks, @cielf I was confused about that one. I'll try to replicate the issue then.

@edwinthinks
Copy link
Collaborator Author

Hey @cielf; I followed your steps to replicate the issue and was unable to get it what you were seeing. This would happen if you ran the migration and then went back to production branch. After migration are you staying on this branch? Maybe a restart might work?

Thanks!

@cielf
Copy link
Collaborator

cielf commented May 5, 2025

It's plausible. I'll try to re-recreate.

@cielf
Copy link
Collaborator

cielf commented May 6, 2025

Ok. That seems to be working. Sorry about the mixup.

@cielf
Copy link
Collaborator

cielf commented May 6, 2025

Nit: The order on the view is not right after the migration, though it corrects itself the first time you save the organization.

@cielf
Copy link
Collaborator

cielf commented May 6, 2025

@edwinthinks

It looks like the order of the partial names is a bigger problem than that, though.

By appending "Contacts" to the list, instead of replacing it in the same order, we end up changing the order of the partials in the partner profile edits, and the partner's view of their profile, though not in the bank's view of the partner's profile.

That's not a desirable side-effect - could be confusing to the users. And it would change back when the organization was saved (I'm pretty sure - haven't tested it.)

Is it workable to do the migration in a way that the order is preserved?
Alternatively, we would need to rework the partner profile edits, and the partner's profile view.

@edwinthinks
Copy link
Collaborator Author

Yep we can do it to retain the order for sure. Thanks @cielf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rename Executive Director section on Profile to Contacts
2 participants