diff --git a/app/helpers/partners_helper.rb b/app/helpers/partners_helper.rb index 74974649f3..93876cc7bb 100644 --- a/app/helpers/partners_helper.rb +++ b/app/helpers/partners_helper.rb @@ -34,6 +34,11 @@ def partial_display_name(partial) 'attached_documents' => 'Additional Documents' } + # TODO: temporary change of name for the contacts partial before migration + if partial == 'executive_director' + return 'Contacts' + end + custom_names[partial] || partial.humanize end diff --git a/app/models/organization.rb b/app/models/organization.rb index 7acc1d9fac..b188c76a0e 100644 --- a/app/models/organization.rb +++ b/app/models/organization.rb @@ -108,7 +108,7 @@ def flipper_id ['Sources of Funding', 'sources_of_funding'], ['Area Served', 'area_served'], ['Population Served', 'population_served'], - ['Executive Director', 'executive_director'], + ['Contacts', 'contacts'], ['Pickup Person', 'pick_up_person'], ['Agency Distribution Information', 'agency_distribution_information'], ['Attached Documents', 'attached_documents'] diff --git a/app/views/partners/profiles/edit/_contacts.html.erb b/app/views/partners/profiles/edit/_contacts.html.erb new file mode 100644 index 0000000000..e7ec72c652 --- /dev/null +++ b/app/views/partners/profiles/edit/_contacts.html.erb @@ -0,0 +1,38 @@ +
+
+
+
+
+
+

Executive Director

+
+
+ <%= form.input :executive_director_name, label: "Executive Director Name", class: "form-control", wrapper: :input_group %> + <%= form.input :executive_director_phone, label: "Executive Director Phone", class: "form-control", wrapper: :input_group %> + <%= form.input :executive_director_email, label: "Executive Director Email", class: "form-control", wrapper: :input_group %> +
+
+
+
+
+
+ +
+
+
+
+
+
+

Primary Contact

+
+
+ <%= form.input :primary_contact_name, label: "Primary Contact Name", class: "form-control", wrapper: :input_group %> + <%= form.input :primary_contact_phone, label: "Primary Contact Phone", class: "form-control", wrapper: :input_group %> + <%= form.input :primary_contact_mobile, label: "Primary Contact Cell", class: "form-control", wrapper: :input_group %> + <%= form.input :primary_contact_email, label: "Primary Contact Email", class: "form-control", wrapper: :input_group %> +
+
+
+
+
+
diff --git a/app/views/partners/profiles/edit/_executive_director.html.erb b/app/views/partners/profiles/edit/_executive_director.html.erb index e7ec72c652..78f0127433 100644 --- a/app/views/partners/profiles/edit/_executive_director.html.erb +++ b/app/views/partners/profiles/edit/_executive_director.html.erb @@ -1,38 +1,2 @@ -
-
-
-
-
-
-

Executive Director

-
-
- <%= form.input :executive_director_name, label: "Executive Director Name", class: "form-control", wrapper: :input_group %> - <%= form.input :executive_director_phone, label: "Executive Director Phone", class: "form-control", wrapper: :input_group %> - <%= form.input :executive_director_email, label: "Executive Director Email", class: "form-control", wrapper: :input_group %> -
-
-
-
-
-
- -
-
-
-
-
-
-

Primary Contact

