Skip to content

Commit

Permalink
Merge branch 'main' into repo-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kimadactyl authored Dec 9, 2024
2 parents 5503934 + 0f03893 commit 113aed7
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ GEM
factory_bot_rails (6.2.0)
factory_bot (~> 6.2.0)
railties (>= 5.0.0)
ffi (1.15.5)
ffi (1.17.0)
ffi (1.17.0-x86_64-linux-gnu)
font-awesome-rails (4.7.0.8)
railties (>= 3.2, < 8.0)
foreman (0.87.2)
Expand Down
7 changes: 5 additions & 2 deletions app/graphql/types/partner_type.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,14 @@ class PartnerType < Types::BaseObject
description: 'The URL provided by the partner for users to find out more info'

field :twitter_url, String,
description: 'The URL to the partner\'s Twitter profile'
description: "Full URL for partner's Twitter / X profile"

field :facebook_url, String,
method: :facebook_link,
description: 'The URL of the partner\'s Facebook page'
description: "Full URL of partner's Facebook page"

field :instagram_url, String,
description: "Full URL of partner's instagram page"

field :areas_served, [NeighbourhoodType],
method: :service_area_neighbourhoods,
Expand Down
4 changes: 4 additions & 0 deletions app/models/partner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,10 @@ def twitter_url
"https://twitter.com/#{twitter_handle}" if twitter_handle.present?
end

def instagram_url
"https://instagram.com/#{instagram_handle}" if instagram_handle.present?
end

def logo_url
image&.url
end
Expand Down
1 change: 1 addition & 0 deletions collections/All Partners.bru
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ body:graphql {
url
twitterUrl
facebookUrl
instagramUrl
}
}
}
Expand Down
1 change: 1 addition & 0 deletions collections/Partner by ID.bru
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ body:graphql {
url
twitterUrl
facebookUrl
instagramUrl
}
}

Expand Down
4 changes: 3 additions & 1 deletion test/integration/graphql/partners_integration_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ def check_basic_fields(data, partner)
assert_field_equals data, 'description', value: partner.description
assert_field_equals data, 'accessibilitySummary', value: partner.accessibility_info
assert_field_equals data, 'url', value: partner.url
assert_field_equals data, 'twitterUrl', value: "https://twitter.com/#{partner.twitter_handle}"
assert_field_equals data, 'twitterUrl', value: partner.twitter_url
assert_field_equals data, 'facebookUrl', value: partner.facebook_link
assert_field_equals data, 'instagramUrl', value: partner.instagram_url

# see note below
# assert_field_equals data, 'logo', value: partner.image.url
Expand All @@ -155,6 +156,7 @@ def check_basic_fields(data, partner)
url
twitterUrl
facebookUrl
instagramUrl
address {
streetAddress
Expand Down

0 comments on commit 113aed7

Please sign in to comment.