-
-
Notifications
You must be signed in to change notification settings - Fork 571
[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
edwinthinks
wants to merge
10
commits into
main
Choose a base branch
from
5086/rename-executive-director
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+143
−104
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
4357d6c
Fix step to migrating to contacts naming
edwinthinks 5c3e06a
More copy changes
edwinthinks 4cff51a
Rename Executive Director with contacts
edwinthinks 2869487
Add a migration for the conversion to use the new field name
edwinthinks 1f67159
Update schema
edwinthinks af864e7
Remove some changes
edwinthinks 31f7212
Merge branch 'main' into 5086/rename-executive-director
edwinthinks 7707cce
Clean up
edwinthinks d3a2dbb
Fix up guide
edwinthinks 82e36af
Fix linting erb errors
edwinthinks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| <section class="content"> | ||
| <div class="container-fluid"> | ||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <div class="card"> | ||
| <div class="card-header bg-white"> | ||
| <h3 class="card-title"><strong>Executive Director</strong></h3> | ||
| </div> | ||
| <div class="card-body"> | ||
| <%= 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 %> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </section> | ||
|
|
||
| <section class="content"> | ||
| <div class="container-fluid"> | ||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <div class="card"> | ||
| <div class="card-header bg-white"> | ||
| <h3 class="card-title"><strong>Primary Contact</strong></h3> | ||
| </div> | ||
| <div class="card-body"> | ||
| <%= 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 %> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </section> |
40 changes: 2 additions & 38 deletions
40
app/views/partners/profiles/edit/_executive_director.html.erb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,38 +1,2 @@ | ||
| <section class="content"> | ||
| <div class="container-fluid"> | ||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <div class="card"> | ||
| <div class="card-header bg-white"> | ||
| <h3 class="card-title"><strong>Executive Director</strong></h3> | ||
| </div> | ||
| <div class="card-body"> | ||
| <%= 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 %> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </section> | ||
|
|
||
| <section class="content"> | ||
| <div class="container-fluid"> | ||
| <div class="row"> | ||
| <div class="col-md-12"> | ||
| <div class="card"> | ||
| <div class="card-header bg-white"> | ||
| <h3 class="card-title"><strong>Primary Contact</strong></h3> | ||
| </div> | ||
| <div class="card-body"> | ||
| <%= 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 %> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </section> | ||
| <%# TODO: remove this after migration to the other partials %> | ||
| <%= render "partners/profiles/edit/contacts", form: form %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <div class="card mb-4"> | ||
| <h5 class="card-header bg-primary text-white">Contacts</h5> | ||
| <div class="card-body"> | ||
| <h5 class='font-weight-bold'>Executive Director</h5> | ||
| <dl> | ||
| <dt>Name</dt> | ||
| <dd><%= profile.executive_director_name %></dd> | ||
|
|
||
| <dt>Phone Number</dt> | ||
| <dd><%= profile.executive_director_phone %></dd> | ||
|
|
||
| <dt>Email</dt> | ||
| <dd><%= profile.executive_director_email %></dd> | ||
| </dl> | ||
|
|
||
| <h5 class='font-weight-bold'>Primary Contact</h5> | ||
| <dl> | ||
| <dt>Name</dt> | ||
| <dd><%= profile.primary_contact_name %></dd> | ||
|
|
||
| <dt>Phone Number</dt> | ||
| <dd><%= profile.primary_contact_phone %></dd> | ||
|
|
||
| <dt>Mobile Phone Number</dt> | ||
| <dd><%= profile.primary_contact_mobile %></dd> | ||
|
|
||
| <dt>Email</dt> | ||
| <dd><%= profile.primary_contact_email %></dd> | ||
| </dl> | ||
| </div> | ||
| </div> |
31 changes: 1 addition & 30 deletions
31
app/views/partners/profiles/show/_executive_director.html.erb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1 @@ | ||
| <div class="card mb-4"> | ||
| <h5 class="card-header bg-primary text-white">Executive Director</h5> | ||
| <div class="card-body"> | ||
| <dl> | ||
| <dt>Name</dt> | ||
| <dd><%= profile.executive_director_name %></dd> | ||
|
|
||
| <dt>Phone Number</dt> | ||
| <dd><%= profile.executive_director_phone %></dd> | ||
|
|
||
| <dt>Email</dt> | ||
| <dd><%= profile.executive_director_email %></dd> | ||
| </dl> | ||
|
|
||
| <h6>Primary Contact Person</h6> | ||
| <dl> | ||
| <dt>Name</dt> | ||
| <dd><%= profile.primary_contact_name %></dd> | ||
|
|
||
| <dt>Phone Number</dt> | ||
| <dd><%= profile.primary_contact_phone %></dd> | ||
|
|
||
| <dt>Mobile Phone Number</dt> | ||
| <dd><%= profile.primary_contact_mobile %></dd> | ||
|
|
||
| <dt>Email</dt> | ||
| <dd><%= profile.primary_contact_email %></dd> | ||
| </dl> | ||
| </div> | ||
| </div> | ||
| <%= render "partners/profiles/show/contacts", profile: profile %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <%= f.fields_for :profile, profile do |pf| %> | ||
| <h3 class="pt-3"><strong>Executive Director</strong></h3> | ||
| <div class="form-group"> | ||
| <%= pf.input :executive_director_name, label: "Executive Director Name", class: "form-control" %> | ||
| </div> | ||
| <div class="form-group"> | ||
| <%= pf.input :executive_director_phone, label: "Executive Director Phone", class: "form-control" %> | ||
| </div> | ||
| <div class="form-group"> | ||
| <%= pf.input :executive_director_email, label: "Executive Director Email", class: "form-control" %> | ||
| </div> | ||
|
|
||
| <h3 class="pt-3"><strong>Primary Contact</strong></h3> | ||
|
|
||
| <div class="form-group"> | ||
| <%= pf.input :primary_contact_name, label: "Primary Contact Name", class: "form-control" %> | ||
| </div> | ||
| <div class="form-group"> | ||
| <%= pf.input :primary_contact_phone, label: "Primary Contact Phone", class: "form-control" %> | ||
| </div> | ||
| <div class="form-group"> | ||
| <%= pf.input :primary_contact_mobile, label: "Primary Contact Cell", class: "form-control" %> | ||
| </div> | ||
| <div class="form-group"> | ||
| <%= pf.input :primary_contact_email, label: "Primary Contact Email", class: "form-control" %> | ||
| </div> | ||
| <% end %> |
27 changes: 1 addition & 26 deletions
27
app/views/partners/profiles/step/_executive_director_form.html.erb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1 @@ | ||
| <%= f.fields_for :profile, profile do |pf| %> | ||
| <div class="form-group"> | ||
| <%= pf.input :executive_director_name, label: "Executive Director Name", class: "form-control" %> | ||
| </div> | ||
| <div class="form-group"> | ||
| <%= pf.input :executive_director_phone, label: "Executive Director Phone", class: "form-control" %> | ||
| </div> | ||
| <div class="form-group"> | ||
| <%= pf.input :executive_director_email, label: "Executive Director Email", class: "form-control" %> | ||
| </div> | ||
|
|
||
| <h3 class="pt-3"><strong>Primary Contact</strong></h3> | ||
|
|
||
| <div class="form-group"> | ||
| <%= pf.input :primary_contact_name, label: "Primary Contact Name", class: "form-control" %> | ||
| </div> | ||
| <div class="form-group"> | ||
| <%= pf.input :primary_contact_phone, label: "Primary Contact Phone", class: "form-control" %> | ||
| </div> | ||
| <div class="form-group"> | ||
| <%= pf.input :primary_contact_mobile, label: "Primary Contact Cell", class: "form-control" %> | ||
| </div> | ||
| <div class="form-group"> | ||
| <%= pf.input :primary_contact_email, label: "Primary Contact Email", class: "form-control" %> | ||
| </div> | ||
| <% end %> | ||
| <%= render "partners/profiles/step/contacts_form", f: f, profile: profile %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...20250420031735_migrate_organization_partner_form_fields_executive_director_to_contacts.rb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| class MigrateOrganizationPartnerFormFieldsExecutiveDirectorToContacts < ActiveRecord::Migration[8.0] | ||
| class Organization < ApplicationRecord | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| 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 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.