-
-
- <%= form.input :primary_contact_name, label: "Primary Contact Name", class: "form-control", wrapper: :input_group %> - <%= form.input :primary_contact_phone, label: "Primary Contact Phone", class: "form-control", wrapper: :input_group %> - <%= form.input :primary_contact_mobile, label: "Primary Contact Cell", class: "form-control", wrapper: :input_group %> - <%= form.input :primary_contact_email, label: "Primary Contact Email", class: "form-control", wrapper: :input_group %> -
-
-
-
-
-
+<%# TODO: remove this after migration to the other partials %> +<%= render "partners/profiles/edit/contacts", form: form %> diff --git a/app/views/partners/profiles/show/_contacts.html.erb b/app/views/partners/profiles/show/_contacts.html.erb new file mode 100644 index 0000000000..04e4f9bdff --- /dev/null +++ b/app/views/partners/profiles/show/_contacts.html.erb @@ -0,0 +1,31 @@ +
+
Contacts
+
+
Executive Director
+
+
Name
+
<%= profile.executive_director_name %>
+ +
Phone Number
+
<%= profile.executive_director_phone %>
+ +
Email
+
<%= profile.executive_director_email %>
+
+ +
Primary Contact
+
+
Name
+
<%= profile.primary_contact_name %>
+ +
Phone Number
+
<%= profile.primary_contact_phone %>
+ +
Mobile Phone Number
+
<%= profile.primary_contact_mobile %>
+ +
Email
+
<%= profile.primary_contact_email %>
+
+
+
diff --git a/app/views/partners/profiles/show/_executive_director.html.erb b/app/views/partners/profiles/show/_executive_director.html.erb index d8c34b3a29..1c98e2ed0b 100644 --- a/app/views/partners/profiles/show/_executive_director.html.erb +++ b/app/views/partners/profiles/show/_executive_director.html.erb @@ -1,30 +1 @@ -
-
Executive Director
-
-
-
Name
-
<%= profile.executive_director_name %>
- -
Phone Number
-
<%= profile.executive_director_phone %>
- -
Email
-
<%= profile.executive_director_email %>
-
- -
Primary Contact Person
-
-
Name
-
<%= profile.primary_contact_name %>
- -
Phone Number
-
<%= profile.primary_contact_phone %>
- -
Mobile Phone Number
-
<%= profile.primary_contact_mobile %>
- -
Email
-
<%= profile.primary_contact_email %>
-
-
-
+<%= render "partners/profiles/show/contacts", profile: profile %> diff --git a/app/views/partners/profiles/step/_contacts_form.html.erb b/app/views/partners/profiles/step/_contacts_form.html.erb new file mode 100644 index 0000000000..8bc57f2bf4 --- /dev/null +++ b/app/views/partners/profiles/step/_contacts_form.html.erb @@ -0,0 +1,27 @@ +<%= f.fields_for :profile, profile do |pf| %> +

Executive Director

+
+ <%= pf.input :executive_director_name, label: "Executive Director Name", class: "form-control" %> +
+
+ <%= pf.input :executive_director_phone, label: "Executive Director Phone", class: "form-control" %> +
+
+ <%= pf.input :executive_director_email, label: "Executive Director Email", class: "form-control" %> +
+ +

Primary Contact

+ +
+ <%= pf.input :primary_contact_name, label: "Primary Contact Name", class: "form-control" %> +
+
+ <%= pf.input :primary_contact_phone, label: "Primary Contact Phone", class: "form-control" %> +
+
+ <%= pf.input :primary_contact_mobile, label: "Primary Contact Cell", class: "form-control" %> +
+
+ <%= pf.input :primary_contact_email, label: "Primary Contact Email", class: "form-control" %> +
+<% end %> diff --git a/app/views/partners/profiles/step/_executive_director_form.html.erb b/app/views/partners/profiles/step/_executive_director_form.html.erb index 2cb5e963dd..140d560013 100644 --- a/app/views/partners/profiles/step/_executive_director_form.html.erb +++ b/app/views/partners/profiles/step/_executive_director_form.html.erb @@ -1,26 +1 @@ -<%= f.fields_for :profile, profile do |pf| %> -
- <%= pf.input :executive_director_name, label: "Executive Director Name", class: "form-control" %> -
-
- <%= pf.input :executive_director_phone, label: "Executive Director Phone", class: "form-control" %> -
-
- <%= pf.input :executive_director_email, label: "Executive Director Email", class: "form-control" %> -
- -

Primary Contact

- -
- <%= pf.input :primary_contact_name, label: "Primary Contact Name", class: "form-control" %> -
-
- <%= pf.input :primary_contact_phone, label: "Primary Contact Phone", class: "form-control" %> -
-
- <%= pf.input :primary_contact_mobile, label: "Primary Contact Cell", class: "form-control" %> -
-
- <%= pf.input :primary_contact_email, label: "Primary Contact Email", class: "form-control" %> -
-<% end %> +<%= render "partners/profiles/step/contacts_form", f: f, profile: profile %> diff --git a/app/views/profiles/_show.html.erb b/app/views/profiles/_show.html.erb index cd2b31733d..ca1f4a77f7 100644 --- a/app/views/profiles/_show.html.erb +++ b/app/views/profiles/_show.html.erb @@ -116,13 +116,13 @@

Poverty Unknown: <%= partner_profile.poverty_unknown %>


<% end %> - <% if partner_profile_fields.include?('executive_director') || partner_profile_fields.empty? %> -

Executive Director

+ <% if partner_profile_fields.include?('contacts') || partner_profile_fields.empty? %> +

Contacts

+ Executive Director

Executive Director Name: <%= partner_profile.executive_director_name %>

Executive Director Phone: <%= partner_profile.executive_director_phone %>

