Skip to content

Commit

Permalink
Fix/correct new designation tag (#515)
Browse files Browse the repository at this point in the history
* Node version fixed

* Remove package-lock.json

* package-lock.json removed

* Google ads conversion tracking second iteration.

* Preview param bug fix

* fix(designation) correct International copy

* fix(designation) improve desgination tag component and organization decorator

---------

Co-authored-by: Alan Soto <[email protected]>
  • Loading branch information
JosueMagnus12 and AlanSoto31 authored Feb 13, 2024
1 parent f9cd6e1 commit 91366ec
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
8 changes: 4 additions & 4 deletions app/components/designation_tag/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class DesignationTag::Component < ApplicationViewComponent
attr_reader :organization, :container_options, :designation_map

def initialize(organization, container_options: {})
@organization = organization.decorate
@organization = organization
@container_options = container_options
build_designation_map
end
Expand All @@ -19,10 +19,10 @@ def container_setup

def build_designation_map
@designation_map = {}
designation_copies = organization.decorate.designation_copies

if ["nationwide", "internationally"].include? organization.scope_of_work
designation_map[organization.scope_of_work.capitalize] =
"Services offered #{organization.scope_of_work}"
if ["National", "International"].include? organization.scope_of_work
designation_map[designation_copies[:tag_copy]] = "Services offered #{designation_copies[:desc_copy]}"
end

if organization.volunteer_availability
Expand Down
24 changes: 18 additions & 6 deletions app/decorators/organization_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,23 @@ def volunteer_link
object.decorate.url(object.volunteer_link)
end

def scope_of_work
{
"National" => "nationwide",
"International" => "internationally",
"Regional" => "locally"
}[object.scope_of_work]
def designation_copies
case object.scope_of_work
when "National"
{
tag_copy: "Nationwide",
desc_copy: "nationwide"
}
when "International"
{
tag_copy: "International",
desc_copy: "internationally"
}
when "Regional"
{
tag_copy: "Regional",
desc_copy: "locally"
}
end
end
end

0 comments on commit 91366ec

Please sign in to comment.