Skip to content

Commit

Permalink
Merge pull request #10746 from wellcomecollection/throughout-location
Browse files Browse the repository at this point in the history
Change condition for "throughout our building"
  • Loading branch information
rcantin-w authored Mar 20, 2024
2 parents 0153b51 + adc5b73 commit 7961e38
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions content/webapp/components/EventPromo/EventPromo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ describe('getLocationText', () => {
expect(locationText).toEqual('Reading Room');
});

it('returns "In our building" given one physical location which has the name "Throughout the building"', () => {
it('returns "In our building" given one physical location which has the name "Throughout our building"', () => {
const locationText = getLocationText(false, [
{
...location,
title: 'Throughout the building',
title: 'Throughout our building',
},
]);
expect(locationText).toEqual('In our building');
Expand Down
4 changes: 2 additions & 2 deletions content/webapp/components/EventPromo/EventPromo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ export function getLocationText(
// * If an event is only in venue, in multiple locations, we display 'In our building'
// * If an event is only online, we display 'Online'
// * If an event is online and in venue, we display 'Online | In our building'
// * If an event has a single Prismic location, 'Throughout the building', we display 'In our building'
// * If an event has a single Prismic location, 'Throughout our building', we display 'In our building'
// This is how the editorial team used to do multi-location events before we added proper support
// for multiple locations.
if (!isOnline && isNotUndefined(places) && places.length === 1) {
// Content API's EventDocumentPlace has a type, PlaceBasic doesn't.
const firstEventLabel =
'type' in places[0] ? places[0].label : places[0].title;

return firstEventLabel === 'Throughout the building'
return firstEventLabel === 'Throughout our building'
? inOurBuilding
: firstEventLabel;
}
Expand Down

0 comments on commit 7961e38

Please sign in to comment.