Skip to content

Commit 2ae16a1

Browse files
authored
feat(listings): improve mirrored stub UX and port phillip addresses (#116)
Combine street and suburb in Port Phillip About text, align prod migration timestamps, remove stub header lozenge, hide claim CTA on mirrored listings, and shorten open-data trust copy.
1 parent 84e0e84 commit 2ae16a1

11 files changed

Lines changed: 65 additions & 25 deletions

File tree

messages/de.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@
480480
"signInForPhotos": "<link>Melde dich an</link>, um die Fotos dieses Gastgebers zu sehen.",
481481
"ownerNote": "Dies ist dein eigener Eintrag{stub, select, true {, als Stub markiert} other {}}. {visibility, select, true {Sieht gut aus!} other {Du hast ihn von der Karte ausgeblendet, daher kannst im Moment nur du ihn sehen.}}",
482482
"stubNote": "Dies ist ein Stub, der vom Peels-Team erstellt wurde. Prüfe die Angaben im Eintrag, bevor du vorbeischaust.",
483-
"stubMirroredNote": "Dieser Eintrag spiegelt offizielle öffentliche Daten wider und wird nicht von einer Peels-Gastgeberin oder einem Peels-Gastgeber verwaltet. Öffnungszeiten und angenommene Materialien können sich ändern. Prüfe alles, bevor du vorbeischaust.",
483+
"stubMirroredNote": "Dieser Eintrag stammt aus offiziellen öffentlichen Daten. Öffnungszeiten und angenommene Materialien können sich ändern. Prüfe alles, bevor du vorbeischaust.",
484484
"stubClaim": "Bist du die Eigentümerin oder der Eigentümer? <link>Kontaktiere uns</link>, um diesen Eintrag zu beanspruchen oder Änderungen anzufordern.",
485485
"firstTime": "Zum ersten Mal hier? <link>Registrieren</link>",
486486
"residentOf": "Bewohner von {area}",

messages/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@
480480
"signInForPhotos": "<link>Sign in</link> to see this host’s photos.",
481481
"ownerNote": "This is your own listing{stub, select, true {, marked as a stub} other {}}. {visibility, select, true {Lookin’ good!} other {You’ve hidden it from the map, so only you can see this right now.}}",
482482
"stubNote": "This is a stub created by the Peels team. Double-check the listing information before visiting.",
483-
"stubMirroredNote": "This listing is mirrored from official public data and is not managed by a Peels host. Hours and accepted items can change. Double-check before you visit.",
483+
"stubMirroredNote": "This listing comes from official public data. Hours and accepted items can change. Double-check before you visit.",
484484
"stubClaim": "Are you the owner? <link>Reach out</link> to claim this listing or to request changes.",
485485
"firstTime": "First time here? <link>Sign up</link>",
486486
"residentOf": "Resident of {area}",

messages/es.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@
480480
"signInForPhotos": "<link>Inicia sesión</link> para ver las fotos de esta persona anfitriona.",
481481
"ownerNote": "Este es tu propio anuncio{stub, select, true {, marcado como ficha preliminar} other {}}. {visibility, select, true {¡Se ve bien!} other {Lo ocultaste del mapa, así que solo tú puedes verlo ahora.}}",
482482
"stubNote": "Esta es una ficha preliminar creada por el equipo de Peels. Revisa la información del anuncio antes de visitar.",
483-
"stubMirroredNote": "Este anuncio refleja datos públicos oficiales y no está gestionado por un anfitrión de Peels. Los horarios y los artículos aceptados pueden cambiar. Revísalo antes de visitar.",
483+
"stubMirroredNote": "Este anuncio procede de datos públicos oficiales. Los horarios y los artículos aceptados pueden cambiar. Revísalo antes de visitar.",
484484
"stubClaim": "¿Eres el propietario? <link>Contáctanos</link> para reclamar este anuncio o pedir cambios.",
485485
"firstTime": "¿Primera vez por aquí? <link>Regístrate</link>",
486486
"residentOf": "Residente de {area}",

messages/fr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@
480480
"signInForPhotos": "<link>Connectez-vous</link> pour voir les photos de cette personne hôte.",
481481
"ownerNote": "C’est votre propre annonce{stub, select, true {, marquée comme brouillon} other {}}. {visibility, select, true {Tout va bien !} other {Vous l’avez masquée de la carte, donc vous seul pouvez la voir pour le moment.}}",
482482
"stubNote": "Ceci est un brouillon créé par l’équipe Peels. Vérifiez bien les informations avant de vous déplacer.",
483-
"stubMirroredNote": "Cette annonce reprend des données publiques officielles et n’est pas gérée par un hôte Peels. Les horaires et les articles acceptés peuvent changer. Vérifiez avant de vous déplacer.",
483+
"stubMirroredNote": "Cette annonce provient de données publiques officielles. Les horaires et les articles acceptés peuvent changer. Vérifiez avant de vous déplacer.",
484484
"stubClaim": "Vous êtes la personne responsable ? <link>Contactez-nous</link> pour revendiquer cette annonce ou demander des modifications.",
485485
"firstTime": "Première visite ici ? <link>Inscrivez-vous</link>",
486486
"residentOf": "Habite à {area}",

messages/pt-BR.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@
480480
"signInForPhotos": "<link>Entre</link> para ver as fotos desta pessoa anfitriã.",
481481
"ownerNote": "Este é o seu próprio anúncio{stub, select, true {, marcado como rascunho} other {}}. {visibility, select, true {Está com tudo certo!} other {Você o ocultou do mapa, então só você consegue vê-lo agora.}}",
482482
"stubNote": "Este é um rascunho criado pela equipe do Peels. Confira as informações antes de visitar.",
483-
"stubMirroredNote": "Este anúncio espelha dados públicos oficiais e não é gerenciado por um anfitrião do Peels. Horários e itens aceitos podem mudar. Confira tudo antes de visitar.",
483+
"stubMirroredNote": "Este anúncio vem de dados públicos oficiais. Horários e itens aceitos podem mudar. Confira tudo antes de visitar.",
484484
"stubClaim": "Você é a pessoa responsável? <link>Fale conosco</link> para reivindicar este anúncio ou pedir alterações.",
485485
"firstTime": "Primeira vez por aqui? <link>Cadastre-se</link>",
486486
"residentOf": "Morador(a) de {area}",

src/components/ListingCta/ListingCta.tsx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,17 @@ function ListingCta({
7777
? t("Listings.read.stubMirroredNote")
7878
: t("Listings.read.stubNote")}
7979
</p>
80-
<p>
81-
{t.rich("Listings.read.stubClaim", {
82-
link: (chunks) => (
83-
<EncodedEmailLink address={siteConfig.encodedEmail.team}>
84-
{chunks}
85-
</EncodedEmailLink>
86-
),
87-
})}
88-
</p>
80+
{!isOpenDataMirrored && (
81+
<p>
82+
{t.rich("Listings.read.stubClaim", {
83+
link: (chunks) => (
84+
<EncodedEmailLink address={siteConfig.encodedEmail.team}>
85+
{chunks}
86+
</EncodedEmailLink>
87+
),
88+
})}
89+
</p>
90+
)}
8991
</Text>
9092
</StyledListingCta>
9193
);

src/components/ListingHeader/ListingHeader.tsx

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { getListingAvatar } from "@/utils/listingUtils";
22

33
import Avatar from "@/components/Avatar";
4-
import Lozenge from "@/components/Lozenge";
54

65
import { css, styled } from "next-yak";
76
import { theme } from "@/styles/theme.yak";
@@ -114,10 +113,6 @@ const TitleBlock = styled.div<{ $presentation?: ListingHeaderPresentation }>`
114113
${({ $presentation }) => $presentation === "full" && fullTitleBlockStyles}
115114
`;
116115

117-
const StyledLozenge = styled(Lozenge)`
118-
margin-left: -0.025rem;
119-
`;
120-
121116
function ListingHeader({
122117
presentation,
123118
listing,
@@ -185,7 +180,6 @@ function ListingHeader({
185180
)}
186181
</p>
187182
)}
188-
{listing?.is_stub && <StyledLozenge>{t("Common.stub")}</StyledLozenge>}
189183
</TitleBlock>
190184
</StyledListingHeader>
191185
);

