From cfc15a4db5e958bc49ed0a25ab0efbfa862298e2 Mon Sep 17 00:00:00 2001 From: Ben <95949082+kasugaijin@users.noreply.github.com> Date: Thu, 19 Dec 2024 14:06:38 -0800 Subject: [PATCH 01/11] Some more small fixes (#1283) * update comments for using the service * require requester name and city/town * remove delete account link * fix the sex filter * validate 500 max for contacts --- app/models/contact.rb | 3 ++- app/models/organization_account_request.rb | 2 +- app/services/organizations/create_service.rb | 9 +++++---- app/views/layouts/adopter_foster_dashboard.html.erb | 5 ----- app/views/organizations/adoptable_pets/index.html.erb | 2 +- app/views/organizations/staff/pets/index.html.erb | 2 +- app/views/shared/_location_fields.html.erb | 2 +- 7 files changed, 11 insertions(+), 14 deletions(-) diff --git a/app/models/contact.rb b/app/models/contact.rb index 091b5b7cd..05eb07764 100644 --- a/app/models/contact.rb +++ b/app/models/contact.rb @@ -2,7 +2,8 @@ class Contact include ActiveModel::Model attr_accessor :name, :email, :message - validates :name, :email, :message, presence: true + validates :name, :email, presence: true + validates :message, presence: true, length: {maximum: 500} # credit: https://medium.com/@limichelle21/building-and-debugging-a-contact-form-with-rails-mailgun-heroku-c0185b8bf419 end diff --git a/app/models/organization_account_request.rb b/app/models/organization_account_request.rb index 1d1eb659c..85b64b116 100644 --- a/app/models/organization_account_request.rb +++ b/app/models/organization_account_request.rb @@ -5,7 +5,7 @@ class OrganizationAccountRequest before_validation :normalize_phone - validates :name, :email, :city_town, :country, :province_state, presence: true + validates :name, :email, :requester_name, :city_town, :country, :province_state, presence: true validates_format_of :email, with: /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i validates :phone_number, presence: true, phone: {possible: true, allow_blank: true} diff --git a/app/services/organizations/create_service.rb b/app/services/organizations/create_service.rb index 8a4f2ebfe..599bba598 100644 --- a/app/services/organizations/create_service.rb +++ b/app/services/organizations/create_service.rb @@ -1,11 +1,12 @@ -# class to create a new location, organization, user, and staff account with role admin -# email is sent to admin user if all steps are successful +# Class to create a new location, organization, user, and staff account with role admin. +# An email is sent to admin user if all steps are successful. +# Be sure to use the Country and State codes from countries_states.yml # call with Organizations::CreateService.new.signal(args) # sample args: # { # location: { -# country: 'Mexico', -# city_town: 'La Ventana', +# country: 'MX', +# city_town: 'JAL', # province_state: 'Baja' # }, # organization: { diff --git a/app/views/layouts/adopter_foster_dashboard.html.erb b/app/views/layouts/adopter_foster_dashboard.html.erb index bb4858c06..e6eaca4b3 100644 --- a/app/views/layouts/adopter_foster_dashboard.html.erb +++ b/app/views/layouts/adopter_foster_dashboard.html.erb @@ -121,11 +121,6 @@ Log Out <% end %> - diff --git a/app/views/organizations/adoptable_pets/index.html.erb b/app/views/organizations/adoptable_pets/index.html.erb index e2fc693ad..563459244 100644 --- a/app/views/organizations/adoptable_pets/index.html.erb +++ b/app/views/organizations/adoptable_pets/index.html.erb @@ -26,7 +26,7 @@
<%= f.label :sex_eq, "Sex" %> - <%= f.select :sex_eq, ["Male", "Female"], {include_blank: 'All'}, class: "form-select" %> + <%= f.select :sex_eq, [["Male", "male"], ["Female", "female"]], {include_blank: 'All'}, class: "form-select" %>
<%= f.label :breed_eq, "Breed" %> diff --git a/app/views/organizations/staff/pets/index.html.erb b/app/views/organizations/staff/pets/index.html.erb index 1c512133b..98df3b5f9 100644 --- a/app/views/organizations/staff/pets/index.html.erb +++ b/app/views/organizations/staff/pets/index.html.erb @@ -18,7 +18,7 @@
<%= f.label :sex_eq, "Sex" %> - <%= f.select :sex_eq, ["Male", "Female"], {include_blank: 'All'}, class: "form-select" %> + <%= f.select :sex_eq, [["Male", "male"], ["Female", "female"]], {include_blank: 'All'}, class: "form-select" %>
<%= f.label :species_eq, "Species" %> diff --git a/app/views/shared/_location_fields.html.erb b/app/views/shared/_location_fields.html.erb index 89da415c0..b01a2b4e9 100644 --- a/app/views/shared/_location_fields.html.erb +++ b/app/views/shared/_location_fields.html.erb @@ -21,5 +21,5 @@ } %> <%= form.text_field :city_town, - required: false, + required: true, class: "form-control" %> From 1e8838d98b779c9255364ebdcb378b438a4e2a83 Mon Sep 17 00:00:00 2001 From: Amy McCaughan <149846643+fivefootbot@users.noreply.github.com> Date: Thu, 19 Dec 2024 17:43:07 -0500 Subject: [PATCH 02/11] Feedback and contact forms will auto-fill a user's email if they are logged in (#1282) --- app/controllers/contacts_controller.rb | 1 + app/controllers/feedback_controller.rb | 1 + 2 files changed, 2 insertions(+) diff --git a/app/controllers/contacts_controller.rb b/app/controllers/contacts_controller.rb index 9e60c609b..9725ea9fa 100644 --- a/app/controllers/contacts_controller.rb +++ b/app/controllers/contacts_controller.rb @@ -4,6 +4,7 @@ class ContactsController < ApplicationController def new @contact = Contact.new + @contact.email = current_user.email if current_user.present? end def create diff --git a/app/controllers/feedback_controller.rb b/app/controllers/feedback_controller.rb index c03ecac77..749e75fd3 100644 --- a/app/controllers/feedback_controller.rb +++ b/app/controllers/feedback_controller.rb @@ -7,6 +7,7 @@ class FeedbackController < ApplicationController def new @feedback = Feedback.new + @feedback.email = current_user.email if current_user.present? end def create From c4ca21fd76ed5debe0e0273c68a8e3380b1670a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:07:46 -0800 Subject: [PATCH 03/11] Bump debug from 1.9.2 to 1.10.0 (#1279) Bumps [debug](https://github.com/ruby/debug) from 1.9.2 to 1.10.0. - [Release notes](https://github.com/ruby/debug/releases) - [Commits](https://github.com/ruby/debug/compare/v1.9.2...v1.10.0) --- updated-dependencies: - dependency-name: debug dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5b21fb911..c61c4edd7 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -146,7 +146,7 @@ GEM railties (>= 6.0.0) sass-embedded (~> 1.63) date (3.4.1) - debug (1.9.2) + debug (1.10.0) irb (~> 1.10) reline (>= 0.3.8) devise (4.9.4) @@ -277,7 +277,7 @@ GEM activesupport (>= 6.0.0) railties (>= 6.0.0) io-console (0.8.0) - irb (1.14.2) + irb (1.14.3) rdoc (>= 4.0.0) reline (>= 0.4.2) jbuilder (2.13.0) @@ -439,7 +439,7 @@ GEM rb-fsevent (0.11.2) rb-inotify (0.11.1) ffi (~> 1.0) - rdoc (6.9.1) + rdoc (6.10.0) psych (>= 4.0.0) regexp_parser (2.9.3) reline (0.6.0) From fea32beeb9c52289d2bb5fe0fc6f321050f15a47 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:08:15 -0800 Subject: [PATCH 04/11] Bump action_policy from 0.7.2 to 0.7.3 (#1280) Bumps [action_policy](https://github.com/palkan/action_policy) from 0.7.2 to 0.7.3. - [Release notes](https://github.com/palkan/action_policy/releases) - [Changelog](https://github.com/palkan/action_policy/blob/master/CHANGELOG.md) - [Commits](https://github.com/palkan/action_policy/compare/v0.7.2...v0.7.3) --- updated-dependencies: - dependency-name: action_policy dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 960b25729..63ed77031 100644 --- a/Gemfile +++ b/Gemfile @@ -104,7 +104,7 @@ gem "ransack" gem "rails-controller-testing" # Use Action Policy for authorization framework -gem "action_policy", "~> 0.7.2" +gem "action_policy", "~> 0.7.3" # Use ViewComponent for our presenter pattern framework gem "view_component", "~> 3.20" diff --git a/Gemfile.lock b/Gemfile.lock index c61c4edd7..4f2f01487 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ GEM remote: https://rubygems.org/ specs: - action_policy (0.7.2) + action_policy (0.7.3) ruby-next-core (>= 1.0) actioncable (8.0.1) actionpack (= 8.0.1) @@ -570,7 +570,7 @@ PLATFORMS x86_64-linux DEPENDENCIES - action_policy (~> 0.7.2) + action_policy (~> 0.7.3) active_link_to active_storage_validations acts_as_tenant From 140adf0ef525ce039f6ace567433276c48b9de3c Mon Sep 17 00:00:00 2001 From: Jason Wang <39580712+jasonwang7517@users.noreply.github.com> Date: Thu, 19 Dec 2024 15:09:49 -0800 Subject: [PATCH 05/11] Adding tooltip to awaiting data status for new adopters (#1269) * initial commit * removing stylesheet link and refactoring * changing tooltip to partial * deleting whitespace * changing status --- app/views/organizations/adoptable_pets/show.html.erb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/views/organizations/adoptable_pets/show.html.erb b/app/views/organizations/adoptable_pets/show.html.erb index be807cd85..7e173f1f4 100644 --- a/app/views/organizations/adoptable_pets/show.html.erb +++ b/app/views/organizations/adoptable_pets/show.html.erb @@ -156,6 +156,11 @@ <%= image_tag('green_check.png', height: '21') %> <% end %>
+ <% if 'awaiting_data' == @adoption_application.status %> +
+ <%= render partial: "shared/empty_state", locals: {text: "Please make sure you fill out the adoption questionnaire so staff have enough information to process your application."} %> +
+ <% end %> <% elsif allowed_to?(:manage?, @pet) %> <%= link_to "Manage #{@pet.name}", staff_pet_path(@pet) %> <%# FIXME: This section was missed during the remove of AdopterFosterProfile but I think it requires FormSubmission to be ready to refactor %> From 51f7a1ee140eff1aeaf477178f3d999e4db4676a Mon Sep 17 00:00:00 2001 From: Caitlyn Landry Date: Thu, 19 Dec 2024 18:45:35 -0500 Subject: [PATCH 06/11] Reorder nav items for mobile and hide org name (#1284) --- app/views/layouts/shared/_navbar.html.erb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/app/views/layouts/shared/_navbar.html.erb b/app/views/layouts/shared/_navbar.html.erb index 3352787e7..8c4be241c 100644 --- a/app/views/layouts/shared/_navbar.html.erb +++ b/app/views/layouts/shared/_navbar.html.erb @@ -1,15 +1,5 @@