From 70e56fcdf726d132d7f6f0ff3ed0c3b7952ff278 Mon Sep 17 00:00:00 2001 From: Emillio Mariscal Date: Tue, 9 Jan 2024 16:22:58 -0300 Subject: [PATCH 1/4] Updates following Underpass API changes. Remove hashtag filter. Add feature type filters --- frontend/src/views/projectLiveMonitoring.js | 101 +++++++++++--------- 1 file changed, 58 insertions(+), 43 deletions(-) diff --git a/frontend/src/views/projectLiveMonitoring.js b/frontend/src/views/projectLiveMonitoring.js index 8dc8feb798..8f9329bb47 100644 --- a/frontend/src/views/projectLiveMonitoring.js +++ b/frontend/src/views/projectLiveMonitoring.js @@ -34,12 +34,18 @@ const mappingTypesTags = { WATERWAYS: 'waterway', }; +const mappingTypesFeatureTypes = { + ROADS: 'line', + BUILDINGS: 'polygon', + WATERWAYS: 'line', +}; + export function ProjectLiveMonitoring() { const { id } = useParams(); const [coords, setCoords] = useState([0, 0]); const [activeFeature, setActiveFeature] = useState(null); const [tags, setTags] = useState('building'); - const [hashtag, setHashtag] = useState('hotosm-project-' + id); + const [featureType, setFeatureType] = useState("polygon"); const [mapSource, setMapSource] = useState('osm'); const [realtimeList, setRealtimeList] = useState(false); const [realtimeMap, setRealtimeMap] = useState(false); @@ -47,7 +53,6 @@ export function ProjectLiveMonitoring() { // eslint-disable-next-line const [area, setArea] = useState(null); const tagsInputRef = useRef(''); - const hashtagInputRef = useRef(''); const styleSelectRef = useRef(); useSetTitleTag(`Project #${id} Live Monitoring`); @@ -85,6 +90,7 @@ export function ProjectLiveMonitoring() { ].join(','), ); setTags(mappingTypesTags[project.mappingTypes] || 'building'); + setFeatureType(mappingTypesFeatureTypes[project.mappingTypes] || 'polygon'); } }, [project]); @@ -113,7 +119,6 @@ export function ProjectLiveMonitoring() { const handleFilterClick = (e) => { e.preventDefault(); setTags(tagsInputRef.current.value); - setHashtag(hashtagInputRef.current.value); return false; }; @@ -151,14 +156,6 @@ export function ProjectLiveMonitoring() { defaultValue="building" />   - -   - + className="w-50 z-2" + /> + display: 'flex', + 'flex-direction': 'column', + backgroundColor: `rgb(${hottheme.colors.white})`, + }} + >
Semantic
- { setFeatureType("all") }} name="featureTypeAllCheckbox" id="featureTypeAllCheckbox" type="radio" /> - - { setFeatureType("polygon") }} name="featureTypePolygonCheckbox" id="featureTypePolygonCheckbox" type="radio" /> - - { setFeatureType("line") }} name="featureTypeLineCheckbox" id="featureTypeLineCheckbox" type="radio" /> - - { setFeatureType("node") }} name="featureTypeNodeCheckbox" id="featureTypeNodeCheckbox" type="radio" /> - + { + setFeatureType('all'); + }} + name="featureTypeAllCheckbox" + id="featureTypeAllCheckbox" + type="radio" + /> + + { + setFeatureType('polygon'); + }} + name="featureTypePolygonCheckbox" + id="featureTypePolygonCheckbox" + type="radio" + /> + + { + setFeatureType('line'); + }} + name="featureTypeLineCheckbox" + id="featureTypeLineCheckbox" + type="radio" + /> + + { + setFeatureType('node'); + }} + name="featureTypeNodeCheckbox" + id="featureTypeNodeCheckbox" + type="radio" + /> +
Date: Sat, 13 Jan 2024 19:33:25 +0545 Subject: [PATCH 4/4] Fix console error for `unsupported style property` in `Live Monitoring` --- frontend/src/views/projectLiveMonitoring.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/views/projectLiveMonitoring.js b/frontend/src/views/projectLiveMonitoring.js index b4433c7398..8ac147acea 100644 --- a/frontend/src/views/projectLiveMonitoring.js +++ b/frontend/src/views/projectLiveMonitoring.js @@ -265,7 +265,7 @@ export function ProjectLiveMonitoring() { flex: 1, padding: 10, display: 'flex', - 'flex-direction': 'column', + flexDirection: 'column', backgroundColor: `rgb(${hottheme.colors.white})`, }} >