src/lib/open-data/port-phillip-fogo.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,11 @@ test("mapPortPhillipFogoListing builds About blocks and FOGO programme chips", (
7474
assert.equal(listing.areaName, "Albert Park");
7575
assert.equal(listing.countryCode, "AU");
7676
assert.equal(listing.useSourceAvatar, true);
77-
assert.match(listing.description, /\*\*Address:\*\*\n9 Little Finlay St/);
78-
assert.match(listing.description, /\*\*Suburb:\*\*\nAlbert Park/);
77+
assert.match(
78+
listing.description,
79+
/\*\*Address:\*\*\n9 Little Finlay St,\nAlbert Park/
80+
);
81+
assert.doesNotMatch(listing.description, /\*\*Suburb:\*\*/);
7982
assert.match(
8083
listing.description,
8184
/\*\*Collection location:\*\*\nMoubray Lane Side/

supabase/functions/_shared/open-data/port-phillip-fogo.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,14 @@ function labeledBlock(label: string, value: string | null): string | null {
103103

104104
function buildDescription(record: PortPhillipFogoRecord): string {
105105
const streetParts = [record.streetNumber, record.streetName].filter(Boolean);
106-
const streetAddress = streetParts.length > 0 ? streetParts.join(" ") : null;
106+
const streetLine = streetParts.length > 0 ? streetParts.join(" ") : null;
107+
const address =
108+
streetLine && record.suburb
109+
? `${streetLine},\n${record.suburb}`
110+
: (streetLine ?? record.suburb);
107111

108112
return [
109-
labeledBlock("Address", streetAddress),
110-
labeledBlock("Suburb", record.suburb),
113+
labeledBlock("Address", address),
111114
labeledBlock("Collection location", record.collectionLocation),
112115
labeledBlock(
113116
"Notes",
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
insert into public.open_data_sources (
2+
id,
3+
name,
4+
source_name,
5+
source_url,
6+
source_type,
7+
api_url,
8+
mapper_id,
9+
sync_cron,
10+
default_avatar,
11+
default_import_mode
12+
)
13+
values (
14+
'port-phillip-fogo-communal',
15+
'City of Port Phillip communal FOGO bins',
16+
'City of Port Phillip',
17+
'https://www.portphillip.vic.gov.au/council-services/waste-recycling-and-rubbish/communal-glass-recycling-and-fogo-recycling-hubs',
18+
'manual_file',
19+
null,
20+
'port-phillip-fogo-v1',
21+
null,
22+
'stubs/city-of-port-phillip.jpg',
23+
'complete_snapshot'
24+
)
25+
on conflict (id) do update set
26+
name = excluded.name,
27+
source_name = excluded.source_name,
28+
source_url = excluded.source_url,
29+
source_type = excluded.source_type,
30+
api_url = excluded.api_url,
31+
mapper_id = excluded.mapper_id,
32+
sync_cron = excluded.sync_cron,
33+
default_avatar = excluded.default_avatar,
34+
default_import_mode = excluded.default_import_mode;

0 commit comments

Comments
 (0)