Executive Director Email: <%= partner_profile.executive_director_email %>

-
-

Primary Contact Person

+ Primary Contact Person

Primary Contact Name: <%= partner_profile.primary_contact_name %>

Primary Contact Phone: <%= partner_profile.primary_contact_phone %>

Primary Contact Mobile: <%= partner_profile.primary_contact_mobile %>

diff --git a/app/views/profiles/step/edit.html.erb b/app/views/profiles/step/edit.html.erb index fe706c9e59..635606aaef 100644 --- a/app/views/profiles/step/edit.html.erb +++ b/app/views/profiles/step/edit.html.erb @@ -26,7 +26,9 @@ <%= render 'partners/profiles/step/accordion_section', f: f, partner: @partner, section_id: 'agency_information', section_title: 'Agency Information', icon_class: 'fa-edit', partial_name: 'agency_information', sections_with_errors: @sections_with_errors %> <%= render 'partners/profiles/step/accordion_section', f: f, partner: @partner, section_id: 'program_delivery_address', section_title: 'Program / Delivery Address', icon_class: 'fa-map', partial_name: 'program_delivery_address', sections_with_errors: @sections_with_errors %> <% @partner.partials_to_show.each do |partial| %> - <%= render 'partners/profiles/step/accordion_section', f: f, partner: @partner, section_id: partial, section_title: partial_display_name(partial), icon_class: 'fa-cogs', partial_name: partial, sections_with_errors: @sections_with_errors %> + <%= render 'partners/profiles/step/accordion_section', f: f, partner: @partner, section_id: partial, section_title: partial_display_name(partial), icon_class: 'fa-cogs', + partial_name: partial, + sections_with_errors: @sections_with_errors %> <% end %> <%= render 'partners/profiles/step/accordion_section', f: f, partner: @partner, section_id: 'partner_settings', section_title: 'Settings', icon_class: 'fa-cog', partial_name: 'partner_settings', sections_with_errors: @sections_with_errors %> diff --git a/db/migrate/20250420031735_migrate_organization_partner_form_fields_executive_director_to_contacts.rb b/db/migrate/20250420031735_migrate_organization_partner_form_fields_executive_director_to_contacts.rb new file mode 100644 index 0000000000..ce620b45d2 --- /dev/null +++ b/db/migrate/20250420031735_migrate_organization_partner_form_fields_executive_director_to_contacts.rb @@ -0,0 +1,27 @@ +class MigrateOrganizationPartnerFormFieldsExecutiveDirectorToContacts < ActiveRecord::Migration[8.0] + class Organization < ApplicationRecord + end + + def up + organizations_to_update = Organization.where.not(partner_form_fields: []) + organizations_to_update.each do |org| + if org.partner_form_fields.include?('executive_director') + org.partner_form_fields.delete('executive_director') + org.partner_form_fields << 'contacts' + org.save! + end + end + end + + def down + organizations_to_update = Organization.where.not(partner_form_fields: []) + organizations_to_update.each do |org| + if org.partner_form_fields.include?('contacts') + org.partner_form_fields.delete('contacts') + org.partner_form_fields << 'executive_director' + org.save! + end + end + end + +end diff --git a/db/schema.rb b/db/schema.rb index 230bcef07c..9457806d82 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[8.0].define(version: 2025_04_04_102321) do +ActiveRecord::Schema[8.0].define(version: 2025_04_20_031735) do # These are extensions that must be enabled in order to support this database enable_extension "pg_catalog.plpgsql" diff --git a/docs/user_guide/bank/pm_partner_profiles.md b/docs/user_guide/bank/pm_partner_profiles.md index 4c45cfd6ea..b731153cbd 100644 --- a/docs/user_guide/bank/pm_partner_profiles.md +++ b/docs/user_guide/bank/pm_partner_profiles.md @@ -42,8 +42,7 @@ The high level sections of the partner profile are: - Sources of Funding - Area Served (County/Client Share %) - Population Served -- Executive Director -- Primary Contact +- Contacts - Pick up Person - Race/Ethnicity of Client Base - Agency Distribution Information @@ -165,7 +164,7 @@ There is no check on whether the numbers add up to 100 -- because there may be o - % Greater than 2 times FPL - % Poverty Unknown -### Executive Director +### Contacts ![screenshot of expanded executive director section](images/partners/partners_profile_edit_executive.png) ![NOTE] This section currently contains both Executive Director and Primary Contact for the partner. We have splitting them up in our queue. Contact information for the head of the agency: