From 9bfbb8707e12e111b385628c817d386d5b2d6018 Mon Sep 17 00:00:00 2001 From: frozenhelium Date: Wed, 6 May 2026 07:55:04 +0545 Subject: [PATCH 1/3] feat(locate-features): add project type and description --- backend | 2 +- public/img/locate_icon.svg | 15 +++++++++ public/img/locate_image.svg | 10 ++++++ public/locales/cs/data.json | 4 +++ public/locales/cs/home.json | 2 ++ public/locales/de/data.json | 4 +++ public/locales/de/home.json | 2 ++ public/locales/en/data.json | 6 +++- public/locales/en/home.json | 2 ++ public/locales/hu/data.json | 4 +++ public/locales/hu/home.json | 2 ++ public/locales/ne/data.json | 4 +++ public/locales/ne/home.json | 2 ++ public/locales/pt/data.json | 4 +++ public/locales/pt/home.json | 2 ++ src/components/ProjectTypeIcon/index.tsx | 31 ++++++++++++++++++- .../ProjectTypeIcon/styles.module.css | 4 --- src/pages/[locale]/data/index.tsx | 28 +++++++++++++++++ src/pages/[locale]/index.tsx | 13 ++++++++ 19 files changed, 134 insertions(+), 7 deletions(-) create mode 100644 public/img/locate_icon.svg create mode 100644 public/img/locate_image.svg diff --git a/backend b/backend index f4a00c54..1c83e8f3 160000 --- a/backend +++ b/backend @@ -1 +1 @@ -Subproject commit f4a00c5412a17df24e62d9c2a42b30637ef0e34e +Subproject commit 1c83e8f39713984cba3a9a19e9f7565d5626608b diff --git a/public/img/locate_icon.svg b/public/img/locate_icon.svg new file mode 100644 index 00000000..1307713a --- /dev/null +++ b/public/img/locate_icon.svg @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/public/img/locate_image.svg b/public/img/locate_image.svg new file mode 100644 index 00000000..483c5b22 --- /dev/null +++ b/public/img/locate_image.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/public/locales/cs/data.json b/public/locales/cs/data.json index 058a43b1..1157add8 100644 --- a/public/locales/cs/data.json +++ b/public/locales/cs/data.json @@ -12,6 +12,7 @@ "project-card-contributors-text": "{{contributors}}", "mapped-area": "Zmapovaná oblast", "contributors": "Přispěvatelé", + "type-locate-view-title": "", "download-projects-overview-heading": "Přehled projektů", "download-projects-overview-description": "Informace o všech projektech", "download-projects-csv-heading": "", @@ -48,6 +49,9 @@ "type-street-key-point-1": "", "type-street-key-point-2": "", "type-street-key-point-3": "", + "type-locate-key-point-1": "", + "type-locate-key-point-2": "", + "type-locate-key-point-3": "", "explore-section-heading": "Prozkoumání dat", "data-last-fetched": "Poslední aktualizace: {{date, datetime}}", "explore-section-heading-description": "", diff --git a/public/locales/cs/home.json b/public/locales/cs/home.json index b25c00d0..8d63ab51 100644 --- a/public/locales/cs/home.json +++ b/public/locales/cs/home.json @@ -26,6 +26,8 @@ "validate-image-type-description": "", "type-street-type": "", "street-type-description": "", + "type-locate-features-type": "", + "locate-features-type-description": "", "start-mapswiping-title": "Začněte používat MapSwipe!", "download-description": "Svým mobilním telefonem se můžete podílet na pomoci komunitám po celém světě, a to jedním přejetím prstem.", "download-playstore": "Stáhnout logo z obchodu Play store", diff --git a/public/locales/de/data.json b/public/locales/de/data.json index f061f080..ce2bddda 100644 --- a/public/locales/de/data.json +++ b/public/locales/de/data.json @@ -12,6 +12,7 @@ "project-card-contributors-text": "{{contributors}}", "mapped-area": "Kartografierter Bereich", "contributors": "Mitwirkende ", + "type-locate-view-title": "", "download-projects-overview-heading": "Projektübersicht", "download-projects-overview-description": "Informationen zu allen Projekten", "download-projects-csv-heading": "", @@ -48,6 +49,9 @@ "type-street-key-point-1": "", "type-street-key-point-2": "", "type-street-key-point-3": "", + "type-locate-key-point-1": "", + "type-locate-key-point-2": "", + "type-locate-key-point-3": "", "explore-section-heading": "Erkunde die Daten", "data-last-fetched": "zuletzt aktualisiert: {{date, datetime}}", "explore-section-heading-description": "", diff --git a/public/locales/de/home.json b/public/locales/de/home.json index 11607729..422c793a 100644 --- a/public/locales/de/home.json +++ b/public/locales/de/home.json @@ -26,6 +26,8 @@ "validate-image-type-description": "", "type-street-type": "", "street-type-description": "", + "type-locate-features-type": "", + "locate-features-type-description": "", "start-mapswiping-title": "Beginne mit dem Swipen!", "download-description": "Mit deinem Smartphone, kannst du mit jedem einzelnen Swipe Communities überall auf der Welt helfen.", "download-playstore": "Download from play store logo", diff --git a/public/locales/en/data.json b/public/locales/en/data.json index 205268e5..1dd457ca 100644 --- a/public/locales/en/data.json +++ b/public/locales/en/data.json @@ -12,6 +12,7 @@ "project-card-contributors-text": "{{contributors}}", "mapped-area": "Mapped area", "contributors": "Contributors", + "type-locate-view-title": "Locate Features", "download-projects-overview-heading": "Projects Overview", "download-projects-overview-description": "Information on all projects", "download-projects-csv-heading": "Project Type's Stats", @@ -48,7 +49,10 @@ "type-street-key-point-1": "Explore ground-level photos", "type-street-key-point-2": "Find relevant features or qualify their characteristics", "type-street-key-point-3": "Capture more detailed information on local communities", - "explore-section-heading": "Explore the data", + "type-locate-key-point-1": "Localize the location of features like rooftops, solar panels, or waterways within satellite image tiles", + "type-locate-key-point-2": "Help improve training data that teaches machine learning models where features are located in imagery", + "type-locate-key-point-3": "Capture more detailed information on local communities", + "explore-section-heading": "Improve the speed and accuracy of automated mapping, helping humanitarian organizations scale their efforts", "data-last-fetched": "Last updated: {{date, datetime}}", "explore-section-heading-description": "The data files always contain the most up-to-date data.", "see-more-button": "Show more", diff --git a/public/locales/en/home.json b/public/locales/en/home.json index 213efb28..d3118379 100644 --- a/public/locales/en/home.json +++ b/public/locales/en/home.json @@ -26,6 +26,8 @@ "validate-image-type-description": "Review photographs to identify the presence of a feature or validate detections as part of mapping workflows and to improve machine learning tools.", "type-street-type": "View Streets", "street-type-description": "Explore ground-level photos to find relevant features and capture more detailed information on communities.", + "type-locate-features-type": "Locate Features", + "locate-features-type-description": "Mark the subgrid cells within satellite image tiles that contain requested features such as rooftops, solar panels, or trees, helping train machine learning models to localize features more accurately", "start-mapswiping-title": "Start MapSwiping!", "download-description": "From your internet browser or mobile phone, you can play a part in helping communities around the world, one swipe at a time.", "download-playstore": "Download from play store logo", diff --git a/public/locales/hu/data.json b/public/locales/hu/data.json index 3c5f2099..b7d96e14 100644 --- a/public/locales/hu/data.json +++ b/public/locales/hu/data.json @@ -12,6 +12,7 @@ "project-card-contributors-text": "{{contributors}}", "mapped-area": "Feltérképezett terület", "contributors": "Közreműködők", + "type-locate-view-title": "", "download-projects-overview-heading": "Projektek áttekintése", "download-projects-overview-description": "Az összes projekt adatai", "download-projects-csv-heading": "", @@ -48,6 +49,9 @@ "type-street-key-point-1": "", "type-street-key-point-2": "", "type-street-key-point-3": "", + "type-locate-key-point-1": "", + "type-locate-key-point-2": "", + "type-locate-key-point-3": "", "explore-section-heading": "Adatok felfedezése", "data-last-fetched": "Legutóbbi frissítés: {{date, datetime}}", "explore-section-heading-description": "", diff --git a/public/locales/hu/home.json b/public/locales/hu/home.json index 5eada407..6de174dc 100644 --- a/public/locales/hu/home.json +++ b/public/locales/hu/home.json @@ -26,6 +26,8 @@ "validate-image-type-description": "", "type-street-type": "", "street-type-description": "", + "type-locate-features-type": "", + "locate-features-type-description": "", "start-mapswiping-title": "Lásson neki a MapSwipe-nak!", "download-description": "Mobiltelefonjával egyetlen mozdulattal is hozzájárulhat a világ közösségeinek megsegítéséhez.", "download-playstore": "Letöltés a Play áruházból logó", diff --git a/public/locales/ne/data.json b/public/locales/ne/data.json index 0455870f..5c9b982c 100644 --- a/public/locales/ne/data.json +++ b/public/locales/ne/data.json @@ -12,6 +12,7 @@ "project-card-contributors-text": "{{contributors}}", "mapped-area": "नक्सा गरिएको क्षेत्र", "contributors": "योगदानकर्ताहरू", + "type-locate-view-title": "", "download-projects-overview-heading": "परियोजनाहरू अवलोकन", "download-projects-overview-description": "सबै परियोजना बारे जानकारी", "download-projects-csv-heading": "", @@ -48,6 +49,9 @@ "type-street-key-point-1": "", "type-street-key-point-2": "", "type-street-key-point-3": "", + "type-locate-key-point-1": "", + "type-locate-key-point-2": "", + "type-locate-key-point-3": "", "explore-section-heading": "डाटा अन्वेषण गर्नुहोस्", "data-last-fetched": "पछिल्लो अपडेट: {{date, datetime}}", "explore-section-heading-description": "", diff --git a/public/locales/ne/home.json b/public/locales/ne/home.json index d7e828b7..932059ae 100644 --- a/public/locales/ne/home.json +++ b/public/locales/ne/home.json @@ -26,6 +26,8 @@ "validate-image-type-description": "", "type-street-type": "", "street-type-description": "", + "type-locate-features-type": "", + "locate-features-type-description": "", "start-mapswiping-title": "अब MapSwiping सुरु गर्नुहोस्", "download-description": "आफ्नो मोबाइल फोनको साथ, तपाईं एक पटकमा एक स्वाइप गरी विश्वभरका समुदायहरूलाई मद्दत गर्न भूमिका खेल्न सक्नुहुन्छ।", "download-playstore": "Download from play store logo", diff --git a/public/locales/pt/data.json b/public/locales/pt/data.json index a82a12bb..61111e27 100644 --- a/public/locales/pt/data.json +++ b/public/locales/pt/data.json @@ -12,6 +12,7 @@ "project-card-contributors-text": "{{contributors}}", "mapped-area": "Área mapeada", "contributors": "Contribuidores", + "type-locate-view-title": "", "download-projects-overview-heading": "Visão geral dos projetos", "download-projects-overview-description": "Informações sobre todos os projetos", "download-projects-csv-heading": "", @@ -48,6 +49,9 @@ "type-street-key-point-1": "", "type-street-key-point-2": "", "type-street-key-point-3": "", + "type-locate-key-point-1": "", + "type-locate-key-point-2": "", + "type-locate-key-point-3": "", "explore-section-heading": "Explorar os dados", "data-last-fetched": "Última atualização: {{date, datetime}}", "explore-section-heading-description": "", diff --git a/public/locales/pt/home.json b/public/locales/pt/home.json index 73d5ebb6..26b8d91e 100644 --- a/public/locales/pt/home.json +++ b/public/locales/pt/home.json @@ -26,6 +26,8 @@ "validate-image-type-description": "", "type-street-type": "", "street-type-description": "", + "type-locate-features-type": "", + "locate-features-type-description": "", "start-mapswiping-title": "Começar o MapSwiping!", "download-description": "Com o seu telemóvel, pode contribuir para ajudar as comunidades de todo o mundo, um toque de cada vez.", "download-playstore": "Logótipo de descarregar da Play Store", diff --git a/src/components/ProjectTypeIcon/index.tsx b/src/components/ProjectTypeIcon/index.tsx index 497429c6..ebe2428f 100644 --- a/src/components/ProjectTypeIcon/index.tsx +++ b/src/components/ProjectTypeIcon/index.tsx @@ -15,7 +15,7 @@ const sizeToStyleMap: { export interface Props { className?: string; - type: 'FIND' | 'VALIDATE' | 'VALIDATE_IMAGE' | 'COMPARE' | 'COMPLETENESS' | 'STREET'; + type: 'FIND' | 'VALIDATE' | 'VALIDATE_IMAGE' | 'COMPARE' | 'COMPLETENESS' | 'STREET' | 'LOCATE'; size?: SizeTypes; } function ProjectTypeIcon(props: Props) { @@ -114,6 +114,35 @@ function ProjectTypeIcon(props: Props) { )} + {/* FIXME(frozenhelium): Add icon for locate features */} + {type === 'LOCATE' && ( + + + + + + + + )} ); } diff --git a/src/components/ProjectTypeIcon/styles.module.css b/src/components/ProjectTypeIcon/styles.module.css index c082e32b..4e596751 100644 --- a/src/components/ProjectTypeIcon/styles.module.css +++ b/src/components/ProjectTypeIcon/styles.module.css @@ -4,10 +4,6 @@ width: var(--height); height: var(--height); - path { - fill: var(--color-text); - } - &.small { --height: 1.2rem; } diff --git a/src/pages/[locale]/data/index.tsx b/src/pages/[locale]/data/index.tsx index c4205b43..a4e42230 100644 --- a/src/pages/[locale]/data/index.tsx +++ b/src/pages/[locale]/data/index.tsx @@ -311,6 +311,13 @@ function Data(props: Props) { ), }, + { + key: 'LOCATE', + label: t('type-locate-view-title'), + icon: ( + + ), + }, ]), [t]); const projectTypeOptionsMap = useMemo(() => ( @@ -666,6 +673,27 @@ function Data(props: Props) { label={t('type-street-key-point-3')} /> + + )} + childrenContainerClassName={styles.keyPointList} + > + + + +
{t('street-type-description')} + + )} + > + {t('locate-features-type-description')} +
Date: Fri, 8 May 2026 07:56:50 +0545 Subject: [PATCH 2/3] chore(backend): update backend submodule --- backend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend b/backend index 1c83e8f3..c5bfe14d 160000 --- a/backend +++ b/backend @@ -1 +1 @@ -Subproject commit 1c83e8f39713984cba3a9a19e9f7565d5626608b +Subproject commit c5bfe14dc6f6b3417f09c3f2d4a19bb0f4ea4a70 From 5a1fb7f34682fafcf73349f3051a0360e41ab3ac Mon Sep 17 00:00:00 2001 From: AdityaKhatri Date: Fri, 8 May 2026 10:55:11 +0545 Subject: [PATCH 3/3] fix: add missing project type label --- public/locales/cs/data.json | 2 +- public/locales/cs/data_old.json | 3 +- public/locales/cs/project.json | 1 + public/locales/de/data.json | 2 +- public/locales/de/data_old.json | 3 +- public/locales/de/project.json | 1 + public/locales/en/data.json | 2 +- public/locales/en/data_old.json | 3 +- public/locales/en/project.json | 1 + public/locales/hu/data.json | 2 +- public/locales/hu/data_old.json | 3 +- public/locales/hu/project.json | 1 + public/locales/ne/data.json | 2 +- public/locales/ne/data_old.json | 3 +- public/locales/ne/project.json | 1 + public/locales/pt/data.json | 2 +- public/locales/pt/data_old.json | 3 +- public/locales/pt/project.json | 1 + src/components/ProjectsMap/index.tsx | 100 +++++++++++++----------- src/pages/[locale]/data/index.tsx | 109 ++++++++++++++------------- src/pages/[locale]/projects/[id].tsx | 100 +++++++++++++----------- 21 files changed, 193 insertions(+), 152 deletions(-) diff --git a/public/locales/cs/data.json b/public/locales/cs/data.json index 1157add8..e2ee79e5 100644 --- a/public/locales/cs/data.json +++ b/public/locales/cs/data.json @@ -7,12 +7,12 @@ "type-completeness-title": "", "type-validate-image-title": "", "type-streets-view-title": "", + "type-locate-title": "", "project-card-progress-text": "{{progress, number}}% dokončeno", "project-card-last-update": "{{date, datetime}}", "project-card-contributors-text": "{{contributors}}", "mapped-area": "Zmapovaná oblast", "contributors": "Přispěvatelé", - "type-locate-view-title": "", "download-projects-overview-heading": "Přehled projektů", "download-projects-overview-description": "Informace o všech projektech", "download-projects-csv-heading": "", diff --git a/public/locales/cs/data_old.json b/public/locales/cs/data_old.json index b8509ae0..cfca417d 100644 --- a/public/locales/cs/data_old.json +++ b/public/locales/cs/data_old.json @@ -11,5 +11,6 @@ "street": "", "published": "", "withdrawn": "", - "download-projects-with-geometry-heading": "Projekty s geometrií" + "download-projects-with-geometry-heading": "Projekty s geometrií", + "type-locate-view-title": "" } diff --git a/public/locales/cs/project.json b/public/locales/cs/project.json index 8a62d894..f55332e7 100644 --- a/public/locales/cs/project.json +++ b/public/locales/cs/project.json @@ -7,6 +7,7 @@ "type-completeness-title": "", "type-validate-image-title": "", "type-streets-view-title": "", + "type-locate-title": "", "project-tab-head": "{{projectTitle}} | MapSwipe", "Location": "Lokace", "requesting-organization": "Žádající organizace", diff --git a/public/locales/de/data.json b/public/locales/de/data.json index ce2bddda..176b23fa 100644 --- a/public/locales/de/data.json +++ b/public/locales/de/data.json @@ -7,12 +7,12 @@ "type-completeness-title": "", "type-validate-image-title": "", "type-streets-view-title": "", + "type-locate-title": "", "project-card-progress-text": "{{progress, number}}% fertiggestellt", "project-card-last-update": "{{date, datetime}}", "project-card-contributors-text": "{{contributors}}", "mapped-area": "Kartografierter Bereich", "contributors": "Mitwirkende ", - "type-locate-view-title": "", "download-projects-overview-heading": "Projektübersicht", "download-projects-overview-description": "Informationen zu allen Projekten", "download-projects-csv-heading": "", diff --git a/public/locales/de/data_old.json b/public/locales/de/data_old.json index addf5870..6f095d22 100644 --- a/public/locales/de/data_old.json +++ b/public/locales/de/data_old.json @@ -11,5 +11,6 @@ "street": "", "published": "", "withdrawn": "", - "download-projects-with-geometry-heading": "Projekte mit Geometrie" + "download-projects-with-geometry-heading": "Projekte mit Geometrie", + "type-locate-view-title": "" } diff --git a/public/locales/de/project.json b/public/locales/de/project.json index 6bdd65bc..2b263e80 100644 --- a/public/locales/de/project.json +++ b/public/locales/de/project.json @@ -7,6 +7,7 @@ "type-completeness-title": "", "type-validate-image-title": "", "type-streets-view-title": "", + "type-locate-title": "", "project-tab-head": "{{projectTitle}} | MapSwipe", "Location": "Standort", "requesting-organization": "Anfordernde Organisation", diff --git a/public/locales/en/data.json b/public/locales/en/data.json index 1dd457ca..c4766333 100644 --- a/public/locales/en/data.json +++ b/public/locales/en/data.json @@ -7,12 +7,12 @@ "type-completeness-title": "Check Completeness", "type-validate-image-title": "Assess Image", "type-streets-view-title": "View Streets", + "type-locate-title": "Locate Features", "project-card-progress-text": "{{progress, number}}% completed", "project-card-last-update": "{{date, datetime}}", "project-card-contributors-text": "{{contributors}}", "mapped-area": "Mapped area", "contributors": "Contributors", - "type-locate-view-title": "Locate Features", "download-projects-overview-heading": "Projects Overview", "download-projects-overview-description": "Information on all projects", "download-projects-csv-heading": "Project Type's Stats", diff --git a/public/locales/en/data_old.json b/public/locales/en/data_old.json index 436b30b0..27115f14 100644 --- a/public/locales/en/data_old.json +++ b/public/locales/en/data_old.json @@ -7,5 +7,6 @@ "ready-to-published": "Ready to Publish", "publishing-failed": "Publishing Failed", "paused": "Paused", - "download-projects-with-geometry-heading": "Projects with Geometry" + "download-projects-with-geometry-heading": "Projects with Geometry", + "type-locate-view-title": "" } diff --git a/public/locales/en/project.json b/public/locales/en/project.json index 55d37c00..067938a6 100644 --- a/public/locales/en/project.json +++ b/public/locales/en/project.json @@ -7,6 +7,7 @@ "type-completeness-title": "Check Completeness", "type-validate-image-title": "Assess Images", "type-streets-view-title": "View Streets", + "type-locate-title": "Locate Features", "project-tab-head": "{{projectTitle}} | MapSwipe", "Location": "Location", "requesting-organization": "Requesting organization", diff --git a/public/locales/hu/data.json b/public/locales/hu/data.json index b7d96e14..461a761b 100644 --- a/public/locales/hu/data.json +++ b/public/locales/hu/data.json @@ -7,12 +7,12 @@ "type-completeness-title": "", "type-validate-image-title": "", "type-streets-view-title": "", + "type-locate-title": "", "project-card-progress-text": "{{progress, number}}% elkészült", "project-card-last-update": "{{date, datetime}}", "project-card-contributors-text": "{{contributors}}", "mapped-area": "Feltérképezett terület", "contributors": "Közreműködők", - "type-locate-view-title": "", "download-projects-overview-heading": "Projektek áttekintése", "download-projects-overview-description": "Az összes projekt adatai", "download-projects-csv-heading": "", diff --git a/public/locales/hu/data_old.json b/public/locales/hu/data_old.json index c8582e8d..49343905 100644 --- a/public/locales/hu/data_old.json +++ b/public/locales/hu/data_old.json @@ -11,5 +11,6 @@ "street": "", "published": "", "withdrawn": "", - "download-projects-with-geometry-heading": "Projektek alakzatfájllal" + "download-projects-with-geometry-heading": "Projektek alakzatfájllal", + "type-locate-view-title": "" } diff --git a/public/locales/hu/project.json b/public/locales/hu/project.json index df4bcace..3914744b 100644 --- a/public/locales/hu/project.json +++ b/public/locales/hu/project.json @@ -7,6 +7,7 @@ "type-completeness-title": "", "type-validate-image-title": "", "type-streets-view-title": "", + "type-locate-title": "", "project-tab-head": "{{projectTitle}} | MapSwipe", "Location": "Helyszín", "requesting-organization": "Kérelmező szervezet", diff --git a/public/locales/ne/data.json b/public/locales/ne/data.json index 5c9b982c..fc075a73 100644 --- a/public/locales/ne/data.json +++ b/public/locales/ne/data.json @@ -7,12 +7,12 @@ "type-completeness-title": "", "type-validate-image-title": "", "type-streets-view-title": "", + "type-locate-title": "", "project-card-progress-text": "{{progress, number}}% सम्पन्न भयो", "project-card-last-update": "{{date, datetime}}", "project-card-contributors-text": "{{contributors}}", "mapped-area": "नक्सा गरिएको क्षेत्र", "contributors": "योगदानकर्ताहरू", - "type-locate-view-title": "", "download-projects-overview-heading": "परियोजनाहरू अवलोकन", "download-projects-overview-description": "सबै परियोजना बारे जानकारी", "download-projects-csv-heading": "", diff --git a/public/locales/ne/data_old.json b/public/locales/ne/data_old.json index be50317c..ece19d5f 100644 --- a/public/locales/ne/data_old.json +++ b/public/locales/ne/data_old.json @@ -11,5 +11,6 @@ "street": "", "published": "", "withdrawn": "", - "download-projects-with-geometry-heading": "ज्यामिति का साथ परियोजनाहरू" + "download-projects-with-geometry-heading": "ज्यामिति का साथ परियोजनाहरू", + "type-locate-view-title": "" } diff --git a/public/locales/ne/project.json b/public/locales/ne/project.json index a0d95fc9..c6fa840d 100644 --- a/public/locales/ne/project.json +++ b/public/locales/ne/project.json @@ -7,6 +7,7 @@ "type-completeness-title": "", "type-validate-image-title": "", "type-streets-view-title": "", + "type-locate-title": "", "project-tab-head": "{{projectTitle}} | MapSwipe", "Location": "स्थान", "requesting-organization": "अनुरोध गर्ने संगठन", diff --git a/public/locales/pt/data.json b/public/locales/pt/data.json index 61111e27..bcfe54ff 100644 --- a/public/locales/pt/data.json +++ b/public/locales/pt/data.json @@ -7,12 +7,12 @@ "type-completeness-title": "", "type-validate-image-title": "", "type-streets-view-title": "", + "type-locate-title": "", "project-card-progress-text": "{{progress, number}}% concluído", "project-card-last-update": "{{date, datetime}}", "project-card-contributors-text": "{{contributors}}", "mapped-area": "Área mapeada", "contributors": "Contribuidores", - "type-locate-view-title": "", "download-projects-overview-heading": "Visão geral dos projetos", "download-projects-overview-description": "Informações sobre todos os projetos", "download-projects-csv-heading": "", diff --git a/public/locales/pt/data_old.json b/public/locales/pt/data_old.json index d063b198..f0de5e62 100644 --- a/public/locales/pt/data_old.json +++ b/public/locales/pt/data_old.json @@ -11,5 +11,6 @@ "street": "", "published": "", "withdrawn": "", - "download-projects-with-geometry-heading": "Projetos com geometria" + "download-projects-with-geometry-heading": "Projetos com geometria", + "type-locate-view-title": "" } diff --git a/public/locales/pt/project.json b/public/locales/pt/project.json index 5920df63..144ad198 100644 --- a/public/locales/pt/project.json +++ b/public/locales/pt/project.json @@ -7,6 +7,7 @@ "type-completeness-title": "", "type-validate-image-title": "", "type-streets-view-title": "", + "type-locate-title": "", "project-tab-head": "{{projectTitle}} | MapSwipe", "Location": "Localização", "requesting-organization": "Organização requerente", diff --git a/src/components/ProjectsMap/index.tsx b/src/components/ProjectsMap/index.tsx index ff21ba2b..4efed400 100644 --- a/src/components/ProjectsMap/index.tsx +++ b/src/components/ProjectsMap/index.tsx @@ -23,6 +23,7 @@ import { import { ProjectTypeOption, ProjectStatusOption, + ProjectType, ProjectStatus, } from 'utils/common'; @@ -99,50 +100,61 @@ function ProjectMap(props: Props) { ) ), [projectStatusOptions]); - const projectTypeOptions: ProjectTypeOption[] = useMemo(() => ([ - { - key: 'FIND', - label: t('type-find-title'), - icon: ( - - ), - }, - { - key: 'VALIDATE', - label: t('type-validate-title'), - icon: ( - - ), - }, - { - key: 'COMPARE', - label: t('type-compare-title'), - icon: ( - - ), - }, - { - key: 'COMPLETENESS', - label: t('type-completeness-title'), - icon: ( - - ), - }, - { - key: 'VALIDATE_IMAGE', - label: t('type-validate-image-title'), - icon: ( - - ), - }, - { - key: 'STREET', - label: t('type-streets-view-title'), - icon: ( - - ), - }, - ]), [t]); + const projectTypeOptions: ProjectTypeOption[] = useMemo(() => { + const projectTypeOptionsMapping: Record<`${ProjectType}`, ProjectTypeOption> = { + FIND: { + key: 'FIND', + label: t('type-find-title'), + icon: ( + + ), + }, + VALIDATE: { + key: 'VALIDATE', + label: t('type-validate-title'), + icon: ( + + ), + }, + COMPARE: { + key: 'COMPARE', + label: t('type-compare-title'), + icon: ( + + ), + }, + COMPLETENESS: { + key: 'COMPLETENESS', + label: t('type-completeness-title'), + icon: ( + + ), + }, + VALIDATE_IMAGE: { + key: 'VALIDATE_IMAGE', + label: t('type-validate-image-title'), + icon: ( + + ), + }, + STREET: { + key: 'STREET', + label: t('type-streets-view-title'), + icon: ( + + ), + }, + LOCATE: { + key: 'LOCATE', + label: t('type-locate-title'), + icon: ( + + ), + }, + }; + + return Object.values(projectTypeOptionsMapping); + }, [t]); const projectTypeOptionsMap = useMemo(() => ( listToMap( diff --git a/src/pages/[locale]/data/index.tsx b/src/pages/[locale]/data/index.tsx index a4e42230..d8d3a3b9 100644 --- a/src/pages/[locale]/data/index.tsx +++ b/src/pages/[locale]/data/index.tsx @@ -42,6 +42,7 @@ import SelectInput from 'components/SelectInput'; import { rankedSearchOnList, ProjectTypeOption, + ProjectType, ProjectStatusOption, getFileSizeProperties, } from 'utils/common'; @@ -268,57 +269,61 @@ function Data(props: Props) { ) ), [projectStatusOptions]); - const projectTypeOptions: ProjectTypeOption[] = useMemo(() => ([ - { - key: 'FIND', - label: t('type-find-title'), - icon: ( - - ), - }, - { - key: 'VALIDATE', - label: t('type-validate-title'), - icon: ( - - ), - }, - { - key: 'COMPARE', - label: t('type-compare-title'), - icon: ( - - ), - }, - { - key: 'COMPLETENESS', - label: t('type-completeness-title'), - icon: ( - - ), - }, - { - key: 'VALIDATE_IMAGE', - label: t('type-validate-image-title'), - icon: ( - - ), - }, - { - key: 'STREET', - label: t('type-streets-view-title'), - icon: ( - - ), - }, - { - key: 'LOCATE', - label: t('type-locate-view-title'), - icon: ( - - ), - }, - ]), [t]); + const projectTypeOptions: ProjectTypeOption[] = useMemo(() => { + const projectTypeOptionsMapping: Record<`${ProjectType}`, ProjectTypeOption> = { + FIND: { + key: 'FIND', + label: t('type-find-title'), + icon: ( + + ), + }, + VALIDATE: { + key: 'VALIDATE', + label: t('type-validate-title'), + icon: ( + + ), + }, + COMPARE: { + key: 'COMPARE', + label: t('type-compare-title'), + icon: ( + + ), + }, + COMPLETENESS: { + key: 'COMPLETENESS', + label: t('type-completeness-title'), + icon: ( + + ), + }, + VALIDATE_IMAGE: { + key: 'VALIDATE_IMAGE', + label: t('type-validate-image-title'), + icon: ( + + ), + }, + STREET: { + key: 'STREET', + label: t('type-streets-view-title'), + icon: ( + + ), + }, + LOCATE: { + key: 'LOCATE', + label: t('type-locate-title'), + icon: ( + + ), + }, + }; + + return Object.values(projectTypeOptionsMapping); + }, [t]); const projectTypeOptionsMap = useMemo(() => ( listToMap( @@ -675,7 +680,7 @@ function Data(props: Props) { ([ - { - key: 'FIND', - label: t('type-find-title'), - icon: ( - - ), - }, - { - key: 'VALIDATE', - label: t('type-validate-title'), - icon: ( - - ), - }, - { - key: 'COMPARE', - label: t('type-compare-title'), - icon: ( - - ), - }, - { - key: 'COMPLETENESS', - label: t('type-completeness-title'), - icon: ( - - ), - }, - { - key: 'VALIDATE_IMAGE', - label: t('type-validate-image-title'), - icon: ( - - ), - }, - { - key: 'STREET', - label: t('type-streets-view-title'), - icon: ( - - ), - }, - ]), [t]); + const projectTypeOptions: ProjectTypeOption[] = useMemo(() => { + const projectTypeOptionsMapping: Record<`${ProjectType}`, ProjectTypeOption> = { + FIND: { + key: 'FIND', + label: t('type-find-title'), + icon: ( + + ), + }, + VALIDATE: { + key: 'VALIDATE', + label: t('type-validate-title'), + icon: ( + + ), + }, + COMPARE: { + key: 'COMPARE', + label: t('type-compare-title'), + icon: ( + + ), + }, + COMPLETENESS: { + key: 'COMPLETENESS', + label: t('type-completeness-title'), + icon: ( + + ), + }, + VALIDATE_IMAGE: { + key: 'VALIDATE_IMAGE', + label: t('type-validate-image-title'), + icon: ( + + ), + }, + STREET: { + key: 'STREET', + label: t('type-streets-view-title'), + icon: ( + + ), + }, + LOCATE: { + key: 'LOCATE', + label: t('type-locate-title'), + icon: ( + + ), + }, + }; + + return Object.values(projectTypeOptionsMapping); + }, [t]); const projectTypeOptionsMap = useMemo(() => ( listToMap(